Writing in INF file  Problem!

Hi
I've successfully read from INF file by the following code :
    public String Read_INI(String Path , String Attribute)
        Properties p = new Properties();
        try
            p.load(new FileInputStream(Path));
        catch (Exception e)
                System.out.println(e);
        return p.getProperty(Attribute);
    }Now I'm facing a problem in writing in INF file
i used this code but it doesn't work!
    public void Write_INI(String Value, String Attribute, String Path)
        Properties p = new Properties();
        try
               p.load(new FileInputStream(Path));
               p.setProperty(Attribute, Value);
        catch (Exception e)
                System.out.println(e);
    }any ideas ?

thnx very much :)
just i added :
               p.store(new FileOutputStream(Path), Value);after :
     p.setProperty(Attribute, Value);

Similar Messages

  • URGENT : Writing to UNIX file problem !

    Hi friends,
    I am stuck at a crucial point while uploading a UNIX file from ABAP program.
    I am using open dataset & then transfer to...the file path.
    But when I go and check the UNIX file it is split into 2 lines (it is supposed to be a
    record with 1 line with 1500 characters) ! It shows a maximum of 255 chars in one line.Moreover,while I download to a text file via Txn CG3Y,some data are missing or truncated etc.
    Please suggest how can I create a record with 1500 characters in UNIX and download it successfully with full data or how can I ensure proper data has been transferred as the record display is truncated.I checked the program its fine,only after transferring I get the problem.
    Thanks,
    Sandip.

    The files would not get truncated. The file actually exists in App. server but you will be able to see only uptil 255 characters. You can check the same by downloading it onto Pres. server by specifying  file type as BIN when you are downloading through CG3Y

  • Writing XML to file problem

    I have the following code, worked just fine in JRE 1.4.2 but when I try to run it on a JRE 1.5 runtime it does not.
    Code:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    DocumentBuilder documentBuilder = factory.newDocumentBuilder();
    Document document = documentBuilder.newDocument();
    Element configNode = document.createElement("config");
    configNode.setAttribute("name", "something");
    document.appendChild(configNode);
    code to write the document to a file.
    In JRE 1.5 the XML file that is written to the file looks like this:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    [config: null]
    In JRE 1.4.2 the XML file that is written to the file looks like this:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <config name="something">
    </config>
    In JRE 1.5, after document.appendChild(configNode); I can do document.getDocumentElement(); and it returns the [config: null].
    What has changed in 1.5 that breaks creating XML documents? And what is the new correct way to do it?
    Any help would be greatly appreciated.

    Hmm, ok. We were doing the following to write out the file:
    BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
                                                new FileOutputStream(configFile)));
             out.write(headerString); // headerString being <?xml version="1.0" encoding="ISO-8859-1" ?>
             out.newLine();
             out.newLine();
             out.write(document.getDocumentElement().toString());
             out.flush();
             out.close();And before document.getDocumentElement returned the XML so we were able to just write it out, but in 1.5 it was returning the [config: null] thing.

  • Problem in writing to the file

    I use this labview code to read and save some electrical measurement data from a set of instruments. I am having a problem that the code stops writing to the file after a while. It stops responding too. The only way to stop it then is to use the task manager and kill it. The code was written for an older version of labview but now I am using labview 9. Everything else seems updated but there's a section that uses Write characters to file vi and that may be causing the problem. I made a few futile attempts to change it. I would highly appreciate if someone takes a look at it and could tell me what's going wrong.
    Attachments:
    JANUS 2.2_4K Probe edit (2).vi ‏60 KB

    I will second aeastet's advice - please look into how state machines and producer/consumer loops work and use them.  Your program is very inefficient, but is very similar to what I would have written before I learned about state machines and producer/consumer loops.  Start with the LabVIEW help and go from there.  These forums and the National Instruments website can give you lots of help.
    Two things that will help you for this particular problem:
    At every loop iteration, you are opening the file, seeking to the end of it, appending data, then closing the file.  This is very slow and the code you use, as mentioned above, will not work if the file size exceeds 2GBytes.  I would recommend you open the file once, then use the write primitive to write to it until you finish, then close it.  You do not need the write character to file VI.  No seeking.  No repetitive opening and closing.  You can either open and close outside the loop, or use case structures and boolean flags (as you have done for other things) to open and close inside the loop.
    After you write to the file, if you choose to graph, you are reopening the file, reading the entire thing, and plotting this data.  This is another major slowdown that will only get worse as your file gets bigger.  You would be far better off caching the data in a shift register and plotting it on demand.  It would probably take less memory, as well.  You may want to read the tutorial Managing Large Data Sets in LabVIEW.
    One last tip.  You use Value properties to read and set the values of front panel controls.  Local variables are far faster (about three orders of magnitude).  However, do not make the mistake of using local variables for data storage.  Data is wires.  Local variables are a way to communicate to the front panel.  You seem to have this down, but a reminder to others reading this thread is in order.
    Let us know if you need more explanation or help.  Good luck!
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • Error writing to temporary file location. If this problem persists contact customer support. (-70)

    I've been trying to update/install Creative Cloud applications via Adobe Application Manager and no matter which application I try to install I receive this error: "Error writing to temporary file location. If this problem persists contact customer support. (-70)"
    Prior to this I was having trouble running updates to an application, and it told me I needed "Administrative Privleges" to do so. I have tried everything I can think of with the assistance of the Apple Store. Can anyone at Adobe help me?

    You do not have the permission on the TMP folder for write because of which you are facing the issue.
    Tmp folder is hidden on the Mac hence you have to unhide it first to check the permission and getting it corrected.
    I would recommend you to check the install/update from
    1) New user account
    2) Run the Disk repair utitlity
    if these steps doesn't help then contact support to get the permission corrected.

  • Problem writing to a file on a shared drive

    I am having problems with my application not writing to a file on a shared drive. Actually it works perfect on one computer, but not on any other computer. Any ideas on why this would not work. Here is my code below, I think this may be an issue with permissions on the shared drive but have played with those until I am sick of it and nothing works. Any help on getting it to write to a file on a shared drive would be great.
    report2 = new JButton("Provider Order Entry");
                        report2.addActionListener(new ActionListener() {
                             public void actionPerformed (ActionEvent e) {
                                  if (e.getSource() == report2) {
                                       try {
                                            File file = new File("z:\\Provider Order Entry Reports\\ACCESSFILE.RMD");
                                            FileReader checkAccess = new FileReader(file);
                                            BufferedReader checkAccessBuff = new BufferedReader(checkAccess);
                                            boolean eof = false;
                                            while (!eof) {
                                                 String line = checkAccessBuff.readLine();
                                                 if (line != null) {
                                                      eof = true;
                                                      checkAccess.close();
                                                      checkAccessBuff.close();
                                                      if (!poeSelectionWindow.isShowing()) {
                                                           poeSelectionWindow.setSize(575, 200);
                                                           poeSelectionWindow.setBackground(blue);
                                                           JFrame.setDefaultLookAndFeelDecorated(false);
                                                           poeSelectionWindow.setVisible(true);
                                                      else if (poeSelectionWindow.isShowing()) {
                                                           poeSelectionWindow.setVisible(false);
                                       catch (IOException error) {
                                            Component controllingFrame = null;
                                            JOptionPane.showMessageDialog(controllingFrame,
                                                       "YOU DO NOT HAVE ACCESS TO THIS OPTION" + "\n" +
                                                       "PLEASE CONTACT IRM SUPPORT TO REQUEST ACCESS ",
                                                       "ACCESS DENIED",
                                                       JOptionPane.ERROR_MESSAGE);
                                            try {
                                                 File errorFile = new File("Z:\\LOG\\LOGGER.log");
                                                 String username = System.getProperty("user.name");
                                                 InetAddress addr = InetAddress.getLocalHost();
                                                 Date date = new Date();
                                                 BufferedWriter bw = new BufferedWriter(new FileWriter(errorFile, true));
                                               bw.write("ACCESS ATTEMPTED ON: Provider Order Entry Report BY:" + username + " At Workstation/IP: "
                                                         + addr + " " + date);
                                               bw.newLine();
                                               bw.flush();
                                               bw.close();
                                            catch (IOException error1) {
                                                 System.out.println("Error-- " + error1.toString());
                                            catch (NullPointerException NPE) {
                                                 System.out.println("Error -- " + NPE.toString());                                                       
                                       catch (NullPointerException NPE) {
                                            System.out.println("Error -- " + NPE.toString());                                                       
                        });

    So how do I stop the
    NPE from occurring.By not dereferencing a null reference.
    Thingamabob xyz = doSomethingWhichMightReturnNull();
    if (xyz != null)
    // go ahead and use xyz here
    If you leave out the above "if" statement check, and just willy-nilly try to use xyz when it is null, you'll get the NPE.
    It is occurring on the file
    name. I have never been able to stop the file name
    from throwing a NPE.I don't know how that translates to some lines of your code.

  • Problem writing a segmented file to a a socket

    I have something like this:
    temp.out.writeObject("sot");
    temp.out.flush();
    temp.out.writeObject(fileName);
    temp.out.flush();
    for (int j=0;j<size;j=j+256){
                   byte[] temporary = new byte[256];
                   f.read(temporary,j,256);
                   System.out.println("J este " + j);
                   temp.out.writeObject(String.valueOf(j));
                   temp.out.flush();
                   temp.out.writeObject(temporary);
              temp.out.flush();
    temp.out.writeObject("-3");
         temp.out.flush();
    The problem is that it writes ok the "sot", it's writing ok the file name, and the first 256 bytes.
    After that the for stops at j=0. I don't get it ..

    sorry, I'm not really any good at reading other peoples code, but if it does what I think it does, here is how I do it
    int iHaveRead = 1;
              while(iHaveRead > 0){
              try {
    InBuffer = new byte[4096] ;
    iHaveRead = Sinput2.read(InBuffer, 0, 4096) ;
              } catch(IOException e) {
              System.out.println("Error on Input " + e) ;
              iHaveRead = -1 ;
              if(iHaveRead != -1){
              iToWrite = ProcData(iHaveRead) ;
              // write to Soutput
              try {
              Soutput.write(OutBuffer, 0, iToWrite) ;
    Soutput.flush() ;
    } catch(IOException e) {
              System.out.println("Error on Output " + e) ;
    iHaveRead = -1 ;
    where procData turns inbuffer to outbuffer and returns the size

  • Writing defaults to inf file

    I want to programatically change some default control values. Searching the forums tells me that the invoke node won't handle changing defaults on a running vi. It looks like using an .inf file will be the best method. I've used this before for storing some path information.
    The examples available for writing and reading to .inf shows string, number and boolean.  My question is though, how do I store and retrieve the values in the control, attached (LV8.0)? Particularly the Trigger slope and trigger source controls.
    ~~~~~~~~~~~~~~~~~~~~
    Paul Johnson
    Renco Encoders, Inc
    Goleta, CA
    ~~~~~~~~~~~~~~~~~~~~
    Attachments:
    Aquisistion Control LV8.0.ctl ‏13 KB

    Its another "Never Mind". I figured it out.
    ~~~~~~~~~~~~~~~~~~~~
    Paul Johnson
    Renco Encoders, Inc
    Goleta, CA
    ~~~~~~~~~~~~~~~~~~~~

  • Has anyone ever had a problem with their iphone 4 not syncing and/or writing a backup file?

    Has anyone ever had a problem with their iphone 4 not syncing and/or writing a backup file?  Itunes locks up when i attempt a sync as well as when I transfer my purchases from my phone to Itunes. I'm running Itunes 10.4.1 on iOS 4.3.5.  All of this is running on an 8 year old hp pavillian laptop running XP Pro that is fully updated. Could my phone have a bug or a hardware problem. Are there any known problems with  iOS 4.3.5?  Pretty frustrating problem so I'm hoping that someone has heard of this and can offer some suggestions on a solution.  Thanks a bunch.

    Did you used to have service and now suddenly you don't?
    This happened to me a few years back, and several other iPhone users in my neighborhood, and after a while on the phone with AT&T they figured out that a technician had recently adjusted the receiver/sender on the tower and it was slightly off. They sent them back up and I actually had a better signal after than I did before it went out.
    I would call AT&T and explain the issue you are having and see if they can fix it.
    If you never had service there then like wjosten said it's probably just a bad zone.
    Hope you get it sussed out.
    -PM

  • Problem writing object to file

    Hi everyone,
    I am creating an index by processing text files. No of files are 15000 and index is a B+ Tree. when all files processed and i tried to write it to the file it gives me these errors.
    15000 files processed.
    writing to disk...
    Exception in thread "main" java.lang.StackOverflowError
            at sun.misc.SoftCache.processQueue(SoftCache.java:153)
            at sun.misc.SoftCache.get(SoftCache.java:269)
            at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:244)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1029)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
            at java.util.Vector.writeObject(Vector.java:1018)
            at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            at java.io.ObjectOutputStream.writeArray(ObjectOutputStream.java:1245)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1069)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:380)
            at java.util.Vector.writeObject(Vector.java:1018)
            at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:890)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1333)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
            at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1341)
            at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1284)
            at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1073)
            at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1369)
    ..........can anyone point out the mistake im doing?
    thanks

    the B+ Tree is balanced and is perfectly working without writing to the file. and i am using default writeObject() method of ObjectOutputStream.
      try {
                                FileOutputStream   f_out   = new   FileOutputStream ("tree.idx");
                                ObjectOutputStream obj_out = new   ObjectOutputStream (new BufferedOutputStream (f_out));   
         for (int x = 0, l = files.length; x < l; x++) {
              ProcessTree(files[x].toString());
                    System.out.println("Writing main index to the disk...");
                    obj_out.writeObject (tree); 
                    obj_out.flush();
                    obj_out.close();
                    } catch (Exception e)
          System.out.println (e.toString ());
          System.out.println("Error Writing to Disk!");
        }

  • Error in Windows 8 default Broadcom netb57vx.inf file?

    Hello all,
    We are trying and failing to install Windows 8 32bit enterprise on some older machines that use a Broadcom b5786 NIC. Hardware Id PCI\VEN_14e4&DEV_169A&SUBSYS_101f17AA. We can install Windows 8 from a USB stick and Windows
    finds the NIC and tries to load the default driver which fails with the error "A service installation section in this inf is invalid".
    I can manually load the Windows XP version of the driver ok and this would be ok except that the Windows 8 boot.wim file has the same problem (same files) and I am unable to get the XP driver to load which means we cannot use WDS for
    deployment and support.
    I have tried removing the offending file(s) from the boot.wim file and installing the XP version of the driver which gets me closer but when booting it is unable to locate the dhcp server.
    Any help would be much appreciated.
    Many thanks in advance.
    Regards
    Graeme

    I think I've got it. There was no file copy command in the section of the inf below. The drivers downloaded from Broadcom and the netb57vx.inf file were missing the CopyFiles line in:
    [BCM5787A1eStar_LHinst.NTx86.6.1]
    Characteristics = 0x84 ; NCF_HAS_UI | NCF_PHYSICAL
    AddReg          = LH_AddReg, Intr_coal, BCM5750.Params, ParamsNt, ParamsNT8021p, ParamsNtW9x, ParamsC, ParamsWOLeStar, ParamsWireSpeed, ParamsLgSnd, ParamsPM
    CopyFiles       = CopyFile_Binary
    BusType         = 5
    *IfType         = 6             ; IF_TYPE_ETHERNET_CSMACD
    *MediaType      = 0             ; NdisMedium802_3
    *PhysicalMediaType = 0          ; NdisPhysicalMediumUnspecified
    AddReg = ParamsNtv6Tx, ParamsGSOv4
    Adding the CopyFies line so the section looked like above got the later drivers to install in Windows 8 but didn't work in the boot.wim file as the driver files are in a different place. I updated the netb57vx.inf file in the Windows\inf directory
    but maybe should have updated the one in windows\system32\driverstore\filerepository. I mounted the boot.wim file and copied the driver files (b57nd60x.sys & b57nd60x.cat) into the Windows\System32\drivers folder , committed the changes and
    got network connectivity with WDS and PXE.
    Hope this helps others.
    Regards
    Graeme

  • File problem in linux OS.

    hi,
    I am creating one jar file . In my program, when I click one survey menu in my GUI,it will collect information from remote device and store it in log file located LOG folder. In my case, I put one folder " Cal" and inside it I put myjar.jar file and that log (LOG) folder.
    In Windows, when I click survey menu in GUI, the log information automatically stored in log foder as survey.txt file. And also, i create one show dialog box to show where the log file located.
    my code is,
    String  ss=new String(" HIllo"+"loginfo" );           
                     byte b[]=ss.getBytes ();
                           OutputStream f0=new FileOutputStream               ("LOG/survey.log",true);
                           f0.write(b);
                           f0.flush();                      
                           f0.close ();    the above code is file writing in txt file.
    for display dialog box,
    if(source==Survey)
                    File file = new File("LOG/Survey.log");                      
                    file = file.getAbsoluteFile(); 
                    javax.swing.JOptionPane.showMessageDialog(MainFrame, "The LOG FILE is stored at -- \t \t"+file);
                 }In windows, where can i install that Cal folder (inside it JAR file and LOG folder), and click that jar , all are working fine. The log file stored correctly inLOG folder and dialog box show the located path.
    eg. log file stored at D:/sbk/Cal/LOG/survey.log
    But my problem in linux.
    when i click survey menu, it will defaultly stored in root folder and log folder. Actually i am not creating LOG folder in root folder.
    I am changing file writer as , to store that JAR folder and want to store that log file in home directory.
    if(no_of_ssid!=null){
                    String  ss=new String(""HIllo"+"loginfo\n" );          May
                     byte b[]=ss.getBytes ();
                           OutputStream f0=new FileOutputStream ("/home/Cal/LOG/Survey.log",true);
                           f0.write(b);
                           f0.flush();                      
                           f0.close ();    but, now also that file stored in rot directory.
    what can I do.
    how can I store log file in home/Cal/Log folder in Linux.
    any one help this problem

    Use System get prop user.home?

  • I can't open an autorun.inf file on my macbook, what should I do?

    I have a problem because I want to open a CD that has autorun.inf documents on it. It is actually a CD that has drivers lisence tests on it and it is definitely not just written text. I read on the Internet that it can only be opened on Windows. Please tell me this is not true since this is the only computer I own. Thanks in advance

    Definitely Windows only  >  http://en.wikipedia.org/wiki/Autorun.inf
    Mac OS X cannot read an .inf file.

  • Can't get Printer to Share need INF file

    I have a HP 6500 E709n All in One Printer and I cannot get it to share. I have it connected to my Computer running Win 7 and I want to share the Printer with my Laptop running Vista. I cannot set it up to share,  I get 2 error messages all the time the one is:
    The file "INF" on (Unknown) is needed   I cannot find the INF file and can't download it. The other error messages I get is:
    The Print Spooler has stopped working and was closed  or the other error message is:  Spooler Subsystem APP stopped working and was closed.
    When I check the Print Spooler In Services it is on Started and on Auto, how do I get rid of these error messages that appear all the time and get my Printer to share to my Laptop? As a point of information the Printer is set up correctly to share.

    Make and model number of modem?
    Make and model number of router?
    Computers connected via wire or wireless?
    OS of computers?
    Please detail all steps you have done to troubleshoot the issue. 
    Say thanks by clicking the Kudos Thumbs Up to the right in the post.
    If my post resolved your problem, please mark it as an Accepted Solution ...
    I worked for HP but now I'm retired!

  • Writing output to file does not work

    Hello All,
    I have a problem with writing to a file created on the command prompt:
    1) my base class is called TestRandom2
    2) I have a method called run which runs the print method
    3) I passed a reference of the run method into the main below, I don't know if I'm doing it correctly but the error message I'm getting "cannot resolve variable symbol : variable String
    location: class TestRandom2 return String;"
    4)When I declare the method run as void it's also giving an error.
    5)I would to fix this proble to write my output to a .xls file. Can someone help me as soon as possible please!!!!
    public static void main(String[] args) throws Exception {
         TestRandom2 testrandom = new TestRandom2();
              byte b[] = new String(testrandom.run()).getBytes();
              OutputStream o = new FileOutputStream(args[0]);
              o.write(b);
              o.close();
         }

    this is my entire file, I want to be able to call the run method in main and have the file out put to an xls file can some one help me please
    Code ------
    import java.io.*;
    public class TestRandom2{
         Deck deck = new Deck();
         public TestRandom2(){
              deck.populate();
         public void run(String file){
                   if(file.equals("") || file==null)
                   throws IOException {
                   FileOutputStream output=new FileOutputStream(file);
                   for(int i=0; i<5; i++){
                   deck.shuffle();
                   deck.print();
                   output.close;
         class Deck{
              public void populate(){
                   System.out.println("populating deck!");
                   cards=new Integer[52];
                   for(int i=0;i<52;i++){
                        cards= new Integer(i+1);
         public void shuffle(){
              System.out.println("Shuffling deck!");
              rnd.setSeed(randomseed.getSeed());
              java.util.List list = java.util.Arrays.asList(cards);
              java.util.Collections.shuffle(list,rnd);
              cards = (Integer[])list.toArray(new Integer[0]);
         public void print(){
              System.out.println("populating deck!");
              for(int i=0;i<cards.length;i++){
                   System.out.print("P:"+(i+1));
                   System.out.print("C:"+cards[i].intValue());
              Integer[] cards = null;
              RandomSeed randomseed = new RandomSeed();
              java.util.Random rnd = new java.util.Random();
              class RandomSeed {
         private long[] seeds = new long[] {
              9876, 54321,
              1299961164, 253987020,
              669708517, 2079157264,
              190904760, 417696270,
              1289741558, 1376336092,
              1803730167, 324952955,
              489854550, 582847132,
              1348037628, 1661577989,     
              350557787, 1155446919,          
              591502945, 634133404,
              1901084678, 862916278,     
              1988640932, 1785523494,     
              1873836227, 508007031,          
              1146416592, 967585720,
              1837193353, 1522927634,
              38219936, 921609208,
              349152748, 112892610,          
              744459040, 1735807920,
              1983990104, 728277902,
              309164507, 2126677523,
              362993787, 1897782044,
              556776976, 462072869,
              1584900822, 2019394912,
              1249892722, 791083656,          
              1686600998, 1983731097,
              1127381380, 198976625,
              1999420861, 1810452455,
              1972906041, 664182577,          
              84636481, 1291886301,
              1186362995, 954388413,
              2141621785, 61738584,
              1969581251, 1557880415,          
              1150606439, 136325185,
              95187861, 1592224108,
              940517655, 1629971798,
              215350428, 922659102,     
              786161212, 1121345074,
              1450830056, 1922787776,
              1696578057, 2025150487,
              1803414346, 1851324780,          
              1017898585, 1452594263,
              1184497978, 82122239,
              633338765, 1829684974,
              430889421, 230039326,          
              492544653, 76320266,
              389386975, 1314148944,
              1720322786, 709120323,
              1868768216, 1992898523,          
              443210610, 811117710,
              1191938868, 1548484733,
              616890172, 159787986,
              935835339, 1231440405,     
              1058009367, 1527613300,
              1463148129, 1970575097,
              1795336935, 434768675,
              274019517, 605098487,          
              483689317, 217146977,
              2070804364, 340596558,
              930226308, 1602100969,
              989324440, 801809442,          
              410606853, 1893139948,
              1583588576, 1219225407,
              2102034391, 1394921405,
              2005037790, 2031006861,          
              1244218766, 923231061,
              49312790, 775496649,
              721012176, 321339902,
              1719909107, 1865748178,          
              1156177430, 1257110891,
              307561322, 1918244397,
              906041433, 360476981,
              1591375755, 268492659,          
              461522398, 227343256,
              2145930725, 2020665454,
              1938419274, 1331283701,     
              174405412, 524140103,          
              494343653, 18063908,
              1025534808, 181709577,
              2048959776, 1913665637,
              950636517, 794796256,          
              1828843197, 1335757744,
              211109723, 983900607,
              825474095, 1046009991,
              374915657, 381856628,          
              1241296328, 698149463,
              1260624655, 1024538273,
              900676210, 1628865823,
              697951025, 500570753,          
              1007920268, 1708398558,
              264596520, 624727803,
              1977924811, 674673241,
              1440257718, 271184151,          
              1928778847, 993535203,
              1307807366, 1801502463,
              1498732610, 300876954,
              1617712402, 1574250679,          
              1261800762, 1556667280,
              949929273, 560721070,
              1766170474, 1953522912,
              1849939248, 19435166,          
              887262858, 1219627824,
              483086133, 603728993,
              1330541052, 1582596025,
              1850591475, 723593133,          
              1431775678, 1558439000,
              922493739, 1356554404,
              1058517206, 948567762,
              709067283, 1350890215,          
              1044787723, 2144304941,
              999707003, 513837520,
              2140038663, 1850568788,
              1803100150, 127574047,          
              867445693, 1149173981,
              408583729, 914837991,
              1166715497, 602315845,
              430738528, 1743308384,          
              1388022681, 1760110496,
              1664028066, 654300326,
              1767741172, 1338181197,
              1625723550, 1742482745,          
              464486085, 1507852127,
              754082421, 1187454014,
              1315342834, 425995190,
              960416608, 2004255418,          
              1262630671, 671761697,
              59809238, 103525918,
              1205644919, 2107823293,
              1615183160, 1152411412,          
              1024474681, 2118672937,
              1703877649, 1235091369,
              1821417852, 1098463802,
              1738806466, 1529062843,          
              620780646, 1654833544,
              1070174101, 795158254,
              658537995, 1693620426,
              2055317555, 508053916,          
              1647371686, 1282395762,
              29067379, 409683067,
              1763495989, 1917939635,
              1602690753, 810926582,          
              885787576, 513818500,
              1853512561, 1195205756,
              1798585498, 1970460256,
              1819261032, 1306536501,          
              1133245275, 37901,
              689459799, 1334389069,
              1730609912, 1854586207,
              1556832175, 1228729041,
              251375753, 683687209,
              2083946182, 1763106152,
              2142981854, 1365385561,
              763711891, 1735754548,
              1581256466, 173689858,
              2121337132, 1247108250,
              1004003636, 891894307,
              569816524, 358675254,
              626626425, 116062841,
              632086003, 861268491,
              1008211580, 779404957,
              1134217766, 1766838261,
              1423829292, 1706666192,
              942037869, 1549358884,
              1959429535, 480779114,
              778311037, 1940360875,
              1531372185, 2009078158,
              241935492, 1050047003,
              272453504, 1870883868,
              390441332, 1057903098,
              1230238834, 1548117688,
              1242956379, 1217296445,
              515648357, 1675011378,
              364477932, 355212934,
              2096008713, 1570161804,
              1409752526, 214033983,
              1288158292, 1760636178,
              407562666, 1265144848,
              1071056491, 1582316946,
              1014143949, 911406955,
              203080461, 809380052,
              125647866, 1705464126,
              2015685843, 599230667,
              1425476020, 668203729,
              1673735652, 567931803,
              1714199325, 181737617,
              1389137652, 678147926,
              288547803, 435433694,
              200159281, 654399753,
              1580828223, 1298308945,
              1832286107, 169991953,
              182557704, 1046541065,
              1688025575, 1248944426,
              1508287706, 1220577001,
              36721212, 1377275347,
              1968679856, 1675229747,
              279109231, 1835333261,
              1358617667, 1416978076,
              740626186, 2103913602,
              1882655908, 251341858,
              648016670, 1459615287,
              780255321, 154906988,
              857296483, 203375965,
              1631676846, 681204578,
              1906971307, 1623728832,
              1541899600, 1168449797,
              1267051693, 1020078717,
              1998673940, 1298394942,
              1914117058, 1381290704,
              426068513, 1381618498,
              139365577, 1598767734,
              2129910384, 952266588,
              661788054, 19661356,
              1104640222, 240506063,
              356133630, 1676634527,
              242242374, 1863206182,
              957935844, 1490681416 };
         public void longToLong(){
              for (int i=0;i<(seeds.length);i++){
                   seedsArray[i] = new java.lang.Long(seeds[i]);
         public boolean checkForSeed(long seed){
              for(int i=0;i<lastSeed.length;i++){
                   if (seed == lastSeed[i])
                        return true;
              addSeed(seed);
              return false;
         public void addSeed(long seed){     
              if (!(currentseedpos < maxSeeds))
                   currentseedpos = 0;
              lastSeed[currentseedpos] = seed;
         public boolean checkForValue(int value){
              for(int i=0;i<lastValue.length;i++){
                   if (value == lastValue[i])
                        return true;
                   addValue(value);
                   return false;
         public void addValue(int value){
              if (!(currentvaluepos < maxValues))
                   currentvaluepos = 0;
              lastValue[currentvaluepos] = value;
         public RandomSeed(){
              lastValue = new int[maxValues];
              lastSeed = new long[maxSeeds];
              longToLong();
              shuffle();
         public RandomSeed(int v){
              maxValues = v;
              lastValue = new int[maxValues];
              lastSeed = new long[maxSeeds];
              longToLong();
              shuffle();
         public RandomSeed(int v, int s){
              maxValues = v;
              maxSeeds = s;
              lastValue = new int[maxValues];
              lastSeed = new long[maxSeeds];
              longToLong();
              shuffle();
         public void shuffle(){
              random.setSeed(seeds[random.nextInt(seeds.length-1)]);
              java.util.List list = java.util.Arrays.asList(seedsArray);
              java.util.Collections.shuffle(list,random);
         public long getSeed(){
              shuffle();
              random.setSeed(seeds[random.nextInt(seeds.length-1)]);
              long seed=seedsArray[random.nextInt(seeds.length-1)].longValue();
              while (checkForSeed(seed))seed=seedsArray[random.nextInt(seeds.length-1)].longValue();
              return seed;
         public int nextInt(int max){
              shuffle();
              random.setSeed(seeds[random.nextInt(seeds.length-1)]);
              long seed = seedsArray[random.nextInt(seeds.length-1)].longValue();
              while (checkForSeed(seed))
                   seed = seedsArray[random.nextInt(seeds.length-1)].longValue();
                   random.setSeed(seed);
                   int seedone = random.nextInt(max)+1;
                   if (checkForValue(seedone))
                   seedone = random.nextInt(max)+1;
                   return (seedone);
         public int nextInt(){
              return nextInt(MAXINT);
         }     private int currentseedpos = 0;
         private int currentvaluepos = 0;
         public int lastValue[] = new int[0];
         public long lastSeed[] = new long[0];
         public final int MAXINT = 9999;
         public int maxSeeds = 400;
         public int maxValues = 5;
         private java.lang.Long[] seedsArray = new java.lang.Long[seeds.length];
         private java.util.Random random = new java.util.Random();
         public static void main(String[] args) throws Exception {
         TestRandom2 testrandom = new TestRandom2();
              testrandom.run();
    ----Code
    Thanks for all the response I've been getting please continue to help

Maybe you are looking for

  • How to exactly replicate webpage fonts in Photoshop? Can it be done?

    Hi all, I've just come across something in photoshop that I must have never have picked up on before. I am trying to simply replicate a peice of text in photoshop so that it is pixel by pixel exactly the same as what I would see in a webbrowser with

  • Google map data not displaying correctly in a spry collapsible panel

    I created a spry collapsible panel into which I've put google map data. The map placed in the collapsible panel looks and functions OK but shows my location in the wrong place. I tested it by putting exactly the same google map elsewhere on my page a

  • Slow 3d acceleration Catalyst

    Hi, I have an ATI Radeon 3650 HD AGP. Performance inside awesome wm using xcompmgr is OK, and so are playing flash videos etc. But when playing games like assaultcube or sauerbraten I get only 10-20 fps, which is really low even for this card(should

  • Non-Apple iBook batteries and how this affects the warranty

    I have a 14" G4 iBook (not eligible for the Apple battery replacement program) in which the original battery is clearly dying after almost two years of heavy use. There are vendors out there selling non-Apple replacement iBook batteries, and some mak

  • Mis match in BW report

    Hi Experts, I have a report Summary of Sales on 0SD_C03, in this report NET VALUE column is there, this column value is summation of BASICVALUE, BED, CESS, SEC-CESS. in R/3 these 4 values are there,but coming to BW it is showing '0' value for SEC-CES