Trouble with primitive arrays and casting, lesson 521

hi everyone!
there is a problem i discovered right now - after years with java where was no necessity to do this.....
and i'm shure this must have been the topic already, but i couldn't find any helpful resource :-/
right here we go:
1. an array is a (special) kind of object.
2. there are "primitive" arrays and such containing references to objects. of course - and i imagine why - they are treated differently by the VM.
3. then both are - somehow - subclasses of Object. whereas primitive types are not really, primitive-arrays are. this is hidden to the programmer....
4. any array can be "pointed" at via local Object variable, like this:
Object xyz = new int[6];
5. arrays of Objects (with different dimensions) can be casted, like this:
  Object pointer = null;
  Object[]   o  = new SomeClass[42] ;
  Object[][] oo = new OtherClass[23] [2] ;
  Object[][][] ooo = new OtherClass[23] [2] [9] ;
  o = oo = ooo;     // this is save to do,
                               //because "n-dimensional" object-arrays
                              // are just arrays of  other arrays, down to simple array
pointer = o;         // ok, we are referencing o via Object "pointer"6. but, you cannot do this with primitive types:
  int[]  i1 = new int [99] ;
  int[][] i2 = new int [1] [3] ;
  i1 = i2                  // terror: impossible. this is awful, if you ask me.
                               // ok, one could talk about "special cases" and
                               // "the way the VM works", but this is not of interest to me as
                               // a programmer. i'm not happy with that array-mess!
  pointer = i2;       // now this is completely legal. i2, i1 etc is an object!7. after the preparation, let's get into my main trouble (you have the answer, i know!) :
suppose i have a class, with methods that should process ANY kind of object given. and - i don't know which. i only get it at runtime from an unknown source.
let's say: public void BlackBox( Object x );
inside, i know that there might be regular objects or arrays, and for this case i have some special hidden method, just for arrays... now try to find it out:
public void BlackBox( Object x )
  if ( x == null)
       return;
   Class c = x.getClass();
   if ( c.isArray() )
          // call the array method if it's an array.........
          BlackBoxes(     (Object [] )  x );         // wait: this is a cast! and it WILL throw an exception, eventually!
          return;
   else
           DoSpecialStuffWith( x );
}ok ? now, to process any kind of array, the special method you cannot reach from outside:
private void BlackBoxes( Object[] xs )
   if ( xs != null )
        for ( Object x : xs )
             BlackBox( x );
// this will end up in some kind of recursion with more than one array-dimension, or when an Object[] has any other array as element!this approach is perfectly save when processing any (real) Object, array or "multi-dimensional" arrays of Objects.
but, you cannot use this with primitive type arrays.
using generics wouldn't help, because internally it is all downcasted to Object.
BlackBox( new Integer(3) ) ---- does work, using a wrapper class
BlackBox( new Integer[3] ) ----- yep!
BlackBox( 3 ) ---- even this!
BlackBox( new int[42] ) ---- bang! ClassCastException, Object[] != int[]
i'm stuck. i see no way to do this smoothly. i could write thousands of methods for each primitive array - BlackBox( int[] is ) etc. - but this wouldn't help. because i can't cast an int[][] to int[], i would also have to write countless methods for each dimension. and guess, how much there are?
suppose, i ultimately wrote thousands of possible primitive-type methods. it would be easy to undergo any of it, writing this:
BlackBox( (Object) new int[9] [9] );
the method-signature would again only fit to my first method, so the whole work is useless. i CAN cast an int[] to Object, but there seems no convenient way to get the real array out of Object - in a generic way.
i wonder, how do you write a serialisation-engine? and NO, i can't rely on "right usage" of my classes, i must assume the worst case...
any help appreciated!

thanks, brigand!
your code looks weird to me g and i think there's at least one false assumption: .length of a multidimensional array returns only the number of "top-level" subarrays. that means, every length of every subarray may vary. ;)
well i guess i figured it out, in some way:
an int is no Object;
int[ ] is an Object
the ComponentType of int [ ] is int
so, the ComponentType of an Object int[ ] is no Object, thus it cannot be casted to Object.
but the ComponentType of int [ ] [ ] IS Object, because it is int [ ] !
so every method which expects Object[], will work fine with int[ ] [ ] !!
now, you only need special treatment for 1-dimensional primitive arrays:
i wrote some code, which prints me everything of everything:
    //this method generates tabs for indentation
    static String Pre( int depth)
         StringBuilder pre = new StringBuilder();
         for ( int i = 0; i < depth; i++)
              pre.append( "\t" );
         return pre.toString();
    //top-level acces for any Object
    static void Print( Object t)
         Print ( t, 0);
    //the same, but with indentation depth
    static void Print( Object t, int depth)
        if ( t != null )
             //be shure it is treated exactly as the class it represents, not any downcast
             t = t.getClass().cast( t );
            if ( t.getClass().isArray() )
                 //special treatment for int[]
                 if ( t instanceof int[])
                      Print( (int[]) t, depth);
                 // everything else can be Object[] !
                 else
                      Print( (Object[]) t, depth );
                 return;
            else
                System.out.println( Pre(depth) + " [ single object:] " + t.toString() );
        else
            System.out.println( Pre(depth) + "[null!]");
    // now top-level print for any array of Objects
    static void Print( Object [] o)
         Print( o, 0 );
    // the same with indentation
    static void Print( Object [] o, int depth)
        System.out.println( Pre(depth) + "array object " + o.toString() );
        for ( Object so : o )
                Print( so, depth + 1 );
    //the last 2 methods are only for int[] !
    static void Print( int[] is)
         Print( is, 0 );
    static void Print( int[] is, int depth)
        System.out.println( Pre(depth) + "primitive array object " + is.toString() );
        // use the same one-Object method as every other Object!
        for ( int i : is)
             Print ( i, depth + 1 );
        System.out.println( "-----------------------------" );
    }now, calling it with
Print ( (int) 4 );
Print ( new int[] {1,2,3} );
Print( new int[][] {{1,2,3}, {4,5,6}} );
Print( new int[][][] {{{1,2,3}, {4,5,6}} , {{7,8,9}, {10,11,12}}, {{13,14,15}, {16,17,18}} } );
Print( (Object) (new int[][][][] {{{{99}}}} ) );
produces this fine array-tree:
[ single object:] 4
primitive array object [I@9cab16
      [ single object:] 1
      [ single object:] 2
      [ single object:] 3
array object [[I@1a46e30
     primitive array object [I@3e25a5
           [ single object:] 1
           [ single object:] 2
           [ single object:] 3
     primitive array object [I@19821f
           [ single object:] 4
           [ single object:] 5
           [ single object:] 6
array object [[[I@addbf1
     array object [[I@42e816
          primitive array object [I@9304b1
                [ single object:] 1
                [ single object:] 2
                [ single object:] 3
          primitive array object [I@190d11
                [ single object:] 4
                [ single object:] 5
                [ single object:] 6
     array object [[I@a90653
          primitive array object [I@de6ced
                [ single object:] 7
                [ single object:] 8
                [ single object:] 9
          primitive array object [I@c17164
                [ single object:] 10
                [ single object:] 11
                [ single object:] 12
     array object [[I@1fb8ee3
          primitive array object [I@61de33
                [ single object:] 13
                [ single object:] 14
                [ single object:] 15
          primitive array object [I@14318bb
                [ single object:] 16
                [ single object:] 17
                [ single object:] 18
array object [[[[I@ca0b6
     array object [[[I@10b30a7
          array object [[I@1a758cb
               primitive array object [I@1b67f74
                     [ single object:] 99
-----------------------------and i'll have to write 8 methods or so for every primitive[ ] type !
sounds like a manageable effort... ;-)

Similar Messages

  • Trouble With Opening InDesign and now Photoshop and Illustrator

    First off I apologize if this isn't in the correct section. I couldn't find a section specific to my problem since it involves multiple aspects of Adobe products. I was having trouble with InDesign, it kept crashing. So I followed all of the advice I could find on the forums about deleting the preferences and cache information in the Library folder, and that didn't seem to make a difference. So then I thought maybe it needed an update, so I logged into Adobe Application Manager and sure enough, it did. So I clicked on "download" and it stalled there too. Then the manager became unresponsive. I couldn't cancel the update or log out or anything. So then I saw in the forum someone suggested the Adobe Creative Cloud Cleaner Tool if your manager becomes unresponsive. I ran that and then shut my computer off. When I turned it back on, InDesign started working BUT my Photoshop is completely gone from my system (I never messed with it in the first place since I wasn't having any trouble with it.) And the when I tried to click on Illustrator it said "Do you want to begin your trial?" Huh?
    I have had a subscription since 2012, why on earth would it suddenly think that I no longer should have access to these programs? If I log on to my Adobe account it shows my subscription and that it's up to date (last payment was April 5, 2015). The versions I was using were the CS versions that I had downloaded directly from Adobe and when I used to have any trouble or when I got a different computer I could just log into my account and then redownload them. They are no longer showing under my products, so I can't figure out what on earth is going on. The website has changed since the last time I downloaded them, so that partly could be me, but I thought they would at least be showing up under products. I contacted Adobe support and the first person I talked to on chat said "this is clearly a technical issue I am transferring you to someone better suited for this," but that's all he said. And I haven't heard from anyone since so I thought I'd make a topic and see if anyone else out there has had a similar problem.

    The versions I am using are the CS6 versions.*

  • Trouble with CCME 4 and VIC2-2FXO; IOS 12.4(9)T

    Trouble with CCME 4 and VIC2-2FXO; IOS 12.4(9)T
    I am having trouble making outgoing call or answering incoming call.
    When I try to call out from my IP 7961 phone, it fails with the message "unknown number".
    For incoming call, it rings but when I pick up the call nothing happens,
    Put the receiver back on hook, the phone carries on ringing. I am in UK
    and just trying to set up test system with one analogue line. Any help will
    be most appreciated. My config of the 2811 router is posted below. All calls ineternally works fine.
    Thank you for your help.
    hostname Test-CME
    ip cef
    no ip dhcp use vrf connected
    ip dhcp excluded-address 10.10.10.1 10.10.10.10
    ip dhcp excluded-address 10.139.139.1 10.139.139.10
    ip dhcp pool host
    network 10.10.10.0 255.255.255.0
    default-router 10.10.10.1
    option 150 ip 10.10.10.1
    ip dhcp pool data
    network 10.139.139.0 255.255.255.0
    default-router 10.139.139.1
    dns-server 10.139.139.5
    voice-card 0
    no dspfarm
    voice service voip
    allow-connections h323 to h323
    allow-connections h323 to sip
    allow-connections sip to h323
    allow-connections sip to sip
    supplementary-service h450.12
    h323
    sip
    header-passing
    registrar server expires max 3600 min 3600
    interface FastEthernet0/1
    no ip address
    no ip mroute-cache
    duplex auto
    speed auto
    no shut
    interface FastEthernet0/1.2
    description ** Data VLAN **
    encapsulation dot1Q 2
    ip address 10.139.139.1 255.255.255.0
    interface FastEthernet0/1.3
    description ** Voice VLAN **
    encapsulation dot1Q 3
    ip address 10.10.10.1 255.255.255.0
    ip http server
    ip http authentication local
    no ip http secure-server
    ip http path flash:
    tftp-server flash:S00104000100.sbn
    tftp-server flash:TERM41.7-0-3-0S.loads
    tftp-server flash:term61.default.loads
    tftp-server flash:term41.default.loads
    tftp-server flash:CVM41.2-0-2-26.sbn
    tftp-server flash:cnu41.2-7-6-26.sbn
    tftp-server flash:Jar41.2-9-2-26.sbn
    tftp-server flash:term70.default.loads
    tftp-server flash:term71.default.loads
    tftp-server flash:cnu70.2-7-6-26.sbn
    tftp-server flash:Jar70.2-9-2-26.sbn
    tftp-server flash:TERM70.7-0-3-0S.loads
    tftp-server flash:CVM70.2-0-2-26.sbn
    control-plane
    voice-port 0/3/0
    connection plar opx 202
    caller-id enable
    dial-peer voice 1 pots
    incoming called-number .
    destination-pattern 9T
    port 0/3/0
    telephony-service
    load 7914 S00104000100
    load 7941 TERM41.7-0-3-0S
    load 7961 TERM41.7-0-3-0S
    load 7970 TERM70.7-0-3-0S
    max-ephones 20
    max-dn 40
    ip source-address 10.10.10.1 port 2000
    calling-number initiator
    service phone videoCapability 1
    system message MKC CME
    url services http://10.10.10.1/voiceview/common/login.do
    url authentication
    http://10.10.10.1/voiceview/authentication/authenticate.do
    time-zone 21
    date-format dd-mm-yy
    voicemail 600
    max-conferences 8 gain -6
    call-forward pattern .T
    call-forward system redirecting-expanded
    moh music-on-hold.au
    web admin system name admin secret 0 test
    dn-webedit
    time-webedit
    transfer-system full-consult dss
    transfer-pattern 9.T
    secondary-dialtone 9
    create cnf-files
    ephone-dn 1 dual-line
    number 201
    label 201
    description Sarah
    name Sarah
    ephone-dn 2 dual-line
    number 202
    label 202
    description Vitthal
    name User2 Vitthal
    ephone-dn 3 dual-line
    number 203 secondary
    label 203
    description Neil
    name User3 Neil
    ephone 1
    video
    username "user1" password 201
    mac-address 0018.18EE.947F
    type 7961 addon 1 7914
    button 1:1
    ephone 2
    video
    username "user2" password 202
    mac-address 0018.18BB.B973
    type 7941
    button 1:2
    ephone 3
    video
    username "user3" password 203
    mac-address 0018.1885.6BA2
    type 7970
    button 1:3

    Hi
    Please find enclosed debug attachment for voice ccapi and ephone. First, I called from outside. Extension 202 rings but when I answered on extension 202 nothing happens. Replace the rceiever and the pone starts ringing again.Second step. I tried to call out by dialing 9 and then number but after a while phone displays unknown number.
    Thank you for your help.
    Vitthal

  • HT1657 I rented Trouble with the Curve and haven't it yet and I when I went to watch the movie it tells me the file can not be found -  please help

    I rented Trouble with the Curve and haven't it yet and I when I went to watch the movie it tells me the file can not be found -  please help

    Yes, thank you.  My apologies, I was typing one handed and did not add that. 
    Anyway, I have tried deleting the cache, deleting my pics and then re-syncing, etc. and nothing is working This is very frustrating, as I had no problems up until about 2 weeks ago, and now all of a sudden, I have this issue......UGH!

  • Having trouble with wav files and sample rates

    Hi ,I am having trouble with wav files and sample rates .I have been sent multiple projects on wav as the main instrumental ; I wish to record in 48.000kHz .Now comes the problem.When I try to change the project to 48k It seems to pitch up the track.I can't have them send the logic/project file as most have outboard synths,different plug ins etc.This particular case the producer has recorded the synth task in 41.000 kHz .My successful outcome would be to be able t create a project file in 48 kHz .And NOT pitch up whne I add the instrumenta wav file .Any help would be gratefully recieved,this is my first post so any mistakes I may have made go easy 

    You'll have to convert the actual synth audio file file that the producer gave you to 48kHz. You can do this in the audio Bin in Logic.

  • I'm having trouble with iTunes synching and accessing the iTunes store.

    I'm having trouble with iTunes synching and accessing the iTunes store.   When synching, the process tops at the back up stage, freezes and I can't close the iTunes window, need to ctrl alt del.   When trying to access the store, the progress bar stops halfway.   I've googled heaps and tried most of the standard answers - unistall, reinstall, etc, now looking for some help please.
    This has only started a few weeks back, after working smoothly for the 2 years of owning the iPhone 3gs.
    Any suggestions will be appreciated, it's getting realy frustrating.
    Cheers for now,
    Marty

    http://support.apple.com/kb/HT1923?viewlocale=en_US
    this worked perfectly for me, with no loss of library! BUT was warned about uninstalling things in the order listed...FYI.

  • Trouble with internal keyboard and touchpad

    Hi,
    Yesterday I just out of nowhere started having some trouble with my keyboard and touchpad on my MacBook Air.
    The problem displayed itself on various ways. One thing was that I couldn't press regulary with the touchpad. When I was pressing one time, it acted like a pressed with two fingers. When I tried to type in my password on the administrator page, some of the keys didn't work at all and some started to act weird. For example when I was pressing the letter B, the "bar" which displayes where you are in the text (don't know the word in English) went backwards, and when I pressed the letter F it went forward. This seemes so weird and also gives me a hope that it might be some setting failure though B stands for backwards and F stands for forward.
    I could log in to the guestpage where I tried to write in "notes". In notes, no letters at all was working, only numbers. When I tried to shut the computer down from the apple symbol I was asked to write administrator name and password. When I tried to mark the name to write it, there wasn't a "bar" but a cross, but on the other hand did it work to write in the password field. But of course not B and F..
    Usualy I'd just press the on/off botton until the computer lockdown, unfortunately the botton doesn't work. So the only thing I could do was to let the battery die and hope that it would start when I recharged it and pressed start, this didn't go as well as I hoped, so now I'm stuck with a dead macbook air.
    Any ideas of what could be the problem or/and any solutions what might do the trick?
    Extremly greatful for any answers

    Yes you need to use a wired keyboard.

  • Trouble with LaCie disk and time machine

    HI everyone,
    I've been having trouble with using time machine to back-up to my 1 TB LaCie drive (purchased 5/12, unfornuately I was dumb and didn't register the drive and no longer have the box with the serial number and there is no serial number on my drive. The only problem I had up until the end of August was that every so often the LaCie drive (using my FW 800 port) would unmount after waking up from sleep.
    The end of August the drive unmounted for no reason while I was on the computer doing a task. Could not get the LaCie drive remounted (rebooting, etc. etc.) To make a long story short, ended up calling apple care who took me through resetting my SMC and PRAM to no avail. Was booted to higher level of support who walked me through trying to repair my drive using the disk utiltiy. When that didn't work, she walked me through erasing and reformatting the LaCie drive and starting a new time machine back-up. Every thing ok until about ten days ago.
    Last week, when I woke my iMac up from sleep, I got an error saying that the disk was not ejected properly and I could not mount the drive. Restarting did nothing, the disk did not  mount. Shutting down and rebooting seemed to solve the problem and the disk was mounted. Every so often I've had the problem with the disk unmounting after waking up from sleep before. So, I changed my energy sleep preferences. At the end of the day when I am done, I'd unmount the LaCie drive before putting the Mac to sleep using the apple menu.
    Today I came in to start my day, plugged the drive in and it would not mount. Tried rebooting nothing. Went into the disk utility, at first the LaCie drive passed the disk verify (6:26:25 and 6:26:38). Then I went into repair disk on the indented drive at 6:27:13, I wasn't sure what it is was doing, thinking that it had hung, I stopped the repair at 6:27:24. Exited disk utility, and the LaCie drive mounted. But I was getting a read only error when I tried to back-up using time machine. So, I went back into disk utility at 6:27:35, when I verified the disk (indented disk), I got an error saying the disk need to be repaired. After several minutes the disk could not be repaired. So, I erased and reformatted the drive. Ran a time machine back-up and it seemed to back-up everything on my hard drive. Just ran another verify disk and it passed.
    Is the drive failing? Have some other back-ups of my documents, my address book, iCal and am going to make a backup of some of my pref files and important e-mail files and am going to do some more back-ups after I am done.
    Have reached out to the women at apple care whom I talked to last August, but don't expect to hear back from her for at least 24 hours.
    Here is my disk utility log
    2013-11-07 06:26:25 -0500: Verifying partition map for “LaCie”
    2013-11-07 06:26:25 -0500: Starting verification tool:
    2013-11-07 06:26:25 -0500: Checking prerequisites
    2013-11-07 06:26:25 -0500: Checking the partition list
    2013-11-07 06:26:25 -0500: Checking for an EFI system partition
    2013-11-07 06:26:25 -0500: Checking the EFI system partition’s size
    2013-11-07 06:26:25 -0500: Checking the EFI system partition’s file system
    2013-11-07 06:26:25 -0500: Checking all HFS data partition loader spaces
    2013-11-07 06:26:25 -0500: Checking Core Storage Physical Volume partitions
    2013-11-07 06:26:25 -0500: The partition map appears to be OK
    2013-11-07 06:26:25 -0500:
    2013-11-07 06:26:25 -0500:
    2013-11-07 06:26:38 -0500: Verifying partition map for “LaCie”
    2013-11-07 06:26:38 -0500: Starting verification tool:
    2013-11-07 06:26:38 -0500: Checking prerequisites
    2013-11-07 06:26:38 -0500: Checking the partition list
    2013-11-07 06:26:38 -0500: Checking for an EFI system partition
    2013-11-07 06:26:38 -0500: Checking the EFI system partition’s size
    2013-11-07 06:26:38 -0500: Checking the EFI system partition’s file system
    2013-11-07 06:26:38 -0500: Checking all HFS data partition loader spaces
    2013-11-07 06:26:38 -0500: Checking Core Storage Physical Volume partitions
    2013-11-07 06:26:38 -0500: The partition map appears to be OK
    2013-11-07 06:26:38 -0500:
    2013-11-07 06:26:38 -0500:
    2013-11-07 06:27:13 -0500: Disk Utility started.
    2013-11-07 06:27:21 -0500: Verifying and repairing partition map for “LaCie”
    2013-11-07 06:27:21 -0500: Starting repair tool:
    2013-11-07 06:27:21 -0500: Checking prerequisites
    2013-11-07 06:27:21 -0500: Checking the partition list
    2013-11-07 06:27:21 -0500: Checking for an EFI system partition
    2013-11-07 06:27:21 -0500: Checking the EFI system partition’s size
    2013-11-07 06:27:21 -0500: Checking the EFI system partition’s file system
    2013-11-07 06:27:23 -0500: Checking all HFS data partition loader spaces
    2013-11-07 06:27:24 -0500: Reviewing boot support loaders
    2013-11-07 06:27:24 -0500: Checking Core Storage Physical Volume partitions
    2013-11-07 06:27:24 -0500: Updating Windows boot.ini files as required
    2013-11-07 06:27:24 -0500: The partition map appears to be OK
    2013-11-07 06:27:24 -0500:
    2013-11-07 06:27:24 -0500:
    2013-11-07 06:27:35 -0500: Verifying volume “LaCie”
    2013-11-07 06:27:35 -0500: Starting verification tool:
    2013-11-07 06:27:35 -0500: Checking file system2013-11-07 06:27:35 -0500: Error: This disk needs to be repaired. Click Repair Disk.2013-11-07 06:27:35 -0500:
    2013-11-07 06:27:35 -0500: Disk Utility stopped verifying “LaCie”: This disk needs to be repaired. Click Repair Disk.
    2013-11-07 06:28:05 -0500:
    2013-11-07 06:28:13 -0500: Verify and Repair volume “LaCie”
    2013-11-07 06:28:13 -0500: Starting repair tool:
    2013-11-07 06:28:13 -0500: Checking file system2013-11-07 06:28:13 -0500: Volume repair complete.2013-11-07 06:28:13 -0500: Updating boot support partitions for the volume as required.2013-11-07 06:35:05 -0500: Stopped by user
    2013-11-07 06:44:56 -0500: Disk Utility started.
    2013-11-07 06:45:20 -0500: Verifying volume “LaCie”
    2013-11-07 06:45:20 -0500: Starting verification tool:
    2013-11-07 06:45:20 -0500: Checking file system2013-11-07 06:45:20 -0500: Checking Journaled HFS Plus volume.
    2013-11-07 06:45:20 -0500: Checking extents overflow file.
    2013-11-07 06:45:20 -0500: Checking catalog file.
    2013-11-07 06:45:59 -0500: Missing thread record (id = 5057741)
    2013-11-07 06:46:06 -0500: Checking multi-linked files.
    2013-11-07 06:46:19 -0500: Checking catalog hierarchy.
    2013-11-07 06:46:38 -0500: Invalid directory item count
    2013-11-07 06:46:38 -0500: (It should be 0 instead of 4)
    2013-11-07 06:46:38 -0500: Invalid volume directory count
    2013-11-07 06:46:38 -0500: (It should be 166840 instead of 166841)
    2013-11-07 06:46:38 -0500: Checking extended attributes file.
    2013-11-07 06:47:05 -0500: Checking multi-linked directories.
    2013-11-07 06:48:10 -0500: Checking volume bitmap.
    2013-11-07 06:48:12 -0500: Checking volume information.
    2013-11-07 06:48:12 -0500: The volume LaCie was found corrupt and needs to be repaired.
    2013-11-07 06:48:12 -0500: Error: This disk needs to be repaired. Click Repair Disk.2013-11-07 06:48:12 -0500:
    2013-11-07 06:48:12 -0500: Disk Utility stopped verifying “LaCie”: This disk needs to be repaired. Click Repair Disk.
    2013-11-07 06:48:12 -0500:
    2013-11-07 06:50:02 -0500: Verify and Repair volume “LaCie”
    2013-11-07 06:50:02 -0500: Starting repair tool:
    2013-11-07 06:50:02 -0500: Checking file system2013-11-07 06:50:02 -0500: Checking Journaled HFS Plus volume.
    2013-11-07 06:50:02 -0500: Checking extents overflow file.
    2013-11-07 06:50:02 -0500: Checking catalog file.
    2013-11-07 06:50:41 -0500: Missing thread record (id = 5057741)
    2013-11-07 06:50:48 -0500: Checking multi-linked files.
    2013-11-07 06:51:02 -0500: Checking catalog hierarchy.
    2013-11-07 06:51:20 -0500: Invalid directory item count
    2013-11-07 06:51:20 -0500: (It should be 0 instead of 4)
    2013-11-07 06:51:20 -0500: Invalid volume directory count
    2013-11-07 06:51:20 -0500: (It should be 166840 instead of 166841)
    2013-11-07 06:51:20 -0500: Checking extended attributes file.
    2013-11-07 06:51:47 -0500: Checking multi-linked directories.
    2013-11-07 06:52:55 -0500: Checking volume bitmap.
    2013-11-07 06:52:56 -0500: Checking volume information.
    2013-11-07 06:52:56 -0500: Repairing volume.
    2013-11-07 06:52:56 -0500: Missing directory record (id = 5057741)
    2013-11-07 06:52:56 -0500: Look for missing items in lost+found directory.
    2013-11-07 06:53:10 -0500: Rechecking volume.
    2013-11-07 06:53:10 -0500: Checking Journaled HFS Plus volume.
    2013-11-07 06:53:10 -0500: Checking extents overflow file.
    2013-11-07 06:53:10 -0500: Checking catalog file.
    2013-11-07 06:53:16 -0500: Incorrect number of thread records
    2013-11-07 06:53:22 -0500: Checking multi-linked files.
    2013-11-07 06:53:35 -0500: Checking catalog hierarchy.
    2013-11-07 06:53:53 -0500: Invalid directory item count
    2013-11-07 06:53:54 -0500: (It should be 5 instead of 6)
    2013-11-07 06:53:54 -0500: Invalid volume directory count
    2013-11-07 06:53:54 -0500: (It should be 166844 instead of 166842)
    2013-11-07 06:53:54 -0500: Invalid volume file count
    2013-11-07 06:53:54 -0500: (It should be 1056326 instead of 1056321)
    2013-11-07 06:53:54 -0500: Checking extended attributes file.
    2013-11-07 06:54:20 -0500: Checking multi-linked directories.
    2013-11-07 06:55:25 -0500: Checking volume bitmap.
    2013-11-07 06:55:26 -0500: Checking volume information.
    2013-11-07 06:55:26 -0500: Repairing volume.
    2013-11-07 06:58:06 -0500: Rechecking volume.
    2013-11-07 06:58:06 -0500: Checking Journaled HFS Plus volume.
    2013-11-07 06:58:06 -0500: Checking extents overflow file.
    2013-11-07 06:58:07 -0500: Checking catalog file.
    2013-11-07 06:58:12 -0500: Incorrect number of thread records
    2013-11-07 06:58:18 -0500: Checking multi-linked files.
    2013-11-07 06:58:31 -0500: Checking catalog hierarchy.
    2013-11-07 06:58:50 -0500: Invalid volume directory count
    2013-11-07 06:58:50 -0500: (It should be 166844 instead of 166842)
    2013-11-07 06:58:50 -0500: Invalid volume file count
    2013-11-07 06:58:50 -0500: (It should be 1056326 instead of 1056321)
    2013-11-07 06:58:50 -0500: Checking extended attributes file.
    2013-11-07 06:59:17 -0500: Checking multi-linked directories.
    2013-11-07 07:00:22 -0500: Checking volume bitmap.
    2013-11-07 07:00:24 -0500: Checking volume information.
    2013-11-07 07:00:24 -0500: Repairing volume.
    2013-11-07 07:03:03 -0500: Rechecking volume.
    2013-11-07 07:03:03 -0500: Checking Journaled HFS Plus volume.
    2013-11-07 07:03:03 -0500: Checking extents overflow file.
    2013-11-07 07:03:04 -0500: Checking catalog file.
    2013-11-07 07:03:09 -0500: Incorrect number of thread records
    2013-11-07 07:03:15 -0500: Checking multi-linked files.
    2013-11-07 07:03:29 -0500: Checking catalog hierarchy.
    2013-11-07 07:03:47 -0500: Invalid volume directory count
    2013-11-07 07:03:47 -0500: (It should be 166844 instead of 166842)
    2013-11-07 07:03:47 -0500: Invalid volume file count
    2013-11-07 07:03:47 -0500: (It should be 1056326 instead of 1056321)
    2013-11-07 07:03:47 -0500: Checking extended attributes file.
    2013-11-07 07:04:14 -0500: Checking multi-linked directories.
    2013-11-07 07:05:19 -0500: Checking volume bitmap.
    2013-11-07 07:05:20 -0500: Checking volume information.
    2013-11-07 07:05:20 -0500: The volume LaCie could not be repaired after 3 attempts.
    2013-11-07 07:05:21 -0500: Volume repair complete.2013-11-07 07:05:21 -0500: Updating boot support partitions for the volume as required.2013-11-07 07:05:21 -0500: Error: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.2013-11-07 07:05:21 -0500:
    2013-11-07 07:05:21 -0500: Disk Utility stopped repairing “LaCie”: Disk Utility can’t repair this disk. Back up as many of your files as possible, reformat the disk, and restore your backed-up files.
    2013-11-07 07:05:21 -0500:
    2013-11-07 07:09:45 -0500: Disk Utility started.
    2013-11-07 07:11:45 -0500: Preparing to erase : “LaCie”
    2013-11-07 07:11:45 -0500:     Partition Scheme: GUID Partition Table
    2013-11-07 07:11:45 -0500:     1 volume will be erased
    2013-11-07 07:11:45 -0500:         Name        : “LaCie”
    2013-11-07 07:11:45 -0500:         Size        : 999.86 GB
    2013-11-07 07:11:45 -0500:         File system    : Mac OS Extended (Journaled)
    2013-11-07 07:11:45 -0500: Unmounting disk
    2013-11-07 07:11:45 -0500: Erasing
    2013-11-07 07:11:54 -0500: Initialized /dev/rdisk1s2 as a 931 GB HFS Plus volume with a 81920k journal
    2013-11-07 07:11:54 -0500: Mounting disk
    2013-11-07 07:11:54 -0500: Erase complete.
    2013-11-07 07:11:54 -0500:
    2013-11-07 10:38:00 -0500: Disk Utility started.
    2013-11-07 10:38:12 -0500: Verifying volume “LaCie”
    2013-11-07 10:38:12 -0500: Starting verification tool:
    2013-11-07 10:38:14 -0500: Checking file system2013-11-07 10:38:14 -0500: Checking Journaled HFS Plus volume.
    2013-11-07 10:38:14 -0500: Checking extents overflow file.
    2013-11-07 10:38:14 -0500: Checking catalog file.
    2013-11-07 10:38:29 -0500: Checking multi-linked files.
    2013-11-07 10:38:29 -0500: Checking catalog hierarchy.
    2013-11-07 10:38:41 -0500: Checking extended attributes file.
    2013-11-07 10:39:04 -0500: Checking multi-linked directories.
    2013-11-07 10:39:31 -0500: Checking volume bitmap.
    2013-11-07 10:39:32 -0500: Checking volume information.
    2013-11-07 10:39:32 -0500: The volume LaCie appears to be OK.
    2013-11-07 10:39:32 -0500: Repair tool completed:
    2013-11-07 10:39:32 -0500:
    2013-11-07 10:39:32 -0500:

    I just got a call back from the upper level support person at apple care who had been advising me on my trouble with time machine and my LaCie 1 TB FWD. I had sent her much of the same verbiage as I posted here. As some of you have probably figured out, the verdict is that the drive is probably failing. She says this because I have had to do two erase and reformats. She thought that the intermitant problem that I have had with the drive unmounting when my iMac wakes from sleep could be related to the drive failing.
    In the meantime I have a secondary back-up (not using time machine) and the LaCie  1 TB FWD is working for the moment.
    Thanks to all who read all my verbiage.
    And in the meantime, I've learned something. I marked this question as solved. But I'm open to other things to try.
    Message was edited by: njtreehugger minor edits and update

  • TS3999 Help! Trouble with my calendar and icloud.

    I am having trouble with my calendar and icloud.
    Customers send me meeting invites and I can accept them no problem. But if they subsequently change the date or time I get an error message:
    Access to “appointment name” in “Home” in account “iCloud” is not permitted.
    The server responded:
    “403”
    to operation CalDAVWriteEntityQueueableOperation
    sometimes the time changes in my calendar, sometimes it doesn't, and my customers keep getting messages back from icloud 'accepting' the original date, not the changed date!!
    It is driving me an my clients crazy!  any help would be appreciated.

    I had a problem specific to the Calendar on web-based Firefox (PC) Was asked for a separate sign-in I'd never seen before which didn't work. I resolved this by signing out, signing in again.

  • IMessage trouble with two iPhones and one Apple ID

    Hi,
    I'm having trouble with iMessage after updating both of my iPhones to iOS 6 and not being able to use iMessage with one of the phones.
    Some background:
    -I have two iPhones, one on AT&T in the U.S., and one on NTT DoCoMo in Japan, both with separate phone numbers, using the same Apple ID.
    -The AT&T iPhone is a 4, the NTT is an unlocked 4S.
    On my 4 (AT&T), on iMessage, I have the option to send/receive as my U.S. phone number and my Apple ID. Works just like before updating.
    On my 4S (NTT), on iMessage, before I updated, I was able to send/receive using my Japanese number and Apple ID. After updating, I have the option to send/receive using my U.S. number and Apple ID. My Japanese number is greyed out and I cannot select it. When I turn on iMessage, it says "Waiting for activation..." and does not do anything. Turning iMessage off and on, some times I get an error message staying that activation cannot be completed.
    I have rebooted the phone multiple times, turned on/off iMessage and FaceTime, turned the Set Date & Time Automatically option on/off, and reset Network settings several times. Nothing works; iMessage will not activate on my NTT 4S. Please help!

    Finally resolved this issue after months of off and on troubleshooting.
    I have no idea exactly which steps "fixed" the issue, but here's what I did. None of the basic troubleshooting steps that are on here worked for me, and this is including restoring both phones in iTunes as a "last resort" step that two Apple technical service representatives suggested.
    I found a post on here from user "tungddao" who suggested:
    "Turn on iMessage then make a phone call to : 011+445773142076
                 With Facetime & Siri: 011+447786205094"
    I called both numbers with my NTT 4S, and both numbers hung up right away. I also texted both numbers, and the FaceTime one went through, while the iMessage number did not. I then checked my SMS blocking settings with NTT. There were no blocks, but I reset the settings to "unblock all" anyway.
    I was able to activate iMessage and FaceTime with my Apple ID and my NTT phone number. Halfway there.
    I then turned on my ATT 4, and while I could send/receive using my Apple ID and NTT phone number, the ATT number was greyed out, which was the opposite of what had happened before, when I could use the ATT number, but not the NTT one. On my NTT 4S, I could select my ATT number, but it was stuck on "verifying" for days, and I knew it wouldn't go through.
    So, I signed out of my Apple ID on iMessage and FaceTime on my ATT 4, and turned both services off. I turned on data roaming, and turned off WiFi. *This step was key to activating both services, as they would not activate over WiFi for some reason.
    I turned on iMessage and FaceTime without signing in to my Apple ID just yet. They both activated successfully, and then I signed into my Apple ID on both services, and from then on, I can use both numbers and my Apple ID on both phones! Finally!
    These are my current options:
    Phone 1 (4S on NTT): Phone 1's #, Phone 2's #, Apple ID
    Phone 2 (4 on ATT, roaming here in Japan on Softbank): Phone 2's #, Phone 1's #, Apple ID
    Hope this helps someone out there, as this issue was real frustrating for me.

  • Trouble with UTF-8 and PHP-OCI

    Hi there!
    I'm having some serious trouble with UTF-8. I just tried to insert a lambda into an NCLOB column in one of my databases and it was converted to an inverted question mark. I have verified that the string reaches my PHP script correctly encoded. Also selecting RAWTOHEX(column) in SQL Developer shows, that the inverted question mark is already stored in the column. So the problem must be somewhere between PHP-OCI and the database. Inserting a lambda via SQL developer works. I can also correctly fetch it via PHP.
    I'm using the latest PHP-OCI (2.0.8). v$version says "Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production".
    The database is fairly old and uses WE8MSWIN1252 as the character set and AL16UTF16 as the NCHAR character set. Hence I'm using NCLOB instead of CLOB. However, I connect to the database with AL32UTF8, since my app is running in UTF-8. I was under the impression that this would result in an automatic conversion from UTF-8 to UTF-16 when inserting into NCLOB columns, but apperently this is not the case. It looks like there is some sort of double conversion, first UTF-8 to WE8MSWIN1252 and then to UTF-16, because some non-ASCII characters like ä (a umlaut) get correctly converted from UTF-8 to UTF-16.
    Any ideas? I'm at a loss here. Thanks in advance.

    PHP OCI8 doesn't support NCLOB or NVARCHAR2.
    See NCLOB support in OCI8

  • Trouble with bridge mode and port forwarding

    I have a Westell Model 6100F DSL modem in bridge mode into my network and I'm having trouble forwarding ports. Is there any general guidance available to do this. I have set many of my friends networks up to allow port forwarding but all have been on other service providers, mainly cable. (my experience) My network is the only one I have had trouble with.
    Basically, my question is, while in bridge mode, does the modem forward all incoming traffic to my NAT router or do I need to apply special port forwarding settings in the modem to allow this?
    If bridge mode is the reason I cannot forward the ports, can someone explain how to set the WEstell 6100F back to factory defaults so I can start over. 
    Any other suggestions?
    Thanks in advance.
    Paul

    If bridge mode is set up correctly, your router should be holding the Public IP address (basically not something that is a 192.168 address) as shown at http://www.whatismyip.com/ and compared against what IP your router has.
    If your router has the public IP, all problems lie with either your router or your PC's firewall and configuration. I'd check out portforward.com for some guides on forwarding ports for your router or poarticular application if you need some additional help.
    ========
    The first to bring me 1Gbps Fiber for $30/m wins!

  • I am postin a message but no one seems to answer it . Plse I am having trouble with adobe 5 and I wr

    I am hjaving trouble with adobe 5 not compatable with my computer so how do I get rid of it and up grade  to a newer verson, hopfully a free one

    There is no application named Adobe 5, so you might have to provide the correct name for the application.  If it happens to be Creative Suite 5 (CS5) there is a good chance it is compatible with your computer but you might have to install it in a compatibility mode.  If you want to remove it you should first deactivate it. YOu might also do well to use the Creative Suite Cleaner Tool...
    Adobe Creative Suite Cleaner Tool
    helps resolve installation problems for CS3 thru CS6 and for Creative Cloud
    http://www.adobe.com/support/contact/cscleanertool.html
    As far as I know there are no free upgrades, especially if the reason would be lack of compatibility.  It might be true if you were to have purchased one version when the next version was just about to be released, but CS5 is well beyond being considered for that.  Software is not freely upgraded to match newer machines - that's part of life.
    Just in case... if the lack of compatibility is due to your machine not meeting the tech specs of CS5, then it will most likely be true that your machine does not meet the tech specs of anything newer than that.

  • I am having trouble with my FaceTime and imessage?

    I Am having trouble with my FaceTime. When I try to FaceTime some one I am getting no ringing and then I get a message saying lost connection try again. It has been like this since yesterday. I also tried to send a iMessage and it did not go. This is all new to me, has anyone had the same problem? Please help. Thank you.

    Turn FaceTime off in Settings>FaceTime>Off. Reboot your iPad. Turn FaceTime on again and see if it will work.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider if it appears on the screen - let go of the buttons. Let the iPad start up.

  • Troubles with App Module and Data Model

    Hi All!
    I have trouble with inserting new record in vo.
    My situation is next:
    I have AM with two instances of one VO. One instance I use to perform search and second to insert new records.
    How I can understend if I create instances in AM by giving different aliases to the same VO, they must be independent. Yes or not?
    My problems happens when I deploy app to OAS in local mode. App is stateless.
    When I try to insert new record I always get one from next situation:
    1. PK = 1. This attribute is generated by trigger and sequense on server. Update after insert in EO is on.
    2. **** Updating Attribute: CustSid Value is -******
    Application Error
    Return
    Error Message: JBO-26030: Failed to lock the record, another user holds the lock.
    Seems like update not insert!
    After that I can't edit first record in first VO.
    3. Time by time I get another messages
    When I run this app in JD debugger all is working fine!
    By the way - this page apper in frame.
    When I try it without frame all works fine On OAS too.
    I think it's problem with AM state. Isn't it?
    Any help will be appreciated!
    Mike

    In principle, there are only one way to do my task!? I can add LVAIKolekcijaDati via APasesDati as instance and move APasesDati child elements under that. Am I right? And if my jspx page is created from APasesDati instance and now I want to use my new - LVAIKolekcijaDati via APasesDati then I need to reecreate my jspx page from begining, or I can change something in my jspx page or somewhere else something that way I do not to recreate my jspx page and use LVAIKolekcijaDati via APasesDati in my page?
    Best regards, Debuger!

Maybe you are looking for