Best way to write specific information to a file

Hi there,
I'm looking to write specific information from my program to 2 separate files.
Before the program runs, it asks the operator for their info (name, password, run ID #, a couple safety checkboxes).
So, I would like the first file to record log-in information (i.e. The operator's name, the date and time they accessed the program, and the Run ID #) all in a spreadsheet.
I would like the second file to record data from the different components of the program ( 2 tank levels, a flow meter, and run ID #) in another spreadsheet.
Any thoughts on the best way to do this? I've looked at using arrays to organize the info/data, and then write to spreadsheet, but I haven't quite figured it out...
Thanks,
Daryn

For the first, you could convert everything to strings, then send an array of strings. For the second, just send an array of numbers.
Cameron
To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.
To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):
LabVIEW Unit 1 - Getting Started
Learn to Use LabVIEW with MyDAQ

Similar Messages

  • Best way to write SELECT statement

    Hi,
    I am selecting fields from one table, and need to use two fields on that table to look up additional fields in two other tables.
    I do not want to use a VIEW to do this. 
    I need to keep all records in the original selection, yet I've been told that it's not good practice to use LEFT OUTER joins.  What I really need to do is multiple LEFT OUTER joins.
    What is the best way to write this?  Please reply with actual code.
    I could use 3 internal tables, where the second 2 use "FOR ALL ENTRIES" to obtain the additional data.  But then how do I append the 2 internal tables back to the first?  I've been told it's bad practice to use nested loops as well.
    Thanks.

    Hi,
    in your case having 2 internal table to update the one internal tables.
    do the following steps:
    *get the records from tables
    sort: itab1 by key field,  "Sorting by key is very important
          itab2 by key field.  "Same key which is used for where condition is used here
    loop at itab1 into wa_tab1.
      read itab2 into wa_tab2     " This sets the sy-tabix
           with key key field = wa_tab1-key field
           binary search.
      if sy-subrc = 0.              "Does not enter the inner loop
        v_kna1_index = sy-tabix.
        loop at itab2 into wa_tab2 from v_kna1_index. "Avoiding Where clause
          if wa_tab2-keyfield <> wa_tab1-key field.  "This checks whether to exit out of loop
            exit.
          endif.
    ****** Your Actual logic within inner loop ******
       endloop. "itab2 Loop
      endif.
    endloop.  " itab1 Loop
    Refer the link also you can get idea about the Parallel Cursor - Loop Processing.
    http://wiki.sdn.sap.com/wiki/display/Snippets/CopyofABAPCodeforParallelCursor-Loop+Processing
    Regards,
    Dhina..

  • Is there a way to import specific information into a form?

    is there a way to import specific information into a form?

    No, we currently don't support preopulating a form.

  • Best way to write this sql ?

    Please let me know best way to write this SQL.
    select col1, count(*)
    from TableA
    group by col1
    having count(*) =
    (select max(vals)
    from
    select col1, count(*) as vals
    from TableA
    group by col1
    having count(*) > 1
    )

    post EXPLAIN PLAN
    SELECT col1,
           COUNT(*)
    FROM   tablea
    GROUP  BY col1
    HAVING COUNT(*) = (SELECT MAX(vals)
                       FROM   (SELECT col1,
                                      COUNT(*) AS vals
                               FROM   tablea
                               GROUP  BY col1
                               HAVING COUNT(*) > 1))

  • What is a best way to write SQL ?

    Sample Case
    drop table t;
    drop table b;
    create table t ( a varchar2(4), b number, c varchar2(1));
    insert into t values ('A00', 10, 'R');
    insert into t values ('A01', 11, 'R');
    insert into t values ('A02', 12, 'R');
    insert into t values ('A03', 13, 'R');
    insert into t values ('A00', 10, 'P');
    insert into t values ('A01', 11, 'P');
    insert into t values ('A02', 12, 'P');
    insert into t values ('A03', 13, 'P');
    commit;
    create table b ( j varchar(4), k varchar2(1), l varchar2(5), m number(3), n varchar2(5), o number(3));
    insert into b values ('A00', 'P', 'FIXED', 100, 'FLOAT', 60);
    insert into b values ('A01', 'P', 'FIXED', 101, 'FIXED', 30);
    insert into b values ('A02', 'R', 'FLOAT', 45, 'FLOAT', 72);
    insert into b values ('A03', 'R', 'FIXED', 55, 'FLOAT', 53);
    commit;
    10:19:13 SQL> select * from t;
    A B C
    A00 10 R
    A01 11 R
    A02 12 R
    A03 13 R
    A00 10 P
    A01 11 P
    A02 12 P
    A03 13 P
    8 rows selected.
    10:19:19 SQL> select * from b;
    J K L M N O
    A00 P FIXED 100 FLOAT 60
    A01 P FIXED 101 FIXED 30
    A02 R FLOAT 45 FLOAT 72
    A03 R FIXED 55 FLOAT 53
    1/     In table t each reference having 2 records one with P another is with R
    2/     In table b each refrence merged into single record and there are many records which are not existing in table t
    3/      both t and j tables can be joined using a = j
    4/     If from table t for a reference indicator is 'P' then if have to pick up l and m columns, if it is 'R' then I have to pick up n and o columns
    5/     I want output in following format
    A00     P     FIXED          100
    A00     R     FLOAT          60
    A01     P     FIXED          101
    A01     R     FIXED          30
    A02     P     FLOAT          72
    A02     R     FLOAT          45
    A03     P     FLOAT          53
    A03     R     FIXED          55
    6/     Above example is a sample ouput, In above example I have picked up only l,m,n,o columns, but in real example there are many columns ( around 40 ) to be selected. ( using "case when" may not be practical )
    Kindly suggest me what is a best way to write SQL ?
    thanks & regards
    pjp

    Is this?
    select b.j,t.c as k,decode(t.c,'P',l,n) as l,decode(t.c,'P',m,o) as m
    from t,b
    where t.a=b.j
    order by j,k
    J K L M
    A00 P FIXED 100
    A00 R FLOAT 60
    A01 P FIXED 101
    A01 R FIXED 30
    A02 P FLOAT 45
    A02 R FLOAT 72
    A03 P FIXED 55
    A03 R FLOAT 53
    8 rows selected.
    or is this?
    select b.j,t.c as k,decode(t.c,b.k,l,n) as l,decode(t.c,b.k,m,o) as m
    from t,b
    where t.a=b.j
    order by j,k
    J K L M
    A00 P FIXED 100
    A00 R FLOAT 60
    A01 P FIXED 101
    A01 R FIXED 30
    A02 P FLOAT 72
    A02 R FLOAT 45
    A03 P FLOAT 53
    A03 R FIXED 55
    8 rows selected.

  • Best way to write Pl/Sql

    Dear all,
    Can someone say the best way writing below stored proc:
    procedure missing_authorized_services is
    v_truncate_sql varchar2(200);
    v_sql varchar2(2000);
    BEGIN
    v_truncate_sql := 'truncate table missing_authorized_services';
         execute immediate v_truncate_sql;
         commit;
    v_sql := 'INSERT into missing_authorized_services select distinct trim(service_group_Cd) as service_group_Cd, trim(service_cd) as service_cd from stage_1_mg_service_request
    where (service_group_cd, service_cd) not in (
                        select distinct service_group_cd, service_cd from stage_3_servcd_servgrp_dim)';
    execute immediate v_sql;
         commit;
    END missing_authorized_services;
    /* I am doing select from table and then try to Insert into a different table the result set */
    Please guide,
    Thanks
    J

    Hi,
    The best way to write PL/SQL (or any code) is in very small increments.
    Start with a very simple procedure that does something (anything), just enough to test that it's working.
    Add lots of ouput statments so you can see what the procedure is doing. Remember to remove them after testing is finished.
    For example:
    CREATE OR REPLACE procedure missing_authorized_services IS
            v_truncate_sql  VARCHAR2 (200);
    BEGIN
         v_truncate_sql := 'truncate table missing_authorized_services';
         dbms_output.put_line (  v_truncate_sql
                        || ' = v_truncate_sql inside missing_authorized_services'
    END      missing_authorized_services;If you get any errors (for example, ORA-00955, becuase you're trying to give the same name to a procedure that you're already using for a table), then fix the error and try again.
    When it worls perfectly, then add another baby step. For example, you might add the one line
    EXECUTE IMMEDIATE v_truncate_sql;and test again.
    Don't use dynamic SQL (EXECUTE IMMEDIATE) unless you have to.
    Is there any reason to use dynamic SQL for the INSERT?

  • Best way to write an Wrapper class around a POJO

    Hi guys,
    What is the best way to write an Wrapper around a Hibernate POJO, given the latest 2.2 possibilities? The goal is, of course, to map 'regular' Java Bean properties to JavaFX 2 Properties, so that they can be used in GUI.
    Thanks!

    what about this:
    import javafx.beans.property.SimpleStringProperty;
    import javafx.beans.property.StringProperty;
    public class PersonPropertyWrapper {
         private StringProperty firstName;
         private StringProperty lastName;
         private Person _person;
         public PersonPropertyWrapper(Person person) {
              super();
              this._person = person;
              firstName = new SimpleStringProperty(_person.getFirstName()) {
                   @Override
                   protected void invalidated() {
                        _person.setFirstName(getValue());
              lastName = new SimpleStringProperty(_person.getLastName()) {
                   @Override
                   protected void invalidated() {
                        _person.setLastName(getValue());
         public StringProperty firstNameProperty() {
              return firstName;
         public StringProperty lastNameProperty() {
              return lastName;
         public static class Person {
              private String firstName;
              private String lastName;
              public String getFirstName() {
                   return firstName;
              public void setFirstName(String firstName) {
                   this.firstName = firstName;
              public String getLastName() {
                   return lastName;
              public void setLastName(String lastName) {
                   this.lastName = lastName;
         public static void main(String[] args) {
              Person p = new Person();
              p.setFirstName("Jim");
              p.setLastName("Green");
              PersonPropertyWrapper wrapper = new PersonPropertyWrapper(p);
              wrapper.firstNameProperty().setValue("Jerry");
              System.out.println(p.getFirstName());
    }Edited by: 906680 on 2012-7-27 上午10:56

  • Best way to spool DYNAMIC SQL query to file from PL/SQL

    Best way to spool DYNAMIC SQL query to file from PL/SQL [Package], not SqlPlus
    I'm looking for suggestions on how to create an output file (fixed width and comma delimited) from a SELECT that is dynamically built. Basically, I've got some tables that are used to define the SELECT and to describe the output format. For instance, one table has the SELECT while another is used to defined the column "formats" (e.g., Column Order, Justification, FormatMask, Default value, min length, ...). The user has an app that they can use to customize the output...which leaving the gathering of the data untouched. I'm trying to keep this formatting and/or default logic out of the actual query. This lead me into a problem.
    Example query :
    SELECT CONTRACT_ID,PV_ID,START_DATE
    FROM CONTRACT
    WHERE CONTRACT_ID = <<value>>Customization Table:
    CONTRACT_ID : 2,Numeric,Right
    PV_ID : 1,Numeric,Mask(0000)
    START_DATE : 3,Date,Mask(mm/dd/yyyy)The first value is the kicker (ColumnOrder) as well as the fact that the number of columns is dynamic. Technically, if I could use SqlPlus...then I could just use SPOOL. However, I'm not.
    So basically, I'm trying to build a generic routine that can take a SQL string execute the SELECT and map the output using data from another table to a file.
    Any suggestions?
    Thanks,
    Jason

    You could build the select statement within PL/SQL and open it using a cursor variable. You could write it to a file using the package 'UTL_FILE'. If you want to display the output using SQL*Plus, you could have an out parameter as a ref cursor.

  • HT3847 How is the best way to separate copied MP3 from AIFF files in my library?

    How is the best way to separate duplicate MP3 from AIFF files in my library?

    Zice wrote:
    I want higher resolution then afforded in the original download.
    Then why are you converting iTunes purchases?
    You cannot get higher resolution by converting  the original. This goes for converting anything, not just iTunes purchases.
    Creating an AIFF will simply make the file 10 time as large with zero increase in quality.
    Don't really want to debate value of creating the new version.
    Agreed.
    You are simply wasting time and drive space converting iTunes purchases to AIFF.

  • Best way to import a 200GB single dump file

    I was given a 200GB size single dump file containing full export of a schema. can any please tell me whats the best way to import such a huge dmp file. I need to get this import done asap in QA for testing which will let us solve some production issues. step by step instructions if possible would be really helpful for me to complete my task asap.
    Thanks in Advance,
    krim.

    Hi Krim,
    Our dump files normally are never that big so that maybe you could face some other issue here.
    If your dump was a full DB schema dump like:
    $ exp username/password file=full.dmp parameter-list
    then the import should first drop the user in the target system
    SQL> drop user username cascade;
    this is to drop the existing schema before importing
    SQL> Create user according to your reqs
    $ imp username/password file=full.dmp full=y commit=y ignore=y
    Don't know which env you have to run this, but in our case for instance using an 8 X 1.6GHz Itanium2 Montecito a 14 GB dump takes about a couple of hours to import (with an EMC Clariion disk array). It's also true that Oracle imp (did you use exp or expdp ?) is not able as far as I understand to achieve parallelism like impdp where in case of multiple huge tables the import time could be sped up.
    Another thing you may want to check is if you have archive logging on, since the import will log there consuming time.
    Cheers,
    Mike

  • What is the best way to write 10 channels of data each sampled at 4kHz to file?

    Hi everyone,
    I have developed a vi with about 8 AI channels and 2 AO channels... The vi uses a number of parallel while loops to acquire, process, and display continous data.. All data are read at 400 points per loop interation and all synchronously sampled at 4kHz...
    My questions is: Which is the best way of writing the data to file? The "Write Measurement To File.vi" or low-level "open/create file" and "close file" functions? From my understanding there are limitations with both approaches, which I have outlines below..
    The "Write Measurement To File.vi" is simple to use and closes the file after each interation so if the program crashes not all data would necessary be lost; however, the fact it closes and opens the file after each iteration consumes the processor and takes time... This may cause lags or data to be lost, which I absolutely do not want..
    The low-level "open/create file" and "close file" functions involves a bit more coding, but does not require the file to be closed/opened after each iteration; so processor consumption is reduced and associated lag due to continuous open/close operations will not occur.. However, if the program crashes while data is being acquired ALL data in the buffer yet to be written will be lost... This is risky to me...
    Does anyone have any comments or suggestions about which way I should go?... At the end of the day, I want to be able to start/stop the write to file process within a running while loop... To do this can the opn/create file and close file functions even be used (as they will need to be inside a while loop)?
    I think I am ok with the coding... Just the some help to clarify which direction I should go and the pros and cons for each...
    Regards,
    Jack
    Attachments:
    TMS [PXI] FINAL DONE.vi ‏338 KB

    One thing you have not mentioned is how you are consuming the data after you save it.  Your solution should be compatible with whatever software you are using at both ends.
    Your data rate (40kS/s) is relatively slow.  You can achieve it using just about any format from ASCII, to raw binary and TDMS, provided you keep your file open and close operations out of the write loop.  I would recommend a producer/consumer architecture to decouple the data collection from the data writing.  This may not be necessary at the low rates you are using, but it is good practice and would enable you to scale to hardware limited speeds.
    TDMS was designed for logging and is a safe format (<fullDisclosure> I am a National Instruments employee </fullDisclosure> ).  If you are worried about power failures, you should flush it after every write operation, since TDMS can buffer data and write it in larger chunks to give better performance and smaller file sizes.  This will make it slower, but should not be an issue at your write speeds.  Make sure you read up on the use of TDMS and how and when it buffers data so you can make sure your implementation does what you would like it to do.
    If you have further questions, let us know.
    This account is no longer active. Contact ShadesOfGray for current posts and information.

  • OK, what is the best way to lower specific frequencies in edit view

    Listen guys, yes I do happen to know about "frequencies" and that you can't fully remove an instrument without effecting another in that same file that plays at the same time, this is pretty basic stuff.
    However, partially removing frequencies is one of the main things AA3 is intended for: "editing" the sound is it's main function.
    There must be some better answers out there about the best way of going about this in AA3.
    Do people use the spectral analysis with the different colors representing different frequencies? I have no idea how to use this.
    Do most people not get into this type of stuff?  I don't get it, seems like this is what the program was designed for (partially) so there must be more techniques out there.

    As mentioned, using the Graphic EQ or Parametric EQs, are the most common tools to adjust the energy around specific frequencies.
    The Graphic EQ provides between 10-30 bands and uses fixed values and widths.  (A slider for 1000 Hz will adjust the sound around 1000 Hz +/- a few hundred Hz in both directions.)
    The Parametric EQ offers fewer bands, but allows for greater control over the frequencies being adjusted and the affect on surrounding frequencies.
    The Notch Filter allows very tight, specific adjustments and is best used for removing artifacts like a 50/60Hz hum or high-pitched buzz.
    Spectral Frequency View makes it easy to see the frequency patterns and find precise frequencies of problem audio.  The editing tools allow you to perform many of the same functions mentioned, but visually in a paint-style application.  The frequency range of the file is displayed vertically, with 1Hz at the bottom and 22KHz (for a 44.1K file) at the top.  Each column represents a particular slice of time and displays the energy level of each frequency band via brightness and color.  The brighter a particular blob is, the louder that frequency range is at that particular point in time.
    There are other spectral views that give different viewpoints of your audio.  For example, the Spectral Pan Display shows a sort of birds-eye view of the audio's stereo-field.  Instruments that are panned further to the left, for example, will display brighter blobs on the left.  Using the selection tools, you can isolate these sounds from the rest of the stereo field and remove, copy, or add effects to the selection without affecting the rest of the audio.

  • Best way to write entire DVD-R?

    It's come to my attention that certain set top DVD players (Phillips in particular) won't play recordable media with a small amount of information written to the disc. But if you burn more than 4GB to the disc, the player reads the disc just fine. I'm working with a 15-minute program, so I'm obviously not near the 4GB. I'm interested in maximizing functionality and playability on all machines, so I'm wondering if there's a way within DVDSP, Disk Utility or Toast to write the entire disc. I've tested this by inserting video tracks that the user cannot reach from the menus, but the user could easily use the 'chapter forward' function and get lost in the dummy tracks. Thanks in advance for any thoughts.

    Yes, TY media are good, but Memorex? This forum is littered with references to the coasters that they make.
    The media in question here are TY, Verbatim and some leftover Apple brand discs from the old days. DVD-R manufacturer definitely has nothing to do with this. It's definitely an idiosyncrasy of the Phillips player in question. I've never had it happen with any of the other dozen or so players we have around here.
    We maintain many different brands of DVD player in our studios to be able to simulate any situation our products may find themselves in. Our goal is to be able to reach the largest audience possible for our clients, no matter their technological limitations. That is not always easy or even possible, given the amount of old, poor, and poorly maintained computers and DVD players out there. But we try to reach as many as possible. As tempting as it might be to always blame the user's equipment, we have to try to find novel ways of making every project as accessible as possible.
    I'll mark this question as answered, because I've discovered that there is no way to write to the edge of a DVD-R without the requisite amount of QT tracks within the DVDSP project. If anyone ever has any other ideas, please offer them. Thanks to all for contributing.

  • Best way to write readable code?

    So I'm waist deep in building my GUI by hand and it occurs to me that I'm probably not doing this the best way possible. What I have now is listed below and I was thinking that other possibilities would be to write other methods like initMainFrame() and initSearchPanel() and such that would be called from initComponents() (though I would have to either put the objects outside of those methods, probably declared immediately above the method declaration for readability, or somehow make them class scope that're declared within a method which I think I've seen somewhere, but have been unable to reproduce) or to make new class files that handle this.
    So any comments on my ideas (good/bad/etc) or insight on how you structure your code when making a GUI would be much appreciated.
        public static void initComponents() {
            // main frame
            JFrame mainFrame = new JFrame("CookBook");
            Dimension d1 = new Dimension(255, 255);
            //mainFrame.setSize(d1);
            BorderLayout mainLayout = new BorderLayout();
            mainFrame.setLayout(mainLayout);
            mainFrame.setPreferredSize(d1);
            mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // end main frame
            // menu
            JMenuBar menuBar = new JMenuBar();
            JMenu file = new JMenu("File") ;
            JMenuItem exit = new JMenuItem("Exit");
            file.add(exit);
            menuBar.add(file);
            mainFrame.setJMenuBar(menuBar);
            // end menu
            // start search bar
            JPanel search = new JPanel();
            SpringLayout searchLayout = new SpringLayout();
            search.setLayout(searchLayout);
            JLabel nameLabel = new JLabel("Name: ");
            JTextField name = new JTextField(10);
            searchLayout.putConstraint(SpringLayout.SOUTH, nameLabel, 0, SpringLayout.SOUTH, name);
            searchLayout.putConstraint(SpringLayout.WEST, nameLabel, PADDING, SpringLayout.WEST, search);
            searchLayout.putConstraint(SpringLayout.WEST, name, PADDING, SpringLayout.EAST, nameLabel);
            searchLayout.putConstraint(SpringLayout.NORTH, name, PADDING, SpringLayout.NORTH, search);
            search.add(nameLabel);
            search.add(name);
            Vector<String> initCatValue = new Vector<String>(1);
            initCatValue.add("Category");
            JComboBox category = new JComboBox(initCatValue);
            category.setEditable(true);
            searchLayout.putConstraint(SpringLayout.WEST, category, PADDING, SpringLayout.WEST, search);
            searchLayout.putConstraint(SpringLayout.NORTH, category, PADDING, SpringLayout.SOUTH, name);
            search.add(category);
            mainFrame.add(search);
            // end search bar
            // status bar
            JPanel status = new JPanel();
            FlowLayout statusLayout = new FlowLayout(FlowLayout.RIGHT);
            status.setLayout(statusLayout);
            JProgressBar progressBar = new JProgressBar();
            status.add(progressBar);
            mainFrame.add(BorderLayout.SOUTH, status);
            // end status bar
            mainFrame.pack();
            mainFrame.setVisible(true);
        }

    or somehow make them class scope that're declared within a method which I think I've seen somewhere, but have been unable to reproduceIf this is your problem then here is one method:
    public class GUI{
    JFrame mainFrame;
    public static void initComponents() {
            initMainFrame();
            initMenu();
            initSearchPanel();
            initStatusBar();
            mainFrame.pack();
            mainFrame.setVisible(true);
    private void initMainFrame(){
           // main frame
            JFrame mainFrame = new JFrame("CookBook");
            Dimension d1 = new Dimension(255, 255);
            //mainFrame.setSize(d1);
            BorderLayout mainLayout = new BorderLayout();
            mainFrame.setLayout(mainLayout);
            mainFrame.setPreferredSize(d1);
            mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            // end main frame
    private void initMenu(){
           // menu
            JMenuBar menuBar = new JMenuBar();
            JMenu file = new JMenu("File") ;
            JMenuItem exit = new JMenuItem("Exit");
            file.add(exit);
            menuBar.add(file);
            mainFrame.setJMenuBar(menuBar);
            // end menu
    private void initSearchPanel(){
          // start search bar
            JPanel search = new JPanel();
            SpringLayout searchLayout = new SpringLayout();
            search.setLayout(searchLayout);
            JLabel nameLabel = new JLabel("Name: ");
            JTextField name = new JTextField(10);
            searchLayout.putConstraint(SpringLayout.SOUTH, nameLabel, 0, SpringLayout.SOUTH, name);
            searchLayout.putConstraint(SpringLayout.WEST, nameLabel, PADDING, SpringLayout.WEST, search);
            searchLayout.putConstraint(SpringLayout.WEST, name, PADDING, SpringLayout.EAST, nameLabel);
            searchLayout.putConstraint(SpringLayout.NORTH, name, PADDING, SpringLayout.NORTH, search);
            search.add(nameLabel);
            search.add(name);
            Vector<String> initCatValue = new Vector<String>(1);
            initCatValue.add("Category");
            JComboBox category = new JComboBox(initCatValue);
            category.setEditable(true);
            searchLayout.putConstraint(SpringLayout.WEST, category, PADDING, SpringLayout.WEST, search);
            searchLayout.putConstraint(SpringLayout.NORTH, category, PADDING, SpringLayout.SOUTH, name);
            search.add(category);
            mainFrame.add(search);
            // end search bar
      private void initStatusBar(){
             // status bar
            JPanel status = new JPanel();
            FlowLayout statusLayout = new FlowLayout(FlowLayout.RIGHT);
            status.setLayout(statusLayout);
            JProgressBar progressBar = new JProgressBar();
            status.add(progressBar);
            mainFrame.add(BorderLayout.SOUTH, status);
            // end status bar
    }There can many other methods to solve this same problem... choose anyone which suits you.
    Thanks!

  • Best way to write stream to OutputStream?

    Hi, I need to write a string into an OutputStream (socket). I am a little confused how is the best way (most elegant, efficient) to do it.
    Should I use a OutputStreamWriter? Sometimes, I also need to write raw bytes directly.
    Currently, I am using:
    ByteArrayOutputStream output = new ByteArrayOutputStream();
    PrintStream printStream = new PrintStream(output);
    socket.write(output.toByteArray(), 0 , output.size());
    I would appreciate some oppinions.
    Thanks

    Hi, I need to write a string into an OutputStream
    (socket). I am a little confused how is the best way
    (most elegant, efficient) to do it.
    Should I use a OutputStreamWriter?Yes.
    Sometimes, I also need to write raw bytes directly.But does it happen in the same method? If so, you might need to re-design.
    Currently, I am using:
    ByteArrayOutputStream output = new
    ByteArrayOutputStream();
    PrintStream printStream = new PrintStream(output);
    socket.write(output.toByteArray(), 0 ,
    output.size());What's the BAOS good for? Why not String.getBytes(), if you have to use the bytes?

Maybe you are looking for

  • Function module to get table description

    Is there any function module to get table description on passing table name

  • Looking for some design ideas...

    We'd like to re-vamp a few sites from our portfolio and are looking to do so with some simple flash ideas but being new to flash we are having some trouble coming up with ideas. Looking for some ideas for the following 3 sites: http://www.goldenflax.

  • Import .java file

    I am working on a program where a few small methods change the entire gameplay. The way I have written them uses several global variables, so I cannot compile the methods without putting the globals in each. How would I go about this? I am thinking a

  • Depreciation key - Straight line method

    Hi, I have an asset with ord deprecition start date on 1.7.07. After the financial year close on 31.3.2008, we have change the ord. depn start date to 1.3.2007. Now, the adjustment is being admortised to the asset useful life (3 years) instead of cat

  • Can't get Itunes to play all the music in folder.

    I have Vista and just put iTunes on it to use instead of Media Player. My problem is if I select more then 10 files to play or just hit the "Play All" button in the folder the files open in Media Player and not iTunes. These are .mp3 files which I ha