Separate thread for input stream and output stream.

Hi Techies,
In a socket connection, can we run the input stream and output stream in separate threads. actually in my case, the input stream will be getting the input regularly and output stream will send data very rare. so if i impelment them in one class then unless there is data to send output stream will be blocked. i was thinking to impelment both the streams in separate threads. is it a good way? so how to implement it. your guidance will be of great help.
thanks in advance.

JavaBreather wrote:
Hi Techies,
In a socket connection, can we run the input stream and output stream in separate threads.I would say this is the most common way of handling sockets and threads. esp pre-NIO.
Iis it a good way? so how to implement it. your guidance will be of great help.Once you have a socket, create two threads, one which does the reading and one which does the writing.
You could use BlockingQueues to abstract access to these threads. i.e. the reading thread reads something from the socket and adds it to the BlockingQueue. The writing thread take()s something froma second BlockingQueue and writes it to the Socket. This way you add things to write or get thing to process by looking at the BlockingQueues.

Similar Messages

  • MultiThreading with Input and Output Streams

    Hi,
    I have a problem and I think it's because I'm not coding correctly. Please help me if you can understand what I'm doing wrong.
    I have a server that spawns a separate thread to go off and collect data from a serial port. It also waits to accept connections from any client and if a connection is made it will send that data to the clients connected.
    There is data constantly coming in through the serial port. It is output through a DataOutputStream so when the thread is created in the server, I pipe it into a DataInputStream. I do does because I want the server to then read in the data from the inputstream and then send it out to all my clients.
    So far, the way I have it set up seems to do this. But my problem occurs when I try to close a client connection. Instead of removing the socket connection it gives me an error that it can't send data to the client, but it shouldn't be sending data to the client because I just closed it. I realize this is probably because I'm still constantly receiving data from my inputstream and the connection was closed so it can't send that data to the client. I know I need to either close the stream or close my socket but I don't know where this needs to be done. I'm stuck on the correct way to fix this.
    My second problem is the initial connection made to receive data from the inputstream. This is probably because I'm not very familiar with how input/output streams work. But instead of just sending the client the current data being received in real time, it'll send all the data that's buffered in the inputstream. I don't want all the data that's been collecting to go to that first client. I only want the recent data that is coming through while the client is connected. Does this make sense? Because after I make a second client connection I don't have this problem because the InputStream is no longer buffered up. Should I be using something else besides the DataInputStream?
    I feel like I'm going about this the wrong way. Please advise. I'm shy about showing the code but I've included the bulk of it here in hopes that someone will see what I'm doing wrong. The only part that's left out is the thread that reads from the serial port. I don't seem to have any problems with that thread.
    Thanks,
    kim
    ===
    import java.io.*;
    import java.net.*;
    import javax.comm.*;
    import java.util.*;
    // DataServer waits for a client connection
    class DataServer
         static final int PORT = 7;
         // The ServerSocket to use for accepting new connections
         private ServerSocket ss;
         // A mapping from sockets to DataOutputStreams. This will
         // help us avoid from having to create a DataOutputStream each time
         // we want to write to a stream.
         private Hashtable outputStreams = new Hashtable();
         // The inputstream that will receive serial port data through a
         // piped inputstream
         public DataInputStream datalogger;
         // Constructor and while-accept loop all in one.
         public DataServer() throws IOException
              try {
                   // Creating pipe to convert the outputstream from the
                   // RS232 Thread to an inputstream for the server to read
                   PipedOutputStream pout = new PipedOutputStream();
                   PipedInputStream pin = new PipedInputStream(pout);
                   // The inputstream that will receive data from the RS232Thread
                   datalogger = new DataInputStream(pin);
                   // Spawn the thread that will read data through from
                   // the TINI serial port
                   new RS232Thread( pout ).start();
                   // Begin listening for connections and send data
                   listen();
              } catch (IOException ioe) {
                   System.out.println("Error >> DataServer::DataServer()");
                   System.out.println(ioe.getMessage());
                   ioe.printStackTrace();
              } finally {
                   try     {
                        System.out.println( "Closing >> DataServer::DataServer()" );
                        datalogger.close();
                   } catch (IOException i ) {
                        System.out.println( "Error2 >> DataServer::DataServer()" );
                        System.out.println(i); }
         private void listen() throws IOException
              // Create the ServerSocket
              ss = new ServerSocket( PORT );
              // Inform that the server is ready to go
              System.out.println( "Listening on " + ss );
              // Keep accepting connections forever
              while (true) {
                   // Grab the next incoming connection
                   Socket s = ss.accept();
                   // Inform that connection is made
                   System.out.println( "Connection from " + s );
                   // Create a DataOutputStream for writing data to the
                   // other side
                   DataOutputStream dout = new DataOutputStream( s.getOutputStream() );
                   // Save this stream so we don't need to make it again
                   outputStreams.put( s, dout );
                   // Create a new thread for this connection, and then foret
                   // about it
                   new ServerThread( this, s );
         // Get an enumeration of all the OutputStreams, one for each client
         // connected to the server
         Enumeration getOutputStreams() {
              return outputStreams.elements();
         // Send a message to all clients (utility routine)
         void sendToAll( byte[] b ) {
              // synchronize on this because another thread might be
              // calling removeConnection() and this would screw things up
              // while it walks through the list
              synchronized( outputStreams ) {
                   // For each client...
                   for (Enumeration e = getOutputStreams(); e.hasMoreElements();) {
                        // ... get the output stream ...
                        DataOutputStream dout = (DataOutputStream)e.nextElement();
                        // ... and send the message
                        try {          
                             dout.write( b );
                        } catch(IOException ie) {                     
                             System.out.println( "Error >> ServerThread::sendToAll()" );
                             System.out.println( ie );
         // remove a socket, and it's corresponding output stream, from the
         // list. This is usually called by a connection thread that has
         // discovered that the connection to the client is dead.
         void removeConnection( Socket s ) {
              // Synchronize so it doesn't mess up sendToAll() while it walks
              // down the list of all output streams
              synchronized( outputStreams ) {
                   // Inform about removal
                   System.out.println( "Removing connection to " + s );
                   // Remove if from our hastable/list
                   outputStreams.remove( s );
                   // Make sure it's closed
                   try {
                        s.close();
                   } catch( IOException ie ) {
                        System.out.println( "Error closing " + s );
                        ie.printStackTrace();
         // main - Opens a server socket and spins off a new thread each time
         // a new client connection is accepted on this socket.
         public static void main(String[] args) throws Exception
              System.out.println("Starting DataServer version 1.0 ...");
              try     
                   new DataServer();
              catch (IOException ioe)
                   System.out.println( "Error >> DataServer::main()" );
                   System.out.println(ioe.getMessage());
                   ioe.printStackTrace();
    class ServerThread extends Thread
         //The Server that spawned this thread
         private DataServer server;
         // The Socket connected to the client
         private Socket socket;
         //Constructor
         public ServerThread( DataServer server, Socket socket )
              // save the parameters
              this.server = server;
              this.socket = socket;
              // Start up the thread
              start();
         // This runs in a separate thread when start() is called in the
         // constructor
         public void run() {
              try {
                   // The inputstream receiving data from the global inputstream
                   // that is piped to the RS232 Thread
                   // ???? is this where i'm messing up ???
                   DataInputStream in = new DataInputStream( server.datalogger );
                   int num = 0;
                   byte[] d = new byte[1];
                   // read from the inputstream over and over, forever ...
                   while( ( num = in.read(d) ) > 0 ) {
                        // ... and have the server send it to all clients
                        server.sendToAll( d );               
              } catch (IOException ioe) {
                   System.out.println( "Error >> ServerThread::run()" );
                   System.out.println(ioe.getMessage());
                   ioe.printStackTrace();
              } finally {
                   // The connection is closed for one reason or another,
                   // so have the server dealing with it
                   System.out.println( "Closing" );
                   server.removeConnection( socket );

    A couple of things to note...
    First, you are looping infinitely in your server's constructor. Since the constructor is never completing, your server object is never completely constructed - this may cause indeterminate behaviour when you pass a reference to the server to another thread.
    Second, I would recommend fixing your issues by modifying your design somewhat. The design I would recommend (read: The design I would use) is:
    A server object, with a public listen method. The constructor spawns a thread to constantly read from the serial port and forward the data read back to the server, via a multicast (sendToAll) method.
    The listen method sets up a server socket to accept connections, and in a loop opens client sockets and stores them in a set.
    The multicast method iterates through the list of open client sockets, and for each in turn confirms that it is still open. If open, send the data down the socket's output stream; if closed, remove the socket from the set.
    Note that this design includes only two threads - the main thread listens for and accepts new socket connections, while the extra thread collects data from the serial port, multicasts it to all of the open sockets, and removes all of the closed sockets. If you require to perform any other communication with the sockets, it may be necessary to create a thread for those sockets, to facilitate reading from their input streams, but in the given design, this is not necessary.
    I hope this helps,
    -Troy

  • Java Input and Output streams

    I have maybe simple question, but I can`t really understand how to figure out this problem.
    I have 2 applications(one on mobile phone J2ME, one on computer J2SE). They commuinicate with Input and Output Streams. Everything is ok, but all communication is in sequence, for example,
    from mobile phone:
    out.writeUTF("GETIMAGE")
    getImage();
    form computer:
    reply = in.readUTF();
    if(reply.equals("GETIMAGE")) sendimage()
    But I need to include one simple thing in my applications - when phone rings there is function in MIDlet - pauseApp() and i need to send some signal to Computer when it happens. But how can i catch this signal in J2SE, because mayble phone rings when computer is sending byte array? and then suddnely it receives command "RINGING"....?
    Please explain how to correcly solve such problem?
    Thanks,
    Ervins

    Eh?
    TCP/IP is not a multiplexed protocol. And why would you need threads or polling to decipher a record-oriented input stream?
    Just send your images in packets with a type byte (1=command, 2=image, &c) and a packet length word. At the receiver:
    int type = dataInputStream.read();
    int length = dataInputStream.readInt();
    byte[] buffer = new byte[length];
    int count, read = 0;
    while ((count = dataInputStream.read(buffer,count,buffer.length)) > 0)
    read += count;
    // At this point we either have:
    // type == -1 || count = -1 => EOF
    // or count > 0, type >= 0, and buffer contains the entire packet.
    switch (type)
    case -1:
    // EOF, not shown
    break;
    case COMMAND: // assuming a manifest constant somewhere
    // process incoming command
    break;
    case IMAGE:
    // process or continue to process incoming image
    break;
    }No threads, no polling, and nuthin' up my sleeve.
    Modulo bugs.

  • Java Sockets and Output Streams

    Hi All,
    I am beginning sockets programming and I have a problem. If there is a server listening in the background for incoming connections and say for example 4 client programs programs which we shall call client1...client4 connect. How best can I capture the output streams associated with these newly created sockets so that the server can send back isome nformation to say clients1 and client4 only which is not seen by clients 2 and 3. Similarly I would like the server to send some infor to clients 2 and 3 only which is not seen by client1 and client 4.
    Currently I have the server listening part as shown below, but not too sure how to add DISTINCT output streams for 1 and 4 on one hand and 2 and 3 on the other.
    Thanks:
    // bind socket to a port number
    ServerSocket serverSocket = new ServerSocket(portNo);
    // create socket to listen to client connection
    while (true) {
    //listen to an incoming connection
    System.out.println("chatroom server waiting for incoming connections");
    Socket incomingSocket = serverSocket.accept();
    //launch new thread to take care of new connection
    chatRoomThread chatThread = new chatRoomThread(incomingSocket);
    chatThread.start();
    //go back and wait for next connection
    Please help.
    Thanks,
    Bleak

    HouseofHunger wrote:
    yes thats exactly the way I have my in and out streams, in the run method, but that doesn't help me in filtering traffic, in other words I am saying 2 clients, client1 and client4 for example should share a common in and out stream so that they will see eact other's messages... makes sense.....?No, doesn't make sense. That's the wrong design. Each socket should have its own input and output stream (yes, I know, that's been said several times before). If messages going to client1 should also be sent to client4, then whatever writes the messages to client1's output stream must also write them to client4's output stream. Trying to make those two output streams actually be the same output stream is the wrong way to do that. Just have the controller send the messages to whoever is supposed to get them.

  • Fileinput and output stream

    hi. i was trying to learn this fileinput and output stream in java. i was trying to solve this exercise problem in which a user need to ask for the inputfile (Which i have created mydata.txt which has 5 positive numbers and 5 negative numbers ). my program will ask the user for the input file and then output the results in 2 seperate files one output will be for positive integers which the program will extract from myData,txt and negative integers to another output file. i am very confused. my program does not give me any error msgs but outputs a number 0.
    import java.util.Scanner;
    import java.io.*;
    class fileEg {
         public static void main (String[] args) throws IOException
         int num=0, num1;
         Scanner user = new Scanner(System.in);
         String inputFileName, outputFileName, fileName;
         System.out.println("Input File Name ");
         inputFileName = user.nextLine().trim();
         File input = new File (inputFileName);
         Scanner scan = new Scanner(input);
         System.out.print("Output File Name: ");
        outputFileName = user.nextLine().trim();
        File output = new File( outputFileName );     
        PrintStream  print = new PrintStream( output );     
        while(scan.hasNextInt()) {
             if(num == '+') {
                  print.println( "the numbers are " + num);
             else {
                  print.println("The numbers ares " + num);
             print.close();
    }any help will be really appreciated. any theories or example.
    Thanks

    import java.util.Scanner;
    import java.io.*;
    class fileEg {
         public static void main (String[] args) throws IOException
         int num;
         Scanner user = new Scanner(System.in);
         String inputFileName, outputFileName, negativeFileName;
         System.out.println("Input File Name ");
         inputFileName = user.nextLine().trim();
         File input = new File (inputFileName);
         Scanner scan = new Scanner(input);
         System.out.print("Output File positive Name: ");
        outputFileName = user.nextLine().trim();
        File output1 = new File( outputFileName );     
        PrintStream  positiveNumbers = new PrintStream( output1 ); 
        System.out.print("Output File negative Name: ");
        negativeFileName = user.nextLine().trim();
        File output = new File( negativeFileName );     
        PrintStream  negativeNumbers = new PrintStream( output ); 
    while(scan.hasNextInt()) {
             num= scan.nextInt();
             if (num >0) {
                  positiveNumbers.println( "the numbers are " + num);
             } else {
                  negativeNumbers.println("The numbers ares " + num);
    positiveNumbers.close();
    negativeNumbers.close();
    }Thanks paul
    Message was edited by:
    fastmike

  • Input Tax and Output Tax calculating wrong figures

    Hi,
    I have created Input Tax and Output Tax codes in SAP.
    Input Tax- 3%
    Output Tax- 4%
    All the configuration is done as required. But when I am posting the Purchase and Sales Invoice, the tax amount is not calculating correctly.
    For example:
    Input Tax Calculation should be:
    Vendor A/C.............. Cr 30000-
    Expense A/C............ Dr 29100
    Input Tax A/C............ Dr 900 (@3% on 30000)
    Input Tax Calculation in SAP:
    Vendor A/C.............. Cr 30000-
    Expense A/C............ Dr 29126.21
    Input Tax A/C............ Dr 873.79 (@3% on 30000)
    The same is happening to Output Tax transactions.
    Please advice.

    My understanding about the Input Tax and Output Tax was wrong. In the issue reported
    Input Tax Calculation should be:
    Vendor A/C.............. Cr 30000-
    Expense A/C............ Dr 29100
    Input Tax A/C............ Dr 900 (@3% on 30000)---my understanding was wrong.
    Input Tax 3% should be charged on Expense amount, in this case Rs 30000. But because in the editing option calculate tax on net amount option was not selected, hence SAP was giving the below entry, which is correct as well.
    Vendor A/C.............. Cr 30000-
    Expense A/C............ Dr 29126.21
    Input Tax A/C............ Dr 873.79 (@3% on 29126.21) which is correct.
    Hence, the Vendor amount should be Expense + Input Tax= 30000 * 3%=900 + 30000 (expense) = 30900.
    Correct Entry should be:
    Vendor A/C...............Cr 30900
    Expense A/C............Dr 30000
    Input Tax A/C............Dr 900
    Resolved. Pankaj has given the correct answer.

  • Payroll Log - input,processing and output

    ALL
    i have a doubt here and i hope it would be cleared in this forum.
    how does values comes in Input, Processing and output in payroll log.... for ex: sap provides detailed explanation in processing step.... where does this stored.... how it is appearing in payroll log.... plz. help to understand this.... Thank you all for your continuous contribution to this forum

    Hi,
    I think you are talking about the log that is getting after executing the Payroll.
    If so, as an example, kindly goto Factoring and storage and double click on X023 (Gross input and storage).
    Here, you can see the Input Table, Processing and Output Table.
    If I am not wrong you are talking about the Processing that is displayed here.
    If yes, Open the Schema through TCode PE01 and double click the Subschema for Period factoring and storage (INAL is the standard one. But if some 'Z' has been used instead of INAL double click that one). Here you can see  X023 (Gross input and storage). Double click X023 and you can see Rule according to which the Processing is happening.
    Thanks and Regards
    Kiran

  • Inputting from and Outputting to Excel Spreadsheets (.xls): How is it done?

    Is it possible to input from and output to .xls files in a Java program?
    If so, can you point me in the right direction/show me how?

    AlphaBlue wrote:
    jverd wrote:
    What were you hoping for? Someone reading your mind for what exactly you need, and handing you a giftwrapped answer, without you doing any work or clearly communicating a specific problem? This site doesn't really work that way.Fair enough. I'm asking for insight into how to input from and output to a StarOffice Spreadsheet into/from a Java program. (Think java.io except with spreadsheet files instead of .txt files.) I already answered that question.
    I need to accomplish this without the use of a community-created library.That's a bizarre requriement. Why?
    >
    Okay, [here you go|http://lmgtfy.com/?q=communication+between+StarOffice+Spreadsheets+and+Java].
    If you don't have any knowledge or experience, on the matter, please refrain from directing me to a google search. I assure you, I have already performed such a task.How would I know that.
    But okay, let's say I know that. Let's say you bothered to point out that you've already done that. Further, let's say I do have knowledge of the subject at hand. Maybe I'm an expert. Maybe I wrote Star Office and an open source library (which wheel for some reason you must reinvent). You are assuming that I also have psychic powers, so that I can read your mind and know exactly what you've read so far and exactly what parts of your very broad and vague question said reading did not answer.
    In short, you have received answers commensurate with your questions.

  • How to set input delay and output delay when source Synchronous

    ClkIN is the board clock which is connected to the FPGA. Clkif is the generated clock from ClkIN. The Device's clk come from Clkif. So, how to set input delay and output delay in this scene(within my understand, this is Source Synchronous)?
    The example in many document, the input delay and output delay setting all refer to board clock(within my understand, this is System Synchronous). In that scene, the input delay max = TDelay_max + Tco_max; input delay min = Tdelay_min + Tco_min; the output delay max = Tdelay_max + Tsu; output delay min = Tdelay_min - Th.
    So, I want to know how to set input/output delay in the Source Synchronous.
    In system synchronous, I set input/output delay such as:
    create_clock -period 20.000 -name ClkIN -waveform {0.000 10.000} [get_ports ClkIN]
    create_generated_clock -name Clkif -source [get_pins cfg_if/clk_tmp_reg/C] -divide_by 2 [get_pins cfg_if/clk_tmp_reg/Q]
    create_clock -period 40.000 -name VIRTUAL_clkif //make virtual clock
    set_input_delay -clock [get_clocks VIRTUAL_clkif] -min 0.530 [get_ports DIN]
    set_input_delay -clock [get_clocks VIRTUAL_clkif] -max 7.700 [get_ports DIN]
    set_output_delay -clock [get_clocks VIRTUAL_clkif] -min -0.030 [get_ports DOUT]
    set_output_delay -clock [get_clocks VIRTUAL_clkif] -max 1.800 [get_ports DOUT]
    *******************************************************************************************

    So, first. Architecturally, the clock that you forward to your external device should not come directly from the clock tree, but should be output via an ODDR with its D1 input tied to logic 1 and the D2 tied to logic 0. This guarantees minimal skew between the output data and the forwarded clock.
    ODDR #(
    .DDR_CLK_EDGE("OPPOSITE_EDGE"), // "OPPOSITE_EDGE" or "SAME_EDGE"
    .INIT(1'b0), // Initial value of Q: 1'b0 or 1'b1
    .SRTYPE("SYNC") // Set/Reset type: "SYNC" or "ASYNC"
    ) ODDR_inst (
    .Q (Clkif_ff), // 1-bit DDR output
    .C (ClkIN_BUFG), // 1-bit clock input
    .CE (1'b1), // 1-bit clock enable input
    .D1 (1'b1), // 1-bit data input (positive edge)
    .D2 (1'b0), // 1-bit data input (negative edge)
    .R (rst), // 1-bit reset
    .S (1'b0) // 1-bit set
    OBUF OBUF_inst (.I (Clkif_ff), .O (Clkif_out));
    This generates an output clock that is the same frequency as your input clock. This is consistent with your drawing, but inconsistent with your constraints - is the forwarded clock a 50MHz clock or a 25MHz clock?
    I will assume your ClkIN goes to a BUFG and generates ClkIN_BUFG.  Your first constraint generates a 50MHz clock on the ClkIN port which will propagate through the BUFG to (among other places) this ODDR.
    create_clock -period 20.000 -name ClkIN -waveform {0.000 10.000} [get_ports ClkIN]
    Assuming your forwarded clock is supposed to be 50MHz, then your 2nd command is close to correct
    create_generated_clock -name Clkif -source [get_pins cfg_if/ODDR_inst/C] -combinational  [get_pins cfg_if/ODDR_inst/Q]
    With this done, you have successfully described the forwarded clock from your design. This is the clock that goes to your device, and hence should be the clock which is used to specify your input and output constraints.
    set_input_delay -clock [get_clocks Clkif] -min 0.530 [get_ports DIN]
    set_input_delay -clock [get_clocks Clkif] -max 7.700 [get_ports DIN]
    set_output_delay -clock [get_clocks Clkif] -min -0.030 [get_ports DOUT]
    set_output_delay -clock [get_clocks Clkif] -max 1.800 [get_ports DOUT]
    If you want to get fancier, you could try adding a set_clock_latency to the forwarded clock to account for the board propagation of the clock
    set_clock_latency -source TDtrace2 [get_clocks Clkif]
    (But I haven't experimented with clock latency on a generated clock and I don't know for a fact that it works).
    Avrum

  • Now a separate thread for the HTC Rezound! - lower left under "Spaces"

    FINALLY!! THANK YOU!!!
    For some reason it is not showing in the phone device list above but look below on lower left under Spaces.  There is now a separate thread for those of us with the HTC Rezound!!

    Thanks for your interest.
    Excuse my ignorance as I'm not sure what you meant by "1 of 5" optimization. Did you mean median of 5 ?
    Regarding swapping pointers, yes it is common sense and rather common among programmers to swap pointers instead of swapping large data types, at the small price of indirect access to the actual data through the pointers.
    However, there is a rather unobvious and quite terrible side effect of using this trick. After the pointer array is sorted, sequential (sorted) access to the actual data throughout the remaining of the program will suffer heavily because of cache misses.
    Memory is being accessed randomly because the pointers still point to the unsorted data causing many many cache misses, which will render the program itself slow, although the sort was fast!!.
    Multi-threaded qsort is a good idea in principle and easy to implement obviously because qsort itself is recursive. The thing is Multi-threaded qsort is actually just stealing CPU time from other cores that might be busy running other apps, this might slow
    down other apps, which might not be ideal for servers. The thing researchers usually try to do is to do the improvement in the algorithm it self.
    I Will try to look at your sorting code, lets see if I can compile it.

  • In SAP BW landscape we should have separate servers for DEV, QA and PROD

    Hi all,
    In SAP BW system landscape we should have separate servers for DEV, QA and PROD.
    whether one server is enough for DEV and we can use virtual servers to QA & PROD?
    Regards,
    chandu

    Hi chandu,
    In my previous Organisation we got exactly the same landscape for BW as you described.BCS(BAYER COPSCIENCE LTD) operates a BW System Landscape with one centralized  Global Development System and three regional Quality Assurance and Production Systems located in Europe, Asia Pacific and Americas. This Landscape is to ensure consistent data models to be available in all regional systems as well as to minimize development efforts and make use of respective synergies.
    This is perfectly working  for BCS ,and I think, this is the most approriate way of handling of resources.
    Regards
    CSM Reddy

  • Why do we have separate apps for phone, messages, and contacts?

    I'm trying to reduce the number of apps that I need to run, and this one just boggles my mind.
    Why do we have separate apps for phone, messages, and contacts?
    The messages is to tightly coupled to the phone, that it doesn't make any sense for them to be separate.
    The contacts app is nothing more then looking at the contacts from the phone app.
    What's the story here?
    Does it have something to do with the contacts also being part of email app?
    Actually, that's my other biff... why are they entangled as such?
    Phone contacts should have phone#, email contacts should have email addresses.
    If you want a contact to have both phone# and email address, then the two apps (phone/email) should be combined.

    The contacts app is nothing more then looking at the contacts from the phone app.
    What's the story here?"
    The forums would be full of people complaining that you had to go through an additional step ( opening the phone app) to get to contacts.  I use the contacts app from the home screen far more often then I use it in relation to calling someone.
    I like the way it is far more than the way you propose.
    You can leave feedback for Apple at:
    http://www.apple.com/feedback

  • Create Separate Views for New,Edit and Display forms in Infopath

    Hi,
    I need to create a separate views for New, Edit and Display forms in infopath.
    For ex : I need a Submit Button on Display form and not in New/Edit forms.
    I tried, but i amnot able to get the changes.
    Regards, Shreyas R S

    I just validated my approach in a 2013 farm, this is precisely how it's done!
    Step 1) List > Display Form
    Step 2) Change the View within the Web Part Properties. In your screenshot it looks like you simply went to View Item on the single item, which is not the direction I gave =P.
    **Assuming you've already created the multiple views within InfoPath, this allows you to set them up as distinct defaults for New, Edit and Display, let's make that clear. If you are not even to the point of having separate views, that is just in InfoPath,
    Page Design tab, far left, New View button

  • Input and Output Stream conversion

    I have problem. In my application I should change OutputStream to InputStream and vv. I try to explain it using easy example.
    I am creatin xml document and using XMLOutputter (I am using org.jdom parser) I could write it to file using FileOutputStream, but first I'd like to encrypt this file. For that reason I need InputStream. I write this file on disc, next i read this file, encrypt and write again and at last delete the unencrypted file. Could do It without writeing unencrypted file on disc? Maybe using only streams? Pleas help me, how to do it. Maybe I should convert OutputStream to InputStream.
    When I reading information from encrypted file I have the same problem - streams conversion.

    I wrote an article about how to convert an OutputStream to an InputStream. You can read the article at:
    http://ostermiller.org/convert_java_outputstream_inputstream.html
    It discusses three methods for conversion: byte arrays, piped streams, and circular buffers.

  • Input and output streams

    I am struggling with this, if any of you have any advice I would appreciate it.
    I am creating a java server that can communicate with a client over tcp sockets and to a device through a serial port. I have have the TCP part all set up. I found this packet and code to be able to communicate through a serial port.
    http://rxtx.qbang.org/wiki/index.php/Two_way_communcation_with_the_serial_port
    it works by itself, but I don't think I can make it work with my server because I am already using a system.in for the tcp portion of it. In the long run what I want to be able to do is take information from the socket connection, play with it a little bit, and then send it out the serial port to the device.
    Is it possible to convert this code to instead of asking for input from the keyboard, to take a string that I can pass in from somewhere, or if something comes in on the serial port to write it to a string or something?

    Sorry I was so vague.
    this code that i found on the website, creates a connection with the serial port, then it waits for input from the keyboard. once that input comes in, it sends out that stuff through the serial port. I want it to instead of wanting for input from the keyboard, to check to see if there is something in a string or something, if there is write it out to the serial port.
    Basically instead of having a listener constantly waiting for input from the keyboard, be able to call a method from the rest of my program to send stuff out the serial port.

Maybe you are looking for

  • How can I rename multiple files without Automator?

    Is there a way to rename a large number of files i.e. "file, file(2) file(3)" without using Automator? In Windows you can just right-click and rename any number of selected files.

  • How to only show bleeds on certain pages?

    Hi everyone, I have a few pictures in a publication, and I only need to see the bleed on those pages. However, when I select bleed option under document setting, the bleed appears on every single page.  How to show bleeds only on the pictures pages?

  • Lightroom 3 Can't Find My Images

    I use several external hard drives for my images and they occasionally get moved either to another folder or to another hard drive.  When this happens, Lightroom can't find the image so I go to the image in its new location and Lightroom finds it and

  • Service objects inside libraries (WAS: Interfaces in Forte -has anyon

    The following message is actually not about interfaces, but libraries: > From: Jeanne Hesler <[email protected]> > To: [email protected] <[email protected]> > Date: Thursday, July 30, 1998 11:12 AM > Subject: RE: Interfaces in Forte - has anyone used

  • Problem loading Windows 7 in a MacAir 3.1 after a SSD disk crash.

    I have a MacAir Model 3.1, about 3 months after buying it I change the SSD disk from 128GB to one of 240 GB. The machine has two partitions one for Mac OS X, first Snow Leopard, and after I upgrade to Lion without any trouble, and the other with Wind