Synchronization: useful or not in this case

ok, I'm getting a bit confused if the synchronization is useful or not in this case.
As far as i know, is synchronizsation required if more than one thread is able to enter a specified function/codefragment, but how about "atomaric" functions?
long[]longarray = new long[10];
String[]stringarray = new String[10];
/*some code*/
public String ThisCanBeEnteredByManyThreads(int index,int type){
switch(type)
case 1:
return stringarray[10];
case 2:
return String.valueof(longarray[index]);
}When I get it right, the return value will be a reference on the current String object. If another function now perform something like
stringarray[index]="woods";
longarray[index]=10; then it souldn't affect my reference I returned in the previouse function. Or is this not atomaric (only setting the reference, not the string creating)?
Or is the function "String foo = stringarray[index]" not atomar?

Don't get too hung up with the contract. If you do your calcs, you will discover that the contractvjust means you pay for the phone by installments over the duration of the contract. Often you end up paying less if you opt for sim only and buy your own phone. This way you can also buy any phone you want and best offf all, it will probably be unbranded. 
Find yourself a nice N8, new or secondhand. I have one but it is not for sale.

Similar Messages

  • How to use dynamic SQL in this case for best performance

    I have the table with following columns
    ID NUMBER,
    DATA LONG,
    TAG VARCHAR2(255)
    Records in this table will be like following
    1 this is an abstract ABSTRACT
    1 this is author AUTHOR
    1 100 PRICE
    2 this is an abstract ABSTRACT
    2 this is author AUTHOR
    3 contract is this CONTRACT
    Basically all the records with the same number constitute 1 record for another table. Tag in the above table indicates that what column it is and DATAwill have the actual data for that column. I need to populate the second table based an the above table but will not get the same number of TAGS all the time. I need to insert the values only for the columns provided in the TAG field. How will I accomplish this by dynamic sql. Do I create a loop and create two strings one with columns and one with values and then combine them and use execute immediate to insert into table? Is there an easier way to do this??
    Please respond quickly.
    Thanks
    Bhawna
    null

    > so which collection should i use to perform it..
    so that performance is best......
    Program to interfaces. That way, you can switch out implementations and test for yourself which performance is best in an actual production context. But first, write your program so that it works. Worry about refactoring for performance once your program is written and it works.
    > plz send me the logic....
    Give it a shot on your own first; we can help if you get stuck.
    ~

  • When I send a group txt and one of the people reply it creates a new message.   How do I keep all the replies in the same message?   I used to not have this problem but it started last month.

    When I send a group txt and one of the reciepients replies it creates a new message.   How do I keep all the replies in the same message?

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • How to use analytical function in this case

    SELECT COUNT (rms.status_code) rms_status_count,
    rms.status_name rms_status_name,
    TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date, 'YYYY') month_year,
    MAX (rtd.add_date) date_for_sort
    FROM ri_mast_status rms, ri_tran_data rtd
    WHERE rtd.status_code = rms.status_code
    AND TRUNC (MONTHS_BETWEEN (SYSDATE, rtd.add_date)) < 36
    AND NVL (rtd.delete_flg, '0') = '0'
    GROUP BY TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date, 'YYYY'),
    rms.status_name
    ORDER BY MAX (rtd.add_date);
    it gives output for the last 3 years based on month and year.

    r you trying this ?
    select *from
    select rms.*,
    row_number() over(partition by TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date,rms.status_name 'YYYY') order by rtd.add_date) RN,
    MAX(rtd.add_date) over(partition by TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date,rms.status_name 'YYYY')  order by rtd.add_date) date_for_sort,
    COUNT(rms.status_code) over(partition by TO_CHAR (rtd.add_date, 'MON')|| ' '|| TO_CHAR (rtd.add_date,rms.status_name 'YYYY')  order by rtd.add_date) rms_status_count
    FROM ri_mast_status rms, ri_tran_data rtd
    WHERE rtd.status_code = rms.status_code
    AND TRUNC (MONTHS_BETWEEN (SYSDATE, rtd.add_date)) < 36
    AND NVL (rtd.delete_flg, '0') = '0'
    where rn=1

  • How to use the List in this case.

    I got sample code from http://developer.java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/. But when I compiled it, there was error message like "webcrawler.java:16: reference to List is ambiguous, both class java.util.List in java.util and class java.awt.List in java.awt match List listMatches; "
    I think it might be because it was written by JDK1.1.3. I am using JDK1.4 to compile it. Can any body tell me how to make it can be compiled by JDK1.4?
    Thanks a lot.

    Hi olivia16
    There is an interface called java.util.List and a class java.util.List :-)
    To correct source code just put java.util. prefix at lines 16 and 76:
    java.awt.List listMatches; // 16
    listMatches = new java.awt.List(10); // 76
    Regards.

  • Since ios7 can't use 'not on this iPad' option to download music purchased on another device. What fixes please?

    Since updating to IOS7 I cannot download music purchased on a different device using the 'not on this iPad' button within iTunes Store. Any fixes out there?

    http://www.wikihow.com/Download-Previously-Purchased-Apps-on-an-iPad
     Cheers, Tom

  • How to use a CTE in a CASE statement?

    Hi everyone,
    I'm trying to use a CTE in a CASE statement and getting error. In fact, I'm not sure how to use a CTE in this case and this is the first time I'm using a CTE. I managed to build a CTE successfully but, failed to incorporate it in the CASE statement.
    SELECT wbs,
    MIN(srt),
    MAX(srt)
    CASE ust
    WHEN
    WITH CTE AS
    SELECT p_id + p_name + ps_name AS colg, p_id
    FROM pd_info
    WHERE s_desc = 'warehouse'
    OR p_desc = 'Originated from warehouse'
    OR p_desc = 'Originated from a partner store'
    SELECT colg FROM CTE
    WHERE cte.colg IN (SELECT p_id + p_name + ps_name AS c
    omb from pd_info)
    OR cte.p_id = 'xxxxxxxx' THEN 'invalid'
    ELSE 'valid'
    END,
    p_name,
    sub_name,
    ps_name,
    FROM pd_info;
    Could experts here please help me?
    Thank you,
    Bangaaram
    Known is a DROP, Unknown is an OCEAN.

    With the help from some experts, I've figured out that CTE doesn't work in this case. Here are the queries that I'm using for the above. Either of them is working good so far.
    SELECT Wbs
    , MIN ( Srt )
    , MAX ( Srt )
    , CASE
    WHEN S_Desc = 'warehouse'
    OR P_Desc = 'Originated from warehouse'
    OR P_Desc = 'Originated from a partner store'
    OR P_Id = 'xxxxxxxx'
    THEN 'invalid'
    ELSE 'valid'
    END AS Ust
    , P_Name
    , Sub_Name
    , Ps_Name
    FROM Pd_Info
    GROUP BY Wbs
    , CASE
    WHEN S_Desc = 'warehouse'
    OR P_Desc = 'Originated from warehouse'
    OR P_Desc = 'Originated from a partner store'
    OR P_Id = 'xxxxxxxx'
    THEN 'invalid'
    ELSE 'valid'
    END
    , P_Name
    , Sub_Name
    , Ps_Name;
    SELECT wbs,
    MIN(srt),
    MAX(srt)
    CASE
    WHEN cte.p_id = 'xxxxxxxx'
    or exists
    (select *
    from pd_info p2
    WHERE (s_desc = 'warehouse'
    OR p_desc = 'Originated from warehouse'
    OR p_desc = 'Originated from a partner store' )
    and p2.p_id = p1.p_id and p2.p_name = p1.p_name and p2.ps_name = p1.ps_name
    THEN 'invalid'
    ELSE 'valid'
    END ust,
    p_name,
    sub_name,
    ps_name,
    FROM pd_info p1;
    Thank you,
    Bangaaram
    Known is a DROP, Unknown is an OCEAN.

  • I want to use icloud on my macbook and cant because I am using OSX10.6.8 - I want to upgrade this but I cant upgrade to mountain lion as my mac does not support this - cannot find a way to go to Version 10.7.4 which i understand supports icloud - help

    want to use icloud on my macbook and cant because I am using OSX10.6.8 - I want to upgrade this but I cant upgrade to mountain lion as my mac does not support this - cannot find a way to go to Version 10.7.4 which i understand supports icloud - help to do this please

    If you purchased Lion for your iMac, just log into the Mac App Store from your MacBook using the Apple ID under which you purchased Lion and go to the Purchases page. You will be able to download and install Lion there. 
    searching the internet i found a link to upgrtade to 10.7
    The only place you get get Lion is from the Mac App Store. If you found some other site, that was an illegal copy and almost certainly tied to someone else's Apple ID and hence unusable by you. If the link was just to the Mac App Store, see above.
    As to the problem with synchronization to iCloud, that's not a 10.6 question, so I'd suggest you take up that specific issue in either the Lion or iCloud forums, providing full details, and someone there can probably help you sort things out.
    Regards.

  • I've moved my Aperture library to another computer, and masters are referencing an old path name.  How can I update these references?  Reloctating masters does not work in this case :(

    I've moved my Aperture library from one computer to another using Finder.
    I merged the library with one which was already on the computer.
    Now, the photos I imported have reference to the old path name on my old computer.
    How can I update these references as "Relocate Masters" does not work in this case?

    Just one suggestion to be able to reconnect all at once:
    Create a smart album containing the images with missing masters:
    File -> New ->  Smart Album,     and add a rule: File Status is "Missing"     (or File Status is "offline")
    Then select the images in this album and go to the File menu:
    and select:   File -> Locate referenced File
    If you are lucky, Aperture will reconnect all at once, if you point the first image version to its counterpart.

  • I am traveling out side of the U.S. and I am trying to up-date some apps on my iPod touch and now I'm getting this message... "Account Not In This Store Your account is NOT valid for use in the Ecuadorian store. You must switch to the U.S. store... help!

    I am traveling out side of the U.S. and I am trying to up-date some apps on my iPod touch. Now I'm getting this message... "Account Not In This Store. Your account is NOT valid for use in the Ecuadorian store. You must switch to the U.S. store"
    Please, is there anyone one out who can help me solve this problem? I just can seem to figure out how to get to the U.S. store... thanks!

    I just read this solution, tried it & now it's working...
    I think I found a fix...I went to Settings, iTunes & App Stores, then click on your Apple ID...view Apple ID...change country region to USA (even though it was already USA...just do it again...go through the steps making sure the United States store is selected...agree to the Terms of Service, THEN I think what the key is is to RE-auhorize your credit card...in my case all I had to do was enter the security code...and it worked...I am now able to download the YouTube app for example...couldn't do it before.

  • Should I use a thread and (in this case) how?

    Hi:
    I have a Swing frame (frameA) and on which there is a button; if I double click it,
    it will bring up a second frame (frameB). On frameB, I will select a new button name
    from a combobox, and click "DONE" button, and frameB would change the name of the
    button on frameA to this new name I selected. And frameB would disappear as well.
    I am thinking of using another thread for painting frameB, because I don't know how long
    it would take for frameB to load up, and I don't want to block up the event-dispatching thread
    on frameA.
    However, since frameB uses another thread, and frameB also has an ActionListener
    associated with the DONE button, i am not sure how to make the thread stay alive
    so that it could check whether the ActionEvent is fired. So, in this case, is it necessary to use
    another thread to do the job? Or should I just use the same event-dispatching thread?
    Or is there another whole new approach much better?
    Thanks

    Quite simply, I wouldn't bother threading it.
    If you load, link and instantiate the pop-up frame (actually I'd use a Dialog here) before you trigger the pop-up, the reaction is more or less instant. The execution of th parent frame will continue after the pop-up has been made visible, so any way you cut it, you are going to get a brief pause in the parent UI while the pop-up is shown - you may as well have it when the button is clicked.
    Hope this helps.--
    <sig> http://www.itswalky.com http://www.crfh.net </sig>

  • Using 3.6.12, when I enter a bid on eBay, FF immediately signs off eBay. Never had that problem with earlier versions. I do not have this problem with Internet Explorer.

    Using FF 3.6.12, I can log onto eBay, view my account, rate a purchase or win, and search for items. In other words, pretty much do anything normally on eBay.
    But if I try to enter a bid on an item, the program exits eBay.com and I get the "You've Signed Off. See You Again Soon!" screen. This happens every time I try to enter or re-enter a bid.
    I've been using Firefox for a few years to bid on eBay without any problems. This started as soon as I upgraded to 3.6.12 a month or so ago. Any suggestions?
    I've been forced to use Internet Explorer just to get on eBay and bid now. Not nearly as fast and elegant as Firefox. Help!

    To re-install Lightroom 5.4, there's no need to go back to the original full version and systematically re-install every upgrade you've ever purchased in order to re-install the latest version. All you need to do is re-install your most recent version (in this case 5.4), enter your Lightroom 5 serial number then enter your Lightroom 4 serial number when prompted. That's it.
    How did you first license the Lightroom 5 upgrade on your computer? Since it's not a subscription version, you must have received a version 5 serial number somewhere in the purchasing process. Without a record of that, Adobe Customer Care may struggle with your case.
    If you're running Windows, you can try running the free Belarc Advisor which often successfully retrieves your full serial number from inside your computer.
    Belarc Advisor - Free Personal PC Audit, for software, hardware and security configuration information on your computer.…

  • What's wrong with a "regular" global in this case? AND WIl ActiveX objects stored in functional globals remain valid (when used in an executable)?

    I've written a plugin layer for a LV executable.  When this layer makes a call to the plugins' initialization functions, I want each plugin library to be able to initialize and maintain its own global memory (where things like VISA resource names or ActiveX objects are stored).  However, I've found that I can't manage to keep my global VIs "alive."  I'm inclined to switch to functional globals, but I suspect that this will be a problem for things like ActiveX objects (that in this particular case reference a CAN interface).  I believe that the functional global will indeed store the object from run to run, it's just that I'm somehow disinclined to think that the object will remain valid.  I think you'll have to re-initialize it.  Can anyone speak for or against this hunch?  (If you can't tell, I'm trying to avoid building a whole little test executable just to debug this problem.)
    I suppose the more profound question is "Why don't the globals stay in memory?"  I'm attaching an image of what the application layer that calls the plugins' intializations looks like.  Next I'm attaching an example of an actual initialization routine.  You'll notice that I've even gone so far as to explicitly open the ref to the global VI that I want to keep in memory.  Then I just leave it there dangling - but it still gets dropped!  In my mind I shouldn't even have to do this, since the dynamically-called subVI "MC_CMO Init.vi" actually initializes the globals and runs with AutoDisposeRef = False. 
    Lastly, this is my first-ever attempt at writting plugin software.  So if you look at my code and have any criticisms/pointers, I'll greatly appreciate them.
    Thanks in advance,
    Nick
    "You keep using that word. I do not think it means what you think it means." - Inigo Montoya
    Attachments:
    AppLayer.JPG ‏60 KB
    InitPlugin.JPG ‏103 KB

    I am not sure if I follow you completely on your work-around.
    Everything I have to say on this topic is based on obesrvations and threads I have read on Info-LabVIEW. Therefore it is subject to corecttion by those who know better.
    LV is smart enough to know when "something" that had been opened, can be closed. It is not perfect.
    If for instance you open a VISA refnum and pass the refnum  to a LV2 AS A REFNUM the refnum in the LV2 stay alive as long as the VI's are running.
    If you start another VI that uses the LV2 to fetch the refnum, it should get a valid ref as long as it starts before the first goes idle.
    You then be able to work with refnum usign the VI launched second as long as stays active.
    I often create action engine that can be invoked where required throughout an application. If the action engines get a ref in one state (like init) and use it another, I will generally write a "tester" that calls the action engine action to test the engine. In this case, my "tester" stays live and it keeps the ref's fresh.
    I suspect if you tried to trick LV you could. If you type cast the ref nums to I32 and stored those in a LV2, I could see how LV could loose track of the resource sharing, but that is something I would avoid.
    So I encourage you to do some experimenting with keeping track of who's running when to see if your work-around will work.
    If you think you understand it better than I explained it, please post.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Uploading the Notes text pool using Conversion method for Dispute Cases.

    Hi Everybody,
    Please can anybody give the solution for uploading the Notes textarea in tab(Notes in dispute cases) using BDC method for transaction FDM_AUTO_CREATE(Dispute Cases).
    Here, the problem is, Notes is text area which is not having proper reference.
    We have tried few BAPI's like BAPI_DISPUTE_CREATE but did not worked.

    Hello! Anyones could resolve this?
    Regards,
    Federico

  • Preventing SQL injection - can't use cfqueryparam in this case

    Hello. I have a form with a checkbox next to each row.  If the user checks some boxes, then clicks the "Delete" button, I want to execute the following query, but I want to protect it from sql injection attacks:
        <cfquery datasource="#application.mainDS#">
            delete userMessages
            where messageID in (#form.messageID#)
        </cfquery>
    As written above, it works fine.  But if I try to protect this code with <cfqueryparam value="#form.messageID#" cfsqltype="cf_sql_varchar">, I get this error: "Conversion failed when converting the varchar value '7,21' to data type int" (7 and 21 are the messageID's to be deleted).  Obviously the comma prevents conversion to an integer.
    If I use cfsqltype="cf_sql_integer", then the string gets converted to a single integer (in this case 40015, which is nonsense).
    I tried passing form.messageID to a stored procedure, but I seemed to have the same problem there.  I could run the query in a loop where I just delete one row at a time, but I'd like to run just one query if I can do it safely.  Any ideas?
    Thanks.
    PK

    I agree that you should not do an SQL "DELETE" from a web page.  Instead, use "soft deletes," where you contrive for there to be a deleted_flag (boolean), and maybe deleted_by (varchar) and deleted_timestamp.  Then create an SQL "VIEW" which automagically omits the "deleted" records.
    It is also a very good idea to refer to the records using a nonsensical, made-up "moniker" instead of actual record-IDs.  You see, "if I am a nasty person and I know that there is a record #123456, then I'll bet I know the record-IDs of 123,455 other records, too."  But if you refer to the record as "QZB0E9S" and the next record-id in the list is "4Q_9RJPEM2" then it won't take me long to realize that I can't get too far, not even by brute-force.  (And if I see that the record-IDs seem to have verification tags, like "QZB0E9S:4E396", then I know that I am really scroo'd in my hacking-attempt because even if I did somehow million-monkeys my way into a valid record-ID, I've got no earthly idea how to come up with the tag.
    It pays to code defensively, like this.  And it doesn't really take more time.  Without question, always use <cfqueryparam> !!

Maybe you are looking for

  • Create an area from a set of points

    How to create an area from a set of points ? I searched everywhere but could not find a better solution for it. Let�s say that I have a matrix that contains the points for a shape. I�ll need a way to connect the points near each other continuously to

  • IPhoto File System

    I thought this was a pretty simple process. I heard that you can make it so that when you import photos into iPhoto it will leave the pictures and/or folders in their original file system and NOT import them into iPhoto's file system. I was really ex

  • RAW files, iPhoto and PS CS2

    hi i use iphoto and a raw workspace in photoshop to import and edit digital images taken with a nikon digital camera. i notice now that whenever i double-click on one of the raw file thumbnails in the library, it opens in photoshop as a very large 72

  • Windows XP 64bit SP2 will not recognise additional memory.

    Hi, Hope Im posting this in the correct forum. I have a XP PRO 64bit  SP2 (latest version support till April 2014) It has 4GB of ram and I have upgraded it to 8GB. The bios see the extra ram but the OS will not. Running crucial memory tool also sees

  • EDI Subsystem To xi

    Hi,   I have a query. Can an edi subsystem map an edi message to a standard sap idoc like orders05,pordcr05 etc and then can it send to xi via a tRFC Protocol. Can it post to xi direcly or an external adapter is needed. Please help. Regards, Anirban.