Have a problem in Formatting output with Escape Sequence

class Welcome
     public static void main(String args[])
          //Khong the hieu noi
          System.out.println("Welcome\tto the world of java");
          System.out.println("Happy\tBirthday");
          System.out.println("Welcome\" to the world of java");
          System.out.println("Bo\ttay");
          System.out.println("Be\ttay");
          System.out.println("Nhe\ttay");
          System.out.println("Welcome\tto Viet Nam");
          System.out.println("?Welcome\tto Viet Nam");
          System.out.println("!Welcome\tto Viet Nam");
          System.out.println("*Welcome\tto Viet Nam");
          System.out.println("#Welcome\tto Viet Nam");
          System.out.println("$Welcome\tto Viet Nam");
          System.out.println("%Welcome\tto Viet Nam");
          System.out.println("^Welcome\tto Viet Nam");
          System.out.println("&Welcome\tto Viet Nam");
          System.out.println("/Welcome\tto Viet Nam");
          System.out.println("Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println(" Welcome\tto Viet Nam");
          System.out.println("Bodsdsadsme\ttay");
          System.out.println("come\tto");
Let's explain for me...Thanks

Dou you have a question ?
The character and string escape sequences allow for the representation of some nongraphic characters as well as the single quote, double quote, and backslash characters in character literals and string literals:'\b'     /* \u0008: backspace       */
'\t'     /* \u0009: horizontal tab  */
'\n'     /* \u000a: linefeed        */
'\f'     /* \u000c: form feed       */
'\r'     /* \u000d: carriage return */
'\"'     /* \u0022: double quote    */
'\''     /* \u0027: single quote    */
'\\'     /* \u005c: backslash       */In case you are using Java 1.5, you might be interested in System.out.printf(), which usesformat string.

Similar Messages

  • Hi, I have a problem on the ipod with this file "metadata_never_index". My PC doesn't recognise it. I need the program Apple Spotlight but I can't download it as well. Why? Any solution?

    Hi, I have a problem on the ipod with this file "metadata_never_index". My PC doesn't recognise it. I need the program Apple Spotlight but I can't download it as well. Why? Any solution?

    I am not doing it in ITunes, but i did down load the song from ITunes.  I loaded the song on to my Nano, but in my menu selections it doesn't show the song or the artist in any search format.  However, when i plug in my nano to my PC I see the Nano library on my PC drive listings and that song and artist are there.  I can click on the song and it will play in Windows media on my work PC.  I did notice that the format for most all the songs in my library on my Nano are MPEG - 4 audio Files. 
    Thanks for your help, Mel

  • Hi, I have big problems since 2 weeks with outline, fonts, size in Ai CS6 : Numerical value are so big

    Hi, I have big problems since 2 weeks with outline, fonts, size in Ai CS6 : Numerical value are so big and I can't change it with smaller. Apparently Ai said me that comes from AiPrefs... Could you help me please.
    I tried to initialize my preferences but nothing change.
    PS : Sorry for my English, I'm French
    Pierre

    Pierre,
    You may try the list and see how far down you need to go; you have probably been through 1) and 2), and 4) is both reversible and more thorough than 3); 5) is hardly relevant, so you may end up with 6).
    The following is a general list of things you may try when the issue is not in a specific file (you may have tried/done some of them already); 1) and 2) are the easy ones for temporary strangenesses, and 3) and 4) are specifically aimed at possibly corrupt preferences); 5) is a list in itself, and 6) is the last resort.
    If possible/applicable, you should save current artwork first, of course.
    1) Close down Illy and open again;
    2) Restart the computer (you may do that up to at least 5 times);
    3) Close down Illy and press Ctrl+Alt+Shift/Cmd+Option+Shift during startup (easy but irreversible);
    4) Move the folder (follow the link with that name) with Illy closed (more tedious but also more thorough and reversible);
    5) Look through and try out the relevant among the Other options (follow the link with that name, Item 7) is a list of usual suspects among other applications that may disturb and confuse Illy, Item 15) applies to CC, CS6, and maybe CS5);
    Even more seriously, you may:
    6) Uninstall, run the Cleaner Tool (if you have CS3/CS4/CS5/CS6/CC), and reinstall.
    http://www.adobe.com/support/contact/cscleanertool.html

  • I have a problem in formatting cells in Excel while using OLE method.

    Hi All,
    I have a problem in formatting cells in Excel while using OLE method.
    My requirement is to have certain fields of a cell as text and amount fields should be in number format.
    How to format a cell in Excel in OLE method of downloading data to excel.
    For example I have plant field whose value is 0002 in internal table while coming to excel it is showing as 2 .
    I want that field to be shown as 0002.(text format)
    Material field whose value in internal table is 000000000000000051 is shown as 51 which has to be shown as
    000000000000000051.(text format).
    Amount field should be in number format so that totalling is possible .
    So I need some cells in text format and some in number format.
    Please suggest a sloution.
    Thanks in advance,
    Regards,
    vidyulatha.U

    https://forums.sdn.sap.com/click.jspa?searchID=21931962&messageID=6852860
    hope this helps.

  • I have a problem regarding af:dataTable with tableSelectOne .

    HI,
    I have a problem regarding <af:dataTable> with <tableSelectOne>. I would like to know how can I pre-select
    the first item of the table? I have tried to search on the net but can't find something useful.
    Any help would be appreciated
    Regards
    Amu

    Ask has the human to know?

  • Anyone have the problem I'm having with the Safari collecting cookies even when I'm not on a website?  I cleaned everything out and checked several times.  Each time cookies were added that I've never seen with my older version of Safari.  I have the bloc

    Anyone have the problem I'm having with the Safari collecting cookies even when I'm not on a website?  I cleaned everything out and checked several times.  Each time cookies were added that I've never seen with my older version of Safari.  I have the block third parties and advertisers but I don't think it works.  Here's a sample of what is popping up:  247realmedia.com, 2mdn.net addthis.com, admeld.com, adsafeprotected.com, adsonar.com, bit.ly, bluekai.com, bluelithium.com, bluetoad.com bondware.com.......... over 100 things without a clue where they are coming from.  Especially since I'm not on any webpage!  How do I report a bug?  Is there a way to fix this?  

    Firefox + NoScript, BetterPrivacy, Ghostery, AdBlock Plus, Click&Clean helps.
    Hidden Flash cookies are stored in "Macromedia" Folders on your computer, can delete using the free Easy Find, but need to reinstall Flash again here
    http://www.macupdate.com/app/mac/11076/easyfind
    http://get.adobe.com/flashplayer/
    OnyX run afterwards All the cleaning and maintenance steps followed by a reboot, followed by a Disk Utility erase free space.
    http://www.titanium.free.fr/
    CCleaner is in beta for OS X, can combine the cleaning and secure erase in the same steps if properly configured.
    http://www.piriform.com/mac/ccleaner
    Ideally, to surf XXX sites, one should use a virtual machine software like the free VirtualBox and a ISO of Linux like MacBuntu,
    https://www.virtualbox.org/
    http://www.oslike.se/
    comes with Firefox and Flash is available in the Ubuntu Software Center, create a "snapshot" of this virtual machine to revert back too after surfing. This dumps everything hidden or malware related in the guest OS, scrub the drive if you wish with Disk Utility Erase free space option.
    HTML 5 has introduced a whole new range of tracking ability, you can search for the details online.
    Flash cookie, everycookie, HTML cookies. Google has trackers all over the internet, they record your computer info and all your searches, ISP's record all your IP traffic and keep it for a year, cell carriers track your location via tower and signal triangulation (even non-GPS/smartphones) and keep the results for 6 months and both turn over everything to governments. In fact Uncle Sammy has NSA backrooms on the Internet backbone capturing the traffic in real time.
    http://yro.slashdot.org/story/11/03/26/179257/German-Politician-Demonstrates-Ext ent-of-Cellphone-Location-Tracking
    Turn off Java. Run with little or no scripts. (NoScript)
    SSD drives can't be securely erased as this would wear them out prematurely, the government and police have a portable device from Cellbright they can attach to over 3000 phones and grab the data and password with.
    http://hardware.slashdot.org/story/11/02/17/1911217/Confidential-Data-Not-Safe-O n-Solid-State-Disks
    http://www.thenewspaper.com/news/34/3458.asp
    Creepy program track you by pictures you took
    http://www.thinq.co.uk/2011/3/30/creepy-app-warns-end-privacy/
    Apple trying to patent new spyware
    https://www.eff.org/deeplinks/2010/08/steve-jobs-watching-you-apple-seeking-pate nt-0
    http://betanews.com/2011/04/20/apple-tracking-location-of-ios4-device-users-rese archers-say/
    Each computer has a unique ID and a MAC addrress on file with Apple, Java gives up this information with a simple script on websites
    Also look here and freak out.
    http://www.whatsmyip.org/more/
    You can't win, the government, advertisers, social sites, search engines and devices makers are all in cohoots to profile everyone.
    Live off the grid and have your freedom or tell everyone your business and let them mold you, there is no "in between", try as you may they just come up with new stuff to watch you, through your web cam, via the hidden microphone and even can turn on some cell phones microphones too.
    You may be paranoid, so is the government, and they got more money, power and resources at their disposal to act on it.
    Erase the whole hard drive and reinstall, if you can't do that, trash the entire machine and go read a book.
    https://discussions.apple.com/message/16276201#16276201
    (ps. that was fun, enjoy the paranoia because they ARE watching you.)

  • I have billing problem who to contact with in middle east ?

    i have billing problem who to contact with in middle east ?

    your carrier
    apple do not sell phone subscriptions
    and this is not an official apple channel this is a user helping users forum

  • I have a problem when update tables with a database link (APEX)

    Hi, I search answers for my problem and I not found a solution. My problem start when I open page with database link statement in APEX. I drop tables and execute this for update the tables in APEX.
    EXECUTE IMMEDIATE 'CREATE TABLE XXXXXXX
    AS
    SELECT A1,A2,A3
    FROM AAA@BBB';
    I use Mozilla Firefox and isn't always updated the tables because it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    In the explorer always show a window only the text "IBMPC/WIN_NT-8.1.0"...
    What is the solution for my problem? I need update this tables.
    Thanks. John.

    It's easy. It doesn't work a database link, on apex, with a pl/sql code or store procedure.
    I saw that many people had the same problem but I don't see a solution.
    As I put up, I want to remove my tables on APEX and copy the table of my Oracle database with the update dates.
    The posts are from the same problem as my English is very bad, it got to help explain the problem.
    I have a page with a pl/sql code. This code in Oracle is correctly.
    For example, with this code I update the table PRUEBAS with the data of TABLEX.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX';
    END;
    But, in this code, I have the problem.
    BEGIN
    BEGIN
    EXECUTE IMMEDIATE 'DROP TABLE "PRUEBAS"';
    EXCEPTION WHEN OTHERS THEN NULL;
    END;
    EXECUTE IMMEDIATE 'CREATE TABLE "PRUEBAS"
    AS
    SELECT AAA,
    BBB,
    CCC
    FROM TABLEX@DB_LINK';
    END;
    I sometimes get an error. Sometimes it works fine, but half of the tries Apex returns "IBMPC/WIN_NT-8.1.0" in the browser and I am not using an IBM PC or Win NT...
    And i read that In the alert_xe.log file there are a error of core dump... ... :S or that the application return corrupt headers.... Is a problem of versions?
    I used a synonym and I have the same problem.      
    Even if I run the code on SQL COMMANDS (SQL WORKSHOP) it shows dialog for downloading file "f". I rename the file to txt and I see the text "IBMPC/WIN_NT-8.1.0"...
    The problem is in Mozilla Firefox and in IE.
    I have the OracleXE 10g (Application Express 3.0.1.00.08).
    And the question is.. ... ... ... ... What is the solution? :)
    Thanks.
    John.

  • I have some problem about wifi sync with iOS5

    Hi~everbody~
    I have some problem with wifi sync, and still don't know how to resolve it. Please Help Me~
    First,I using Windows 7 64-bit, the latest iTunes 10.5, and iPod touch 4 with 5.0(9A334), and of course a WIFI AP in my room.
    Here is my major problem:
    When I setted up enable wifi sync in iTunes summary, the iTunes had identified my iPod and show at left side in iTunes,
    even when I unplug  my iPod touch 4 from my computer, the iTunes still shows there.
    But after one day when I came home, I opened the iTunes want do a wireless sync, but the iTunes did not found my machine.
    I have tried restart computer, restart WIFI AP, disable anti-virus software, close MSN, close teamviewer, and any software may caused some unstable network issue between iTunes and iPod touch 4, but when I done these whole things, the iTunes still not found my iPod.
    So I want to know do Wifi Sync needs any specific net port ? like 80 port or some port else?
    Wish there are somebody can help me fix this, very appreciate.
    BTW: Even iTunes did not found my iPod touch 4, but I can still using "Remote App" to control iTunes music play, so I really confuse why it just can't do wifi sync ?

    This error has got nothing to do with rmi.
    The StackOverflowError means the Java VM stack is filled up. The
    stack is used for keeping track of method calls. An easy way to
    produce a StackOverFlowErrer is the following code:
    class Test {
    public static void main(String[] args) {
    a();
    static void a() {
    a();
    So if you call method a() within the same method, the stack
    fills up quickly.

  • Formatted output with JAXB

    Hi, Please help me with the formatting of output XML file using JAXB. This is my client program that marshals xml content into xml file. This program is creating XML file with no indentation at all. I commented out the line
    m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    still getting same xml file with no indentation. Am I doing anything wrong?
    Thanks in advance.
    try {
    // create a Validator
    Validator v = jc.createValidator();
    // validate the content tree
    boolean valid = v.validate( root );
    //logger.info("XML File Validated Successfully" );
         Marshaller m = jc.createMarshaller();
    m.setProperty(Marshaller.JAXB_SCHEMA_LOCATION, "http://mydomain.com/Schemas/data DT.xsd");
    DataWriter writer = new DataWriter(
    new OutputStreamWriter(new FileOutputStream(fileName),"UTF-8"),
    "UTF-8" );
    m.setProperty("com.sun.xml.bind.namespacePrefixMapper",new NamespacePrefixMapperImpl());
    m.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    m.marshal(root, writer);
    }catch( ValidationException ue ) {
    logger.error( "Caught ValidationException"+ue ); throw new SdarsDBException("Validation Exception "+ue);
    } catch( JAXBException je ) {
    je.printStackTrace();
    } catch( IOException ioe ) {
    ioe.printStackTrace();

    Hi,
    try writing to the FileOutputStream directly.
    I get formatted output this way.
    maybe the DataWriter is doinfg some translatiopn for you?
    Chris

  • I have a problem sending files along with thier directories to server

    The Problem is i couldnt understand the sequence in which should the file transfers will execute.....
    Here is the Code ......
    The **************Error************* i get is that it makes one dir then other one and paste one file in it after writing another file in the second loop it gives error on write UTF that Socket write Error COnnection Reset by peer
    ***************************CLIENT************************
    package oam.filemanager;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    import oam.beans.*;
    public class FileClient {
    Socket socket;
    DataOutputStream dataout;
    FileBean file;
    public void SetSocket() {
    //Create socket connection
    try {
    socket = new Socket("localhost", 9898);
    dataout = new DataOutputStream(socket.getOutputStream());
    String wavfiles []=null;
    //Directory & Wavfiles Manipulation
    file=new FileBean();
    String dirs []= file.getDirsForSocket("Accounts//");
    for(int i=0;i<dirs.length;i++){
    wavfiles= file.getWavfiles("Accounts//"+dirs[i]+"//");
    //sending Username & DIR
    dataout.writeUTF(dirs);
    if (wavfiles.length==0)
    dataout.writeUTF("no");
    for (int j=0;j<wavfiles.length;j++){       
    //Sending Filename
    dataout.writeUTF(wavfiles[j]);
    //getting file to be send
    File f = new File("Accounts//"+dirs[i]+"//"+wavfiles[j]);
    int fileLength = (int) f.length();
    System.out.println("fileLength " + fileLength);
    byte data[] = new byte[fileLength]; //settting array of byte to file len
    //reading from file acha
    FileInputStream fis = new FileInputStream(f);
    // Send file length
    dataout.writeInt(fileLength); // writing file length
    dataout.flush();
    System.out.println("Length Sent .... " + fileLength);
    dataout.flush();
    // Send file
    int loop = 0;
    loop = fis.read(data);
    System.out.println("......1......" + "in loop" + loop);
    if (loop > -1) {
    dataout.write(data);
    //closeConnection();
    // output.flush();
    catch (UnknownHostException e) {
    System.out.println("Unknown host:");
    System.exit(1);
    catch (IOException e) {
    System.out.println("No I/O " + e.getMessage());
    System.exit(1);
    catch (Exception e){
    e.printStackTrace();
    public static void main(String args[]) {
    FileClient serv = new FileClient();
    serv.SetSocket();
    ******************************************SERVER*********************
    import java.io.*;
    import java.net.*;
    import java.io.*;
    class ClientThread
    implements Runnable {
    FileOutputStream output;
    DataInputStream input;
    String uname;
    String filename;
    Socket client;
    public ClientThread(Socket clientth) {
    this.client=clientth;
    public void checkdir(String dirname){
    File f =new File("..//Accounts//"+uname+"//");
    if (!f.exists()){
    f.mkdirs();
    public void run() {
    try {
    while (true) {
    input = new DataInputStream(client.getInputStream());
    uname = "";
    filename = "";
    uname = input.readUTF();
    checkdir(uname);
    filename = input.readUTF();
    if (!filename.equals("no")) {
    System.out.println("Filename Recieved of file: " + filename);
    File f = new File("..//Accounts//" + uname + "//" + filename);
    if (!f.exists()) {
    RandomAccessFile raf = new RandomAccessFile(f, "rw");
    raf.setLength(0);
    int length;
    int pack = 0;
    int fileLength = 0;
    System.out.println("User Name received...." + uname);
    System.out.println("...2a....");
    fileLength = input.readInt();
    System.out.println("...2b....");
    System.out.println("Length Receieved .... " + fileLength);
    // input.readInt();
    // input.readInt();
    byte data[] = new byte[fileLength];
    System.out.println("Length Receieved .... " + fileLength);
    input.read(data);
    raf.write(data);
    raf.close();
    System.out.println("File Receieved and Wrote at Server");
    // clientoutput.flush();
    else {
    System.err.println("File Already Exists request by " + uname);
    } //if check ends
    catch (IOException e) {
    System.out.println("in or out failed"+ e.getMessage());
    System.exit( -1); }
    public class FileServer {
    Socket client;
    ServerSocket server;
    public FileServer(){
    File f=new File("..//Accounts") ;
    if(!f.exists())
    f.mkdirs();
    public void listenSocket() {
    try {
    server = new ServerSocket(9898);
    catch (IOException e) {
    System.out.println("Could not listen on port 9898 Server Already Listening");
    System.exit( -1);
    while (true) {
    ClientThread cth;
    try {
    cth = new ClientThread(server.accept());
    Thread thr = new Thread(cth);
    thr.start();
    catch (Exception mye) {
    mye.printStackTrace();
    protected void finalize() {
    try {
    server.close();
    catch (IOException e) {
    System.out.println("Could not close socket");
    System.exit( -1);
    public static void main(String args[]) {
    FileServer serv = new FileServer();
    serv.listenSocket();

    Well Thanks a lot : jschell so nice of u helping me all through this well i sort out this problem as well...
    i wasnt sending all files at once ...........one by one the problem was the biggest file is 240 k and byte arraay couldnt accomdate it ................so now i am sending files in 4k packets any of u guys need help u can see this code how to send files in packets .................
    //**********************SERVER************************************
    package servermanager;
    import java.io.*;
    import java.net.*;
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    class ClientThread
        implements Runnable {
      FileOutputStream output;
      DataInputStream input;
    DataOutputStream dataout;
      String uname;
      String filename;
      Socket client;
      JTextArea log;
      public ClientThread(Socket clientth,JTextArea mylog) {
        this.client=clientth;
        this.log=mylog;
      public void checkdir(String dirname){
      File f =new File("..//Accounts//"+uname+"//");
      if (!f.exists()){
        f.mkdirs();
      public synchronized  void  startTransfer(){
          try {
              FileOutputStream fos=null;
              input = new DataInputStream(client.getInputStream());
              uname = "";
              filename = "";
              uname = input.readUTF();
              checkdir(uname);
              filename = input.readUTF();
              File f = new File("..//Accounts//" + uname + "//" + filename);
              RandomAccessFile raf = new RandomAccessFile(f, "rw");
              raf.setLength(0);
              raf.close();
              long fileLength=0;
              byte lenbuf[]=null;
              int help =input.read();
              lenbuf = new byte[help];
              input.read(lenbuf);
              String lenz = new String(lenbuf);
              fileLength = new Integer(lenz).longValue();
              fos = new FileOutputStream (f);
              byte data[]=new byte[4096];
              int length;
              while( (length=input.read(data, 0, 4096)) > 0) {
               fos.write(data, 0, length);
              fos.close();
      log.append("\n File Recieved = ["+filename+"]:---:"+"of Size["+fileLength+"]:---:"+"By ["+uname+"]." );
        catch (IOException e) {
          log.append("\n In or Out failed"+e.getMessage());
          System.exit( -1);}
      public void run() {
        startTransfer();
    public class FileServer extends JFrame {
      int port;
      Socket client;
      ServerSocket server;
      JScrollPane textscrollpane = new JScrollPane();
      JTextArea log = new JTextArea();
      JButton clear_btn = new JButton();
      JButton stop_btn = new JButton();
      public FileServer(){
        port=9898;
        File f=new File("..//Accounts")  ;
        if(!f.exists())
         f.mkdirs();
        try {
          jbInit();
        catch(Exception e) {
          e.printStackTrace();
      public void listenSocket() {
        try {
          server = new ServerSocket(port);
        catch (IOException e) {
         log.append("\n Could not listen on port["+port+"]");
         System.exit( -1);
        while (true) {
          ClientThread cth;
          try {
            cth = new ClientThread(server.accept(),log);
            Thread thr = new Thread(cth);
            thr.start();
          catch (Exception  mye) {
         log.append("\n Thread Exception["+mye.getMessage()+"]");
      protected void finalize() {
        try {
          server.close();
        catch (IOException e) {
              log.append("\n Could not Close Socket on port["+port+"]");
          System.exit( -1);
      public static void main(String args[]) {
        FileServer serv = new FileServer();
        serv.setBounds(new Rectangle(150,150,500,300));
        serv.show();
        serv.listenSocket();
      private void jbInit() throws Exception {
        this.getContentPane().setLayout(null);
        textscrollpane.setBounds(new Rectangle(1, 21, 489, 212));
        log.setBackground(Color.black);
        log.setForeground(Color.green);
        log.setToolTipText("Server Log");
        log.setEditable(false);
        log.setLineWrap(true);
        clear_btn.setText("Clear");
        clear_btn.addActionListener(new FileServer_clear_btn_actionAdapter(this));
        clear_btn.setBounds(new Rectangle(323, 245, 86, 13));
        clear_btn.setToolTipText("");
        stop_btn.setToolTipText("");
        stop_btn.setBounds(new Rectangle(55, 246, 86, 13));
        stop_btn.setText("Stop");
        stop_btn.addActionListener(new FileServer_stop_btn_actionAdapter(this));
        this.addWindowListener(new FileServer_this_windowAdapter(this));
        this.getContentPane().add(textscrollpane, null);
        this.getContentPane().add(stop_btn, null);
        this.getContentPane().add(clear_btn, null);
        textscrollpane.getViewport().add(log, null);
        log.setText("Server Initiated Listening on Port [9898]...");
      void stop_btn_actionPerformed(ActionEvent e) {
        System.exit(0);
      void this_windowClosed(WindowEvent e) {
        System.exit(0);
      void this_windowClosing(WindowEvent e) {
    System.exit(0);
      void clear_btn_actionPerformed(ActionEvent e) {
      log.setText("");
    class FileServer_stop_btn_actionAdapter implements java.awt.event.ActionListener {
      FileServer adaptee;
      FileServer_stop_btn_actionAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.stop_btn_actionPerformed(e);
    class FileServer_this_windowAdapter extends java.awt.event.WindowAdapter {
      FileServer adaptee;
      FileServer_this_windowAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void windowClosing(WindowEvent e) {
        adaptee.this_windowClosing(e);
    class FileServer_clear_btn_actionAdapter implements java.awt.event.ActionListener {
      FileServer adaptee;
      FileServer_clear_btn_actionAdapter(FileServer adaptee) {
        this.adaptee = adaptee;
      public void actionPerformed(ActionEvent e) {
        adaptee.clear_btn_actionPerformed(e);
    //**********************CLIENT************************************
    package servermanager;
    import java.net.*;
    import java.util.*;
    import java.io.*;
    public class FileClient {
      Socket socket;
      DataOutputStream dataout;
      public   void SetSocket(String dir,String filename) {
        try {
          socket = new Socket("localhost", 9898);
          dataout = new DataOutputStream(socket.getOutputStream());
            //sending Username & DIR name
            dataout.writeUTF(dir);
            //Sending Filename
            dataout.writeUTF(filename);
            dataout.flush();
            File f = new File("Accounts//"+dir+"//"+filename);
            byte data[]=new byte[4096];  //40k
            long filelength=f.length();
            String lenbuf = String.valueOf(filelength);
             byte lenz[] = lenbuf.getBytes(); //file length in bytes
               int lenzLen = lenz.length;
            FileInputStream fis = new FileInputStream(f);
            dataout.write(lenzLen);  //sending length in integer
            dataout.flush();
            System.out.println(lenzLen+"--------First Thing Sent length of byte array");
            dataout.write(lenz);      //sendinf byte  Array length
            dataout.flush();
              System.out.println(lenz+"--------Second Thing Sent bytes");
            int loop=0;
              while(loop!=-1){
                loop=fis.read(data);
                dataout.write(data);
                dataout.flush();
              socket.close();
        catch (UnknownHostException e) {
          System.out.println("Unknown host:");
          System.exit(1);
        catch (IOException e) {
          System.out.println("No I/O   " + e.getMessage());
          System.exit(1);
        catch (Exception e){
          e.printStackTrace();
      public static void main(String args[])  {
        FileClient serv = new FileClient();
        FileBean file=new FileBean();
        String wavfiles []=null;
        String dirs []=  file.getDirsForSocket("Accounts//");
        for(int i=0;i<dirs.length;i++){
        wavfiles= file.getWavfiles("Accounts//"+dirs[i]+"//");
         //if (wavfiles.length==0)
              for (int j=0;j<wavfiles.length;j++){
                  serv.SetSocket(dirs,wavfiles[j]);

  • Format output with printf

    I'm currently taking a Java programming class using Java version 1.5.0_06 for my class.
    I'm running into problems with the printf statements. Can someone help me figure out what's wrong with this statement?
    outFile.printf("%-26s $ %12.2f%n", "Assessed Value:", assessVal);
    Basically, I want the output to print, for example:
    Assessed Value:********* $ 1000000.00 (* denotes spaces)
    This is the error message I get when running it:
    Exception in thread "main" java.lang.Error: Unresolved compilation problems:
         The method printf(String, Object[]) in the type PrintWriter is not applicable for the arguments (String, String, double)
    Any help is appreciated.
    ntjava

    Well, opened list of arguments which is used by printf method, as well as autoboxing, are 1.5 features. So when you need to compile with an old java (1.4), opened list of arguments is replaced by array of Objects. And in this case you need to write something like
    printf("your format string", new Object[] {"some string", new Double(varDouble)});But in this case you need to check what java version do you use to compile it. Just execute
    java -versionYou can use -source argument to specify which version of java do you use (1.4 or 1.5) in your java sources.

  • Formatting output with colors

    Hi,
    I want to display a particular word with some color. But I have to choose that word at runtime based on some condition.
    for eg: there are 3 words: str1, str2 and str3.
    I have to print all the words, but str2 with yellow color and others with normal color ( ie no color ).
    How to do this?
    Regards,
    Kalai

    Hi,
    Use the FORMAT keyword
    eg.
    FORMAT color 3.
    write str3.
    FORMAT color off.
    Note :
    FORMAT.
    Additions:
    1. ... COLOR n     [ON] or   ... COLOR       OFF
    2. ... INTENSIFIED [ON] or   ... INTENSIFIED OFF
    3. ... INVERSE     [ON] or   ... INVERSE     OFF
    4. ... HOTSPOT     [ON] or   ... HOTSPOT     OFF
    5. ... INPUT       [ON] or   ... INPUT       OFF
    6. ... RESET
    Effect
    Sets or modifies the valid output format.
    Notes
    The formats set by FORMAT are effective from the next output operation to the list, i.e. from the next WRITE command or from the next new line.
    The addition ON for switching on the relevant output format is optional.
    You can also set the static additions ON, OFF and n (for COLOR) dynamically with = var (for further information, see end of this documentation).
    Addition 1
    ... COLOR n [ON] or   ...COLOR OFF
    Effect
    Color of line background. n can have the following values:
    Reward if helpful.
    regards,
    LIJO JOHN.

  • Problems setting Inhibit Outputs with UMI

    I am using a 3rd party stepper drive with a PCI7334 and 7764 UMI. The Step, Dir and Enable inputs on the drive are opto isolated. I have tied the -ve terminal of each to Ground and the +ve terminal to +5V though a 390ohm resistor and to the corresponding connection on the UMI.
    I setup the axes inhibit output in software to be Inverting, the switch on the UMI is set to Active Low inhibit outputs and the Drives are Active closed (need to have a potential difference across them to be enabled).
    My third axis must be enabled the opposite way around. But when i set it up in software to be Non-inverting, it doesn't change on the UMI. why would this be so?
    Can you have one axis with its inhibit output active low, and another axis with it
    s inhibit output active high?
    Also, Do i need to pull the inhibit outputs high?
    Your help will be much appreciated.

    To whom it may concern:
    Yes, you can have one axis with its inhibit output active low and another axis set to active high. You need to go into MAX under the Device Settings and expand the tree entitled Axis Settings. With the corresponding axis selected in the tree, you can set the inhibit output to active high or low. If you don't expand the tree under Axis Settings then whatever you set the inhibit output polarity to will apply to all axes on the board. That might be part of your problem.
    That inhibit output shouldn't need to be pulled high. That would be handled internally to the board.
    Hopefully that is help to you. Best of luck with things.
    Jim Laudie
    Applications Engineer, National Instruments

  • I have a problem to add data with UDO.

    this is my code:
      Try
                Dim oCompService As SAPbobsCOM.CompanyService
               oCompService = ap.oCompany.GetCompanyService()
               ap.oCompany.StartTransaction()
                Dim oDocGeneralService As SAPbobsCOM.GeneralService
                Dim oDocGeneralData As SAPbobsCOM.GeneralData
                ''in this line is the Error. ***
                +*oDocGeneralService = oCompService.GetGeneralService("MyDocUDO")*+       
      Catch ex As Exception
                If (ap.oCompany.InTransaction) Then
                    ap.oCompany.EndTransaction(SAPbobsCOM.BoWfTransOpt.wf_RollBack)
                End If
       End Try
    in this line trought a exception that it said: "Interface not registered". I think the problem is the object oCompService but I don't know solved. Anyone Can Help me??
    Thanks.

    ...you are sure you have created the UDO "MyDocUDO" ? that error appears in the case that there is any UDO with that name, to verify if this UDO exists go in Business One to Menu Tools --> Customisation tools --> Objects registration wizard, in the wizard click next -> update existing object -> next : you will see the list of existing UDO....
    I have verified that the object exists, even I have verified it in the table OUDO. I think that the error owes to the DLL SAPBOSCOM, but i don,t know solved it.
    Thanks.

Maybe you are looking for

  • File broswer issues

    My file browser opened today way up in the right hand corner of the window. I cannot get it to move down so I can even see the X to click it off. It won't move around in the window like I used to could. I see very little of the window. How can I rese

  • How to configure a DualPoint Stick?

    On my Dell E6530 "xinput -list" shows these two input devices: ⎜ ↳ DualPoint Stick id=13 [slave pointer (2)] ⎜ ↳ AlpsPS/2 ALPS DualPoint TouchPad id=14 [slave pointer (2)] I fail to find a way to configure the sensitivity and speed of the DualPoint S

  • How can you contact itunes without giving a serial number?

    Does anyone know how to contact Itunes without having to give a serial number?   I just need then to allow me to update things, but the system does not recognise my password

  • OSMF 1.5 RTE

    I'm trying to upgrade my AS3 only application from OSMF 1.0 -> 1.5 but I'm getting the following RTE: VerifyError: Error #1053: Illegal override of defaultFactory in mx.styles.CSSMergedStyleDeclaration. I've taken a look at my settings and it seems t

  • Epson PS R2400 won't print 13 by 20

    For the last few days, my Epson Photo Smart R2400 will only print a 8.5 x 11 portion of a 13x20 document. I have iMac Power Mac on 10.5.6. I have tried everything possible to get this printer to print the full page (and I've been using these printers