Mixed up

I already posted this message, but i realized it wasn't explained very well, it was confusing. So forgive me to post it again, but better explained:
I have objects from a class i made myself, Product. This class has an ArrayList called list.
Here is a bit of code:
Product parent = new Product();
res = stat.executeQuery(sql);
while(res.next())
          child.setIdentifier(res.getInt("IDENTIFIER"));
          child.setStringId(res.getInt("STRINGID"));
          (parent.list).add(child);                         
          System.out.println("Child of " + parent.getIdentifier() + ": " + child.getIdentifier());
Here everything is fine. i get these values with the System.out.println(...):
Child of a : 222
Child of b : 243
Child of b : 543
Child of b: 469
which is what i wanted.
BUT, when i try to do this:
for(Iterator it = (parent.list).iterator();it.hasNext();)
     Product d = new Product();
     d = (Product) it.next();
     System.out.println("d = " + d.getIdentifier());
the output i get is this:
469
469
469
469
when i should be getting
222
243
543
469
why is it stuck to the last value entered??
....this is weird!!!!!
Can anyone help me please?
Thanks for your patience :)

You need a new child object every time, else you end up changing the same child object the next time through the loop. I assume that is what you found. Also no need for new object here, just do it like so
for(Iterator it = (parent.list).iterator();it.hasNext();)
  Product d = (Product) it.next();
  System.out.println("d = " + d.getIdentifier());
}

Similar Messages

  • Mixing memory modules on Westmere

    Dear Hardware gurus,
    I have a 12-Cores Westmere. Do you know is it possible to mix different memory modules on it, namely:
    6x1 Gb 1330Mhz
    +
    2x4 Gb 1066Mhz
    and if yes, in which configuration?
    Thanks a lot for any comment!

    Kappy, thanks for the note.
    I am actually going to order some more 1333 modules, but just for the short time I have to work with what I have currently (see my original post).
    As I posted above, I tried a bit already to combine the modules and Mac doesn't boot
    Can you suggest a configuration, which will work?

  • Mixing RAM Modules

    Several weeks ago, I replaced my 256 MB RAMs with 2 1 GB modules in a late 2005 G5. They seemed to work fine, though my GPU seemed to be running a bit hotter. I just installed an additional 2 GB bought from OWC, and also added back the 2 original 256 MBs to bring my total to 4.5.
    Looking in System Profiler, I see that my original 256s and the latest 1 GB modules are PC2-4200U-444, as specified in the online compatibility guide. I see the I GB modules from my first upgrade are PC2-3200U-288.
    I bought them at a local shop- for way too much money, by the way - and was told that the number printed on them was wrong and they were compatible with my model. Is that right, or this a problem?
    Thanks

    Hi! The PC2-4200 modules are the correct ones and you shouldn't run anything slower. You can run faster ones but you shouldn't run slower ones or mix speeds. And if the computer sees them as the slower ones then most likely they are! Tom
    Message was edited by: Thomas Bryant

  • Mixing RAM Modules (1gig + 2gig = 3gig)

    Hello,
    I am about to buy a Mac Mini and I am on a tight budget. The one thing I want to do for sure is upgrade the memory, but I'm in a quandary of sorts given my budget. The retailer where I want to buy the Mini from only sells the appropriate RAM for the Mini in 2gig modules. So here's my question: I know it is possible to mix the stock 1gig stick with a 2gig stick to get 3 gig of RAM total, but will it be worth it to me? I realize that the best configuration would be to slap in 2 2gig modules in and just be done with it, but with 3gig, would I be appreciatively shooting myself in the foot and killing the machine's performance, or wouldn't I notice? I need to have the memory installed at purchase because I am physically handicapped and adding the memory myself is out of the question. And after researching how to replace memory on the Mini, I wouldn't have the courage to ask anybody I know to attempt to do it after buying it. Is mixing RAM modules a good idea?
    Thanks in advance.
    Malcolm

    Nope, I am not confused, There does have generation between Mac mini model. Maybe not official, but we all know. Check About This Mac ---> More Info ---> Model Identifier : Macmini2,1 (That means, 2nd generation)
    Macmini 3,x (means 3rd generation I supposed)
    And the 3rd generation doesn't support Dual Channel, referred to Crucial.com
    http://www.crucial.com/store/listparts.aspx?model=Mac%20mini%20%28Intel%20Core%2 02%20Duo%202.0GHz%20DDR3%29%20MB463LL/A&pl=Apple&cat=RAM

  • Mixing Memory

    My z61m, type 9450-A36 has 2 512 cards. The number on them is 512 2Rx 16 PC2-5300S 555-12-A3. Can I put in a 2GB PC2-5300 667MHZ DDR2 Sdram card and one of the 512s in? Thanks Sue
    Solved!
    Go to Solution.

    you can do that, but 2 gig and 512 mb mix is not very good, you should do either 1 gig + 512 mb or 2 gig + 1 gig. 
    Regards,
    Jin Li
    May this year, be the year of 'DO'!
    I am a volunteer, and not a paid staff of Lenovo or Microsoft

  • Mixing Memory Mac Pro 2.66 Xenon

    Hello all!
    Alright I am trying to figure the best configuration that I can afford for a memory upgrade to my Mac Pro. I am looking to spend somewhere south of $200.
    I currently have the following memory configuration (3GB):
    DIMM Riser A/DIMM 1: 1 GB
    DIMM Riser A/DIMM 2: 1 GB
    DIMM Riser B/DIMM 1: 512 MB
    DIMM Riser B/DIMM 2: 512 MB
    I wanted to expand it quite a bit more and see on NewEgg that they are charging appx 65.00 for (2 x 1GB) and 80.00 for (2 x 2GB). It's definitely a better price per GB to get the 2 x 2GB but would I see a large performance increase?
    I have been reading on the message boards that it is best not to mix memory but it is suggested to fill all the slots with the same size memory.
    I guess it just kills me to take out all of my existing memory to put in just the 4GB of new memory.
    Could anyone provide any suggestions?
    Thank you for your time in advance!

    You have 3GB, which is on the lite side.
    The ideal for that model is 4 DIMMs.
    Without knowing if you are a light photoshop, or what you use it for, Apple calls 4 x 1GB for FCP (and audio apps) "symmetrical memory."
    And I would look at 4 x 2GB and pull your 3GB, maybe sell it once you know the new memory is fine after a month.
    Are you seeing page outs? multiple swap files?
    Go to folder: /var/
    Maybe you are better off with faster drives, new boot drive or for scratch. A WD 10K 150GB VelociRaptor for $180 even.

  • Mixing memory question

    I currently have 2x512MB for 1GB of Crucial Ballistix memory sticks in my system right now. I am planning to buy 2x1GB for 2GB of Corsair XMS memory and mixing it with the Crucial stuff. The memory are to be used on my main system right now which is using a MSI K8N Neo4/SLI board at 2-2-2-5 timings with a AMD 3700+ San Diego core. The Corsair XMS memory can run at 2-3-3-6 timings so I don't believe it would be much of a problem running my Crucial stuff at 2-3-3-6 as well. With this setup all 4 memory slots would be full, and I'll have 3GB worth of memory. However, I am wondering if I would run into any problems using these two memory brands together. Are there any potential problems that I should be aware of before I buy the memory?

    Find out what voltage each ram uses.
    One might use 2.6v the other might use 2.75v.
    Seeing as you cannot run each dimm at a separate voltage they should be of a similar voltage.
    Otherwise one might be getting to much
    and the other maybe too little
    Either way could cause problems

  • Mixing memory module of different sizes in G5-8 slot machine

    is there a problem with Mixing memory module of different sizes in G5-8 slot machine
    I have 2gb on four slots with 512 memory chips
    Can I upgrade my memory with 1gb chips in the remaining four slots.

    Hi epospiech-
    Yes you can.
    Instructions here: Memory (DIMMs) Replacement Instructions
    Luck-
    -DaddyPaycheck

  • Mixing RAM modules on a 800Mhz machine

    I have a new Mac Pro. 800Mhz. I want to install more memory but n find any 800Mhz 2Gb modules for sale as yet.
    I have the option of installing 667mhz modules.
    Will this cause a problem mixing 800Mhz and 667Mhz modules?

    You posted your question in the wrong forum. This forum is for pre-G3 Macs. You should repost in the Power Mac G5 forums @ http://discussions.apple.com/category.jspa?categoryID=108
    That said, this will probably answr your question.
    You can't use a processor speed lower (667Mhz) than that specified (800Mhz). Plus there are other restrictions. See *How do you upgrade the RAM in the Mac Pro? How much RAM of what type does it support?*
    @ http://www.everymac.com/systems/apple/mac_pro/faq/mac-pro-how-to-upgrade-memory- what-type-ram.html
    You can buy the 800Mhz RAM at Other World Computing @ http://eshop.macsales.com/Search/Search.cfm?Ne=5000&Ntt=MacPro+800MHz+MatchedPair&Ntk=Primary&Ns=P_Popularity%7C1&N=7318
     Cheers, Tom

  • Mixing memory modules of different sizes in a Mac Mini

    I have a MM Intel Core Duo with a 1.66GHz processor and 512 MB 667 MHz SDRAM. Model Macmini1,1, 32 Bits, SMC Version (system): 1.3f4.
    Anybody know if you can mix memory modules in it? I have the standard 256 modules (2) and would take one out and replace it with a 1 GB one. Can this be done?
    Thanks

    +Anybody know if you can mix memory modules in it? I have the standard 256 modules (2) and would take one out and replace it with a 1 GB one. Can this be done?+
    Yes, you can do this. You will get a slight performance hit on video, but that will be more than offset 99% of the time by the extra RAM reducing overloading of the Virtual Memory system.
    However, it is enough work to replace the RAM and RAM is cheap enough, that I'd recommend putting in two matched 1 Gig modules instead.

  • Follow Up...Vocal Mixing Approach

    I've been kicking around possibilities in a different thread with some very helpful people
    http://discussions.apple.com/thread.jspa?threadID=2386425&tstart=0
    Now, I'd like to implement what AT THIS POINT, I think may be my best way to approach the issue of getting my vocal mixes good.
    First, I am going to go back to using my mic the way I had in previous recordings. That is, using the large windshield that came with my SM7, that helped with a lot of plosives etc. Also, I will apply the bass roll off and NOT the presence boost. Presence boost seemed to give too harsh highs. I can EQ later if need be. Flat will be easier to start with. As far as pre tracking, this is about all i can do, since I know my recording levels and all are good, and i don't have any other equipment besides the SM7 and the DUET.
    Next, I would like to know y'alls take on "NORMALIZE". I usually have not ever normalized my vocal tracks. The last one I had issues with a lot, I actually DID normalize, So, perhaps I WON'T in the future. I'm gonna open up a meter for monitoring. Prolly the Multimeter. I'm going to go in and for the sake of time, only do some manual edits to the volume envelope for the REAL bad guys, those that stand out clearly in my ears. Maybe do a quick check for anything that is REAL quiet too, boost that a little manually. Problem is I don't know how much to boost or lower. Can I see with the meter what the overall average db is, and see if I have a loud part that hits, say -6db and the average is around -12db, so I'd just lower that part by 6db?? and vice versa for quieter parts.
    Now, the fader is controlled by the volume envelope so if I do automation I will lose control of the fader for my levels, so should I insert GAIN plug or just use an output gain on one of the inserts I'm gonna use anyways. Either way, at this point I will set the relative levels. Just a quick setting to start off with.
    Now I believe I can apply this plugin
    http://sounds.wa.com/audiounits.html
    Thanks Ericksimon!!
    Looks like a nice tool, similar to what I was looking for but not too cumbersome. I have not gotten a chance to try it out or see how to use it properly.
    So at this point, I think I should have a really steady volume level going on.
    Now I am not sure about the whole compression thing. I have come across several options. First though, do I want to do any EQing at this point??? before I add compression or after?? There are two points I would want to use EQ, one is to tame any out of control frequencies and 2 would be to shape the overall tone of the vocal. I suppose I could EQ for any bad frequencies first, then do compression and whatnot, then EQ at the end to slightly shape the sound if need be.
    Anyways, compression. The Multipressor worries me a bit. I've used it with nice results on instruments and sampled audio, but not on vocals. Also, the downward expansion looks cool. I don't usually have any problem with too much noise, but I guess that's a problem i just never knew I had!!! I just try to track with as little gain as possible while still achieving a usable recording level. Then I get increase the gain later without having a lot of noise on the recorded track. Also, the multipressor would address my Highs in my voice jumping out at times. If I could just compress the Highs and not so much the lower frequencies. That might give me better results than JUST compression the whole spectrum equally.
    The OTHER option, maybe, would be to use the DeEsser. I can compress a specific frequency range, but I don't think it has multiple bands. So, I couldn't really get any compression going on for the other bands. But I was thinking about the DeEsser in tandom with a Noise Gate instead of the Mulitpressor. This may be a little easier, but I think I might want to have a full spectrum compression, but be able to compress certain "trouble" frequencies more or less.
    So I think I should be done at this point as far as levels and all that go, perhaps if I was to use EQ to color my track a bit, but that is gonna fall in with applying REverb and Delay or whatever else I want to add flavor. WHICH IS A WHOLE nother thread. After mixing about 13 tracks in logic now, I still can't find a setting that I'm comfortable with for my voice. Every recording seems different so every time i have to do something quite different. And every time i feel like it's the first time!!!
    Anyways, how does my approach at this point look??
    Holy crap,.....I didn't realize I had written that much. My god, If anyone replies you are truly a saint.

    Bee Jay wrote:
    Next, I would like to know y'alls take on "NORMALIZE".
    Never do it. Absolutely pointless.
    I think if it doesn't hurt anything I WILL because I think it helps me when doing manual edits so that I have a point of reference that is somewhat consistent throughout multiple audio regions
    Now, the fader is controlled by the volume envelope so if I do automation I will lose control of the fader for my levels,
    This is a good point - in general, send the output of a channel to a bus/aux channel. You can now automate one, and use the fader on the other to offset the levels - doesn't really matter which, although I prefer to automate the channel fader to smooth out the signal before hitting the aux wher the compressor is.
    I am not real familiar with aux channels, I've tried using them but didn't understand the send amounts and how it was affecting the signal. If I put the send amount at 100 does 100% of the signal get passed to the fader then. So in your example, I would definitiely want to set at 100. As of now I simply used the gain control on the compressor or whatever plugin was last in the chain, I think that should not be any different in the sound....
    The Multipressor worries me a bit. I've used it with nice results on instruments and sampled audio, but not on vocals
    I wouldn't use it unless there is a definite reason to use it. At this point, you don't sound sure why you are using, and thus are unlikely to use it effectively. So don't over-complicate and use something simpler - there are plenty of good sounding compressors around, if you don't like Logic's.
    well what I did is looked at the problem frequencies that I had corrective EQ'd and made that one band,,,,from say 700-1200, then made the other two bands as 0-700 and 1200-18000 or whatever. I didn't touch the low band, but I applied compression slightly different for each one of the other bands. I think it turned out much better than I expected, but I really don't know that I needed much compression anyways......the manual automation, rider plug and EQing had the signal going to the compressor pretty good already. It's amazing how much better a compressor sounds when the signal coming in isn't pure garbage!!!
    I just try to track with as little gain as possible while still achieving a usable recording level.
    What levels do you record at?
    I believe the settings on my Duet are at about 56-58 usually when I record. This puts the input signal usually bouncing around between -24 to -12 db. I heard that was a good range and leaves lots of headroom. I use Ind. Monitoring level to crank it up so I can record at this level, otherwise it's too quiet to hear over the beat. I like to perform with lots of volume. These settings seem to work well, and NO i don't have a noise problem. Actually after alll the compression and everything was said and done. The "silent" parts between phrases or words were actually pretty much dead silent. So that seems to tell me my gainstaging is correct?
    Also, the multipressor would address my Highs in my voice jumping out at times. If I could just compress the Highs and not so much the lower frequencies. That might give me better results than JUST compression the whole spectrum equally.
    Maybe, but I still think it's overcomplicating things, although it's hard to say without knowing the recordings. if you have particular sections which are harsh, the common technique employed by the big guys is to split the vocal ("mult") into multiple channels for the appropriate parts, so you can EQ and treat the parts separately. Some producers will even go so far as to automate or mult individual syllables in a vocal phrase, although that is extreme.
    yeah, haha, It already took something like 4 hours last night to do what I did. I broke down and manually automated nearly every phrase/syllable in the song!!! Boy, that was work. But, the results were quite apparent. Even taming the out of control stuff, it gave life to the stuff that used to get kind of lost in the mix. I been reading the manual to get some easier shortcuts and stuff for editing automation, so that should cut some time a bit. Also, I'm not gonna be recording much more backing tracks I don't think. If I do, I will probably just copy the automation from the first "Lead" track to the backing track. I have gotten a little more comfortable using reverb to help fatten up my vocals.
    So I used manual automation edits. Rider Plugin. Corrective EQing. Multipressor. "Color" Eqing. And Finally SilverVerb.
    Sounded much better than before. And really I only spent about an hour or 2 more than what I had originally spent battling with plugins that couldn't correct a bad input. So good in good out and you know the rest. And like I said. I accidentally erased most of the automation I did, then saved then quit. Didn't realize I did that. Oh well. I'm learning

  • I can not Keep shuffle on. It keeps turning off and I do not want to use Genius mixes as I want a variety at all times.  How do I fix this. It did not happen with my previous ipod.

    can not keep shuffle on. i do not want to use Genises mixes as i want to listen to a variety of musicnot the same type.

    Can anyone help me

  • Compilations: Can you show just one album cover with mixes/compiations?

    Using the current iTunes (11.01) is a misery. I have numerous mix discs and compilations, and for each title eg Royksopp's BACK TO MINE mix, there are about 15 tiles of the album, one for each song. In extreme cases, there may be over 100. Since I have God knows how many songs, easily in the tens of thousands, this is an extremely inefficient way to display my collection.
    Is there any way to display albums with just the one album cover and title showing each time? THis is ridiculous.
    Thanks in advance.

    Wow!
    Is that really so?
    I'm not questioning your answer. Just want to make sure before I say OK and let it be. I had heard that iTunes/iPod forces you to do things their way, this is an example, I guess!
    Thanks for the input.
    I guess I'll just have to leave it be!
    Is iTunes the only way to deal with iPod? Are there any other programs?
    Bob

  • A late majority of the album art on my iPod Touch is mixed up.

    I put a CD in my laptop to import it to iTunes. I unplugged my iPod and all the album art in my music (all of which I had purchased on iTunes) was mixed up. Say, a Lady Gaga song still played Lady Gaga but the album art was one of my Katy Perry songs. I've tried restoring all settings but it's still messed up. I need help, please.

    You are not alone. Try:
    - Reset the iOS device. Nothing will be lost      
    Reset iOS device: Hold down the On/Off button and the Home button at the same time for at
    least ten seconds, until the Apple logo appears.
    - Unsync/delete all music and resync
    To delete all music go to Settings>General>Usage>Storage>Music>Tap edit in upper right and then tap the minus sign by All Music
    - Reset all settings                            
    Go to Settings > General > Reset and tap Reset All Settings.
    All your preferences and settings are reset. Information (such as contacts and calendars) and media (such as songs and videos) aren’t affected.
    - Restore from backup. See:                                               
    iOS: Back up and restore your iOS device with iCloud or iTunes
    - Restore to factory settings/new iOS device.                       

  • Genius Mixes Not Working- On iTunes on Windows 7- 64 bit

    I built my iTunes library from my entire collection- of over 10,000 songs (more than 64 gigabytes)- and all songs are organized through iTunes Media folder- all have the proper information required for identification, match etc. These include 90s songs, 60s songs- and the latest. All sorts of music is in there. But when I turn on Genius I get NOTHING- Nada- no genius mixes, and although genius is on, I get no Genius playlists when select any track and ask for a play list. I have gone through all the forums I could lay my hands on, and tried all the tricks there. Now, I am at a loss. I filled more than half of my iPod Classic (160G), and would love to see what the genius mixes and genius playlists look like for my collections- but I see none. Any ideas? thanks.

    Try the following steps:
    1. Go to Microsoft website to fix install and Unistall problems. Click "Run now" from Fix it to remove all iTunes & related installer files:
    http://support.microsoft.com/mats/Program_Install_and_Uninstall
    Be aware that Windows Installer CleanUp Utility will not remove the actual program from your computer. However, it will remove the installation files so that you can start the installation, upgrade, or uninstall over.
    2. You should remove all instances of iTunes and the rest of the components listed below:
    it may be necessary to remove all traces of iTunes, QuickTime, and related software components from your computer before reinstalling iTunes.
    Use the Control Panel to uninstall iTunes and related software components in the following order:
    iTunes
    QuickTime
    Apple Software Update
    Apple Mobile Device Support
    Bonjour
    Apple Application Support (iTunes 9 or later)
    Follow the instructions from Apple article listed here: http://support.apple.com/kb/HT1923 to remove all components
    3. Reboot your computer. Next, download iTunes from here:http://www.apple.com/itunes/download/ and install from scratch

  • How do I delete a toolbar that was added by a plugin? Plug-in's been uninstalled, but the toolbar is still there and any new tabs open on their search engine (even though I have Tab Mix set to open tabs on a duplicate page). Help?

    Running Firefox on Windows XP3. I installed a plugin from Savevid.com, which they now require. (I've used that site for at least a year with no problem ever.) Everything was fine but it added a toolbar to my browser, and it seems to have reset Firefox somehow so that any new tab opens on "Searchqu", some low-rent search engine. I uninstalled the plug-in altogether, but the toolbar is still there, and I can't make the reset on the search engine go away. I use Tab Mix Plus (also never had this problem before with it), but no matter what I do, the tabs will not open to anything other than searchqu. (Tab Mix has the option to open to a duplicate tab - what it was using BEFORE all this - but changing that no longer has any effect.)
    Anyone know how to deal with a problem like this?

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do NOT click the Reset button on the Safe Mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes
    You can also check for problems with the localstore.rdf file.
    *http://kb.mozillazine.org/Corrupt_localstore.rdf

Maybe you are looking for

  • Error update

    I kept getting error code 2324 when trying to update my iTunes, and now I can't even re-install it or uninstall what's there. I tried istalling the 64 bit version and the same thing happned- Any ideas? Thanks

  • Need Output in Urdu Style in Oracle Customize Application

    Dear Guys I have developed Oracle customize Payroll application in 6i with standard Language Style is English.In this application one of the employee form,which is contain employee information name,address ,location email & fax etc.But my client need

  • User are not able to attach files from sharepoint to Email (they become links)

    Hi, We have a couple of users that can't drag and drop the documents in sharepoint to outlook to send the files as attachment. Instead they become links. They are using IE 9 and 8. This happens both in the search module and from a file library.  Any

  • Where is my saved PDF file?

    I viewed a PDF fle in preview ... and then saved it in Icloud .. but now I cant find it anywhere. It's not in Iwork or on my HD anywhere that I can find. Doesnt Icloud support PDF files? (This is on a Macbook Pro) Thanks in advance ...

  • Some quesionts about message mapping

    becase I need use some pics to explain my question, so I post the question to my googlepage. <a href="http://wanghui1225.googlepages.com/xi_question_1">http://wanghui1225.googlepages.com/xi_question_1</a> Regards, Hui Message was edited by: Wang Hui