Buffered Writer Problem

     public static void createTable1()
          BufferedWriter out = null;
          try{
               out= new BufferedWriter(new FileWriter("c:\\Table1.txt"));          
          }catch(Exception e){e.printStackTrace();}
          // Generate 5 * 200,000 numbers randomly between
          // 100,000 and 300,000
          int rows = 200000;
          int cols = 5;
          int myTable1 [][] = new int[rows][cols];
          try{
          for(int i = 0; i <200000; i++)
               for(int j = 0; j < 5; j++)
myTable1[i][j] = new RandNumGen().getRandomRange(100000,300000);          
               out.write(myTable1[i][j]);
               out.newLine();
          }catch(Exception e){e.printStackTrace();}               
     }I am trying to write to a file about 200,000 rows and 5 cols .. There are no compilation errors.. I cant open the file and see it though.. I waited for 15 minutes... shld I wait longer? Is something not okay with my code?

1- you should not wait for this much time, the only problem can be there in new RandNumGen().getRandomRange( 100000, 300000 );
2- Your output will not be 'ints' rather those will be characters. BufferedWriter writes after casting int into char.
Try following:
  public static void main( String[] argv ) {
      PrintWriter out = null;
      try {
         out = new PrintWriter( new FileOutputStream( "c:\\Table1.txt" ) );
         // Generate 5 * 200,000 numbers randomly between
         // 100,000 and 300,000
         int rows = 200000;
         int cols = 5;
         int myTable1[][] = new int[rows][cols];
         System.out.println( "Writing ..." );
         for( int i = 0; i < 200000; i++ ) {
            for( int j = 0; j < 5; j++ ) {
               myTable1[i][j] = new RandNumGen().getRandomRange( 100000, 300000 );
               out.print( myTable1[i][j] );
               out.print( "\t" );
            out.println();
      } catch( Exception e ) {
         e.printStackTrace( System.out );
      } finally {
         if( out != null ) {
            out.flush();
            out.close();
   private static class RandNumGen {
      int getRandomRange( int x, int y ) {
         return( int ) ( Math.random() * y );
   }Regards,
Humayun

Similar Messages

  • New Mac with major permission and disk-write problems

    Right, so I'm pretty new to Mac, after getting my first Mac computer (a 17-inch MacBook Pro) at the end of January this year. It's been great so far and I love the thing, but I've suddenly encountered some crazy problems which I'm pulling my hair out over because I have tried everything to fix them, and have had no luck.
    I'll try to include as many details as possible, and I'm prepared to bear with anyone who asks me about something I've alrady tried, just so I can get this sorted.
    Okay, so first of all, the main problem seems to be with permissions, mostly with disk-write permissions. Any apps that I want to install that required keychain access will no longer install. I enter my keychain password, hit Return, and the dialog box closes without continuing. So I hit "Install" again and it becomes a never-ending cycle of entering my password to no avail. Now, this happens with ANY application that requires keychain access to install. It is not limited to any particular application. I know my password is right because the box closes, and if I enter it wrong, the dialog box shakes because it is incorrect.
    Furthermore, it seems keychain access is problematic in other apps. If I want to authenticate something, it will do the same thing as I mentioned before, meaning I get nowhere with the application.
    From here, it gets worse. If I download something (anything), then restart my computer, it is still there. As it should be. However, if I delete an APPLICATION (not just any file) OR change preferences for some programs (one in particular that I specifically don't want starting up on.... startup), including through System Preferences>Users & Groups>Login Items, they will not save. This is driving me insane. For instance, I downloaded some free apps from the Mac App Store to try out, but decided I didn't want them. I tried to deleted them from the app folder and succeeded. Emptied trash. Gone. Restart, and.... they're back? So I tried to uninstall them via the Mac App Store, once I found you could do that. Again, it didn't work. Any Login Items preference changes don't stay after a restart.
    Originally, none of this was a problem and everything was working fine. The first sign that something was wrong would be Apple Mail often asking for passwords, usually for my Hotmail accounts, saying that they were rejected by the server (but are correct passwords, I get the emails from the accounts, and the passwords are always accepted once I type them in, only to be asked for them some time later on for no apparent reason). At the time, I tried to repair the keychain, tried deleting and recreating the mail account entries and what not, but nothing helped. It still happens, but at the time, it was more of a niggly thing than an outright problem.
    I should also mention that I did use BootCamp to install Windows 8 on a small partition, but after I couldn't boot back into Mac (I didn't realise you had to use the Option key whilst booting), I found out that you had to hold the Option key to get back into Mac, then used BootCamp to get rid of Windows. Everything was fine so far. Until I decided to reinstall Windows 8 with BootCamp. This is where things started going wrong. I decided to install a bootloader to make it easier for me to boot between the two systems. I was tossing up between rEFIt and Chameleon, and decided that rEFIt would be the best for my needs. So I downloaded and installed it, which seemed to go fine. Until I restarted. Mac would endlessly load (the spinning grey dots with the Apple logo).
    Now, I actually managed to fix this, but I should probably go into more detail. First of all, holding the option key and selecting my Mac partition would allow me back into Mac, and same with Windows 8. At this point, I decided to uninstall Windows 8 to try fix my problems, except now BootCamp was giving me errors. I believe it was something about being unable to unmount the disc, but it may have been a different error. I don't entirely remember. So then I decided to try getting rid of rEFIt. I followed the instructions on the official site but it didn't work. So then I tried deleting the files with root (sudo) access through terminal. Which also failed....
    So to the Recovery partition. Booting into Disk Utilities, I repaired permissions, which worked fine, and repaired the disk. I believe I had run the disk repair a few times before to try to fix BootCamp when it stopped working. Anywaym it had worked before, but this time, it said that it was corrupted and could not be repaired. Something about needing to reinstall Mac OS X. With all my files on this computer and currently nothing to back it up with (eventually I will have something to do backups with, but it'll have to wait a few months), I'm not going to do that.
    Finally, I managed to delete the rEFIt files through Terminal within the Recovery partition. I ran permission repair and disk repair again to clean anything up. Disk repair gave me the same error, but now I could get back into Mac without holding the option key on every **** boot.
    Now more problems had presented themselves. I decided that the lock under Login Items was probably preventing me form successfully changing my startup items. Trying to unlock it did the same thing as I previously mentioned. Type in my password, keychain accepts it, then nothing happens. The keychain settings were already defaulted so that keychain would stay unlocked after authenticated, and all stuff like that. Using "Get Info" on anything has permissions locked and again, I cannot unlock to change them, although looking at a PDF file just now, whilst still locked, it would allow me to add or remove users, so maybe that's not completely accurate. I believe I tended to look at the system folders though, and my name wasn't under ownership, although I don't believe it was meant to be, but I was hoping that maybe that would fix the problem. I guess not.
    At this time, I still had my Windows 8 partition sitting around and couldn't get rid of it. I heard of the manual way to do it through Disk Utility. I tried this in Mac OS X, and through the Recovery partition, but neither worked. An error about being unable to unmount the drive. I finally found a way to remove it. Honestly, I don't completely remember how I did it, but I believe it was through a command line, uh.... command. Now I had free space that I couldn't use to expand my Macintosh HD partition back to full size, again with the unable to unmount error. Finally, I fixed this by booting from a Mac OS X installation disc that I happened to have, and using Disk Utility off of that. After that, Disk Utility no longer gave me errors for disk repair.
    However, my other problems all still remained. I had written a little list of things I found on the internet for fixing my problems. One solution was to use "resetpassword" through terminal under the Recovery partition, then select Macintosh HD and select "Reset Home Directory Permissions and ACLs". That didn't work until I tried it through the Disk Utility on the Mac OS X installation disc. That worked, and once I was back into Mac, Spotlight started indexing again. However, nothing else had happened.
    I should also mention that keychain access isn't completely non-existent for me. Setting up a new WiFi connection worked for me (that is, connecting to a new network), but now every time I connect to the network, I have to authenticate it. However, it does accept my keychain password and eventually connect.
    Now, another thing on my list to try was single-user mode, and using "/sbin/fsck -fy" until everything was okay. Well, the first time, it found a bunch of errors, then fixed itself up. Then it was all okay. But nothing had changed. So trying again, I this time used ?/sbin/mount -uw /" which I believe is meant to allow writing access to the drive. Now when running "/sbin/fsck -fy", I had an error. Specifically, "Journal need to be replayed but volume is read-only".
    So that's pretty much where I am up to at the moment. It seems to be a poblem with write permissions, possibly among other things. If it was Windows, I might be able to work it out easier, but being new to Mac, I'm still finding my way around. I guess this is a good learning experience, but it's not fun to have to deal with it so early on.
    If anyone can help me, I'd greatly appreciate it. I have tried many things, so if you suggest something that I have tried and possibly forgot to mention, I'll let you know, but any help is still helpful, even if only eliminating possible problems/causes/solutions.

    Actually you first post is so long that most people just glance at it and move on. To say the least you are very verbose.
    Your problem stems from something going wrong with permissions, as you know. How and why that happen is usually a user error of some type.
    You can try to repair permissions and see if that corrects it. If not I will leave other options to someone that may know more about the permission system on a Mac.

  • Windows 2008 R2 Folder assign permission "Read and Write" problem with *.doc file

    Hello All,
    I am a new one here,
    I am sorry for any mistakes and also my english is so poor.
    M Brother company runing Windows 2008 R2 as Active Directory...
    We have folder Name: Admin
    and in this folder, there are alot documents files as : *.doc, *.dwg, *.txt etc.....
    All user accesing to these files and they can open to edit and save...
    One day my brother want me to set Admin folder for all users just"Read and Write.." mean they still can open files to edit and save... but can't delete..
    I did success with this..
    But only one thing happen.. when they open *.doc file to edit and attempting to save, the message alert" access denide " and they can only "SAVE AS"...We don't want "Save as"
    Could you show me how can we fix error with *.doc file while they trying to save? because it allow only save as.. but other files as *.text file or *.dwg they can save without problem..
    Could expert here ever face this issues and fix by yourself, please share me with this..
    Please help me..
    Best regards,

    Hi,
    Office programs are specific. They will create a temp file when edit, then the temp file will be deleted when close. So Delete permission is needed for users to saving Office files like Excel/Word.
    For more detaile information, please refer to the thread below:
    Special Permissions - User cannot save files
    http://social.technet.microsoft.com/Forums/windowsserver/en-US/721fb2f1-205b-46e5-a3dc-3029e5df9b5b/special-permissions-user-cannot-save-files
    Best Regards,
    Mandy 
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Soap Attachment write problem

    Hello All,
    I'm seeing the error message given below. I'd been trying to write a soap attachment to a file output stream. I did the same thing in WSAD and it worked. But when I tried to work on unix box.. it wasnt supporting activation.jar and mail.jar resulting the error below. I'm urgently in need of help. Please help me. [java] at javax.activation.ObjectDataContentHandler.writeTo(Unknown Source)
    [java] at javax.activation.DataHandler.writeTo(Unknown Source)
    [java] at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:1147) [java] at javax.mail.internet.MimeBodyPart.writeTo(MimeBodyPart.java:668)
    [java] at javax.mail.internet.MimeMultipart.writeTo(MimeMultipart.java:233) [java] at weblogic.webservice.core.soap.SOAPMessageImpl.writeMimeMessage(SOAPMessageImpl.java:589) [java] at weblogic.webservice.core.soap.SOAPMessageImpl.writeTo(SOAPMessageImpl.java:513) [java] at
    I think there is a problem with the activation.jar and mail.jar.
    Please let me know about this problem if you have any idea since it is very urgent.
    I'm using Weblogic server which is on the solaris box and it is not supporting the activation.jar and mail.jar. The same worked on WSAD.
    Please advise.
    Thanks in advance,
    Vamshi

    Hi Hasan,
      Please, try to implement next xslt mapping before message mapping.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:stylesheet version="1.0" xmlns:ns0="http://www.w3.org/1999/XSL/Transform" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:ns2="https://onlineservice.creditreform.de/webservice/0400-0005">
       <ns0:template match="node() | @*">
          <ns0:copy>
             <ns0:apply-templates select="node() | @*"/>
          </ns0:copy>
       </ns0:template>
       <ns0:template match="xop:Include"/>
    </ns0:stylesheet>
    Regards, Dzmitry

  • Visa write problem

    hello,
    I am trying to control a Coherent Cube laser with labview 8.0 (RS232)
    I always get the response 'invalid cmd' from the laser.
    There is a software furnished by Coherent which works without any problem.
    I monitored the datas sent by this software and labview through the serial port but I did not notice any difference.
    Have you got an idea? (the baud rates is well configured)

    Hi,
    So your query works but your command doesn't, is this correct?
    (Query being the string which starts with ? eg "?S".      Command being "Command=<value>" eg CW=1)
    If this is correct then you haven't got a problem with your Write because the Query has to seed the "?..." charaters before you can perform the Read.
    Therefore the problem is on the exact syntax of the command string. There can't be any spaces between the command, the = and the <value> ie CW=1 not CW = 1.0.
    Hope this helps
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Dvd writer problem

    my dvd writer fails to write dvd but can write cd.
    what is the problem

    Hi,
    Welcome to the HP Forum!
    Abhishek1996 wrote:
    my dvd writer fails to write dvd but can write cd.
    what is the problem
    Please identify your notebook/pc .
    Look at the base/rear/side of the notebook/pc at the barcoded sticker.
    Post item number 2 as seen on the following example of an HP notebook's barcoded sticker. The barcode on your HP product may be slightly different in appearance, but will still have the important information needed for us to help you.  
    ###Do not post the serial number of your product as it is personal information.###
    Post the installed operating system version (state whether it is 32 or 64-bit ) and the CPU as an AMD or Intel product
    Not posting all of the information as requested will delay our responses and slow troubleshooting of the issue that led you to author a thread.
    Is your notebook/PC still within its warranty period?
    Best regards,
    erico
    Kind regards,
    erico
    ****Please click on Accept As Solution if a suggestion solves your problem. It helps others facing the same problem to find a solution easily****
    2015 Microsoft MVP - Windows Experience Consumer

  • DVD Write problem

    I have previously burned DVD's on my Computer with no problem. Today I tried to burn a DVD and I've gone through 5 DVD and keep getting the same error when the disc is about 60% done burning. This is what console shows:
    Finder: Burn started, Tue Feb 14 22:33:53 2006
    Finder: Burning to DVD-R media with DAO strategy in MATSHITA DVD-R UJ-815 D0CB via ATAPI.
    Finder: Requested burn speed was 1x, actual burn speed is 1x.
    Finder: Burn underrun protection is supported, and enabled.
    Finder: Burn failed, Tue Feb 14 22:59:20 2006
    Finder: Burn sense: 4/03/00 Hardware Error, Peripheral device write fault
    Finder: Burn error: 0x80020022 The device failed to respond properly, unable to recover or retry.
    I also noticed a strange scratchy noise while burning it does not do it any other time even when reading other discs. Is this a hardware problem? Is there a DVD drive replacement that will fit that I can buy third party and install myself?

    I just wanted to add that I tried CD burning and it works fine. No funny noises, no problem. I reset the PMU and tried DVD burning again. Still doesn't work. Still makes a funny noise while writing data to the disc.

  • HD read-write problems recording more of 16 audio tracks

    I've a strange problem that i don't have in digital performer with rosetta!
    When i record more of 5-6 track...for example 16...when i stop the registration....logic is blocked for 30-40 seconds....and then it begin to create overview!
    in this time i've see the hd read and write at 5 mb/sec....
    It isn't normal!!! I've tried all the settings of audio driver and buffer....but nothing change
    anybody can help me?!?
    p.s. sorry for my bad english!

    1 : Waht sample Rate are u using -
    2 : I have disk Journaling on and record @ 96KHZ - and can do 64 tracks simoultaneously (split on 4 drives)
    3 : Is your recording drive very fragmented if so defragment it
    4 : Dont EVER record to your system drive - too much activity going on there
    5 : Set your Max Recording time to 10 minutes in the "Set record path" dialog in Logic ( If you have not set the max rec. time Logic will "Freeze" all available space on the disk for the recording and that can lead to problems especially if u aint using a dedicated hard drive to wirte your audio to
    6 : it is very important to have a dedicated drive to record audio to - being an internal SATA or Firewire 400/800 - as long as this drive is being used to record only...This has solved many problems for me...

  • Multithread read write problem.

    This is a producer consumer problem in a multi-threaded environment.
    Assume that i have multiple consumer (Multiple read threads) and a
    single producer(write thread).
    I have a common data structure (say an int variable), being read and written into.
    The write to the data sturcture happens occasionally (say at every 2 secs) but read happens contineously.
    Since the read operation is contineous and done by multiple threads, making the read method synchronized will add
    overhead(i.e read operation by one thread should not block the other read threads). But when ever write happens by
    the write thread, that time the read operations should not be allowed.
    Any ideas how to achive this ??

    Clearly the consumer has to wait for a value to become available and then take it's own copy of that value before allowing any other thread to access it. If it doesn't copy the value then only one consumer can act at any time (since if another value could be added while the consumer thread was accessing the common value then the value would change, affecting the consumer at random).
    In general what you're doing is using a queue, even in the special case where the maximum number of items queued is restricted to one the logic is the same.

  • Print Writer problem

    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.PrintStream;
    import java.util.ArrayList;
    import java.util.Scanner;
    import java.io.PrintWriter;
    public class QuestionAireMain {
         public static void main(String args[]) throws IOException{
              int inputQuestionnAireNum = 0;
              int inputPostCode = 0;
              int inputGender = 0;
              int inputAge = 0;
              int inputResponse = 0;
              int inputQuestionNum = 0;
              int x=0;
              Scanner input = new Scanner(System.in);
              PrintWriter p = new PrintWriter( new FileOutputStream("tryout.txt", true));
              ArrayList<QuestionTemplate> questionArr =new ArrayList<QuestionTemplate> ();
              int rangeStore[];
              System.out.print("Enter Number of Question to create [ ]");
              inputQuestionNum = Integer.parseInt(input.nextLine());
              do{
                   System.out.print("1 new entry or 0 print");
                   x = Integer.parseInt(input.nextLine());  
                   if(x == 1){
                        //Questionnaire Number
                        System.out.print("Enter Questionnaire Number [ ] ");
                        inputQuestionnAireNum = Integer.parseInt(input.nextLine());
                        //Postal code
                        System.out.print("Enter Postal Code [ ] ");     
                        inputPostCode = Integer.parseInt(input.nextLine());
                        //Age
                        System.out.print("Enter Age [ ] ");
                        inputAge = Integer.parseInt(input.nextLine());
                        //Gender
                        System.out.print("Enter Gender '1' for Male and '2' for for female [ ] ");
                        inputGender = Integer.parseInt(input.nextLine());
                        rangeStore = new int[5];
                        //Response input
                        for(int j = 0; j<inputQuestionNum; j++) {
                             System.out.print("Input Response for Question " +(j+1) +" [ ] ");     
                             inputResponse = Integer.parseInt(input.nextLine());
                             rangeStore[j] = inputResponse;                                             
                        }//for response
                        QuestionTemplate qObject = new QuestionTemplate(inputQuestionnAireNum, inputPostCode, inputAge, inputGender, inputQuestionNum, rangeStore);
                        questionArr.add(qObject);
                        p.write(qObject.toString());
                        p.close();
                             } else {
                                           System.out.println("test");
                           } while(x != 0);
    } //Constructor
    public class QuestionTemplate{
         int questionnAireNum = 0;
         int postCode = 0;
         int age = 0;
         int gender = 0;
         int numOfQues = 0;
         int [] rangeStore;
         public QuestionTemplate (int questionnAireNum,  int postCode, int age, int gender, int numOfQues , int rangeStore[]){
              this.questionnAireNum = questionnAireNum;
              this.postCode = postCode;
              this.age = age;
              this.gender = gender;
              this.rangeStore = rangeStore;
         }//public
              //Questionnaire Number
              public int getQuestionnAireNum(){
                   return questionnAireNum;
              public void setQuestionnAireNum(int questionnAireNum){
                   this.questionnAireNum = questionnAireNum;
              //Postal Code
              public int getPostCode(){
                   return postCode;
              public void setPostCode(int postCode){
                   this.postCode = postCode;
              //Age
              public int getAge(){
                   return age;
              public void setAge(int age){
                   this.age = age;
              //Gender
              public int getGender(){
                   return gender;
              public void setGender(int gender){
                   this.gender = gender;
              //Array of response
              public int [] getRangeStore(){
                   return rangeStore;
              public void setRangeStore(int [] rangeStore){
                   this.rangeStore = rangeStore;
              //Print toString method
              public String toString(){
                    StringBuilder result = new StringBuilder();
                       result.append(questionnAireNum+", ");
                       result.append(postCode+", ");
                       result.append(age+", ");
                       result.append(gender+", ");                  
                      for(int i =0;i<numOfQues; i++){          
                             result.append(rangeStore);
                             if(i != numOfQues-1){
                             result.append(", ");
                             }     else{
                                       result.append(".\n");
                   return result.toString();
    }//class
    Enter Number of Question to create [ ]3
    1 new entry or 0 print1
    Enter Questionnaire Number [ ] 2
    Enter Postal Code [ ] 3
    Enter Age [ ] 4
    Enter Gender '1' for Male and '2' for for female [ ] 3
    Input Response for Question 1 [ ] 2
    Input Response for Question 2 [ ] 3
    Input Response for Question 3 [ ] 4
    1 new entry or 0 print1
    Enter Questionnaire Number [ ] 2
    Enter Postal Code [ ] 3
    Enter Age [ ] 4
    Enter Gender '1' for Male and '2' for for female [ ] 6
    Input Response for Question 1 [ ] 5
    Input Response for Question 2 [ ] 4
    Input Response for Question 3 [ ] 3
    1 new entry or 0 print0tryout.txt
    2, 3, 4, 3, 2, 3, 4.
    hi i am facing a problem now. I only manage to print the first entry record but the second record seems to be ignored. when i comment out p.close(); it will not print to my txt file at all. what happen ???                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    TimTheEnchantor wrote:
    As soon as a PrintWriter is closed, you cannot write to it anymore (e.g. write method has no effect -> only the first record is written)
    If you don't close it, it might never be flushed (e.g. it might be that nothing is written)
    What you should do is close it at the right moment.
    Moreover, I would suggest that you clearly separate the "printing" part from the "recording" part.hi i have tired placing close at other areas and the moment i separate the printing part it can`t seems work either, i can`t figure out why?

  • Read and Write Problem

    Hello!
    I have a problem with the Data I/O in my program. The button "Animation" generates random numbers and saves them into a file. With the Button "Vergleich" i want to load the data and reproduce the data in the graph.
    When i push the button "Vergleich" i can choose the data, but the program don*t reproduces it!
    Coult anybody help me??
    TNKS
    Best regards,
    Peter
    Labview 7.1 on Windows 2000
    Attachments:
    program.vi ‏68 KB

    Here are two changes, one uses the write to spreadsheet and read from spreadsheet file functions, the other changes your "read file" to "read text file"
    P.M.
    Putnam
    Certified LabVIEW Developer
    Senior Test Engineer
    Currently using LV 6.1-LabVIEW 2012, RT8.5
    LabVIEW Champion
    Attachments:
    program[1.x].zip ‏41 KB

  • Read Write Problems, Javascript

    Hello,
    I have had problems with a simple procedure. The grand scheme involves a lot more, so my example may seem trivial but this is where I've narrowed the problem down to. I cannot read an image file using the File object and write it back out as an image. Here is my test function, my targetengine for the script is session. When using the BINARY encoding the replicated file is the same size and appears almost identical but it simply won't be recognized as a valid jpg
    function readWrite(){
    var name = "/c/indesign_scripts/Winter.jpg";
    var f = new File(name);
    var encoding = "BINARY";
    if(!File.isEncodingAvailable(encoding))
    alert("You're using an unsupported encoding");
    f.encoding = encoding;
    f.open("r");
    var payload = f.read();
    var f2 = new File("/c/indesign_scripts/Winter-1.jpg");
    f2.open("w");
    var bool = f2.write(payload);
    if(!bool)
    alert(f2.error);
    Thanks in advance for any advice,
    Matt

    You may get a response here, but it will get more attention if you post on the scripting forum down the hall.

  • [nQSError: 46073] Operation 'write()'  Problem

    Hi Experts,
    System platform is Windows 2008 R2.
    Often I have reported errors in OBIEE 11.1.1.6.0 when I run the reports as below, and I have found the error messages in  NQSServer.log
    [nQSError: 46073] Operation 'write()' on file 'E:\OBIEE\Middleware\instances\instance1\tmp\OracleBIServerComponent\coreapplication_obis1\obis_temp\nQS_6576_7614_7989926.TMP' failed with error: (6) The handle is invalid..
    [2013-06-14T10:13:10.000+00:00] [OracleBIServerComponent] [ERROR:1] [] [] [ecid: 5dcb9c2494014f83:-16f7b654:13ef0099939:-8000-000000000160d7f0] [tid: 1d4c]  [nQSError: 46073] Operation 'close()' on file 'E:\OBIEE\Middleware\instances\instance1\tmp\OracleBIServerComponent\coreapplication_obis1\obis_temp\nQS_6576_7614_7989926.TMP' failed with error: (6) The handle is invalid..
    What happen? How to resolve this problem? Thanks.

    Hi check the below link.it helps you..
    https://forums.oracle.com/thread/972762
    This basically means that the write operation into the cache file fails.
    First of all, check whether the [Cache] section in your NQSConfig.ini is configured properly (path, size, etc.).
    Then check wether the user account running the BI server service has the rights to write into that folder structure.
    If you have doubts about the data quantity get the actual queries fired against the source database from the log files to see what the resulting data set looks like.
    Also, try running a test with caching turned off.
    Mark it if helps/correct

  • Buffered Messaging Problem

    I'm just starting out with Streams and was working with the example in Chapter 23 of "Oracle Streams Advanced Queuing User's Guide and Reference".
    It works. Then I decided I wanted to use a buffered queue for non-LCR messaging. So I changed the enq_proc such that
    enqopt.delivery_mode := DBMS_AQ.BUFFERED;
    enqopt.visibility := DBMS_AQ.IMMEDIATE;
    The procedure compiles on 10.2.0.1 on Windows XP but when I try to enqueue an ANYDATA message here's what I get:
    BEGIN
    oe.enq_proc(ANYDATA.convertobject(oe.order_event_typ(
    2500,'05-MAY-01','online',117,3,44699,161,NULL,'APPLY')));
    END;
    BEGIN
    ERROR at line 1:
    ORA-25292: Buffer operations are not supported on the queue
    ORA-06512: at "SYS.DBMS_AQ", line 243
    ORA-06512: at "OE.ENQ_PROC", line 11
    ORA-06512: at line 2
    Part of Metalink doc id 230901.1 says "In 10.2 a new feature was added for Oracle Streams AQ called Buffered Messaging. Buffered messaging enables users and applications to enqueue messages into and dequeue messages from a buffered queue." but I'm not finding out exactly how to do that.
    Any help is greatly appreciated.

    If I understand the problem correctly...
    I think you might want either one of the two things:
    1. create a new instance of your object instead of re-using the one already sent.
    2. if you HAVE to re-use the same object, you must clear the object client-side, otherwise its signature will remain the same, and the receiver will figure it's already been downloaded. You must then implement a separate flag to tell the receiver that the data has changed.
    Hope this helps,
    Eric

  • DPM 2012 R2 protecting a SQL 2008 Cluster/Vss Writer problems on SQL Server

    Hola,
    I am running DPM 2012 R2 rollup 4. My Server OS is 2012 Datacenter. I have a SQL 2008 Active/Passive cluster  and MS support has kicked this to the SQL team for review. OK hear we go ..When I run the vssadmin list writer I do see the SQL Writer. Also
    says no errors. When I run diskshadow /l c:a.txt from an admin command prompt the output does show the SQL Writer information but under that should display all the meta data for each connection to the database so DPM can expand the SQL database to
    be chosen for protection. I am already confused.
    I am going to include a snippet from the vssadmin and the diskshadow command:
    vssadmin list writers:
    Writer name: 'SqlServerWriter'
       Writer Id: {a65faa63-5ea8-4ebc-9dbd-a0c4db26912a}
       Writer Instance Id: {8d773b6f-0196-4c34-9943-f258f99c2d9a}
       State: [1] Stable
       Last error: No error
    Diskshadow /l c:a.txt
     * WRITER "SqlServerWriter"
      - Writer ID   = {a65faa63-5ea8-4ebc-9dbd-a0c4db26912a}
      - Writer instance ID = {8d773b6f-0196-4c34-9943-f258f99c2d9a}
      - Supports restore events = TRUE
      - Writer restore conditions = VSS_WRE_ALWAYS
      - Restore method = VSS_RME_RESTORE_IF_CAN_REPLACE
      - Requires reboot after restore = FALSE
      - Excluded files:
     * WRITER "BITS Writer"
      - Writer ID   = {4969d978-be47-48b0-b100-f328f07ac1e0}
      - Writer instance ID = {5ad5c4f7-5f68-4c1d-a4fc-92d5ef898881}
      - Supports restore events = TRUE
      - Writer restore conditions = VSS_WRE_UNDEFINED
      - Restore method = VSS_RME_UNDEFINED
      - Requires reboot after restore = FALSE
      - Excluded files:
       - Exclude: Path = C:\Windows\System32, Filespec = bits.log
       - Exclude: Path = C:\Windows\System32, Filespec = bits.bak
       - Exclude: Path = C:\ProgramData\Microsoft\Net
    As you can see this did not return the expected results. I should see the meta data for each database. This is why DPM can't list the databases for backup in my 2008 production SQL cluster. Any thoughts? This has not been working for quite sometime. I was
    hoping the update to rollup 4 would have fixed the problem. I know this is a SQL problem but has anyone had this experience?
    Thanks
    Steve J.

    Update:
    Uninstalled SQL Server instance and downloaded SQL Server 2012 SP1 image from link in error message.  It takes you to the download page for the express edition of SQL Server 2012.  I downloaded the SQLEXPRADV_x64_ENU file and used it to re-install
    the SQL Server instance.
    Ultimately I had to use the ISO image to upgrade the instance to Standard because the SQL Server Agent will not run under the express edition and caused the DPM install to fail.
    The DPM installation then completed successfully and after immediately went to Windows Update and SQL Server 2012 SP2 was installed.
    Evidently you cannot start with SP2 until the installation is complete.

Maybe you are looking for

  • Unwanted white border in PDF,

    I get  white border in my PDF.  Designed A4 folding brochure in id cc14, exported as PDF. Bleed and margins set up 0.00. Any printer settings I apply don't make big different. What to do?

  • Converting RTF to PDF?

    Hi all, I am developing a system which allows users to upload RTF files (generated by Microsoft Word). My program will convert them to PDF programmatically on the server side and send the PDF back to the users. I installed a PDF printer driver on the

  • R/3 Archiving effect on Opening Balance of  Inventory manangement

    Can anyone answer the following question. Its quite urgent and will be highly appreciated. Will an Archiving in R/3, effect the Opening stock balance of Inventory management, Material Stockw (as of 3.1 Content) -2LIS_03_BX? Archiving will be done inc

  • Timed loop running parallel with Queues

    I was wondering if it is possible to have a Producer/Consumer Pattern with a timed loop that is not just executed when it is called by the queue or from the Producer Loop, but also executes the timeout after a given time. Thanks in advance, Oliver At

  • IPod screen in some other language, but I want English!

    Hello - Just bought an iPOD (7500 songs, photos) for my husband for Christmas. Turns out the screens are all in either Chinese or some kind of font that uses only symbols. Interestingly, the songs we downloaded print across the screen in English. Any