Searching from array1 to array2 in the fastest way beside using looping

I have 2 array 1d of object, what i want to do is searching data "a" from array1 in array2 in the fastest method because the amount of data in each array reached almost 10000 data.
thanks.

I store my data in a LinkedHashSet and HashSet. I changed it into an array of Object using method toArray. Example :
LinkedHashSet a;
a.toArray() -> this method changed my LinkedHashSet into an Array of Object.
the data in this structure data is not sorted, but i have to use all the data without sorting it.
i think 10000 is quite an amount couse i must use 2 looping to find data from array1 in array2
this is my program :
private boolean removeCrawledLinks(LinkedHashSet toCrawllinks,HashSet crawledLinks_)
          String filename1, filename2;
          FilenameGenerator fng = new FilenameGenerator();
          Object [] array1 = crawledLinks_.toArray();
          Object [] array2 = toCrawllinks_.toArray();
          for (int i = 0; i < array1.length; i++)
               filename1 = array1.toString();
               for (int j = 0; j < array2.length; j++)
                    filename2 = array2[j].toString();
                    if (filename1.equals(filename2))
return true;
this method is spending lot of time, i need more efficient way
thanks

Similar Messages

  • Very elementary doubt, but... can i use the rest free space of Airport Time Capsule as a Hard Drive (copy and paste files freely, from my MacAir SSD to the Time Capsule), besides use it with Time Machine at the same time?

    Cant find it clearly in tutorials...

    You can do it.. should you do it is another question.
    Store files on the TC.
    This is asked several times a day.. obviously people are struggling with their latest SSD being too small.
    The TC is not suitable for network file server.. but many people having no choice press it into service as such.
    Major issues.
    1. No backup.. no way Time Machine can backup a network drive. No place to backup to.. So all your files will be at risk. Think this out very clearly.. how and to where are you going to backup your files. And you will need to buy a third party like CCC to do backup.
    2. The TC cannot be partitioned and mixing TM backups and data is not great. It was and is and ever shall be a backup device for Time Machine.
    3. The drive is slow to spin up and quick to spin down.. there is no control. In fact the TC is so lacking in controls for even the router side.. that you cannot do more than the most basic of setups.
    The following are controls on the hard disk side.
    Reformat it. You can name the share. You can do a full archive of the whole disk. This will go at a speed of aprox. 30-50GB/Hr so calculate how long an archive of a full 2TB will take.
    4. iPhoto in particular can easily corrupt its entire library with wireless networking causing a disconnection to one photo. Even if you do this;;; do not move your photo library... you have been warned!!
              Even apple btw say don’t do it.
    http://support.apple.com/kb/TS5168 Although mostly about FAT32           it adds network drives.
    5. iTunes can constantly lose connection to the library. The disk is slow to respond.. itunes on the computer will constantly spit out errors. Even in the midst of streaming the TC can spin down the disk due to caching.
    6. Do not use any live files on the TC no matter what else you do.. if you edit files in whatever program the file must be on the local hard disk.
    7. The only suitable location for most libraries is a computer. You can plug in an external hard disk.
    Read pondini for some work arounds.
    Q3 here. http://pondini.org/TM/Time_Capsule.html

  • What is the fastest way to transfer files and applications from an older iMac to a new MacBook Pro?

    What is the fastest way to transfer files and applications from an older iMac to a new MacBook Pro?
    I have a Firewire cable and Thunderbolt adapter, but no icons showing either Mac appear on either desktop.

    The fastest way is to use Carbon Copy Cloner and a external drive formatted GUID OS X Ext. J in Disk Utlilty, then connecting to the new Mac and using Migration Assistant in the Utilites folder.
    Even faster, if you can determine your going to replace all the apps from fresh sources anyway (like if the older Mac's OS X verison is old thus the apps) then just use a external drive and copy just your files to it, then connect to the new Mac and transfer over.
    Some apps you can just grab the registration code and install it fresh on the new machine with the old code, talk to the developer about transfering the program, as long as it's deleted on the older Mac in the process.
    It used to be Firewire Target disk mode was fastest, but since Thunderbolt came out...
    Notice this support doc hasn't been updated since june 2012, no Thunderbolt info
    https://support.apple.com/kb/HT1661

  • What's the fastest way to upgrade from tiger

    what's the fastest way to upgrade from tiger

    Buy a DVD for the upgrade your Mac has the hardware to support.
    Allan

  • What is the fastest way of getting data?

    With a scanning electron microscope, I need to scan a 512*512 pixel area with a pixel repetition of 15000 (two channels), meaning averaging over 15000 measurements. Simultaneously I have to adjust the voltage output for every pixel.
    I am using a 6111E Multifunction I/O board in a 800MHz P3. The whole task has do be done as fast as possible (not more than 20 minutes altogether).
    What is the fastest way to get this huge amount of data with averaging and output in between? (E.g. do I use buffered read with hardware triggering or is there a faster way?)

    Using the NI-DAQ API (not LabView) will give you a significant amount of more control over what happens and when to the data stream; which translates to a more efficient program. But you need to program in C/C++ or Delphi then. The Measurement Studio provides ActiveX controls that are like the LabView ones for C&C++ (they�re slow like the LabView ones though � not a lot you can do about the Windows GDI).
    What are you trying to sample 15000 times? The 512*512 pixel field?
    That�s almost 15Gigs of data! And it means you need to process data at 12.8MB/s to finish it in 20 minutes. I hope you know C, x86 assembly and MMX.
    I would setup a huge circular buffer (NI-DAQ calls them �double buffers�), about 30 seconds worth or so, to use with SCAN_Start. Then I would proces
    s the actual buffer the card is DMA�ing the data into with a high priority thread. Progressively sum the scan values from the 16bit buffer (the samples are only 12 bit, but the buffer should still be 16bits wide) into a secondary buffer of DWORDs the size of the screen (512*512), and you�ll need two of those, one for each channel. Once the 15000 scans are complete, convert each entry into a float divide by 15000.0f, and store it in a third buffer of floats.
    If you wish to contract this out, send me an email at [email protected]

  • Sq01 what is the fastest way,

    hi all,
    what is the fastest way to detect coding that update to eban  from sq01?
    as i am facing problem with more than 100,000 PRs updated mysteriously (customer tab data ) without any history changes .
    i suspected it might be from query and i need to find the root cause of problem immediately
    pls advice

    Hi Ester,
    Haven't got clearly what you written.
    You mean to say, there is modifications done to query for updation?
    if it is a standard code then I don't think it is used for modification.
    Regards,
    Atish

  • What is the fastest way to detect on to off tag transition​s and then read 500 analog tags?

    what would be the fastest way to read 500 analog tags from the tag engine when a boolean tag transitions from on to off?? Right now I have a boolean indicator setup with the HMI wizard in a while loop with 20ms timer. The indicator feeds the boolean crossing ptbypt vi. When the output is true, I use one read multiple tags vi to get all 500 at once. I am reading data into the tag engine through an opc server and have around 2500+ tags. I need to read all of the data in less than 100ms. My plc logic is setup to zero out all of the 500 analog tags when the boolean indicator turns on again. Would I be better off using the trend tags vi to monitor the boolean indicator??

    Unclebump,
    You might try using read tag.vi

  • From where can I download the jar files to use JAXB 2.0?

    Hi all,
    From where can I download the jar files to use JAXB 2.0?
    ~Regards

    Does the government not let you do Internet searches where you live? My Internet search for "JAXB 2.0" returned this:
    https://jaxb.dev.java.net/
    as the first link. If you can't find it from that page it doesn't exist.

  • What's the fastest way to look up a User's Work Items?

    Hi, my SCSM environment has a few different service desks and plenty of customer drive-by's.  Sometimes when a customer comes up and asks for a status, the SD personnel can't find their ticket quickly. The fastest way right now is to 1.) click on CONFIGUATION
    ITEMS; 2.) Search for the Affected User; 3.) Click on the Affected User; 4.) Click on the Affected User's Related Items; 5.) Search the related items for the proper Work Item; 6.) Load the Work Item.
    It's not bad, but it's a lot of steps and I'm wondering if anybody has a faster method in place.

    Just to poke holes in the salesmanship, Consider that you might have an easier time in doing any of the following:
    Create a view that lists all open incidents, and make the first column Affected User. Analysts can filter or sort by this column to get quick info
    The search box in the top right corner can be set to users, right click the down arrow to see all options. 
    the search box in the top right can be used to search work item IDs or titles.

  • How to make a table copy - the fastest way????

    Hi,
    Well, I have the following task to do in the minimal possible time:
    Task: duplicate a table in my instance database. The source table name is SPC.
    The destination table name is SPC_REP. Both are partitioned.
    The trouble is my source table has 40 million rows, but I need to copy only 27 million related to a column which I will use a condition in where clause.
    Ok, so I have some questions:
    Question 1)
    What's the fastest way to provide this copy?
    Export/import, Insert into, sqlloader (this one I've never used)
    Question 2)
    I am planning to do this by export/import utility. But I don't want to waste time doing first the export process and only after all doing import process. I would like to do export and import simultaneously to save time as table has so many rows.
    Question 3)
    If I use export/import I will not be able to create the copy table on the same schema as it is my source table, correct? Correct me, if I'm wrong...
    Thank you all,
    And any hint will be appreciated.

    Export & import probably isn't the best solution here. It's not particularly fast, reuires that you create an additional copy of the data in your dump file, involves the cost of pulling all the data out of Oracle and puts it back in, etc.
    Transportable tablespaces would be an option, assuming your partitioned table isn't in the same tablespace as a bunch of other opjects.
    Personally, I would probably do a
    CREATE TABLE <<copy name>>
    AS
    SELECT *
      FROM <<original name>>
    WHERE 1=2
    INSERT /*+ APPEND */
      INTO <<copy name>>
      NOLOGGING
    SELECT *
      FROM <<original name>>
    WHERE <<something>>Justin
    Distributed Database Consulting, Inc.
    http://www.ddbcinc.com/askDDBC
    Message was edited by:
    Justin Cave
    APPEND & NOLOGGING may be faster so I added that.
    Message was edited by:
    Justin Cave

  • Is this the fastest way to copy files?

    I'm looking for a way to take 1 file and make many copies of it. Is this fastest way you know of?
    import java.io.*;
    import java.nio.channels.*;
    public static void applyFiles( File origFile, File[] files )
      FileInputStream f1 = new FileInputStream( origFile.getAbsolutePath() );
      FileChannel source = f1.getChannel();
      FileOutputStream f2[] = new FileOutputStream[ files.length ];
      FileChannel target;
      for( int x=0; x < files.length; x++ )
        if( origFile.getAbsolutePath() != files[x].getAbsolutePath() )
          f2[x] = new FileOutputStream( files[x].getAbsolutePath() );
          target = f2[x].getChannel();
          source.transferTo(0, source.size(), target);
    }

    2 questions from your code...
    1) I assume the last line should read
    out.write(buffer,0,numRead);
    2) Doesnt this just read in a piece at a time and write that piece to each file? Isn't that degrading performance to have so many files open and waiting at once? Would it make more sense to read into a StringBuffer, then write all the data to each file at a time?
    Thanks
    I'd have to say that your question is loaded. :)
    Without knowing anything about your target system, I'd
    have to say no, this is not the fastest way to copy a
    file to many files. This will end up reading the file
    once for every time you want to copy it. Which may
    work fine if the file is small, but not when the file
    that is being copied is larger then free ram. Or if
    the file channel implementation sucks.
    For the general case, where you don't know how big the
    file will be beforehand I'd say that this is a better
    algorithim.
    public static void oneToManyCopy( File source, File[]
    dest ) throws Exception(s) {
    FileInputStream in = new FileInputStream( source );
    FileOutputStream out[] = new
    w FileOutputStream[dest.length];
    for ( int i = 0 ; i < dest.length;++i)
    out[i] = new FileOutputStream(dest);
    byte buffer[] = new byte[1024]; // or whatever size
    e you like
    int numRead;
    while ( ( numRead = in.read(buffer,0,buffer.length)
    ) ) > -1 ) {
    for ( int i = 0 ; i < out.length; ++i )
    out.write(buffer,0,numRead);

  • What's the fastest way to change IP addresses in a Project?

    Hi folks,
    I'm using a cFP2100 controller with LabVIEW 8.2.1.  I made a project using a configuration I created in MAX.  Now I've moved the whole bank of modules to a new location, and the controller now has a new IP address via DHCP.  My question is, what's the fastest way to update the IP address for my project?  Do I have to make a brand new project with a new .iak file that has the new IP address?  I'm thinking there's got to be an easier way.
    Thanks!
    Eric

    Hi Eric,
    Since you are getting your IP address from a DHCP server, the IP address of your Fieldpoint device is ultimately dependant on the server.  If your IP address changes, you have two choices.   You can right click your target and go to properties.  In the properties under the general category, you can change the IP address of the target.  The second option is to import a new IAK file into your project by right clicking the Project Name and going to import>>iak file. 
    I hope this helps,
    Regards,
    Nadim
    Applications Engineering
    National Instruments

  • IMovie: whats the fastest way to import and save all original media?

    Good afternoon. Ok I need help please. Is there a way to simply take all the imported original media and just save it all in one fell swoop? Rather than having to import and then process/export clip by clip.
    I thought I had a quicker way just grabbing all the original media from the imported camera (right clicking imovie library > show package contents > original media) untill I tried to play one of the original media files - no sound and it was mov file. I assume mp4 is better???
    I have 2800 hours of video I need to import off my camera. I don't need to modify them at all, aside from the occasional combining of clips into one movie. So I need the fastest way. Importing and then exporting clip by clip will take me forever. I would prefer to just import and then just drag all 50 clips or so into my movies folder. But as stated above that does not seem to work as expected unless I'm missing a step.
    Thank you!

    ps Can I take the original media files (mov format) and batch convert them using handbrake or MPEG streamclip? And if so would the resulting videos then have sound? And which is the best format (container codec whatever) to export them to? Thanks!

  • SxS to ProRes the fastest way?

    What is the fastest way to get from SxS to ProRes?
    Is importing with FCP and using Compressor/Episode Pro on a Mac Pro/Xserve faster than putting the cards into a AJA KiPro and using that convert then adding the media to the Xsan over FW800?
    Are there other bits of kit that let you take SxS cards and pump out ProRes?
    Thanks

    Thank Brian for your comment. That is getting people editing fast but not converting all the media to ProRes
    I am trying to get the media to ProRes the fastest way which is subtly different. I know you can cut long-GOP and set the Render Control Codec to ProRes but I actually want to convert everything than comes in from the EX cameras, back it up and then put it on which ever San volume it is required on.
    Sounds like there isn't a bit of kit that will help too much. Just need to throw Processors & RAM at the conversions...

  • How can I plott data from a text file in the same way as a media player using the pointer slide to go back and fort in my file?

    I would like to plott data from a text file in the same way as a media player does from a video file. I’m not sure how to create the pointer slide function. The vi could look something like the attached jpg.
    Please, can some one help me?
    Martin
    Attachments:
    Plotting from a text file like a media player example.jpg ‏61 KB

    HI Martin,
    i am not realy sure what you want!?!?
    i think you want to display only a part of the values you read from XYZ
    so what you can do:
    write all the values in an array.
    the size of the array is the max. value of the slide bar
    now you can select a part of the array (e.g. values from 100 to 200) and display this with a graph
    the other option is to use the history function of the graphes
    regards
    timo

Maybe you are looking for