The mystery of the vanishing variables...

Hello,
I've got a bit of a problem re data that vanishes from some of my Vectors.
One class - Transfers - in its update() method, sends data in 2 Vectors to classes Tracking, and Reserve, in that order.
public class Transfers
  update()
   new Tracking(vec1, vec2);
   new Reserve( vec1, vec2);
}Class Tracking's constructor receives the 2 Vectors sent to it so:
  public Tracking(Vector vec1, Vector vec2)
   this.vec1 = vec1;
   this.vec2 = vec2;
  }Once all processing has been done in Tracking, I remove all data elements from the vectors passed to it.
Program flow then passes to the Reserve class, which receives the same 2 Vectors that were passed to the Tracking class.
But, at this stage, there is no data in vec1 or vec2 to pass to the Reserve class.
It seems to me that when the data in Tracking.vec1 and Tracking.vec2 was deleted, the same happened to the data in Transfers.vec1, and Transfers.vec2. But why? Surely, it's only a copy of the data in the Transfers Vectors that is being passed to Tracking and Reserve?
What can I do to prevent the data in the Vectors from vanishing?
Thanks,
Hasman.

The next can be an example. ArrayList is used instead of Vecter.
// import java.util.*;
public class H {
public static void main(String[] args) throws java.lang.Exception{
ArrayList list = new ArrayList();
list.add(new A(0));
list.add(new A(1));
list.add(new A(2));
/*ArrayList scopy = new ArrayList(list);// data is changed in this case if those in the original "list" are changed
((A)list.get(1)).change(100);
for(int j=0;j<scopy.size();j++){
   System.out.println(((A)scopy.get(j)).n);
ArrayList dcopy = new ArrayList(); // in this case data is not changed
for(int j=0;j<list.size();j++){
   Object a = ((A)(list.get(j))).clone();
   dcopy.add(a);
((A)list.get(2)).change(1000);
for(int j=0;j<dcopy.size();j++){
   System.out.println(((A)dcopy.get(j)).n);
}// end of class H
class A implements Cloneable{  // instances of this class will be stored in ArrayList
public int n;
  A(int i){
     this.n = i;
  public void change(int m){
     this.n = m;
  public Object clone(){
     return new A(this.n);
}

Similar Messages

  • "The Mystery of the Deck", or, "Is SAP a Nondeterministic Automaton?"

    Please note:
    1) There is a serious question embedded within this post;
    2) The post is not meant as a criticism of the subscription stack - I know what I fool I am for trying to run it under VM on a 4-year old Dell 8200 with 1G overall RAM.
    That being said ...
    Some of you low-lifes out there (Chris S?) have probably played a hand or two of Hollywood Gin (Rummy) for money stakes such as "straight half", "quarter-nickel-quarter", "world, solarsystem, universe", etc.  So you know that each hand starts with both players being dealt 10 cards, while the remaining 32 are placed between the two players in a face-down "stack" or "deck" (except for one that is placed face up next to the "deck".)
    And therefore, it is safe to conclude that at least some of you low-lifes have probably asked the same question that generations of "gin" players have asked:
    Does the order of the cards in the "deck" change after it is has been placed face-down on the table?
    Since no one knows the answer to this "for sure", and in fact, cannot know the answer to this for sure, this mystery is known as "the mystery of the deck".
    Why am I bothering to tell you this?
    Well, I've spent the last seaveral days trying to get the NW7 subscription stack to run in 750M of a VM on my old Dell 8200 with just 1 gig of RAM overall.
    And as you would expect, the WDA application DEMO_TABLE kept on timing out.
    So I set timeout and proctimeout to -1 in the startup profile and changed max_wprun_time dynamically in RZ11 and chose a simpler demo application (DEMO_SIMPLE_MAIN).
    Well, after a few minutes, the window for this app finally popped.
    But here's the funny thing.
    Since I knew everything was actually working as it should, I figured I'd try "DEMO_TABLE" one more time.
    It popped in about 30 seconds.
    So unless one of you "least-recently-used-page-gurus" knows why this happened, I will have to conclude that:
    a) SAP, or at least the NW7 subscription stack, is really a non-deterministic automaton (intentionally or unintentionally);
    b) yes, the order of the cards does change in the deck after the hand of gin has been dealt.
    djh
    Edited by: Rich Heilman on May 1, 2008 2:38 PM
    Edited by: Rich Heilman on May 2, 2008 9:44 AM

    Hey Rich -
    Yeah - that sounds reasonable - thanks very much for taking the time to mention it.
    But one puzzle - the Basis guy who was helping me out for the install says that for the regular ABAP stuff (not the WDA) stuff, the compiles "persist" across a server down/up.  Meaning that when something compiles for the first time, it doesn't have to be recompiled after a server down/up.
    Is this true for the regular stuff (non-WDA)?
    And if so, why not for the WDA as well? Why would stuff have to recompile each time the server is brought up?
    Also, the Basis guy thought it might also have something to do with SAP being smart enough not to keep swapping stuff in/out that's never used - so eventually, the amount of "thrashing" decreases and the machine gets to do some actual work.
    Glad you're not too busy with your new responsibilities to post here occasionally.
    Have your wife and kids told you yet that you gotta find a job that gets you out of the house?
    Best
    djh

  • The Mystery of the Vanishing Application

    Apologies in advance if this is a common question.  I couldn't find anything similar in searching.
    I have created a new project in FlashBuilder 4.5 and then brought over everything manually from an old FB4 project.
    No errors, no warnings, but when I launch as debug… nothing.  The page gets the right background color, and that's it.  No load bar, nothing.  Can't stop at a breakpoint because it never seems to execute the first line of code.
    The project is kind of huge, and it's proving very difficult to do the take-bits-out or slowly-build-it-up approach to find out what might be causing this.  I'm really hoping that someone has run across something similar, and that there's an easy fix.
    Thanks very much in advance.

    First, delete the preview version of your iBook in case this is causing some kind of conflict. Delete the exported version too and repeat.
    If that doesn't work, how about...
    Choose a different export option (i.e. not email). Try adding the .ibooks file (after saving to your computer) to a Dropbox account and download to your iPad from there.
    OR...
    Save the exported .ibooks with a different file name
    Let us know if any of these work for you!

  • The mystery of the disappearing apps

    Soon after Apple updated the look of the App description pages, the most bizarre thing happened. I don't know if the timing is a coincidence, but it is most mysterious: Every single one of the apps on my iPhone 3G just vanished after the first sync. The Apple-installed homepage apps were there, but none of the 60+ apps I've downloaded over the past 18 months.
    I went to the Mobile Applications folder in my Music home folder, and only a handful were there. Everything else was just gone. And the only backup available to restore from was the most recent which was the App-less backup.
    I eventually had to redownload every one of them and reconfigure my app listing.
    Does anyone have an idea what may have happened and how I might avoid this in the future??
    Thanks in advance.

    Oh, I wish I knew where the post was that told me about the 'battery trick'.
    Whereever that post is-go find it if you have this same problem.
    Sorry if that's non help.
    Cheers.
    Off to play wth 10.4.3

  • The mystery of the double headers : one overtakes the other and i dont have two headers in my code

    This is a total mystery to me and I have tried to resolve the issue for ages and I don't undestand what is going on!
    When I look at my website www.genevievegilbert.com, the top of the browser window from my index page shows me the title 'ARTISTE DES NOUVEAUX...'etc.
    When you look at the source code from the browser, the page shows ONE title, which is 'ARTISTE DES NOUVEAU...'etc
    When I download that original file from the server itself (index.htm) and open the page in Dreamweaver, it shows me a normal header with the title that I want there, named above.
    On my website I have a few links such as 'News'. When you clic on 'News', the top of the browser window from the 'news' page shows me the title
    Kfi :: Digital Media creation for your business
    Now, this is the title of my corporate website, which I DONT WANT to appear in my creative practice website.
    I have no idea why is is part of the title of the other pages in my artist's site. The reason it is a mystery that this title appears there is that when I download to my desktop the actual page (news.htm), IT DOES NOT SHOW TWO TITLES in its header, just one! I open the file in Dreamweaver and the code is written normally, with one title in the header, which contains 'ARTISTE DES NOUVEAU...'etc (which is the title i want on all of this site's pages)
    How come does the one on my server displays TWO titles in its sources code then? What is going on? This is SO strange.
    The first of the two titles in the header TAKES OVER the second one and it is this one that display when anyone visits the site.
    I tested it on explorer, Opera, Safari and Firefox: all the same.
    I have created this site with templates and I gave up on using the template system when updating my pages as I don't quite fully understand the power of this system. Would that possibly have to do with my problem? How can I solve that problem?
    I am applying for grants and I can't have my creative website talking about me wanting to do business! HELP!
    Thanks, Geneviève

    Would it be a matter of 'CLOAKING' my files?
    I found this on the Powweb forums:
    PowWeb Community Forums > The PowWeb Platform > Domain Names / DNS > How to make subdirectorys visible?
    PDA
    View Full Version : How to make subdirectorys visible?
    Kommercial
    2-12-02, 05:35 AM
    Hello,
    I want my visitors to be able to see the full directory they are in, in  the address bar like, ie; http://microsoft.com/whatever/faq.html
    (for example)
    As it is currently, they see http://microsoft.com  (for example) no  matter where they go on my site, it never changes. I can type out  http://microsoft.com/whatever/  in the adress bar and it will then  display that page and show http://microsoft.com/whatever/ at the top,  but once i click on anything to go to another page on my site, it  doesn't change to show the new directory ,  I want it to change as  people move thru my site. Seems almost like a URL cloaking feature is  turned on, like the ones offered on other domain hosts.
    IS this even the right section of the forumn to post this message? Figured it must be "domain name" related.
    is this some feature not offered by powweb?
    Or is there some simple button to hit in the OPS console?
    (btw- i only have one domain name. And my site is all hosted on powweb)
    can someone please help
    thanks
    Dragon
    2-12-02, 07:02 AM
    having  the address not change is most often due to frames ... if you want it  to change just get rid of the frames and you should be fine.
    VBman
    2-12-02, 10:22 AM
    Yes,  its must be frames that you are using, because my addresses are not  'cloaked' as you described, but rather it shows the current location of  each page I go to.
    SBGlasby
    2-18-02, 09:03 PM
    Yes....  THIS IS... one of the many drawbacks of using frames...  otherwise the  Full URL...  of the page... shows in the address bar...

  • The mystery of the invisible files... that are there...

    OK, so I have a drive connected to my airport, and I'm using it for my itunes library... simple enough... but recently i went poking about in the itunes music folder and many many many many of the folders that itunes is reading music from simply do not appear in the finder.
    That is to say.
    Part 1.
    If i control click a track in itunes and read the file path, and try to browse to that file path... nothing is there. The track still plays if i click it in itunes, so itunes can 'get to it' even though I can not.
    I have tried this from about 4 different machines in my house... same result, mysterious invisible folders.
    Part 2.
    If I disconnect the drive from the airport and plug it directly into my computer via usb, the folders are all visible. So it appears to be an issue with the airport and not itunes...
    The drive is a 500 gB G-Drive mini...
    We are running OSX 10.5 (even on my Ti Book, huzzah!)
    Everything else is splendid, but this is driving me batty.

    " simply do not appear in the finder." are you using afp to mount that G Drive before launching itunes?
    secondly do you have itunes preference checked to copy files to your hard drive?

  • The Mystery of the Duplicating Photos with Varying resolutions and Sizes by Sony Z1 Compact

    about the duplicating photos with varying resolutions and Sizes problem... I have a band-aid fix to this without deleting everything in your  phone. What you do is to find time to actually MANUALLY DELETE the extra photos. Don't delete it by Taping on the Album app and deleting everything on the home photos.
    Instead tap the album then on the UPPER LEFT CORNER (If you've updated the albums) tap the 3 bars beside the album icon to access the album menu, then tap the FOLDERS choice.
    You should see alot of folders with Thumbnails named with numbers and different resolutions. Delete all the folders labeled as Thumbnails or cache. *note that you cannot delete whole folders but the folder gets deleted automatically after all the contents inside it is deleted
    Afterwards, go to your phone's settings->App-> Album
    Then tap the Clear Data button
    After that restart your phone.
    This actually "fixes" the problem for a while but usually after a few restarts or Phone charge the folders comeback and you have to redo the whole process again. But the folders that are made becomes fewer than the 1st occurrence of this problem and deleting the photos shouldn't take as long as the 1st.
    Honestly i think this is definitely an Application bug and should be fixed by Sony, since you know its their built in app for Multimedia

    yea that also helps since it's a bug caused by the new update. I'm just waiting for Sony to fix the bug, i don't really mind deleting the thumbnails

  • More about the mystery of the disappearing dock

    addendum: the dock is below the screen. when I click at the bottom of the screen it pops up, but does not stay. ???????????????????

    Go to Dock in System Preferences. Uncheck auto hide.

  • The Mystery of the Missing Files.

    Hi all!
    I have just encountered one of the most peculiar events while running Tiger on my newly-purchased Powerbook G4. After "settling in" a little (changing settings, transporting documents and music, etc.) I had it running perfectly.
    Last night, I was working on a word document. I saved it, and shut the computer down.
    Just this morning, I booted it up... and to my horror, my dock settings had changed (there were question marks all over it, magnification had been turned off), and all of my documents and music files were nowhere to be seen!
    To be fair, I did do the following things the night before:
    Ran maintenance manually via the Terminal ("sudo periodic daily weekly monthly")
    Attempted to uninstall APE Application Enhancer (didn't seem to uninstall correctly)
    Would any of these things have caused the trouble?
    Thanks for any help you're able to offer. I have lost at least twenty important documents.

    Yes! Yes! Thankyou very much! I completely forgot that I renamed the home directory last night (tried to change it to my name... quite naive!)
    I ran into this same problem with linux about a year ago. I've learned this time around.
    Thanks again.

  • The Mystery of the Mysterious Unsyncable iPod Mystery

    So I have a problem which I have yet to find mentioned anywhere else.
    My fiance gave me her iPod Touch 4 (iOS 4.2, not jailbroken) when it refused to sync with her computer or take a charge. I investigatd the matter, and discovered that the device would accept a charge, but would not make the usual noise upon receiving the charge, nor would it show up in itunes (the latest version at that time). Neither the iPod nor the computer seemed to know the other was there.
    So I attempted a software reset on the device (after several attempts at correcting the problem through DFU), and now the iPod needs to connect to iTunes before I can do anything with it (It makes for a sharp looking paperweight right now). It won't sync with iTunes like it wants to, and it still recieves a charge without realizing it.
    So the question is this: what happened to it, and how do I fix it? And also, has anyone else had this problem?

    Here:
    iOS: Device not recognized in iTunes for Windows
    or
    iPhone, iPad, iPod touch: Device not recognized in iTunes for Mac OS X

  • The mystery of the zen sto

    ?Am I the only one searching all over the internet and finding the cupboards bare? I have been looking for a pink zen stone for the missus and a blue one for myself and coming up empty. Are they even available? Creative doesn't seem to even have them on their shopping site for the US. Target seems to have some coming and some sites say sold out or 6-8 weeks. Can they be gone already or did they just roll out the majority in black and white? Please some help, my creative people.

    Hello Jacob,
    I suspect this is already a screen issue. The screen of the ZEN V plus is OLED. OLED's have shorter life spans compared to LCD's. Normally, you will be seeing early signs that the screen is about to give up like screen discoloration, lines on screen or dimming. Eventually, the screen will completely go "blank" (such as your case).

  • The Mystery of the Missing Source-Button?

    Just a minor puzzle to my tired brain.
    Last night, after fiddling around with the Voice-Over Tool, I noticed that there was only ONE Audio Source Button instead of the usual two.
    I did some further fiddling around but was unable to make the disappearing button re-appear.
    This morning, on firing-up FCE HD, it was discovered that the absentee button had returned home safely.
    I have done a few tests to try to make it disappear again but it stubbornly refuses to go. (I can't be certain, but I think I did shutdown and restart FCE last night in a vain attempt to make it re-appear).
    So can anyone explain why or where it went overnight?
    Ian.

    Ian
    The VO only uses one audio track. If you open the VO audio into the Viewer you only have one Tab there called Mono(a1). In the Timeline Audio Track should appear only one button called a1. It's different to A1. A1 is the track number or Destination while a1 is the Source. Double click a stereo pair in the Timeline and the other a2 should appear because it has two audio tracks.
    Al

  • The mystery of the disappearing text headers

    I've run into a peculiar problem with a Flash subpage
    (several of them actually).
    On all of the following pages the header text for the
    garments shown (the bold text on the top left with the drop-shadow)
    will have sections cut off the end or the beginning as if there
    were a transparency layer issue. The problem is intermittent and
    only happens when you click on the icons at the top in a certain
    order. It almost seems arbitrary and random.
    The files are at:
    http://www.flagsgolf.com/cgsflash.html
    http://www.flagsgolf.com/mockflash.html
    http://www.flagsgolf.com/ls_trous.html
    I have moved all of the text in question onto the top layer
    of the master file and this anomaly does not show up when testing
    the file in Flash itself. Please let me know if anyone can think of
    an obvious solution.
    Andy

    Oh, I wish I knew where the post was that told me about the 'battery trick'.
    Whereever that post is-go find it if you have this same problem.
    Sorry if that's non help.
    Cheers.
    Off to play wth 10.4.3

  • The Mystery of The Disappearing Bluetooth

    Not a huge concern as I just read a posting on how to fix this isue, however I am curious to find out the cause of this problem and not just a fix.
    The Bluetooth on my PB has dissapeared 2 times. Wavy live through the icon in the menu and no indication of a Pref Pane in Sys Prefs. Not sure how it was fixed the first time- this time the fix was done by shutting down and removing the battery.
    Any of you pros have any idea why this happens?
    Looking for the Zen/ Eastern way of looking at this problem and not simply the Western - "Just give it some pills and make it feel better" technique.

    Oh, I wish I knew where the post was that told me about the 'battery trick'.
    Whereever that post is-go find it if you have this same problem.
    Sorry if that's non help.
    Cheers.
    Off to play wth 10.4.3

  • The Mystery of the Vanishing Transport Controls

    I have a bit of a conundrum.  When I open a file in Audition 1.0, the top five transport controls are greyed out.  If I reinstall the program, miraculously they become available.  Is there any way to keep them available without the reinstallation?  I should note that this is a fairly recent development, I've been using the program on and off since I got it with no problem.  Any ideas?

    You haven't said, but almost certainly you will be using Audition 1 on an operating system that it wasn't designed for, so all bets are definitely off.

Maybe you are looking for

  • Como alterar o idioma do Thunderbird?

    Depois de fazer a atualização do Thunderbird para a 31.2.0, verifiquei que alguns itens do Thunderbird ficaram em Inglês, gostaria de saber como fazer ficar todo em Português.

  • Can't install driver for HP P1006 LaserJet under Windows 8.1 64 bit

    Hi, I can not install the driver for HP P1006 LaserJet under Windows 8.1 64 bit. I download the driver installation program from the HP website. When I run it, it says reinstalling the driver files, then copying files to the hard drive and then it cr

  • To change the receiver port name

    Hi , I am doing  a File to IDOC scenario. We have a requirement to post IDOC flat file to the IDOC in SAP system through PI. We have Partner Number in control record which we receive in the flat file and that has to be sent to the SAP system which we

  • Is this type of query possible (select with rows stopping based on match)

    I'm trying to write a SQL query and suspect it can't be done. Or at least, I can't mentally grasp it, despite various stabs with subqueries. I've simplified it by changing the metaphor here a little. Let's say I have a truck in some city (say, Chicag

  • YouTube Subscriptions aren't loading!

    YouTube Subscriptions aren't loading in the built-in app for awhile already, even on my iPhone. What's wrong?