[AS CS5] Sorting out multiple nested objects

I have documents where we have labelled frames for scripting. Some of our artist have pasted these labelled frames inside of duplicates of the original labelled frame, or they have group multiple objects, and pasted then into (using **paste into) the labelled box.
This is giving me a big headache when I run the script.
What I have in the document is like this:
Labelled Box < Labelled Box (inside)
or
Labelled Box < group (inside) < Labelled Box1, Labelled Box2 (inside)
or
Labelled Box1, Labelled Box2 (not grouped, not inside of anything else, just 2 instances)
I am trying to get every page item of all page items whose label is "theLabel". This has the result of returning me a list of 2 or more items. If the box has boxes pasted into, I only need the top level item. If there is a group and sub items, I still only want the top object. In the last instance, since there are no items pasted into, I want the top level items, and this can be 2 or more items.
Is there a way of trying to see if one item is inside of one another? I can see that every item has a parent item, and the parent of example 1 is the frame. So I could ask one frame if its parent is the other one, and filter one out of my selection. The parent of each sub-item of example 2 is the group, not the main frame, and I can't seem to see how to ask if a group is inside of another frame. Since my return value on "every object whose label is..." returns items, not a group, how do I find out what the parent is? I tried to coerce a parent value to a string in order to just do some string comparisons but that didn't seem to work.

You don't need the Disk Image. Assuming you have copies of the Libraries you can delete them all.
For iPhoto 09 (version 8.0.2) and later:
What you mean by 'share'.
If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
Remember iPhoto must be running in both accounts for this to work.
If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
(You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.

Similar Messages

  • Sorting out multiple iPhoto libraries

    Hello
    This is my first time posting on apple support....
    I've looked through many discussions and can't find the full answer to my questions so am posting a new question (apologies, if I am duplicating something I missed). 
    Ok, so we (Husband and I) are new Mac users so not very familiar with Macs in general, but so far liking the transition away from PC etc
    We both set up iPhoto libraries under our own user accounts, naively thinking we could share each other libraries and be able to edit each other's photos.  We were hoping to be able to have access to all our photos, edit etc and thus avoid duplicates and generally be much more efficient in organizing our photos. 
    I have subsequently discovered this is not possible as we had hoped, and from my research I believe the best approach is to have one library on a shared folder that we both can access and edit.  And we are aware that we can only have this one library open under one user at a time, i.e. one user needs to quit iPhoto before the other user logs in and opens iPhoto. 
    So based on what I have read, my plan was to:
    1) Set up a sparse disk image on the shared folder that we can both access with read/write permissions
    2) Back-up existing libraries via time machine
    3) Rename my iphoto library (let's call it W library)
    4) Back up via time machine
    5) Move W library to disk image
    6) Move husband's iphoto library to disk image
    7) Back up again
    8) Use iPhoto library manager to merge both libraries into one "master" library
    9) Back up
    10) Use single master library from either account
    However, this hasn't quite gone to plan and I would like to ask for some help. BTW, we have Mac OS x version 10.6.7 and iPhoto version 9.1.3.
    Is this a sensible plan to achieve a shared iPhoto library that we can both edit (given that we have already set up libraries under each account that have different photos in)
    If so, what is the advantage of setting up a disk image over just using the shared folder as is?
    I got in a bit of a muddle with setting up the disk image in the first place, and by accident, didn't make it big enough for both libraries, so  I deleted it (I think) and set another one up.  I gave everyone read & write access via  "get info" in the finder.  Trouble is I didn't use very good names and now I'm not sure if a) I did actually delete the first one, and b) if I didn't actually delete it, I am using the correct disk image for the next steps.    Is there a way to verify which disk image is which, and delete the smaller one?
    Regardless of this problem,  I ploughed ahead with steps 2, 3, 4, and 5.  I dragged my renamed library to the disk image icon I could see on the desktop. 
    I then used the option key to choose the W library on disk image when I opened iPhoto in the dock and all I get is this message:  Caution The iPhoto library is on a locked volume. Reopen iPhoto when you have read/write access, or reopen iPhoto with the Option key held down to choose another library.
    So, if you've managed to read this far,  please can anyone tell me where I've gone wrong, and how to sort this out?  Bear in mind I'm a new Mac user (although that's probably pretty obvious by now!)
    Thanks in advance for any help

    You don't need the Disk Image. Assuming you have copies of the Libraries you can delete them all.
    For iPhoto 09 (version 8.0.2) and later:
    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
    (You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.

  • Sort Nested Object - 2 properties

    Hello,
    I am trying to sort based on a few properties of an object. The only issue i am having is the properties are within a nested object.
    For example.
    I would like to stort the following object by StreetNumber and StreetName, but these properties are inside 'locations_attributes' array.
        "commute": {
            "minutes": 0,
            "startTime": "Wed May 06 22:14:12 EDT 2009",
            "locations_attributes": [
                    "StreetNumber": "12",
                   "StreetName": "Main"
                    "StreetType": "St"   
                    "StreetNumber ": "17",
                   "StreetName": "Morning Side ",
                    "StreetType": "Dr"
                    "StreetNumber ": "26",
                    "StreetName": "Blake",
                    "StreetType": "St"               
    Can this be done ?
    Drew

    I get a JSON result from a REST service and I have a custom component that I populate.
    I am not usin a datagrid, but a extended version of the List component.
    I am just trying to sort the returned result sorted by street number and street name.
    I was using a compareFunction in a sort() method, but only found samples for sorting off of one field.. not 2.
    Here is  is a sample of what I was using for 1 field.
    private function sortByAttribute(a:Object, b:Object):Object
                var x:String = a.attributes[this._activePanel.SortField].toLowerCase();
                var y:String = b.attributes[this._activePanel.SortField].toLowerCase();
                return ((x < y) ? -1 : ((x > y) ? 1 : 0));

  • Sorting Multiple colunms and carry out multiple Searches

    Hello
    i would like to now i can carry out multiple searches for a single record. I have listed the some below
    Server Name Db Name Schema Name Change Reference Person
    GBCCCL15/16--CSAHEPA---DCDMIN----------46935-------------------
    GBCCCL15/16--CSAHEPA---NCADMIN----------46935-------------------
    GBCCCL15/16--CSAHEPA---BUADMIN----------47775-------------------
    GBCCCL15/16--CSAHEPA--- PPADMIN----------48213-------------------
    i would like to be able 2 carry out multiple searches on for example Schema Name (NCADMIN) and the Person's (Peter Salt) as i have a number of records that are similar i would like the Application to carryout multiple searches on the column reports at the moment all searches are done per column.

    Pritesh,
    Can you please clarify what this means? When you say "multiple searches", to me that implies that you want to issue multiple distinct queries, all executing concurrently. I can't believe my understanding is correct.
    Joel

  • Querying for a script insert multiple selected objects...

    Is there a script or plugin which insert multiple selected objects in one new text frame with one click?
    And is there a script or plugin which extract the content of anchored text frame out it's frame and replace it with it's frame. and extract selected text and insert it inside a new anchored text frame in it's place? (like convert text to table - convert table to text, but instead table we use text frame)

    Hi,
    Using OMB scripting to set attribute properties in a data mapping sort of defeats the purpose of utilizing a graphical user interface to define and set properties for a data mapping? Surely the GUI data mapping tool was created to get away from writing scripts and scripting would also require that you know the name of the data mapping, table operator and the set of attribute names for which you have to write one line of script to set each property value, i.e. 90 lines to set 90 attribute values.
    Cheers,
    Phil

  • New technique to place multiple anchored objects in InDesign story

    Hello,
    For a while I have been trying to figure out how to insert multiple anchored objects into an Indesign story. As far as I can tell, you cannot copy multiple objects that have already been placed in a document (such as a multi-page pdf) into an InDesign story, but must copy and paste them one-by-one into the story. This is a problem for a project I am working on where I want to have a large number of 340x52 pt pdfs to flow throughout a document in a master text frame interspersed with text.
    I have now found a solution for this issue that I thought I would share in case it would be helpful for anyone. It utilizes Automator actions for Mac OS X and Microsoft Word 2011 [2008 may work also, but I don't have a copy of that to test]; I am not good with scripting but perhaps similar solutions could be found for other systems and programs.
    1. If you want to place a multipage pdf within a text frame, first it into individual files for each page (with Acrobat Pro or pdftk or something similiar).
    2. Create an Automator service or program with the action "Create New Word Document". You can also use another automator action to save the document, or save it manually (to change the filename). In the finder, select the items you want, then run the service or drag them into the Automator program you have created.
    3. Place the word document into your InDesign story. Your items will now be anchored objects ordered in your text frame as they were in the finder.
    Please let me know if this is helpful or if anyone has suggestions for doing this process is a more efficient way. I am not sure, but it may be the case that this approach would only work on Macs, as I gather from this thread.

    I might note that I am using InDesign CS 5, and importing from a document stored in docx format.

  • How do I sort out the troubles on the console?

    Gmail - [#SAM-621717]: Trial of home intego          15/03/13 10:59 PM
    [#SAM-621717]: Trial of home intego
    2 messages
    Intego Support <[email protected]> Reply-To: [email protected] To: mlkessell@**** Cc: monicakessell02@****
    Hello Monica,
    Fri, Mar 15, 2013 at 3:52 AM
    If the accounts are on the same computer, you should not have to use a different e-mail address. If your son's account is not an Administrator account, this may be the issue. Are you able to launch VirusBarrier from your son's account from Applications>Intego?
    Kind Regards,
    John Intego Support Team
    ____________________________________________________________________ Intego Technical Support          http://www.intego.com/support
    User manuals are available from the 'Help' menu in all Intego software. Keep up-to-date with the latest Mac security information.
    Visit the Intego Mac Security Blog: http://www.intego.com/mac-security-blog/ Follow us on Twitter: @IntegoSecurity
    Facebook: http://www.fa****.com/Intego ____________________________________________________________________
    Monica Kessell <monicakessell02@****>          Fri, Mar 15, 2013 at 10:55 PM To: [email protected]
    Yes I am able to do that and the issue that we were having seems to have settled down after the computer crashed and I restarted it by resetting PRAM and repairing the disk. Can you help me understand what to do about the issues that the console in utilities is logging frequently? both before and since the crash yesterday; (see below)
    First issue; An instance 0x10062c110 of class CBX5KeyboardObservationController was deallocated while key value observers were still registered with it. Observation info was leaked, and may even become mistakenly attacked to some other object. set a breakpoint on NSKVODeallocateBreak to stop here in the debugger. Here's the current observation info: .......
    (lots of stuff I don't understand)
    Monica Kessell <monicakessell02@****>
    Gmail - [#SAM-621717]: Trial of home intego          15/03/13 10:59 PM
    Second Issue; barrier.daemon[51] launcht l: Error unloading:com.intego.virusbarrier.bm_controller barrier.daemon[51] launcht l: Error unloading:com.intego.virusbarrier.bm_injector_32 barrier.daemon[51] launcht l: Error unloading:com.intego.virusbarrier.bm_injector_64 com.apple.launchd[1] (com.apple.xprotectupdater[25]Exited with exit code:252 e.WindowServer[95]Fri Mar 15 21:54;39 monica-kessellsimac. local WindowSever[95] <Error>: kCGErrorFailure: set a breakpoint @ CGErrorBreakpoint() to catcherrors as they are logged. d.peruser .501[146] (com.apple.ReportCrash) Falling back to default Mach exception handler. Could not find: com.apple ReportCrash.Self d.peruser .501[146]          (com.apple.mrt.uiagent[178])Exited with exit code 255 tions.enabled[186] launchct l : CFURLWriteDataAndPropertiesToResource(/var/db/launchd.db/ com.apple.launchd.peruser.501/overides.plist) failed:-10 d.peruser.501[146] (com.apple.Kerberos.renew.plist[179]) Exited with exit code: 1 tions.enabled[186] launchct l : CFURLWriteDataAndPropertiesToResource(/var/db/launchd.db/ com.apple.launchd.peruser.501/overides.plist) failed:-10 es.integomenu[185] objc[185]:ClassIFCrossCompatibleUnicodeString is implemented in both /Library/Intego/Family Protector.bundle/Contents/MacOS/Family Protector Daemon.app/Contents/ Frameworks/Family Protector Foundation.framework/Versions/A/Family ProtectorFoundation and /Library/Intego/ personalbackupd.bundle/Contents/MacOS/Personal BackupDaemon.app/Contents/ Frameworkds/PersonalBackup.framework/Versions/A/PersonalBackup. One of the two will be used. Which one is undefined
    and there are more messages like this regarding the Class IFTimeIntervalManager and the Class IFUUID and the Class IFMessanger and the Class IFMessangerClient and the class IFMessangerLion and the class IFMDelayed Messange and the Class IFSnowReply and the Class IFMessagerSnow and the Class IFMessanger and the Class IFMLionReply
    and on and on the messages go
    Can you shed some light on the subject and help me sort out the computer?
    regards
    Monica Kessell
    <Emails Edited By Host>

    Here's my latest list of complaints to Intego regarding Family Protector. I thought it should be shared:
    I have been using Family Barrier for a couple of years now, and may I say, it has so many problems that as soon as I can find a better alternative, I'm gone. Until that day, however, I expect some solutions.
    Issue #1: The application is 100% unreliable. The chances of it doing its job on any given day are seriously 50/50. Or worse. This alone renders the program useless. But that's not all.
    Issue #2: It's unbelievably easy to override. Are you seriously unaware that all one has to do is change the date on the computer to one before Family Barrier was installed, it will 100% not do its job. Awesome. This is straight out of Hacking 101, and any program should be able to defend against it. Otherwise, any demo I try download can be made to work forever. While some are, most are not. Get it together, People.
    Of course, making time changes impossible can be done from my end by the keeping admin password unknown to the protected user, but what if the protected user needs admin access? That happens to be my case. Nonetheless, I was willing to block admin access to fix the problem until you could tell me that YOU'VE done your job and taken care of it (you will tell me that, right?). But then I was left with Issue #1 (remember? the one where it only works 50% of the time at best?), so what's the point?
    I thought I'd try reinstalling it again, just for fun. I've done this before and it's worked TEMPORARILY (tell me the truth, would you pay for an application that constantly had to be re-installed so that it would work for a while? the truth, now). Why am I not surprised that now even that simple process is f'ing up. I punch in my name and serial and it won't accept it. Is there no end to the awesomeness? Somehow, I think that there is not.
    It's especially frustrating that there is no support number for me to call, forcing me to have to go through THIS process, which makes your job so much easier and is so much less helpful for your customers) just to get any answers... eventually.

  • Not possible to store multiple fileReference object in same array?

    Hi all,
    I'm trying to store multiple fileReference  object in one array. But everytime I push() in a new object the old  objects that's already in the array gets set to the latest object.
    I'm  letting the user select an image. Then I push the selected  fileReference object into an array like my_array.push(  FileReference(event.target) );
    If I then run a loop on  "my_array" to check it's content I'm getting the latest pushed  fileReference object for every index in the array.
    With one object pushed in:
    1. Image1.jpg
    With two objects pushed in:
    1. Image2.jpg
    2. Image2.jpg
    Anyone have any thoughts on this?
    Thank you so much

    This is basically what I'm doing. The code is cut out from a larger portion so there might be errors, but hopefully not.
    // Local Files
    private var localFiles:FileReference           = new FileReference();
    private var fileList:Array                = new Array();
    private function browse(event:MouseEvent)
         trace("[Browse] Using local files");
         localFiles.addEventListener(Event.SELECT, onLocalFilesSelected);
         localFiles.browse(getAllowedTypes());
    * LOCAL FILE
    private function onLocalFilesSelected(e:Event)
         localFiles.addEventListener(Event.COMPLETE, localFileHandler);
         localFiles.load();
    private function localFileHandler(event:Event):void
         localFiles.removeEventListener(Event.COMPLETE, localFileHandler);
         fileList.push(FileReference(event.target));
         showFileList();
    private function showFileList():void
         for(var $x:int=0;$x<fileList.length;$x++)
              var file:FileReference = FileReference(fileList[$x]);
              trace($x+": " + file.name);
    Thank you

  • The Best Tool For Multiple Animated Objects

    Hi,
    I am expirimenting with Flash Web Sites, and I would like suggestions as to a starting point for my project, and I am assuming a Flash website is where I would start.
    Basically, If I were to open up a web page, I would like to see multiple animated objects.  For example, if I were to simulate an Emergency Room, I would have an EKG displaying a heart rate, then perhaps see a breathing maching apparatus moving up and down, a Drip bag (sorry, don't know the real term), dripping into a patient's tube.  And of course, if I were to roll over an object it would animate, and if clicked on more animation or on to another page.
    I tried creating the animated objects in Fireworks, and I thought I could combine various Firworks files into one, but it didn't work (too many frames), either becasue I lack the knowlege of how to do this or simply it cannot be done that way in Fireworks.  I had a background with one animated flashing object (that was easy), but combining multiple independent objects, I could not figure it out.
    Someone suggested that I would have to use Action Scripts, which made me realize, I don't know the best way to accomplish my example above, and although I know I may be over my head, I would just like to get direction as to where I should begin.
    Should it all be in Flash in the first place?  To continue on with the example above, after a user clicks on the rollover image, a girney comes rolling in and we are giving choices on a monitor with what our next actions should be, which would take us into another page.  (this is just to give you perpective of what I am trying to accomplish).
    Should I create independent animated objects (files) in Fireworks, then somehow import them into their specified location in Flash.
    I hope this makes sense and I am hoping someone is kind enough to provide a starting point.
    Best.

    Flash is the best tool for what you want and most of it can be done once you get a handle on the basics.
    For you interactivity (rollOvers / triggering more animations with mouse) you will need some actionscript but don't get hung up on that now.
    There is a world of info out there. Google "animation basics in flash) you may have to weed through some garbage but you will find what you are looking for somewhere.

  • Multiple Consumer object per Streaming Connection in AIR

    hi,
    We require streaming server setup for our project.
    We are trying to minimize the active connections to the server.
    My query is "If we are using multiple Consumer object instances with same channel and destination, will we have a single connection to the server shared by all Consumer instances or we'll be having different connection for each Consumer instance".
    Thanks in advance for your support
    Regards,
    Shailendra Sirohi

    Excellent answer.  It dovetails with the approach I've started to take here.  I'm using something called NetConnectionClient to catch server calls.  Does your NCMgr class extend NetConnection or EventDispatcher?
    Mine extends EventDispatcher and has a method like the following.  Just stuffs the message from the server into an object first before dispatching an event containing it:
            public function receiveChatMessage(msg:String):void
                var tempObj:Object = new Object();
                tempObj.msg = msg;
                dispatchEvent(new NetConnectionClientEvent("onReceiveChatMsg", tempObj));
    All cool there.  This works up to this point.
    I'm hazy after that though.  Who should listen for and handle the event?  I'd like my chat component to listen for and handle it directly, like in your scenario.  But my chat component is in a separate mxml file imported into the main app file.  I'm hazy on how to have it grab what it needs.
    I currently have the "application" listening for and handling the event.  The handler method just relays the call by calling a method on the chat component instance, like this:
    chat.receiveMessage(tempObj); //tempObj contains the message
    I think that's too many relays of the same call, from the NetConnectionClient class, to the main application file, down to the custom chat component.  I'd like to cut out a leg of that trip.
    Should I have the chat component instance itself be listening, like this?
                chat.addEventListener("onReceiveChatMessage", chat.receiveChatMsg);
    Is that a proper relay of the dispatched event to the target component.  The syntax doesn't seem proper to me.  I feel like something's wrong with the design of the last leg of the relay here.

  • Multiple SDO_GEOMETRY Objects of type CIRCLE with the same LOCATION

    Can i have a single MERCHANT LOCATION hold multiple SDO_GEOMETRY Objects of type CIRCLE ?
    For example the use case , i need to have a SDO_GEOMETRY TYPE CIRCLE circle defined for a single MERCHANT LOCATION with a 2 Mile radius as well as a 5 Mile Radius.
    is that even possible with Spatial? I know i can add a single geometry for a merchant at once, but i want to give the user the flexibility of choosing the type of geometry for the merchant based on set of rules. hence want to check if this can be done or not?
    Thanks in Advance

    Person with no name,
    Not clear exactly what you need to do here.
    You can store two circles with the same centre in a single sdo_geometry but only if you use a polygon with the circle with the greatest radius being the outer ring and the smaller radius the inner ring.
    I have a utility in my free COGO plsql package that allows me to create circles for PLANAR data pretty easily as follows:
    -- Function...
    Create
        function CreateCircle(dCentreX in Number,
                              dCentreY in Number,
                              dRadius in Number)
        return mDSYS.sdo_geometry
        IS
          dPnt1X NUMBER;
          dPnt1Y NUMBER;
          dPnt2X NUMBER;
          dPnt2Y NUMBER;
          dPnt3X NUMBER;
          dPnt3Y NUMBER;
        BEGIN
          -- Compute three points on the circle's circumference
          dPnt1X := dCentreX - dRadius;
          dPnt1Y := dCentreY;
          dPnt2X := dCentreX + dRadius;
          dPnt2Y := dCentreY;
          dPnt3X := dCentreX;
          dPnt3Y := dCentreY + dRadius;
          RETURN MDSYS.SDO_GEOMETRY(2003,NULL,NULL,MDSYS.SDO_ELEM_INFO_ARRAY(1,1003,4),MDSYS.SDO_ORDINATE_ARRAY(dPnt1X, dPnt1Y, dPnt2X, dPnt2Y, dPnt3X, dPnt3Y));
        End;
    select sdo_geometry(f.geom.sdo_gtype,
                        f.geom.sdo_srid,
                        sdo_point_type(f.centreX,f.centreY,null),
                        f.geom.sdo_elem_info,
                        f.geom.sdo_ordinates) as mcircle
      from (select 10 as centreX,
                   10 as centreY,
                   sdo_geom.sdo_xor(cogo.CreateCircle(10,10,2),
                                    cogo.CreateCircle(10,10,5),
                                    0.005) as geom
              from dual ) f;
    -- Results
    MCIRCLE
    SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2, 11,2003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0, 10.0,8.0, 8.0,10.0, 10.0,12.0, 12.0,10.0, 10.0,8.0))(This geometry looks like a donut.)
    Note that I have included the centre coordinates in the sdo_point of the result sdo_geometry.
    To extract each ring:
    -- We need a function to return number of rings in a polygon as sdo_util.getNumElems() does not
    Create
      Function GetNumRings( p_geometry  in mdsys.sdo_geometry,
                            p_ring_type in integer /* 0 = ALL; 1 = OUTER; 2 = INNER */ )
        Return Number
      Is
        v_elements   pls_integer := 0;
        v_ring_count pls_integer := 0;
        v_etype      pls_integer;
        v_ring_type  pls_integer := case when ( p_ring_type is null OR
                                                p_ring_type not in (0,1,2) )
                                         Then 0
                                         Else p_ring_type
                                     End;
      Begin
        If ( p_geometry is not null ) Then
          v_elements := ( ( p_geometry.sdo_elem_info.COUNT / 3 ) - 1 );
          <<element_extraction>>
          FOR v_i IN 0 .. v_elements LOOP
            v_etype := p_geometry.sdo_elem_info(v_i * 3 + 2);
            If ( ( v_etype in (1003,1005,2003,2005) and 0 = v_ring_type )
              OR ( v_etype in (1003,1005)           and 1 = v_ring_type )
              OR ( v_etype in (2003,2005)           and 2 = v_ring_type ) ) Then
               v_ring_count := v_ring_count + 1;
            End If;
          END LOOP element_extraction;
        End If;
        Return v_ring_count;
      End GetNumRings;
    -- Query
    with circles as (
      SELECT SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2, 11,2003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0, 10.0,8.0, 8.0,10.0, 10.0,12.0, 12.0,10.0, 10.0,8.0))
             as geom
        FROM dual
    select sdo_util.extract(a.geom,1,e.ringNo) as circle
      from circles a,
           (select level as ringNo from circles a connect by level <= GETNUMRINGS(a.geom)) e;
    -- Result
    CIRCLE
    SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2),SDO_ORDINATE_ARRAY(10.0,15.0, 5.0,10.0, 10.0,5.0, 15.0,10.0, 10.0,15.0))
    SDO_GEOMETRY(2003,NULL,SDO_POINT_TYPE(10.0,10.0,NULL),SDO_ELEM_INFO_ARRAY(1,1003,2),SDO_ORDINATE_ARRAY(10.0,8.0, 12.0,10.0, 10.0,12.0, 8.0,10.0, 10.0,8.0))Not sure if this helps you at all....
    regards
    Simon

  • Quicksort using Comparable can sort out negative value well !!

    man , i have waste another day try to solve this logic problem. It was not easy as what i thought. The Qsort method which i found it on the net and i apply it into my java code .. i do understand his code well , however the result does not sort out well especially negative number or if there is there are small number at the end of the array. Below are some result which i compile .Hope someone can help me , i going crazy soon.
    sample 1:
    Before Soft()
    [93, 50, 34, 24, -48, 27, 45, 11, 60, 51, -95, 16, -12, -71, -37, 2]
    After Soft()
    [-12, -37, -48, -71, -95, 11, 16, 2, 24, 27, 34, 45, 50, 51, 60, 93]
    sample 2:
    Before Soft()
    [-93, 50, -34, -24, 48, -27, -45, 11, 60, 51, -95, 16, -12, -71, -37, 2]
    After Soft()
    [-12, -24, -27, -34, -37, -45, -71, -93, -95, 11, 16, 2, 48, 50, 51, 60]
    sample 3 ==> this one is correct ;-)
    Before Soft()
    [93, 50, 34, 24, 48, 27, 45, 11, 60, 51, 95, 16, 12, 71, 37, 20]
    After Soft()
    [11, 12, 16, 20, 24, 27, 34, 37, 45, 48, 50, 51, 60, 71, 93, 95]
    import java.util.*;
    import java.lang.Comparable;
    public class QuickSort {
    // static Comparable [] array;
    public QuickSort(){}
    public static void main ( String [] args){
              QuickSort qs =new QuickSort ( );
              Object [] test = new Object [16];
              test[0]="93";
              test[1]="50";
              test[2]="34";
              test[3]="24";
              test[4]="-48";
              test[5]="27";
              test[6]="45";
              test[7]="11";
              test[8]="60";
              test[9]="51";
              test[10]="-95";
              test[11]="16";
              test[12]="-12";
              test[13]="-71";
              test[14]="-37";
              test[15]="2";
              for (int i=0;i<test.length;i++)
              System.out.println(test);
              System.out.println();
    /* Copy the value from the Object [ ]test into Comparable [] array. /*
    Comparable [] array = new Comparable [test.length];
    for(int i=0;i<array.length;i++)
         array [i]=(Comparable) test[i];          
         System.out.println(array[i]); //test if the value is the same as the test Object //
    System.out.println("Before Soft()");
    System.out.println(Arrays.asList(array));
    qs.sort(array); //call sort method to sort the array
    System.out.println("After Soft()");
         System.out.println(Arrays.asList(array));
    * Sorts the array of Comparable objects using the QuickSort algorithm.
    * @param comparable an array of java.lang.Comparable objects
    public void sort(Comparable comparable[]) {
    QSort(comparable, 0, comparable.length - 1);
    * @param comparable an array of java.lang.Comparable objects
    * @param lowInt int containing lowest index of array partition
    * @param highInt int containing highest index of array partition
    static void QSort(Comparable comparable[], int lowInt, int highInt) {
    int low = lowInt;
    int high = highInt;
    Comparable middle;
    // The partion to be sorted is split into two separate sections which are
    // sorted individually. This is done by arbitrarily establishing the middle
    // object as the starting point.
    if (highInt > lowInt) {
    middle = comparable[(lowInt + highInt) / 2];
    // Increment low and decrement high until they cross.
    while (low <= high) {
    // Increment low until low >= highInt or the comparison between
    // middle and comparable[low] no longer yields -1 (ie comparable[low]
    // is >= middle).
    while (low < highInt && (comparable[low].compareTo(middle) < 0)) {
    ++low;
    // Decrement high until high <= lowInt or the comparison between
    // middle and comparable[high] no longer yields 1 (ie comparable[high]
    // is <= middle).
    while (high > lowInt && (comparable[high].compareTo(middle) > 0 )) {
    --high;
    /*switch over */
    if (low <= high) {
    Comparable obj;
    obj = comparable[low];
    comparable[low] = comparable[high];
    comparable[high] = obj;
    ++low;
    --high;
    if (lowInt < high) {
    QSort(comparable, lowInt, high);
    if (low < highInt) {
    QSort(comparable, low, highInt);

    the problem is solve after cos i cast a string variable into the object comparable. The problem is solve after i use cast Integer into the object.
    regards
    st

  • Is it possible to  add multiples dimension objects in Webi Ranking ?

    As per the project requirement we need to convert custom sqls to reporting sql in webi 3.1 sp5 .
    Is it possible to  add multiple dimension objects while applying ranking (Webi query panel ).
    Or is there any other way to achieve this feature in BO ?
    Regards,
    Pranay

    Hi ,
    There is a way if you want to apply ranking within a ranking . Below are the steps:
    First on the outer side we can use the Rank feature which is available directly
    Then use the Rank Function (=rank ()) and reset your dimension accordingly .
    This kind of Ranking is possible.
    Regards,
    Rahul

  • How to sort an array of objects?

    I need to sort an array of objects. Each object has serial number, and other properties. I need to sort it by serial number.

    Do a java.util.Arrays.sort(). The method has quite a few overloads, so I'll give a complete example this time:import java.util.*
    public class SortDemo {
        public static void main(String args) {
            SimpleObject[] objs = new SimpleObject[10];
            for (int i=0; i<10; i++)
                objs=new SimpleObject();
    dump(objs);
    Comparator c = new SimpleComparator();
    Arrays.sort(objs, c);
    dump(objs);
    static void dump(Object[] o) {
    for (int i=0; i<o.length; i++)
    System.out.print(o[i] + " ");
    /** Object to demonstrate comparing with **/
    class SimpleObject {
    private int n = (int) (10*Math.random());
    public String toString() {
    return String.valueOf(getNumber());
    public int getNumber() {return n;}
    /** The custom comparator **/
    class SimpleComparator implements Comparator {
    public int compare(Object o1, Object o2) {
    return ((SimpleObject) o1).getNumber() - ((SimpleObject) o2).getNumber();
    public boolean equals(Object o) {return false;}
    }I could have made the SimpleObject class "Comparable", but a design like this allows more flexibility so I decided to use another class for the Comparator.

  • NULL nested object

    Hi,
    OTT generates code as
    streamOCCI_.setObject(obj);
    when one define a nested object (not REF) e.g
    CREATE TYPE inside_t (f1 NUMBER)
    CREATE TYPE outside_t (id NUMBER, insider inside_t)
    The problem I am seeing is that when I instantiate a persistent object of outside_t in a c++ app and assign the result to a Ref<>
    Ref<outside_t> o = new(conn, "OUTSIDERS_V") outside_t;
    where OUTSIDERS_V is an object view over a traditional relational table of the form
    CREATE TABLE outsiders (id NUMBER, f1 NUMBER) and
    CREATE VIEW outsiders_v OF outside_t ... AS SELECT id,inside_t(f1) FROM outsiders
    it core-dumps on the setObject as the writeSQL is called upon the new but i don't have any value for inside_t yet and could want it to remain NULL for the lifetime of the object. Is it possible to achieve this without using REFs ?

    Unfortunately, AMF serialization is something of a black art. I'd run into multiple issues in the past (working with Granite DS, rather than Blaze--but it's essentially the same thing). I'm not sure about Blaze, but Granite has very verbose logging available if you configure log4j to DEBUG level for org.granite. The other alternative is to attach to your Java process with a debugger (Eclipse makes this fairly automagical), download the Blaze source and configure Blaze as a project in Eclipse, add it to source lookup for your project, and step through the actual serialization to see what's going on. This is moderately complicated to set up, but priceless when it comes to debugging.

Maybe you are looking for

  • FacesCtrlListBinding getInputValue ADFv: error while reactivating a reg

    Jdev. 11.1.1.4 Trying to apply this in my application: http://one-size-doesnt-fit-all.blogspot.com.es/2011/06/jdev-111140-afshowdetailitems-and_20.html I'm getting this error while trying to programmatically reactivate my region after having deactiva

  • Local sync of Contacts and Calendars

    I have not yet upgraded to Mavericks, I usually wait to see how things shake out.  I just found out that Mavericks disables local syncing of Contacts, Calendars and Keychains.  This may be a great convenience for some, but I prefer to maintain my per

  • HT1660 How do I run itunes from external Hard drive?

    How do I run itunes from external hard drive. I only have ssd on PC and media is too large to fit

  • How can I create a 6x9 PDF?

    I have a 6x9 word document but when I use the online PDF creator it always makes it into a 11x17 or something like that.  How do I make a 6x9?

  • OAS 4.0.8 and NT and Apache?

    There isn't an OAS forum, so I'm trying here ... Can I use Oracle Application Server 4.0.8 and the Apache Web Server on NT? If so, how? Any help would be appreciated ... thanks.