What is the Proper way to nullify the VECTOR after it's scope is over

I am using Vectors and Array lists at many places in my Web Application, It is neccessary to use them.
In some processes I m storing bulk amount of data into vector due to that the performance of my application will be decreased, for that I have to nullify the vector after it's scope is over.
To nullify I m using Vector v = new Vector()
v.clear().
The above method is suitable in case of simple object data like strings and other values.
But I wanna know that If I m using HashMap and storing bulk data in it and then I m storing each HashMap into vector, what is the proper way.
Does I have to iterate each object of HashMap from vector and set them as null and then set vector as null or directly I can use v.clear() method??
If any having any answer regarding my question then plz reply your each valuable reply will be appriciable.
Thanks in advance......!!

JBOSS2000 wrote:
Each time in loop a new object of vector is created and each time I m nullifying it. Thats what I m doing.
Thats why I m nullifying it.
Even if I'll declare it out side the loop then also for the each iteration I have to nullify it cause what I m doing is I m inserting the data into database in each iteration of loop, So that I think it is must to nullify the objects each time.If it is constructed inside the loop then you do not have to nullify it. If it is constructed outside of the loop and you want to empty it for each iteration then just clear() it.

Similar Messages

  • What is the proper way to move the iTunes (v11) Media folder to an external USB HD?

    What is the proper way to move the iTunes (version 11) Media folder to an external USB HD?  I have tried to following listed instructions, but although I can get the songs listed, their locations are not found.

    Tried the option key, but it would not let me select the copied iTunes folder.  Also changed the path for iTunes Media Location folder.  But still iTunes is not happy.  I could try the alias route, but I don't have an iTunes folder that iTunes is happy with to point it to.  All of the songs and even the playlists will come up, but it seems some form of the folder and its files must remain on the internal hard drive.  But I want to move it off because it is out of space.  Any other thoughts?
    I have all of the music etc files what I do not want to lose is the playlists.  I don't care about the play counts.  I would be glad to reimport all of the songs to the newly designated folder, but won't I lose my playlists?
    Thanks for your help.

  • What is the proper way to use the write method?

    What is the proper way to use the OutputStreams write method? I know the flush() method is automatically called after the write but i cant seem to get any output
    to a file. The char array contains characters and upon completion of the for loop the contents of the array is printed out, so there is actually data in the array. But write dosnt seem to do squat no matter what i seem to do. Any suggestions?
    import java.io.*;
    public class X{
    public static void main(String[] args){
    try{      
    FileReader fis = new FileReader("C:\\Java\\Test.txt"); //read chars
    FileWriter fw = new FileWriter("C:\\Java\\Test1.txt"); //read chars
    File f = new File("C:\\Java\\Test.txt");
    char[] charsRead = new char[(int)f.length()];
    while(true){
    int i = fis.read(charsRead);
    if(i == -1) break;
    // fw.write(charsRead); this wont work
    // but there is infact chars in the char Array?
    for(int i = 0; i < charsRead.length -1 ; ++i){
    System.out.print(charRead);
    }catch(Exception e){System.err.println(e);}

    Sorry to have to tell you this guys but all of the above are broken.
    First of all... you should all take a good look at what the read() method actually does.
    http://java.sun.com/j2se/1.3/docs/api/java/io/InputStream.html#read(byte[], int, int)
    Pay special attension to this paragraph:
    Reads up to len[i] bytes of data from the input stream into an array of bytes. An attempt is made to read as many as len[i] bytes, but a smaller number may be read, possibly zero. The number of bytes actually read is returned as an integer.
    In other words... when you use read() and you request say 1024 bytes, you are not guaranteed to get that many bytes. You may get less. You may even get none at all.
    Supposing you want to read length bytes from a stream into a byte array, here is how you do it.int bytesRead = 0;
    int readLast = 0;
    byte[] array = new byte[length];
    while(readLast != -1 && bytesRead < length){
      readLast = inputStream.read(array, bytesRead, length - bytesRead);
      if(readLast != -1){
        bytesRead += readLast;
    }And then the matter of write()...
    http://java.sun.com/j2se/1.3/docs/api/java/io/OutputStream.html#write(byte[])
    write(byte[] b) will always attempt to write b.length bytes, no matter how many bytes you actually filled it with. All you C/C++ converts... forget all about null terminated arrays. That doesn't exist here. Even if you only read 2 bytes into a 1024 byte array, write() will output 1024 bytes if you pass that array to it.
    You need to keep track of how many bytes you actually filled the array with and if that number is less than the size of the array you'll need pass this as an argument.
    I'll make another post about this... once and for all.
    /Michael

  • What is the proper way to open the app store  for ios

    Using Air3.1 to develope a game.
    I want to have links on my main menu which will open the iOS app store for a specific application.
    The only way I have found to do this is by opening a url "http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=<THEAPPIDHERE>&mt=8"
    However, while this does work, so to speak, when I try to go back to the application, it starts up as if it had crashed... and it does several "redirects" before it get's where it is eventually going.
    Is there a better/proper way to open the app store?
    Cheers
    dave

    Read this page, especially the later examples:
    http://bjango.com/articles/ituneslinks/

  • What is the proper way to fix the Flash Plug-in issue that causes Firefox to hang when playing Flash videos

    This is annoying and causing me to set my default to Chrome. Firefox hangs when playing Flash. I have tirelessly tried everything I could. Uninstalling Flash via the Adobe download. Uninstalling FF and every single one of it's folders. I've done it all, multiple times....and continue to have the exact same problem, any Flash video hangs. Please help, I have read countless articles about others having this same problem, yet nobody offers a real solution.
    == URL of affected sites ==
    http://www.youtube.com

    This is annoying and causing me to set my default to Chrome. Firefox hangs when playing Flash. I have tirelessly tried everything I could. Uninstalling Flash via the Adobe download. Uninstalling FF and every single one of it's folders. I've done it all, multiple times....and continue to have the exact same problem, any Flash video hangs. Please help, I have read countless articles about others having this same problem, yet nobody offers a real solution.
    == URL of affected sites ==
    http://www.youtube.com

  • What is the proper way to charge battery in 2012 15 inch macbook pro.

    what is the proper way to charge the battery and make it last longest

    About Batteries in Modern Apple Laptops
    Battery University
    Apple - Batteries - Notebooks
    Apple - Batteries
    Extending the Life of Your Laptop Battery
    MacBook and MacBook Pro- Mac reduces processor speed when battery is removed while operating from an A-C adaptor
    Apple Portables- Calibrating your computer's battery for best performance
    Mac notebooks- Determining battery cycle count

  • What is the proper way to apply SCCM 2012 R2 Cumulative Updates

    Hello All!
    I am looking for a little advice. Since deploying SCCM 2012 R2 I have not yet installed any of the cumulative updates. What is the proper way to install the previusely released updates? I believe there has been 3 CU relases since SCCM 2012R2. Should
    I just install the most recent CU or install all of them starting with CU1? I know each one addresses different issues so I would think install all of them would make sense.
    Thanks,
    Phillip
    Phil Balderos

    No, they're cumulative, so you only have to install the latest.
    My Blog: http://www.petervanderwoude.nl/
    Follow me on twitter: pvanderwoude

  • What's the proper way of mixing voices on top of loud music?

    Hello!
    I'm working on a little something that contains very loud music and very loud voices mixed together.
    It sounds great on my Logitech G35 headphones, but when playing it through my studio monitors in the living room, the voices seem to get a little drowned out by the music (The music is at a pleasingly loud level that I wish to keep, as it doesn't sound as powerful as soon as I bring it's gain down a little).
    So I was wondering what is the proper way of keeping the great loudness of the music and the voices at the same time, but make the voices a little more understandable?
    The music and the voices are on seperate tracks of course in my Audition file.
    Here is an example of what it sounds like currently: http://soundcloud.com/stefanpanic/gameshow-trailer
    Thanks in advance!

    Okay, with my acoustician's hat on:
    Headphone mixing - especially when it comes to voices in the centre of a stereo field - has always been a disaster area, and you can almost always spot when a mix has been made to play on headphones, because the vocal is invariably too quiet.
    I suppose that the easiest way to explain this is to consider what happens to the central voice with loudspeakers. That voice is essentially a virtual image; there isn't a loudspeaker there to support it. So it's been created out of the off-axis responses of your loudspeakers, and is in a space that's quite a distance from your ears, compared to where it would be on headphones. So, the level of this voice depends as much on the angle of your speakers as anything, and whilst this varies considerably between different setups, it's still considerably different to the relationship that headphones have with your ears!
    Traditionally in the past, it's been recommended that you should sit in an equilateral triangle with your speakers, which should be pointing towards you which means an included angle of 120 degrees between them. Despite this information being repeated all over the place since the 1950's, there's no physical basis for it at all, and most people don't have setups like that anyway. And I have to say that this really isn't good positioning for establishing a central image - that angle is too great, and you are relying on an extremely good off-axis response to achieve any level at all there.
    In this day and age, what you really need is a monitoring compromise that will let you create a mix that sounds not so bad on both headphones and loudspeakers, and there are a couple of things you can do to improve the situation considerably, and get a generally better result. And FWIW, it's what I do in this situation...
    The first is to alter the angle of your monitors so that the included angle is 90 degrees (a right-angle) and sit so that both of them are pointing directly at your ears. This gets you a lot closer to the monitors, admittedly, but is far more realistic as far as a compromise mix is concerned. If you do your whole mix like this, you'll find that it's a lot easier to position things in it too. And don't put anything like soft furnishings between them either - that will definitely make things worse. The second thing is that one of the important things you should always do with a mix like this, to finally establish vocal levels, is to listen to it really quietly. No, really quietly! Almost at vanishing point. What you should hear is the whole mix, but if anything is standing out (like the vocal), it will become obvious like this in a way that it simply won't when it's louder. You want it to be there, certainly - but it shouldn't be either missing or standing out too much.

  • What's the proper way to use reusingView in a custom UIPickerView

    Does anyone have an example of the proper way to use the resuingView parameter when implementing pickerView:viewForRow:forComponent:reusingView: in a UIPickerViewDelegate?
    The documentation states that reusingView is "A view object that was previously used for this row, but is now hidden and cached by the picker view."
    and: "If the previously used view (the view parameter) is adequate, return that. If you return a different view, the previously used view is released. The picker view centers the returned view in the rectangle for row."
    I need to create UILabel views so I can right justify things, and I have that working by always returning my copy of the view, but it seems like things could be made more efficient by returning the view passed to me if it's "adequate". So, how do I tell if the view is adequate?
    I've tried something like this:
    // check to see if the view we're given is a UILabel and return that view
    if ([view isMemberOfClass:[UILabel class]])
    v = (UILabel *)view;
    return v;
    else
    ... return a UILabel instance for this row ...
    But the view I'm being passed is never a UILabel instance. That or I'm not using isMemberOfClass correctly.
    Thoughts anyone?

    - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view {
    iPregnancyAppDelegate *iPregAppDelegate = [[UIApplication sharedApplication] delegate];
    UILabel *pickerLabel = (UILabel *)view;
    // Reuse the label if possible, otherwise create and configure a new one
    if ((pickerLabel == nil) || ([pickerLabel class] != [UILabel class])) { //newlabel
    CGRect frame = CGRectMake(0.0, 0.0, 270, 32.0);
    pickerLabel = [[[UILabel alloc] initWithFrame:frame] autorelease];
    pickerLabel.textAlignment = UITextAlignmentLeft;
    pickerLabel.backgroundColor = [UIColor clearColor];
    pickerLabel.text = @"Put YOUR text here!";
    return pickerLabel;
    Message was edited by: gpmoore

  • What is the proper way to reset a CoreTree's TreeModel?

    I have a senerio in which I need to clear out a CoreTree on an event - remove all roots and nodes and re-populate the CoreTree with new data.
    I've tried to nullify the CoreTree's TreeModel.
    I've tried using the PathSet:
    PathSet pathSetTransact = this.getTransactTree().getTreeState();
    if(pathSetTransact != null){
    Set ks = pathSetTransact.getKeySet();
    ks.clear();
    Neither of these work.
    What is the proper way to reset a CoreTree's TreeModel?
    Thanks,
    --Todd
    Also, in your code snippet, root isn't even used?
    Message was edited by:
    jtp51

    OK.
    This just isn't working.
    Setting my CoreTree's TreeModel with an empty GenericTreeNode does not clear out the previously populated tree.
    What other path could I take to accomplish my goal?
    Thanks,
    --Todd                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • What is the proper way to record line numbers in Master/Detail records?

    Guys and Gals,
    Been thinking about this for awhile, but thought it best to ask the people who really know what they are doing.
    What is the proper way to record & show line numbers in a Master / Detail record set?
    For example, take Master/Detail relationship Orders and OrderItems. Orders has a column Document_Number and OrderItems has Document_Number, Line_Number. Line_Number should contain the row number 1,2,3,4 ... etc. for each row in a document.
    Should I ...
    <ol><li>Add a sequence and a trigger in the database? The FusionOrderDemo does this, but then the sequence never "resets" and I've got row numbers that keep incrementing. So one document has rows 4,5,6 and the next document has 7,8,9 when they should both have 1,2,3.</li>
    <li>Programmatically take care of the row numbers? This seems like I'm asking for trouble. Anytime an insert or delete operation gets done, I'll have to iterate through rows and re-assign row numbers.</li>
    <li>Is there a way to assign row numbers in a table iterator (or data collection?) to an entity?</li></ol>
    Any suggestions would be appreciated. It's looking like #2 is my only option, but if anyone knows different I'd love the input.
    Will

    Thank you both guys.
    As John said, I believe I'm looking for a gap-free sequence per master record.
    The line number of the OrderItems table is the second half of the primary key. The first half of the primary key (DocumentNumber) is the foreign key to the Orders table.
    Think of it like line items on an order or invoice. For example, if you were talking to someone on the phone concerning an invoice, you might say, "The pricing for line item #3 is incorrect." In this case, it's good to have a common reference. Or imagine a Microsoft Excel spreadsheet with no row numbers displayed! You'd never get anywhere if you had to explain something over the phone.
    If this is tricky to perform, I take it using a sequence and trigger such as the Fusion Order Demo is the best way to approach the challenge for simplicity's sake?
    Will

  • What is the proper way to close all open sessions of a NI PXI-4110 for a given Device alias?

    I've found that, when programming the NI PXI-4110 that, if a the VI "niDCPower Initialize With Channels VI" (NI-DCPower pallette) is called with a device
    alias that all ready has one or more sessions open (due to an abort or other programming error) a device reference results from the reference out that has a (*) where "*" is post-fixed to the device reference where and is an integer starting that increments with each initialize call. In my clean up, I would like to close all open sessions. For example, let's said the device alias is "NIPower_1" in NI Max, and there are 5 open sessions; NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4). A simple initialize or reset (using niDCPower Initialize With Channels VI, or, niDCPower Initialize With Channels VI, etc.) What is the proper way to close all open sessions?
    Thanks in advance. Been struggleing with this for days!

    When you Initialize a session to a device that already has a session open, NI-DCPower closes the previous session and returns a new one. You can verify this very easily: try to use the first session after the second session was opened.
    Unfortunately, there is a small leak and that is what you encountered: the previous session remains registered with LabVIEW, since we unregister inside the Close VI and this was never called. So the name of the session still shows in the control like you noted: NIPower_1, NIPower_1 (1), NIPower_1 (2), NIPower_1 (3), and NIPower_1 (4), etc.
    There may be a way to iterate over the registered sessions, but I couldn't find it. However, you can unregister them by calling "IVI Delete Session". Look for it inside "niDCPower Close.vi". If you don't have the list of open sessions, but you have the device name, then you can just append (1), (2) and so forth and call "IVI Delete Session" in a loop. There's no problem calling it on sessions that were never added.
    However - I consider all this a hack. What you should do is write code that does not leak sessions. Anything you open, you should close. If you find yourself in a situation where there are a lot of leaked sessions during development, relaunching LabVIEW will clear it out. If relaunching LabVIEW is too much of an annoyance, then write a VI that does what I described above and run it when needed. You can even make it "smarter" by getting the names of all the NI-DCPower devices in your system using the System Configuration or niModInst APIs.
    Hope this helps.
    Marcos Kirsch
    Principal Software Engineer
    Core Modular Instruments Software
    National Instruments

  • What is the proper way to create a monotone image with real looking contrast?

    Once I apply a color to my previously created black and white image everything looks washed out.
    I have an artwork with 3D representation of the letterforms, casting shadows on the textured surface. Shadows are deep black. I need this artwork to be colored in gold. My client forwarded me the specs for the metallic gold which he got from the PANTONE. They are:Gold (871); Adobe 1998 RGB: 126-113-76
    HSB*: 44 degrees-40%-50%
    What is the proper way of applying those values to the desired image.
    My idea was to make the image black and white and than create a monotone image with the above specs. In this case the image gets washed out as the darkest black in the shadows becomes this Pantone gold. Is there any other way?

    A duotone will work, however you are going to want to work closely with your printer . Most printers will want the second color in CMYK (Possibly C60 M40 Y0 K100 instead of RGB values or specify a Pantone Rich Black (I personally like 6C)but it will cost you more for the wash up of both heads of the printer...
    Go to Image>Mode>Duotone (image must be greyscale first for this to work) then add the desired colors to your ink scales.

  • What is the proper way to include search terms in your page

    Say you have a web page that is about a certain topic and has information displayed on the page.  What is the proper way to include terms that you would like this page to show up on a search for but don't necessarily want to display on the page?
    I didn't know if including the search keywords at the bottom in small font with invisible color was the proper way.

    I didn't know if including the search keywords at the bottom in small font with invisible color was the proper way.
    ABSOLUTELY NOT!!!  This practice will get your site banned or blacklisted from Search Engines.  It is considered a Black Hat tactic to attempt to mislead search engine results in an effort to drive traffic to your site.
    Instead, use plenty of keyword rich, relevant text and good semantic mark-up (h1, h2, h3) inside the body of your pages.   In time, search engines will find you.
    Some Excellent Links on Search Engine Optimization:
    Google's SEO Starter Guide (PDF)
    http://www.google.com/webmasters/docs/search-engine-optimization-starter-guide.pdf.
    Can Better Web Accessibility Mean Better Search  Ranking?
    http://alt-web.blogspot.com/2007/07/can-better-web-accessibility-mean.html
    High Rankings Advisor
    http://www.highrankings.com/newsletter/
    SEOMoz.org - Beginner's Guide to SEO (1-page  html)
    http://www.seomoz.org/article/beginners-1-page
    SEO Chat
    http://www.seochat.com/
    Submit Site Maps to 4 Major Search Engines
    http://alt-web.blogspot.com/2008/11/submit-sitemaps-to-4-major-search.html
    Nancy O.
    Alt-Web Design & Publishing
    www.alt-web.com
    www.twitter.com/altweb
    www.alt-web.blogspot.com/

Maybe you are looking for

  • Is it possible to create different font styles within the same text field?

    The form I am creating is getting really complex because when different fields require different font treatments (bold, italic, different font size, different font) I have to create a seperate text box and get it to align with the others. This wouldn

  • IMovie stops importing after 7 seconds or so

    I am trying to import some video that is being passed thru my digital camcorder from a dvd. I have done this before several months ago but today it stops importing after about 7 seconds. I don't have FileVault turned on so that isn't the problem. Eve

  • JTabbedPane with JTextField

    Can anyone provide me with an example on how to incorporate a JTextField into a JTabbedPane? There are many examples of creating JButtons as components of a JTabbedPanes but nothing for JTextFields. Can this be done? I get some wierd compiler errors

  • GRC-AC 5.3sp14, ERM, Role Generation

    We updated our GRC-AC 5.3 from sp12 to sp14 and now we cannot generate roles anymore. When we try to do it, we get the following error: "Failure : Field AGR_1252 not a member of TABLES". Does any one know how can we solve it? The backends were also u

  • Weird Errors on running applescript

    Hello everyone, I am new to applescript and with a decent amount of googling about, I managed to write a script that would write out the state of skype to a file. This is how it goes: tell application "System Events" to set theCount to the count of (