Correct Way to Look at ROWID value

I found some sql and modified it that is suppose to allow you to look at the ROWID info of a table
Can someone tell me why this does not work and what would be the correct way to get the info based on the ROWID ?
Evertyime I generate the ROWIDs and try to enter one into the second SQL statement, I get nothing back
Example:
prompt
prompt ******************
prompt V$Session/DBA_Objects - Create RowIDs
prompt ******************
prompt
select
     s.sid,
     s.terminal,
     do.object_name,
     row_wait_obj#,
     row_wait_file#,
     row_wait_block#,
     row_wait_row#,
     dbms_rowid.rowid_create ( 1, ROW_WAIT_OBJ#, ROW_WAIT_FILE#, ROW_WAIT_BLOCK#, ROW_WAIT_ROW# ) rowid_created
from
     v$session s,
     dba_objects do
where
     s.ROW_WAIT_OBJ# = do.OBJECT_ID
order by
     s.sid;
prompt
prompt ******************
prompt Get ROWID Info
prompt ******************
prompt
select * from &table_select where rowid = '&rowid_created';
Any assistance would be appreciated
Thanks
Jim

Hi Miguel
well i am using thread based processes into oracle and some of my users are getting CGI timeouts or else getting tired of waiting and trying to do the same task again through my web app so they try it again causing a lock problem
I can see what is being locked down to the table but i wanted to know what data is being locked when trying to get updated, so i thought i could use the ROWID to look at the entry
Thanks
Jim

Similar Messages

  • Correct way to pass pointers around labview

    Hello,
    what is the correct way to pass pointers, pointing to DLL allocated memory around labview ?
    I have been for quite some time using the standard C type cast working as:
    typedef struct
    void *mem;
    } myVars;
    int InitMyVars(int64_t *myVarsLVPtr)
    void *myVarsPtr = NULL;
    myVarsPtr = malloc(sizeof(myVars));
    if(myVarsPtr)
    *myVarsLVPtr = (int64_t)myVarsPtr;
    return 0;
    return -1;
    int UseMyVars(int64_t *myVarsLVPtr)
    void *myVarsPtr = NULL;
    myVarsPtr =(void*)*myVarsLVPtr;
    //return funcWithVars(myVarsPtr);
    Afterwards configure the library call nodes as follows:
    And pass the pointer around in labview as an 64 bit number (since it is a pointer value, I think it does not make difference if its signed or unsigned, please facepalm me if wrong)
    This way is very ugly. I do not like it. Found several discussions stating that "Every time someone writes a code like int tmp = (int)(&something); a little fluffy kitten chokes to death. Unfortunately, programming so far had been quite a felinicide." This makes me a serial kittenchoker.
    It is also dangerous, for different platforms eg. i686 and x86_64.
    I was self learning all this stuff, now looking back at it, it feels like I missed something big time.
    There must be a better way.
    I am thankful for suggestions.
    Solved!
    Go to Solution.

    nathand wrote:
    It would help for you to post real code, or at least consistent examples. Where in your code are you actually using the cast from pointer to integer that you are trying to avoid?
    Lines 12 and 21 in the 1st post
    *myVarsLVPtr = (int64_t)myVarsPtr;
    myVarsPtr =(void*)*myVarsLVPtr;
     Sorry, but I cannot see how are my examples inconsistent, I only supplied one. I know it consists of 2 images and some code, but still describes the same process.
    nathand wrote:
    There is no need for LabVIEW to know whether a wire contains a pointer or a number - either way, it's just a number. There are many situations in which the Call Library Function Node configuration does NOT match the function prototype, but you get the correct result.
    You allways have to match the function prototype, if you do not, you corrupt memory. I guess you mean, that the function prototype may be written different, as long as the datatypes and memory layout is the same.
    nathand wrote:
    One such situation is when the wire contains an address. In that case, even though the function prototype specificies that the parameter is a pointer, in LabVIEW you should configure that parameter to be passed BY VALUE because the value on the wire already is a pointer. Does that make sense? In your example code, you have essentially created a handle, because the myVars data type contains a pointer. Your C code can move around the memory pointed to by myVars.mem as much as it wants, so long as the pointer to myVars stays constant. I'm assuming that's what you're doing; is that correct?
    If you pass a variable into DLL "by value", it does exactly what it says, it passes the value. Means, if you want to change the value going through the wire, you cant, you just get the value of it to the function stack. You can assign new value to such value inside DLL, but LabView will still keep the same value in its wire, since it only passed value. Its confusing, I know.
    Imagine 1 guy thinking a number, he tells it to his neighbourgh, so they both know what the number is. But if the second guy wants to change it, he cant, ho only knows the value.
    If the guy 1 passes a position of such information in his brain, guy 2 can read the number and if he modifies it, guy 1 will think of the new number. However guy 2 cannot move the position.
    I am not creating a Handle by making a pointer to a pointer. First, handle can be quite anything, that is used to identify an object of some use. I know LabView calls Handles the pointers to memory pointers pointing at some LabView datatype. The value in the wire, as you correctly stated, is a place in a memory, the fact, that I pass it to DLL in a "pointer style" manner, does not mean I intend to create pointer to it, I just want to know the place in memory, where LabView keeps such value, so I am able to modify it in cases it changes (inside DLL, my DLL is guy 2 and labview is guy 1).
    Pointer to a memory in heap tells the computer where the memory is. You cannot move a memory and still have the same pointer.
    nathand wrote:
    If so, then again, in LabVIEW you should be passing the pointer by value. I think this will avoid the dereference cast that's bothering you. As you have it now, you are adding an unnecessary extra layer of reference (LabVIEW is passing a pointer to an address, rather than the address itself), which you then need to cancel out with the cast that you don't like.
    I cannot avoid type cast in LabView, since you are LabView limited. I am trying to avoid casting a pointer to integer.
    There is a reason why pointer is of datatype pointer. It is platform specific, it can be flat number or something more complex, so anytime I make a number from a pointer, it is risky, I am mixing apples and bananas + the kitten chokes.
    Thank you for answer.

  • Correct way to use double type to represent money quantities

    I was assigned a project where I had to create a class that received money quantities as double numbers and that implemented a method returning a quantity of money as double. I have to use this scheme as we have no seen other data types in class.
    My question is, what can I do to make sure that the value I'm returning is a double number that looks like money. For example, I don't want my method to return 10.78889332., I want it to return 10.79. How can I do that? Is there any intended method for that?
    Can I let this issue like that and then take care of it in the test class by formating the output of the method when using it. I think this approach is not correct.
    Thanks for your time.

    See http://docs.sun.com/source/806-3568/ncg_goldberg.html
    There is no correct way to use double type to represent money quantities. You shouldn't be receiving them, you shouldn't use them, and you shouldn't return them. Floating-point is for science, not money.
    Use BIgDecimal.

  • What is the correct way to create links to my website?

    Hi
    My site is finally finished and I am now looking to list it on various directories on the internet to generate links to my site.
    When my site opens in a browser it shows up as http://ateccomputerservices.co.uk
    I know this question has been asked many times on the internet but what is the correct way to post my link?
    I know I should be consistent and use www or not on every link but none of the articles tell me whether I should use http:// or not when linking.
    So for example, should I use...........
    http://ateccomputerservices.co.uk
    or
    http://www.ateccomputerservices.co.uk
    or
    ateccomputerservices.co.uk
    or
    www.ateccomputerservices.co.uk
    and should I put /index at the end?
    Once I've decided on which link to use should I redirect all the other addresses to the main one?
    I'm pretty new to web design so I need some advice from some seasoned experts
    Thanks for taking the time to read my questions!

    When you browse to http://ateccomputerservices.co.uk and to http://www.ateccomputerservices.co.uk do you get the same page?  Most hosts will automatically create a CNAME record for both 'www.example.tld' and 'example.tld' when the hosting account is created, but not all do.  If that second CNAME record is not created, then you must always use the "www" prefix.
    If the reference to your site is a text reference only, then you could just use 'www.ateccomputerservices.co.uk', but if it's a link you should always make the LINK part (the HTML href attribute's value part) as a fully qualified URL, i.e., 'http://www,ateccomputerservices.co.uk' or 'http://ateccomputerservices.co.uk':
    <p>Click <a href="http://ateccomputerservices.co.uk">here</a> to link to my site .</p>
    When a browser requests that domain from the server, the server will fetch the first file it finds with a 'default filename' (usually 'index.html' or 'index.php' or 'home.html' or...) and upload that to the browser, so there is no need to further specify the filename - the default is when no filename is given.
    Once I've decided on which link to use should I redirect all the other addresses to the main one?
    I'm not sure what you are asking here....
    I'm pretty new to web design so I need some advice from some seasoned experts
    In the immortal words of comedian Myron Cohen, "everybody gotta be somewhere".

  • What is the correct way to add styling to drag-and-drop created calendars?

    I have a working instance of a rich client calendar. I generated the view with the required fields (start, stop, provider, ...), put it into the App Module, and dragged it onto a JSF page to create a calendar.
    Next I created an activityScope object in a class called CalendarBean (no inheritance)
    Class CalendarBean()
    private HashMap<Set<String>, InstanceStyles> activityColorMap;
    +..+
    +public CalendarBean() {+
    super();
    activityColorMap = new HashMap<Set<String>, InstanceStyles>();
    HashSet setEd = new HashSet<String>();
    HashSet setLen = new HashSet<String>();
    setEd.add("Work");
    setLen.add("Home");
    activityColorMap.put(setEd, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityColorMap.put(setLen, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.RED));
    +}+
    +}+
    Next, I linked this up as a backing bean and associated the ActivityStyles of CalendarBean to it:
    +#{backingBeanScope.calendarBean.activityColorMap}+
    I populated some records in the database with properties "Work" and "Ed', but they show default blue.
    As I understand it, I need to do something with the getTags() method of the underlying CalendarActivity class, but I'm not quite sure how to do that.
    Took a stab at creating a class, CalendarActivityBean, that extended CalendarActivity, and pointed all the CalendarActivity references I had to the new class, but it didn't seem to fire (in debug), and I got into trouble, when inserting records, with
    public void calendarActivityListener(CalendarActivityEvent calendarActivityEvent) {
    currActivity = (CalendarActivityBean) calendarActivityEvent.getCalendarActivity();
    being an illegal cast
    What is the correct way to add provider-based styling to drag-and-drop create calendars?
    Ed Schechter

    A colleague of mine was kind enough to solve this:
    The calendar has ActivityStyles property = #{calendarBean.activityStyles}
    CalendarBean looks something like this:
    package com.hub.appointmentscheduler.ui.schedule;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.Set;
    import oracle.adf.view.rich.util.CalendarActivityRamp;
    import oracle.adf.view.rich.util.InstanceStyles;
    +public class CalendarBean {+
    private HashMap activityStyles;
    private String dummy;
    +public CalendarBean() {+
    +// Define colors+
    activityStyles = new HashMap<Set<String>, InstanceStyles>();
    HashSet setPending = new HashSet<String>();
    HashSet setArrived = new HashSet<String>();
    HashSet setApproved = new HashSet<String>();
    HashSet setCompleted = new HashSet<String>();
    setApproved.add("APPROVED");
    setPending.add("PENDING");
    setArrived.add("ARRIVED");
    setCompleted.add("COMPLETED");
    activityStyles.put(setApproved, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.GREEN));
    activityStyles.put(setPending, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.ORANGE));
    activityStyles.put(setArrived, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.PLUM));
    activityStyles.put(setCompleted, CalendarActivityRamp.getActivityRamp(CalendarActivityRamp.RampKey.LAVENDAR));
    +}+
    +public void setactivityStyles(HashMap activityStyles) {+
    this.activityStyles = activityStyles;
    +}+
    +public HashMap getactivityStyles() {+
    return activityStyles;
    +}+
    +}+
    Now, go into the Bindings tab on the calendar page, double click the calendar binding, and specify the column you've defined as the calendar's Provider in the Tags dropdown.
    Should show colors.

  • OBIEE 11G Calculation the Correct Way

    Hi All,
    My requirement is like this that I want to calculate value Gross Profit which is simple Total Revenue - Total Expense. Now I want this to act as a Hierarchy i.e Gross Profit should be drill able to Total Revenue followed by Total Expenses. For this I created a Accounts Dimension table since no Drill Down facility is available on Fact Table(Therefore I had to move my Accounts to Dimension table rather than Fact Table). Now the problem is that there is no minus based aggregation present in OBIEE BMM layer because of which my all other sum based aggregation work correctly except where there is a negative based aggregation required like in the case of Gross Profit. Kindly Suggest what is the correct way to approach this problem. I am working on OBIEE 11g in this case.
    Warm Regards
    Abhishek Kapoor

    Financial reporting is difficult in BI because of the user preference of how to see signs on different accounts and requirements for adding/subtracting depending on the type of account.
    A few ways to approach:
    a. Use case statement to make total rev and total expense columns. Subtract to build a gross profit column. You can do this in the presentation services front end or the BMM.
    b. If you have opposite natural signs for rev and exp, you can create an account hierarchy in the account table which will net out to gross profit. Ex:
    Column 1 – account number
    Column 2 – hierarchy level 1, ex Gross Profit
    Column 3 – hierarchy level 2, ex Rev or exp
    Column 4 – account name
    Etc…
    c. Remember you can always build your own drilldown using navigation links to a report instead of the built-in drilldown.
    Good luck!

  • Looking up the values in a waveform graph with a mouse click

    Hi,
    Does anyone know how to look up the values in a waveform graph with a mouse
    click but... without the cursor legend on, if i press in the waveform graph
    nothing happens, i must search my cursors and only then i can see the values
    of my signal data?! Isn't there any other way?
    Best regards,
    Thijs Boerée

    Dear Chad,
    I know of the function "bring cursor to center". I also figured out that
    when i use a property node of the cursor array of clusters, that i can see
    that some values change when i move the cursor (i can see the X and Y scale
    value change of the graph and also the values of the mouse pointer (in
    points due to screen resolution)) But in this cluster i can't set the mouse
    position. I allready made a VI where i can see the bounds of my
    waveformgraph and I have the Xscale (min and max) and the Yscale (min and
    max), with a linear fit i can translate my mouse position to X an Y scale
    values and when i click on my waveform graph the cursor go's to that
    position (property node of the cursor position), only disadvantage is that i
    only have the bounds of my plot area and not the position, i do have the
    position of my waveform graph but the plot area isn't allways in the center,
    if i could extract the position of the plot area i may find a solution to
    solve this problem.
    And to file a product question:
    I would like to see the function that with a mouse click a little menu
    appears and that there are options to for example set a marker on that data
    and when you right click on it, that there are options to remove it or to
    add comment, a 2D array could make a list of the different channels with
    it's markers (time stamps and comments).
    Best regards,
    And thank you for your help.
    Thijs Boer�e
    "Chad AE" schreef in bericht
    news:[email protected]...
    > Dear Thijs,
    >
    > Thank you for contacting National Instruments.
    >
    > To address your question, there is no direct VI, command, or property
    > node that will allow the cursor snap-to-mouse functionality.
    >
    > I notice a problem you may be occuring is trying to find where the
    > cursor is on the graph. If this is an issue, you can select Bring to
    > Center from the Formatting Ring on the Cursor Legend to move the
    > cursor to the center of the graph.
    >
    > Let me know if you have any further questions or if this does not
    > resolve your issue, as I would be happy to file a product suggestion
    > so that LabVIEW is improved in future versions.
    >
    > Thanks again and have a great day!
    >
    > Chad AE
    > Applications Engineer - National Instruments

  • Which is the correct way to program a Desktop Application???

    Hello all,
    I haven't programmed in a while and I just got the free Netbeans 6.1 CD just for kicks and to try it out. I'm making a basic application for a store that one of my family members has. I was programming away as I could and right now I came to a conclusion... I think I maybe doing this wrong.
    I have done all the GUI using the Netbeans IDE plugin visual designer and I just click on the button and add the event and then I program away. But just right now I noticed another file that is called NameOfProgramApp.java. Then I look to the right and I have NameOfProgramView.java where I have been placing most of my code. Is this the right place to put the code???
    I think I maybe missing something or maybe doing some lousy code writing. Any help would be awsome. Is this where I put my Object Oriented think hat on to accomplish the correct way??
    Thanks in advance and it feels good to be back :D

    A general rule of thumb that I use it to think in layers...
    --GUI {What you show the use}
    --GUI code logic {local rules and edits}
    --WEB/Network {interface for multiuser}
    --BUSINESS RULES {rules and coding to make your business work}
    --DATABASE {where do you store your durable data}
    Granted, this is a very simplistic look, but it will get you a start a thinking process for your app.

  • Ok, does anyone know the correct way to do this

    Hi all
    would someone beable to explain the correct way of attaching dynamic text to a rotaing menu so that the text moves with the image as it rotates,
    I am now being told that in order to have dynamic text rotate/move I have to embed the font, by placing a text field on the stage outside my flash area and then set embedFonts property to true, and then apply a textformat.
    first, is this the correct way of doing it?
    second, can someone please explain(by breaking down into steps, as I am a newbie) how I go about setting embedFonts property to true and applying a textformat.
    what I have created;
    1.)I created a movieclip called 'textHolder' inside this has two dynamic text fields called 'headerText'  & 'bodyText'  <<<<< IS THIS CORRECT?
    2.)I have an xml file which will load the text in as well as the images with the rotating menu, see below;  <<<IS THIS CORRECT????
    <?xml version="1.0" encoding="utf-8"?>
    <data>
      <image name="image 1" path="img/img1.jpg"
        textHolder.headerText="Sunset"
        textHolder.bodyText="The hour of night is near, as the skies get blood-filled" />
    <data>
    3.What I am missing is what script I need for the main.as file, can anyone help here?
    so to break down.
    I have a rotating menu that is driven by xml, that loads images on the menu. I would also like to load text to the left of each image, and have the text be fixed with the image as it rotates.
    I can post the as, but I would like to know if the above is correct first, if you would like to see the main script please say.
    I have attached a jpg layout to give you an idea as to what I am trying to explain. can someone please help!!!!!!!!!
    (this is my previous post: http://forums.adobe.com/thread/463213?tstart=0  but I feel its got lost a little along the way)

    MY CURRENT SCRIPT, CAN YOU SEE HOW TO ATTACH THE TEXT WITH THE IMAGE?
    package 
    import flash.display.DisplayObject;
    import flash.display.MovieClip;
    import flash.display.Loader;
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.events.MouseEvent;
    import flash.net.URLLoader;
    import flash.net.URLRequest;
    import flash.net.URLLoaderDataFormat;
    import soulwire.ui.CircleMenu;
    public class Main extends Sprite
      //————————————————————————————————————————————— CLASS MEMBERS  VALUE
      public var circleMenu:      CircleMenu;
      public var xmlLoader:      URLLoader;
      //——————————————————————————————————————————————— CONSTRUCTOR
      public function Main()
      circleMenu = new CircleMenu( 300, 32, 14 );
      circleMenu.x = 150;
      circleMenu.y = 300;
      addChildAt( circleMenu, 0 );
      // Use URLLoader to load XML
      xmlLoader = new URLLoader();
      xmlLoader.dataFormat = URLLoaderDataFormat.TEXT;
      // Listen for the complete event
      xmlLoader.addEventListener(Event.COMPLETE, onXMLComplete);
      xmlLoader.load(new URLRequest("data.xml"));
      /*for (var i:int = 0; i < 20; i++)
        // MyMenuItem can be a symbol from your library
        // or any class which extends DisplayObject!
        var item:MyMenuItem = new MyMenuItem();
        item.txt.text = 'Menu Item ' + (i + 1);
        item.txt.mouseEnabled = false;
        item.buttonMode = true;
        item.addEventListener( MouseEvent.CLICK, onMenuItemClick );
        circleMenu.addChild( item );
      circleMenu.currentIndex = 4;*/
      // Enable the mouse wheel
      stage.addEventListener( MouseEvent.MOUSE_WHEEL, onMouseWheel );
      // Set up the UI
      ui.spacingSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.radiusSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.minAlphaSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.minScaleSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.scaleSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.itemsSlider.addEventListener( Event.CHANGE, onSliderChange );
      ui.spacingSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.radiusSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.minAlphaSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.minScaleSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.scaleSlider.dispatchEvent( new Event( Event.CHANGE) );
      ui.itemsSlider.dispatchEvent( new Event( Event.CHANGE) );
      //———————————————————————————————————————————— EVENT HANDLERS
      private function onXMLComplete(event:Event):void
      // Create an XML Object from loaded data
      var data:XML = new XML(xmlLoader.data);
      // Now we can parse it
      var images:XMLList = data.image;
      for(var i:int = 0; i < images.length(); i++)
        // Get info from XML node
        var imageName:String = images[i].@name;
        var imagePath:String = images[i].@path;
      //  var textInfo:TextInfo = new TextInfo(); 
    //      textInfo.headerText.text = images[i].@headerText; <<<<THIS IS WHAT i HAVE TRIED, GET ERRORS SO COMMENTED OUT
    //    textInfo.bodyText.text = images[i].@bodyText;
    //    addChild(textinfo);
                  //textInfo.x=120;
        //textInfo.y=300;
        var sp:Sprite=new Sprite();    <<<<<<<< THIS IS SCRIPT JUST ADDED
        var tf:TextField=new TextField();
        tf.wordWrap=true;
        tf.width=200;
        var ldr:Loader=new Loader();
        addChild(sp);
        sp.addChild(tf);
        sp.addChild(ldr);
        ldr.x=tf.width+10;
        // Load images using standard Loader
        var loader:Loader = new Loader();
        // Listen for complete so we can center the image
        loader.contentLoaderInfo.addEventListener(Event.COMPLETE,onImageComplete);
        loader.load(new URLRequest(imagePath));
        // Create a container for the loader (image)
        var holder:Sprite = new Sprite();
        holder.addChild(loader);
        // Same proceedure as before
        holder.buttonMode = true;
        holder.addEventListener( MouseEvent.CLICK, onMenuItemClick );
        // Add it to the menu
        circleMenu.addChild(holder);
      private function onImageComplete(event:Event):void
      var img:Loader = event.currentTarget.loader;
      img.content["smoothing"] = true;
      img.x = -(img.width/2);
      img.y = -(img.height/2);
      private function onMouseWheel( event:MouseEvent ):void
      event.delta < 0 ? circleMenu.next() : circleMenu.prev();
      private function onMenuItemClick( event:MouseEvent ):void
      circleMenu.scrollToItem( event.currentTarget as DisplayObject );
      private function onSliderChange( event:Event ):void
      switch( event.currentTarget )
        case ui.spacingSlider:
        circleMenu.angleSpacing = event.currentTarget.value;
        break;
        case ui.radiusSlider:
        circleMenu.innerRadius = event.currentTarget.value;
        break;
        case ui.minAlphaSlider:
        circleMenu.minVisibleAlpha = event.currentTarget.value;
        break;
        case ui.minScaleSlider:
        circleMenu.minVisibleScale = event.currentTarget.value;
        break;
        case ui.scaleSlider:
        circleMenu.activeItemScale = event.currentTarget.value;
        break;
        case ui.itemsSlider:
        circleMenu.visibleItems = event.currentTarget.value;
        break;

  • Attaching and Detaching Observers to a document, what is the  correct way?

    Hi,
    I came across below code snippet in many of the sample PLugins where Observer is being:
    Attached on the kAfterOpenDocSignalResponderService
    Detached on the on kBeforeCloseDocSignalResponderService
    Same DocRef is being used in both the cases but the Observer being referenced is new each time, so is it a correct way to do it? and Will it work?
    GTTxtEdtResponder::attachDetachStoryObserver(UIDRef storyUIDRef, bool16 bAttach)
      ErrorCode status = kFailure;
      do{
      // while we observe all stories (whether they are accessible or not), we only let accessible
      // stories affect the cache. See the observer implementation for this logic.
      InterfacePtr<IObserver> iGTTxtEdtObserver(storyUIDRef,IID_IGTTXTEDTSTORYOBSERVER);           //<--new reference created
      if (iGTTxtEdtObserver == nil){
      ASSERT_FAIL("GTTxtEdtResponder::attachDetachStoryObserver - no observer on story?");
      break;
      bAttach ? iGTTxtEdtObserver->AutoAttach() :iGTTxtEdtObserver->AutoDetach();
      status = kSuccess;
      }while (kFalse);
      return status;
    If you look closely, you can see that every time a detach is being called after attach, a new Observer reference is created.
    Is correct way to do it?

    Hello kapoor_aman27,
    with InterfacePtr you create a new reference to the observer not a new instance of the observer. The reference will be destroyed at the end of the function or code block. The instance of the observer will be destroyed if the reference Counter will be 0. So the instance of the observer is the same at attach and detach. The InterfacePtr (i.e. the reference to the observer) is temporary in each function.
    Markus

  • Correct way to AddOrUpdate Property of Class in a ConcurrentDictionary?

    I have a ConcurrentDictionary we'll call ParamaterList.  And a class named Parameter. 
    Class parameter{
    public string Username = string.Empty;
    public string FirstName = string.Empty;
    public string LastName = string.Empty;       
    public bool enabled = false;
    ConcurrentDictionary<string, parameter> ParameterList = new ConcurrentDictionary<string, parameter>;
    I want to confirm that I'm doing this correctly and there isn't a better way.  To update a class I am doing this:
    ParameterList.AddOrUpdate("username", true, (k, v) => {v.enabled = true; return v;});
    Is that the correct approach or is there a 'correct' way to update a property of v directly without returning a full 'new' class? My classes are small now but I would like to learn best practices for concurrentDictionaries. 

    1) TryGetValue is thread safe.  If someone is trying to modify the collection while you're retrieving it then they will block until you have the value.
    2) Yes another thread could remove the item after you get it but there is no concurrent collection that guarantees otherwise. A concurrent collection simply guarantees that while a particular method on the collection is being executed that no other
    thread will cause changes that will cause it to fail.  Once the method returns another thread can do whatever it wants.  90% of the time that is perfectly fine and expected.  In the few cases where you need to ensure an item remains in a collection
    for some fixed period of time then you'll have to use a lock instead.  But after the lock is released the item can still be removed. 
    Removing an item from the collection does not invalidate your copy of that item.  You still have a reference to the item and it'll exist and be usable as long as you hold onto it.  Whether it is in the collection or not doesn't matter.  In
    general multiple writers to a collection is not a good thing to have so you'll want to consider modifying your code to have a single writer but any # of readers.  This will simplify your code and make it easier to maintain.
    3) If you want to update an item if it exists or create a new one if it doesn't then you have to make some decisions.  TryAddUpdate would be the way to go if you want to recreate the item each time whether it is already there or not. If you only want
    to create it if it doesn't exist then use TryGetValue and if that fails then use TryAdd to add a new one. However a concurrent collection doesn't prevent modifications between these calls so between the time you get the value and update/add it somebody else
    could remove it, add it or both.  If you need a gurantee that the collection does not change during these calls then you have to use a lock because the collection itself doesn't provide a long enough lock. 
    If you do decide to use TryAddUpdate note that each time you will add a new object to the collection and this will cause problems for other threads.  For example another thread may use TryGetValue to get the object and then set one of the properties. 
    But if another thread calls TryAddUpdate during this time a new object is created and added to the collection so the original thread's changes are lost and they are none the wiser.  However if you use TryGetValue first and only call TryAdd if the item
    doesn't exist yet then you will always be working against the same object across threads and by using the return value of the methods you can determine whether you got a value or successfully added it.  This is the cost of using multiple writers.
    4) The collections are thread-safe, not the objects in them.  There is no guarantees around the thread safety of the objects in the collection. If you need thread safety on the objects themselves then either the object type needs to be thread safe or
    you have to use a lock.  For the case of a single writer, multiple readers then you are better off using a ReaderWriterLock instead of a concurrent dictionary.

  • Is there a change in the way 10g sees the rowid column.

    i have two databases in my test environment
    1. Oracle 10g on CentOS 5.3
    2. Oracle 9i on Windows Server 2003
    i am practicing simple SQL with the default HR schema created while creating databases using dbca.
    all i am doing is trying to display the employee with the 10th highest salary.
    in Oracle 10g i run the following command:
    SQL> select first_name || ' ' || last_name, salary from employees where
    rowid =
    (select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum <=10
    minus
    select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum < 10);
    FIRST_NAME||''||LAST_NAME                          SALARY
    Lisa Ozer                                           11500when i run the same command in 9i
    select first_name || ' ' || last_name, salary from employees where
    rowid =
    (select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum <=10
    minus
    select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum < 10)
    no rows selectedon digging deeper i found out that in 9i .... when i run the two sub-queries, give the same rowid as output.
    SQL> select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum <=10;
    ROWID
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    10 rows selected.
    SQL> select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum < 10;
    ROWID
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    AAAHM7AAFAAAABXAAI
    9 rows selected.the same two queries in 10g give different rowids (this is correct)
    SQL> select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum <=10;
    ROWID
    AAAMg3AAFAAAABYAAA
    AAAMg3AAFAAAABYAAB
    AAAMg3AAFAAAABYAAC
    AAAMg3AAFAAAABYAAt
    AAAMg3AAFAAAABYAAu
    AAAMg3AAFAAAABUAAD
    AAAMg3AAFAAAABUAAH
    AAAMg3AAFAAAABYAAI
    AAAMg3AAFAAAABYAAv
    AAAMg3AAFAAAABYABE
    10 rows selected.
    SQL> select rowid from (select first_name || ' ' || last_name from employees order by salary desc) where rownum < 10;
    ROWID
    AAAMg3AAFAAAABYAAA
    AAAMg3AAFAAAABYAAB
    AAAMg3AAFAAAABYAAC
    AAAMg3AAFAAAABYAAt
    AAAMg3AAFAAAABYAAu
    AAAMg3AAFAAAABUAAD
    AAAMg3AAFAAAABUAAH
    AAAMg3AAFAAAABYAAI
    AAAMg3AAFAAAABYAAv
    9 rows selected.is there a change in the way Oracle 10g treats rowids from subqueries?
    when i change the query to include the rowid in the innermost sub-query things work as they should in both 10g and 9i
    select first_name || ' ' || last_name, salary from employees where
    rowid =
    (select rowid from (select rowid,first_name || ' ' || last_name from employees order by salary desc) where rownum <=10
    minus
    select rowid from (select rowid,first_name || ' ' || last_name from employees order by salary desc) where rownum < 10)

    OK,
    I didn't seem to have made myself clear. You state
    'the above query uses rownum to filter the top 10 and top 9 salaries and picks the person with the 10th highest salary.'
    As you are using row*id* , and rowids are random strings, and can change during the life of your table, you can not rely on the results of your query.
    Your usage of the rownum pseudo function (as opposed to the rownum analytical function is also incorrect, as rownum is assigned prior to ordering it.
    This
            select * from
             (select rownum rn, ename, sal
              from
              (select ename, sal from scott.emp order by sal desc)
              where rn=10is quite as sufficient, and doesn't use hacks like rowid.
    Sybrand Bakker
    Senior Oracle DBA
    Experts: those who did read documentation.

  • Correct way of using LayeredPane for animation

    Hi,
    before I post my questions some background info (it has become quite a long story sorry for that, you can skip to the bottom if you want):
    i'm not an expert java programmer so I appologize for any stupid questions or remarks.
    Currently i'm implementing a road traffic simulation. Cars drive over roads, intersections etc. To make the movements/animation look smooth i've used doublebuffering or page flipping (I'm not sure while I used the getBufferStrategy() from a JFrame: strategy = frame.getBufferStrategy(); )
    To add my own JButtons created from .png file I've switched off the RepaintManager by creating a NullRepaintManager. The simulation thread is responsible for calling the repaint function, which is done every few milliseconds after the positions of the cars are updated. These buttons are added to the ContentPane of the frame which is made non-opaque to make the roadnetwork and cars visible (*i don't understand this)
    Btw I've 'borrowed' these ideas from 'developing games in java ' from Brackeen: http://www.brackeen.com/javagamebook/
    The roadnetwork and cars are drawn on the a Graphics2D by calling: (Graphics2D)strategy.getDrawGraphics(); first I draw an image of the roadnetwork to clear the old vehicle positions and then the new positions of the cars are drawn. after that the screen/frame is updated: strategy.show();
    This all works fine.
    The problems start when I want to have a popup JPanel to appear on the screen after I clicked somewhere on the roadnetwork. According to Brackeen this can be done by initializing a JPanel and add it to the LayeredPane of the JFrame and make it visible when needed. This does not work while the JPanel never pop's up and I don't understand why not, because the demo from brackeen works fine. When I add this JPanel to the contentPane it does popup but the buttons are shifted to the right which is not what i want.
    Also I want to add a JMenuBar to the frame, i thought I could simply used: frame.tsetJMenuBar(menuBar);
    however the menubar shows up next to my custom JButtons....
    ====>My Questions:
    What is the correct way to draw smooth animations inJava without slowing down the whole program when quite a large area has to be draw... this seems to happen e.g. in the Java demos: ..\jfc\Java2D
    How can I popup JPanels or internalFrames ontop of the animation?? probably by using the LayeredPane?
    I also want to add a JMenuBar in the normal position.
    Sorry for the long text and questions... but I'm struggling for almost two month with this now (using an increadible number of java books) and haven't solved it yet.
    Any suggestions are welcome Thanks in advance!!
    Rens

    It gets the first address from the pxelinux.0, another one is usually handed down after it boots, but sometimes it reuses it again. 
    Usually what happens on a diskless system is it tries to use the dhcpcd lease from the last diskless workstation (or possibly reuses the same one it gets from pxelinux.0).  But it has enough logic built into that it looks for another unique address for the next diskless workstation. 
    Do you have your pxeclient.cfg/default appended options set correctly to be ip=::::::dhcp? 
    Of course from the diskless wiki:
    label archxx
    kernel archxx/boot/vmlinuz-linux
    append init=/usr/lib/systemd/systemd initrd=archxx/boot/initramfs-linux.img root=/dev/nfs rootfstype=nfs nfsroot=xx.xx.xx.xx:/srv/tftp/archxx,v3,rsize=16384,wsize=16384 ip=::::::dhcp

  • Correct way (if any) in paragraphs

    If I have a paragraph of type, ranged left (example below) set out with no widows/orphans etc but I have a word starting on its own, what is the correct way to solve this? Start a new paragraph or leave it on its own? Sometime when i do this I get a lot of space that looks wrong.
    example:
    ...for example researcher, recorder. They
    build the table...
    Hope this makes sense.
    thanks in advance

    Jacob's correct in saying -
    function(){return A.apply(null,[this].concat($A(arguments)))}
    function(){return A.apply(null,[this].concat($A(arguments)))}function(){return A.apply(null,[this].concat($A(arguments)))}function(){return A.apply(null,[this].concat($A(arguments)))}Jacob Bugge wrote:
    Ah, silverbadger.
    As Herb says.
    Whether you use Justify (Full Lines) or Align Left (there may be different terms in different applications), normally you just let the type/text flow over the lines as they may fit, with or without hyphens, regardless of sentences/full stops.
    But, (isn't there always a but) there is a stylistic case to be made for avoiding line breaks that potentially 'trick the reader's eye.' We tend to read text a line at a time unless there are lines longer than we can process in a single pass. You can follow this link to see a sample article on the subject.
    http://baymard.com/blog/line-length-readability
    The reading and comprehension process can also be interrupted when the 'topic' changes abruptly, especially at the beginning or end of a line. This includes lines that break after a short word at the beginning of sentence, like A, I, O (rare), At, By, etc. You can probably think of several more examples. I'd also include The (as in the original post) as it can be the very devil to proof-read correctly.
    Consider this snippet:
    He was a tall man with a military bearing which he threw in the air and caught. The
    the example here comes from that especially enchanting book, 'Puckoon' written by
    Spike Milligan.
    Many readers will fail to pick up the repeated 'The the', and some spelling checkers get confused by the different capitalization. So, its probably better set (using a 'hard space' to force the issue) as:
    He was a tall man with a military bearing which he threw in the air and caught.
    The example here comes from that especially enchanting book, 'Puckoon' written
    by Spike Milligan.
    As for A, I, etc -- the isolated letter just looks daft.
    In summary, the rule is that there are no rules. Type should both look right and flow right, so the reader's brain isn't distracted by the visual anomalies.

  • Look Up a value in an Array

    Newbie question. I can't find an example of this in PL/SQL. But surely it's a common practice:
    (Purely hypothetical example)
    I'm going to select a million employee records for processing and I have the State Code in the employee table (AK, AL, ... WY). I also have a state table with all of the state codes and state names. I need to list the state name for each employee.
    Is there a way to "preprocess" the state codes and names into an array and then for each employee record, look up the value in the array, instead of having to do a "select state_name from states where state_code ="?

    Thanks to both of you.
    Tom's mantra was interesting. Based on that, a single join SQL statement is better than PL/SQL. But, I would only be using pure SQL for my own validation and inquiries.
    I would be writing complex database applications of some sort when I would use a look up like that. So, I would be using PL/SQL and getting a collection of records to process. Do you still think a join would be the most efficient way to do that? I would have thought that would be a record-complex (is that term still used) of 1 million rows from employee table to 50 rows of state table.
    I'm learning SQL on my own - no formal training by my employer (I'm getting a jump on a replatform project before it starts), so I'm going by my prior experience with RPGLE.
    I've seen several threads in the two months that I've been reading this forum that state in general, SQL is always faster, a bulk collection with FORALL would be the second best option and bulk collection with FOR LOOP third.
    Dialog is good and you folks exchange a lot of information and it is greatly appreciated.
    Edited by: Houffle on Apr 7, 2012 10:57 PM
    edited again after reading Tom's entire followup, which he summarizes by writing:
    In almost all cases - doing as much as you can in a single sql statement will outperform (greatly) the equivalent slow by slow procedural code.
    Edited by: Houffle on Apr 7, 2012 11:12 PM

Maybe you are looking for

  • Procedure for Upgrading My Hard Drive

    Hello, I have a Mac Pro full of 1.5 TB+ hard drives to store video and other files. My primary drive, however, is only 320 GB and since it is used to hold temporary files while editing and converting video, I have completely filled it up several time

  • Rendering html in JEditorPane

    hi i have a problem in JEditorPane. when i rendering a html with frameset then i cannt resize the frames (like JSplitPane) but it working in browser. so how i do it in JEditorpane?? thanks

  • OWB File_exist

    Dear all, In my OWB 10.2.0.2.8 project I created a process flow which simply contains a file_exists activity. The structure of my process is the following: START->FILE_EXIST IF(FILE_EXISTS=MISSING)->TRASFORMATION(LOG MISSING)->END_ERROR IF(FILE_EXIST

  • SD: Pricing Issues

    Dear All: For our diamond industry we have done enhancement in user exit "USEREXIT_PRICING_PREPARE_TKOMK". In Sales Order the pricing is coming properly, but when I create the Invoice for the same SO, the net amt is coming properly, but in Accounting

  • Microsoft office is not shown in retina quality...

    apart from Outlook, MS Office programms are not in retina quality. How can I change that?