Get duplicate from collection

Hi All,
I've made one method that pulling out duplicate objects from Vector.
But really I don't like this way; looping for(int i=0; i<column.size(); i++) because the vector size is very big and it makes bad performance.
Can anybody give me some better idea?
public Set getDuplicate(Vector column)
     Set unique = new HashSet();
     Set dupResult = new HashSet();
     Object obj;
     for(int i=0; i<column.size(); i++)
          obj = column.get(i);
          if(unique.contains(obj))
               if(!dupResult.contains(obj))
                    dupResult.add(obj);
          }else
               unique.add(obj);
     return dupResult;
}

This should give better performance. I am not sure how to do it
without the for loop though.
public Set getDuplicate(Vector column)
  Set unique = new HashSet();
  Set dupResult = new HashSet();
  Object obj;
  for(int i=0; i<column.size(); i++)
    obj = column.get(i);
    if (unique.add(obj) == false) {
      dupResult.add(obj);
  return dupResult;
}

Similar Messages

  • Error getting value from collection to a date picker field

    Hi all,
    I'm stumble with getting correct data value from collection.
    The column is described as
    'wwv_flow_item.date_popup(3,null, c002, 'dd/mm/yyyy', 10, 10) purchase_date'
    This field is causing error: 'report error:
    ORA-01843: invalid month'
    I'm sure, c002 has correct value '08/08/2003' because I've temporarily changed description of the field to
    'htmldb_item.text(3,c002,10) purchase_date' that returned correct value.
    What can be wrong? I'm puzzled.
    Any suggestion please.

    Are you sure that when you used 'htmldb_item.text(3,c002,10) purchase_date' you got 08/08/yyyy and not 0808yyyy. I have seen that message often in Oracle (outside of HTMLDB) and it is normally when one assumes one format when it is actually another, or the leading zero gets dropped (08082005 becomes 8082005, which converts to 80/82/0205).

  • Bridge CS5: Images added to collection get removed from collection

    This is the first time I used non-smart collections. But, I'm sure that I'm quite sure that I'm not doing anything wrong.
    I simply dragged thumbnails into the collection from various folders and the collection shows all 20 images. Then, I close out Bridge and open it later, only to find that there are only 4 images in that collection. There may have been 4 images to start with, but every image I've added does not get remembered. This has happened twice and it's very unnerving because the images I am adding are coming from folders that are all over the place and it's very hard to look up all the pictures again.
    What's up with this?
    Thanks,
       Mike

    I've just noticed this problem, by chance, whilst moving data to a new computer.
    We found that files that were in collections were randomly missing from Bridge CS5's display, and sure enough, as described earlier, as soon as a file in the collection with a quote/spostrophe was read, that file and the rest of the collection were missing from Bridge CS5's display.
    (This was using Bridge 4.0.3.9. Adobe Application Manager tells me my software is uptodate)
    Because we had some backed up copies of Collections from both Bridge CS4 and Bridge CS5, I've been able to work a few things out, which I hope might help someone at Adobe get the problem fixed - and might help a few frustrated users too...
    Background
    The following entirely applies to Windows 7 (and presumably Windows Vista too):
    In Bridge CS4, collections files are stored in:
    C:\Users\%USERNAME%\AppData\Roaming\Adobe\Bridge CS4\Collections
    In Bridge CS5, collections files are stored in:
    C:\Users\%USERNAME%\AppData\Roaming\Adobe\Bridge CS5\Collections
    Both CS4 and CS5 store their Collections in files called <collection name>.filelist
    Both are XML files, where file paths are surrounded by apostrophes:
    For example:
    <file uri='bridge:fs:file:///D:/Shared%20Images/Flowers/RHS/DSC_0788.jpg'>
    Both Bridge CS4 and CS5 convert any spaces in file paths to %20 - so /Shared%20Images/ above is actually /Shared Images/ on disk.
    The cause of the bug
    Crucially, however, in Bridge CS4, any apostrophes (i.e. single quotes) in file paths get converted to %27
    But this conversion does not happen in Bridge CS5. And then when filelists get read back in, the data is truncated.
    As a developer, I'm surprised at this sort of regression in behaviour, in such expensive software from such a large company.
    Workarounds
    None of these should be required to be done by a user, I feel, but I have found that they do work, and they could be scripted (e.g. in Python) if someone were sufficiently desparate:
    Edit your .filelist files that were created by Bridge CS5, and convert all ' in file paths to %27 - oh yes, and remember to do that every time you add any new files to any existing or new Collections
    Edit your .filelist files and change the single quotes at the start and end of each <file uri line to double quotes
    I don't regard "remove quotes from your file names" as an acceptable workaround, however. We've got nearly 400GB of files, going back more than 10 years, and various of these are referred to from other locations, e.g. InDesign publications: if we were to rename locations for the benefit of Bridge, we'd break other stuff on the PC.
    Clare

  • I keep getting duplicate photos when downloading from my card reader.

    In my PSE11 Camera and Card Reader preferences I have checked "Copy new files only".  Yet whenever I download a camera card that still contains photos that were previously downloaded, I end up with duplicate photos in PSE11. 
    I prefer to leave my photos on the camera card as a "backup" in case of a hard drive crash or other loss of data on the computer.  Once the card is full I archive it.
    Why do I get duplicates even though this setting makes it clear that I should not?  It is very annoying having to look through my photo collection and manually delete dozens or hundreds of duplicate photos.
    Thank you.
    Jon

    First, try contacting the developer of the app here >  http://support.aspyr.com/home
    If you do not get a reply within three to five business days, report the issue to Apple here > Apple - Support - Mac App Store - Contact Support
    Apple's policy states, "all sales are final" > TUNES STORE - MAC APP STORE -TERMS AND CONDITIONS but if you explain the error and you haven't received areply from the developer, it can't hurt to request a refund.
    You're sure there's enough free space on the startup disk?
    edited by:  cs

  • HT201269 My computer crashed and had to be restored to factory settings. My ipad has my ituned library. how do i get the music collection from the ipad to the computer?

    my computer crashed and had to be restored to factory settings losing ituness collection of music. My ipad has my itunes library. how do i get the music collection from the ipad to the computer?

    You should be able to copy iTunes purchases over to your computer's iTunes via File > Devices > Transfer Purchases. For music from other sources (e.g. copied from CDs) you will need a third-party program to copy them back from your iPad - there are some listed half-way down this page which should work : https://discussions.apple.com/docs/DOC-3991

  • JSF: How to get 2 columns from collection?

    Using datatable i couldn't display 2 colums from collection. In JSF sun implementation is there any way to get?
    my requriement is i need to display collection in matrix format 2*x

    you can use ArrayDataModel object returned to the JSF page inoder to display multiple columes....

  • I am getting duplicates in Elements 12 from revel.

    I am getting duplicates in elements 12 that revel has downloadid when syncing. Sometimes they are exact duplicates and sometimes they are exact except for a 3 hr time difference. I have hundreds of duplicates. When cleaning thes up I also deleted the duplicates from the hard drive. Bad move because they were not duplicated in the hard drive files. Now I have lost some really important photos because this buggy program is not working properly. Why is revel duplicating my element photos?

    Hi,
    Please let us know if the link shared by Pattie helped you. If it did not, please let me know. We would need to take a look at the issue happening on your machine and extract the logs to know where is the issue. For that, we would need a connect session with you which will be an online meeting where we can see it happening on your machine.
    Also I would suggest you to apply 12.1 update to see if that helps.
    Regards,
    vaishali

  • Getting duplicate records in cube from each data packet.

    Hi Guys,
    I am using 3.x BI version. I am getting duplicate records in cube. for deleting these duplicate records i have written code. still it is giving same result. Actually i have written a start routine for deleting duplicate records.
    These duplication is occurring depending on the number of packets.
    Eg: If the number of packets are 2 then it is giving me 2 duplicate records.
    If the number of packets are 7 then it is giving me 7 duplicate records.
    How can i modify my code so that it can fetch only one record by eliminating duplicate records? Or any other solution is welcomed.
    Thanks in advance.

    Hi  Andreas, Mayank.
      Thanks for your reply.
      I created my own DSO, but its giving error. And I tried with the stanadard DSO too. Still its giving the same error as could not activate.
    In error its giving a name of function module RSB1_OLTPSOURCE_GENERATE.
    I searched in R3 but could not get that one.
    Even I tried creating DSO for trial basis, they are also giving the same problem.
    I think its the problem from BASIS side.
    Please help if you have any idea.
    Thanks.

  • Fastest way to get data from Multiple lists across multiple site collections

    HI
    I need to get data from multiple lists which spread across 20 site collections and need to show it as list view.
    I have searched on internet about this and got some info like options would be to use search core APIs or BCS . I can't use search because I want real time data. Not sure of any other ways.
    if anybody can provide ideas it would be help.

    Might LINQ be an option for you?  Using
    LINQPad and the
    SharePoint Connector, you should be able to write a query that'll retrieve this data, from which you can tabulate it.  I'm not sure how you'd be able to automate this any further so that it's then imported in as list.
    For something more specific, I used a third party tool called the
    Lightning Tools Lightning Conductor, which is essence a powerful content roll-up tool.  In one of my solutions, I created a calculated column that gave an order / ranking on each item, so that when lists were combined, they'd still have some form of
    order.  The web part is also fairly customisable and has always proven a useful tool.
    Hope that helps.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • [svn:bz-trunk] 21394: bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX .

    Revision: 21394
    Revision: 21394
    Author:   [email protected]
    Date:     2011-06-16 12:34:13 -0700 (Thu, 16 Jun 2011)
    Log Message:
    bug fix for watson 2887837 Not getting duplicate session detected error when same flex client id is used from two different HTTP sessions in CRX.
    get the sessions id before we invalidate the duplicate session.
    Checkintests pass
    Modified Paths:
        blazeds/trunk/modules/core/src/flex/messaging/endpoints/BaseHTTPEndpoint.java

    For our profect I think this issue was caused as follows:
    Believing that remoting was full asynchronous we fired a 2 or 3 remote calls to the server at the same time ( within the same function ) - usually when the users goes to a new section of the app.
    This seemed to trigger the duplicate http session error since according to http://blogs.adobe.com/lin/2011/05/duplication-session-error.html  two remote calls arriving before a session is created will cause 2 sessions to be created.
    Our current solution ( too early to say it works ) is to daisy chain the multiple calls together .
    Also there seemed to be an issue where mobile apps that never quit ( thanks Apple! )  caused the error when activated after a few hours.
    I guess the session expires on the server and the error above occurs on activation.
    So the mobile apps now ping the server with a remote call when activated after sleeping for more than one hour.
    All duplicate http errors are silently caught and reported.
    Fingers crossed we won't get any more!

  • I have connected my time capsule to motorola SG6580 modem via ethernet.  I have a wireless network on the motorola and a wireless network from the time capsule.  I get duplicate IPs error messages sometimes. How do I fix?

    I have connected my time capsule to motorola SG6580 modem via ethernet.  I have a wireless network on the motorola and a wireless network from the time capsule.  I get duplicate IPs error messages (no connection) sometimes when trying to connect devices to the wireless network. How do I fix? Sometimes devices cannot connect to the network because of conflicting IPs.  I look on the Motorola and every device has a unique IP assigned but occasionally a device has taken the IP of another device.  I have been writing down all the devices and the IPs they have been using.  It happens more with PCs than Macs, ipads or iPhones.

    If the Time Capsule is set up correctly in bridge mode, then it is the responsibility of the Motorola modem/router to provide the correct IP address assignments for all devices on the network.
    Check to insure that the Time Capsule is correctly set up to operate in bridge mode as follows:
    On your Mac, open AirPort Utility
    Finder > Applications > Utilities > AirPort Utility
    Click on the Time Capsule icon, then click Edit in the smaller window that appears
    Click the Network tab at the top of the next window
    Insure that the setting for Router Mode is configured to read "Off (Bridge Mode)"
    Once you have confirmed that the Time Capsule is configured correctly, everything else is the responsibility of the Motorola modem/router as far as network routing and IP address assignments for devices.
    If you continue to have IP address issues, then you should contact the Internet Service Provider (ISP) that provided the Motorola device to you and ask them to fix the issue.

  • Getting duplicate emails from SharePoint Report Library subscription.

    Getting duplicate emails from SharePoint Report Library subscription.
    Users are subscribed for each item in Report Library and it is scheduled to send email at 3 PM every day.
    But, intermittently users are getting duplicate emails.
    Please let me know on how to troubleshoot...

    If you have Exchange, you can track the email from there to see if that yields any value. You can also turn up the diagnostic logging in Central Admin -> Monitoring -> Configure diagnostic logging -> SQL Server Reporting Services, and selecting:
    Report Server Email Extension
    Report Server Schedule
    Report Server Subscription
    Turn them up to Verbose in the Trace log, then monitor the ULS log when you identify a user who has received duplicate emails.
    Trevor Seward, MCC
    Follow or contact me at...
    &nbsp&nbsp
    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • HT4191 How do I get to "When prompted, select Delete Notes to remove the duplicates from the device."?  I can't get to this!

    I have duplicate Notes on my iphone 4 (upgraded to iOS 5.1.1)  I have followed your instructions to remove the duplicates.  How do I get "select Detete Notes" to appear on my Mac?  I have connected my phone to my Mac and selected it in iTunes.  I clicked the Info pane and deselected the option to Sync Notes.  THEN WHAT should I do?  How do I get the prompt "Select Delete Notes to remove the duplicates from the device.  (I do want to sync them using the over-the-air feature.)

    I would try the following:
    First sync your phone with iTunes to create a new backup (just in case).  When done, disconnect your phone from your computer.
    Next be sure that all of your Notes are on your mac (Don't proceed any further if they aren't).  If so, turn off iCloud syncing for Notes on your phone go to Settings>iCloud and turning Notes to Off.  When prompted choose to delete the notes from your phone.
    Next, without connecting your phone to your computer, open iTunes and go to iTunes>Preferences, on the Devices tab check "Prevent...from syncing automatically".
    Now connect your phone to your computer, click on the name of your phone when it appears in iTunes on the left sidebar.
    Go to the Info tab and under Other check Sync Notes, then further down under Advanced: Replace information on this iPhone, check Notes.
    Click Apply at the bottom right to sync your phone.  This should sync the Notes from your mac to your phone and you should no longer have duplicate Notes.
    Next, on the Info tab uncheck Sync Notes and click Apply, when prompted select to keep the Notes on your phone (haven't tested this step but I believe you will be given the option to keep them on your phone).
    Now disconnect your phone from your computer and check the Notes on your phone to confirm that they are still there and that you don't have any duplicates.
    Next turn on iCloud syncing on your phone again by going to Settings>iCloud and turning Notes to On.
    On your computer, without connecting your phone, go back to iTunes>Preferences>Devices and uncheck "Prevent…from syncing automatically" to re-enable automatic syncing.
    That should do it.

  • I dont have data in "Client status summary" report for servers in server collection, but get data from our Windows 7?

    Hi,
    I dont have data in "Client status summary" report for servers in server collection, but get data from our Windows 7?
    So and idea of way I dont get data from or servers? Missing client setting for servers?
    /SaiTech

    Hi,
    I do see the server in Server collections in "Monitoring--Client Status--Client Activity" but not in reports like "Clients with failed client check details" i get "No Data Available"?
    /SaiTech

  • I lost my i pod bill and i bye from us., i lost my i pod bill and i bye from us.but now i live in india so how can i get duplicate bill

    i lost my i pod bill and i bye from us., i lost my i pod bill and i bye from us.but now i live in india so how can i get duplicate bill

    Contact Apple
    Contacting Apple
    You are not addressing Apple here. We are all just users like yourself.

Maybe you are looking for

  • Password protecting a gallery?

    Hello all, This is my first post in the Apple support discussions! I was wondering if there is a way to password a specific gallery in iWeb '08, and not the whole site? I'm a photographer and would like to be able to have client specific galleries th

  • Debugging customized function module when Idoc is triggered via ALE

    Hi, Whenever we save the billing document, an outbound idoc is triggered via ALE. The logic for the data to be included in the idoc is written in a customized function module. However we are making some changes and would like to include some more dat

  • J2EE engine version information

    I am trying to find out what version of J2EE SAP's Web AS adheres to.  The last I heard was that it adhered to 1.3 but I came across a weblog which stated that it adheres to 1.4.  I know the JRE is 1.4.2 and this would seem to confirm that SAP adhere

  • CC Desktop App crashes when App tab is selected

    I'm running Windows 7 x64. After attempting to upgrade LR4 via the CC Desktop App, LR4 was removed, but the upgrade to LR5 failed. The installation of LR5 was somehow botched. All that appeared was a reference to LR5.7 in the Programs and Features se

  • Portal Technology Certificate( Can I do it???)

    I am MM consultant but I would like to apply for (Technology Consultant SAP NetWeaver - Enterprise Portal & Knowledge Management (EP 6.0 sp2) Can I pass the exam? given the following: - No java programming - No Unix adminstration What is required? Ho