Executing two commands at the same time from Runtime.getRuntime

Hi everybody,
I m executing a command of imageMagic from javacode to crop and for changing the quality of image.The code is as below :
String changeQuality = new String("convert " + originalImage
                    + " -crop " + imageWidth + "x" + imageHeight + "+" + imageX
                    + "+" + imageY + " -quality " + quality + " " + finalImage);
               Runtime.getRuntime().exec(changeQuality);
But before going to next page of jsp I want the size of the finalImage. So I m calling a new function from the base file, from which i m calling the above function, for getting the size of image:
public String getSize(String finalImage) {
               proc = Runtime.getRuntime().exec("identify " + finalImage);
As identify cmd gives the size and various values of image but this command is showing the size zero. and if try to read the file then it shows FileNotFoundException.It means the file is not on the server.
What should i do to execute both the command and getting the right result.
Any help is appreciated.
Thanks in advance.
Vivek Kumar Gupta

Hi everyone,
Nobody ans my question but finally i got the ans of my question.
I use a input stream for reading the first one imagemagic command. through this the second command execute after the first command finished its execution.
And my images are now displaying without error.
I know now you all are thinking how great mind I am!!! hai na
Hmm woh to main hoon.
post a question if u have over here. Perhaps i can solve your prob.

Similar Messages

  • Stream music to two airports at the same time from my iPad2?

    I found out from the apple-website that its possible to stream music to two(or more) of the new updated Airports from a computer at the same time .. can i do it from my iPad2 also?  i want to build zones in my home and be able to use them one by one, or play music in several of them together at the same time.
    I,m currently using the Spotify-app from my iPad2 or iPhone3GS to my existing(old one) Airport Express, and need to know if i can bye more Airports?
    Thanks in advance
    /Jonas from Sweden.

    I found out from the apple-website that its possible to stream music to two(or more) of the new updated Airports from a computer at the same time .. can i do it from my iPad2 also?
    Sorry, but no. This option is not supported on iOS devices.

  • Burning two DVDs at the same time

    Hi guys,
    I've just bought a new MacPro with two super drives.
    Do you know how to burn two copies of the project at the same time
    using DVD Studio Pro?
    Thanks in advance!
    gogiangigo
    DVD Studio Pro 4.2   Mac OS X (10.4.10)  
      Mac OS X (10.4.10)  

    Welcome to the boards
    You cannot burn two DVDs at the same time from DVD SP though if you build the project you can tyr other approaches
    http://discussions.apple.com/thread.jspa?messageID=4557443

  • Running two stepper motors at the same time from one port

    Hello,
    I have to run two motors at the same time - one used to move a linear ball screw and one to turn a grip. I am doing tension and torsion testing on small wires, but tension and torsion have to be done at the same time. I also have to build in the ability for each motor to take multiple steps, ie. have a motor take x number steps at y velocity and then move x number of steps at z velocity. Both motors need to be able to do this. However, I am having problems getting the motors to run at the same time and to take all the steps. The motors are connected to two RMS Technologies R356 controllers. Both of the controllers are then connected to one RS485 to USB converter card, and that card is connected to one of the USB ports in the computer. Currently, I pass an array of commands to two for loops each containing VISA read and writes. I've attached the vi to look at. All of the timing stuff in the code is because a new command cannot be sent to the controller before the motor is done executing the previous command. If commands are sent right after one another, the controller will only execute the first command and then return with an error. 
    Does anyone have a suggestion as to what I am doing wrong?
    Thanks in advance for any help. 
    Solved!
    Go to Solution.
    Attachments:
    Motor Controller (Sub VI 3).vi ‏41 KB

    I'm not too clear on exactly what you are trying to accomplish or some of the details.
    Are there equal number of torsion and tension steps?
    Is there a pairing between a torsion and tension?  For example, you want to tension and torsion simultaneously, but those two together make a complete step?
    Do you want to wait until both the torsion and tension have completed before moving on to the next torsion/tension pair?
    Is there any time delay you want to hold at before moving on to the next step.
    When working with state machines, it is important not only to define the states, but also the logical stepping from one state to the next, or alternatives based on conditions.  It could be flowchard, but sometimes people call them state charts.
    Right now your latest posting has goes to "Write to Motor" event though and will wait there forever because there is nothing in the queue to write out through the VISA port.
    Let's assume your first state would happen to be Enqueue Tension (in order to get something in the queue), you will actually queue up all your tension commands at once with the For loop.  Then i will be 1 less than the size of the array it always will be because for an array size n, i will go from 0 to n-1 on each iteration.  So your false case will run and you will go to "Write to Motor".  Write to Motor will run and dequeue the first command then go to Waiting for Response.  Waiting for response will iterate through the while loop until 66 or 67 comes back.  I assume only 66 will come back for tension since you have yet to write a torsion command.  Once that comes back, it will go to Enqueue Tension again and insert a whole other series of commands.  Then go back to write Motor and will take out the 2nd queue element from the first set of commands your wrote.  It will stay in a Tension mode and the Queue will grow endlessly putting in a whole new series for each element that you dequeue.
    A state machine is the way to go, but I can't really sketch one out for you because I'm not sure exactly how your applications is supposed to work.  If a tension and torsion command are paired together,  perhaps you should just queue them together and write them out at once.   But the key thing is to sketch out on paper your application and flowchart exactly how the program should progress from step to step.
    PS:  One other thing, make sure you wire the queue reference wire through all states.

  • Can I export my sidecar files to two or more hard drives at the same time from one computer?

    Can I export my sidecar files to two or more hard drives at the same time from one computer?  How do I do this, if it is possible?

    Each image is imported into the LR Catalog from just one stated location on disk. And that is where the sidecar gets written.
    But if you want, outside of LR, you can have a file sync utility replicate all physical changes within those folders on disk, into other corresponding locations on other drives - which hold a copy of all the same images, and a copy of the sidecars too. This might happen continuously, periodically or on demand depending on the particular tool you use... for example, the Dropbox desktop app.
    If you also want to have your LR Catalog replicated, I think this can only be done when LR is not running and using that.

  • Can I access two websites at the same time?

    Does Dreamweaver have the ability to open two websites at the same time?
    I basically have a CMS hosted on one server, that connects to my clients sites on other servers. I want to be able to open files on one server and edit them and also edit files on another server at the same time.
    If this isn't available in Dreamweaver, then I think it should be. I often need to copy code from one page in a site to another page in different site. To have the ability to have two windows open, each connected to a different website server would be invaluable to me. By having separate windows, each can have its own server connection. I don't know how easy that would be, but I'd love it!
    Cheers
    Glynn

    You can only connect to one site at a time.  And you need to edit files locally, save & then upload to the remote server.   AFAIK, no single FTP app is capable of connecting to more than one server at a time.  You might be able to do what you want with DW open and an additional 3rd party FTP client like Filezilla, each connecting to different servers.
    Nancy O.

  • How to make this two things at the same time ?

    Hello
    When my mouse is on a area, I need :
        -  to show a object (a rectangle inserted with the toolbar)
        -  to show a caption
    I think it's not possible to do this two things at the same time when I use the rollover functions (Rollover caption or Rollover Image).
    I would like to use a button, but the button works only if I click it, and not when I just pass my mouse on it.
    Someone have an Idea?
    I can't use Javascript.
    Thanks

    Rick is correct.  You can use the Rollover Slidelet's rollover area to trigger an Advanced Action.  You'll need to create this Advanced Action with two clauses.  One to SHOW the caption, and the other to SHOW the rectangle.
    Your alternative to the rollover slidelet is to use an Event Handler widget attached to the object that the mouse should roll over.
    The Event Handler will detect when the mouse is over the object and trigger its own Success criteria.  You can then use the widget's ON Success event to trigger the Advanced Action as mentioned above.
    More information about using the Event Handler here: http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets
    An example of using it to do two different things on the same object can be found at this web page: http://www.infosemantics.com.au/adobe-captivate-advanced-elearning-tutorials/beat-adobe-ca ptivate-interactive-catch22
    Trial versions of the widget can be downloaded from here:  http://www.infosemantics.com.au/adobe-captivate-widgets/download-free-trial-widgets

  • Re: if weblogic can serve two ports at the same time?

    That's not true. WebLogic supports a non-secure and secure listener port at the
    same time. That was one of the selling points for my organization.
    Michael Girdley wrote:
    If, you mean the same port on two different IP addresses, then the answer is
    yes.
    If, you mean two different ports on the same IP address, then the answer is
    no.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    fxy <[email protected]> wrote in message
    news:8fdk99$t9$[email protected]..
    <URGENT QUESTION>
    I'd like to know if weblogic can support two ports at the same time.
    thank you in advance.
    <URGENT QUESTION>

    Well, the question was really meant to see if any change was made to WL to support
    this, not because I didn't believe Michael Girdley.
    P.S., this is something Websphere 4.0 let's you do...In case this encourages someone
    to add this support.
    "Mike Reiche" <[email protected]> wrote:
    >
    If you don't believe Michael Girdley, then I don't know why you would
    believe anyone
    else. I believe the answer is still 'no'.
    Why do they 'have to be on different ports'? We block requests by URI
    - so just
    block all requests to /youradminapp/* at the firewall. Or you can block
    them at
    your Web Server. Or restrict them by user in WL.
    Mike
    you"Anil Arora" <[email protected]> wrote:
    Is it still true that WL 6.0 cannot host multiple (non-secure) HTTPports
    on one
    server? We need this capability within one JVM to allow one web application
    to
    be accessed from one port while another through a second port. Forexample,
    we
    have a application to be exposed through the firewall at port 7001.
    Then we have
    another admin application to only be accessed within the firewall. But
    they need
    to be deployed within the same JVM since they may have shared statebetween
    them.
    Thanks,
    Anil
    "Michael Girdley" <[email protected]> wrote:
    I'm sorry, to clarify my statement: I was speaking about nonsecure
    communications. Weblogic can only support one listener port at a time.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    Allen Akers <[email protected]> wrote in message
    news:[email protected]...
    That's not true. WebLogic supports a non-secure and secure listenerport
    at the
    same time. That was one of the selling points for my organization.
    Michael Girdley wrote:
    If, you mean the same port on two different IP addresses, then
    the
    answer is
    yes.
    If, you mean two different ports on the same IP address, then theanswer
    is
    no.
    Thanks,
    Michael
    Michael Girdley
    Product Manager, WebLogic Server & Express
    BEA Systems Inc
    fxy <[email protected]> wrote in message
    news:[email protected]...
    <URGENT QUESTION>
    I'd like to know if weblogic can support two ports at the same
    time.
    thank you in advance.
    <URGENT QUESTION>

  • Two images at the same time

    Hi!
    I'm new into FCE and I would like to ask for some help. Can I work with two images at the same time? I mean, Can I superimpose two images to make one? How can I do it?
    Maybe this is something easy, but I'm just starting,
    thanks in advance for your answers
    Message was edited by: angelcotallo

    Yes, you can. You can put one clip on top of the other in the timeline. You can make both clips visible by reducing the opposite of the clip or top, or by scaling back the clips so they are smaller. You can reduce the opacity and scale of the clips in the viewer by opening the clips from the timeline into the viewer. You can also scale the images directly in the canvas when it is in Image+Wireframe mode.

  • Two profile two thunderbird at the same time with same user account

    Dear,
    I would use two Thunderbird at the same time for two different profiles with the same user accounts.
    I using linux OS.
    I was thinking of using:
    # thunderbird -P profile1 &
    # thunderbird -P profile2 &
    But when launching the second command nothing happens.
    Only brings in the foreground thundirbird already started.
    If possible use this configuration now or in the nex future?

    As a rule thunderbird only runs one instance of a profile.
    However, there are a couple of options you could try.
    You could use an addon to esily switch profiles:
    * https://addons.mozilla.org/en-US/thunderbird/addon/profileswitcher/
    there is more help here:
    * http://kb.mozillazine.org/Run_multiple_copies_of_Thunderbird_at_the_same_time
    It does say: 'Multiple instances is intended for debugging, so use it at your own risk'.
    One method would be to use: Start > Run
    "C:\Program Files\Mozilla Thunderbird\thunderbird.exe" -no-remote -P profilename
    there is a space before '-no'
    and also before '-P'
    followed by a space and the profile name
    You could create a shortcut/icon to run each separate profile.

  • Updating two tables at the same time

    Please,
    Does someone have an idea on how to update two tables at the same times?
    Thanks a lot in advance

    I was thinking about a single session and single update command.
    That's why I thougth someone else could have a clue.
    Thank you

  • I AM TRYING TO HOOK UP TWO MONITORS AT THE SAME TIME

    I AM TRYING TO HOOK UP TWO MONITORS AT THE SAME TIME. I have had no success in figuring out why I can get an image on my TV and an image on my monitor (at the same time), but no icons, no start menu and no keyboard access. M y computer freezes as well when I try to do 2 monitors.

    Hi,
    Your machine has:
    *Integrated video is not available if a graphics card is installed.
    Radeon HD 6370D, 6410D, 6530D or 6550D Graphics (model dependent based on processor)
    Supports PCI Express x16 graphics cards
    Two DVI-D ports (Both ports can be used at the same time)
    You can use TWO monitors with the right connections for two ports #3 above. You can get more information from the following instructions:
       http://www.dummies.com/how-to/content/how-to-set-up-multiple-monitors-with-windows-7.html
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • Singletons running on two servers at the same time

    Hello,
              we faced one interesting situation with our application, running on clustered BEA Weblogic 9.2. We implemented some Singletons (ie. Singleton Service in a Weblogic cluster) and they are running fine. Most of the time.
              Common scenarios: cluster is started -> the singletons run on one server; the server is brought down -> the singletons are started on the second server.
              However, we had recently two situations where the Singletons started on both servers! Here they are:
              1) We use Database Migration Basis and we have a dedicated table for Weblogic to capture current state of the singletons. Due to the fact that database (Oracle RAC) was partially available one of the Managed Server could not get the lease and probably assumed that no singleton is running, therefore started the singletons locally.
              2) Network outage: we had several minutes where none of our servers could communicate between them (neither between SASU MS nor with the database). Consequence: each MS decided to start the singleton locally (after some time, which I assume is the waiting time). Once the network came back the servers could communicate again but the duplicate singletons are not deactivate, so they are running in parallel.
              Anyone experienced the same or similar issues? How to prevent the above? Is the Consensus Migration Basis a better choice? (I think yes for #1 but not for situation #2).
              Any helpful answer is appreciated.
              Thank you, best regards,
              Remus.

    In general its not a good idea.  Running PSConfig will try to establish a lock on the configuration database.  Doing that from two servers at the same time may cause the update to fail.
    Paul Stork SharePoint Server MVP
    Principal Architect: Blue Chip Consulting Group
    Blog: http://dontpapanic.com/blog
    Twitter: Follow @pstork
    Please remember to mark your question as "answered" if this solves your problem.

  • Generat two signals at the same time and reading voltage

    Hii
    i have try to generate two signals at the same time and read voltage from another port on the board(not have to be at the same time), i have not alot of expriens in labview
    and i based my code of example(http://zone.ni.com/devzone/cda/epd/p/id/5197) from yours site and try to suit to my needs
    now my problem is when i generat the 2 signals(that work perfect) i canot read voltage from another port on my CB-68LP
    i can not find the problem  and make it over i hope there is away to figer out and fix it.
    i have two cards 6229, and two CB-68LP board.
    labview 8.5.
    my code is look like this - http://img142.imageshack.us/my.php?image=scrennshot2no2.png
    (this works perfect).
    and this is my code after suit to my need - http://img183.imageshack.us/my.php?image=scrennshotfl5.png,there is  error exception at  the right side.
    the exception-
    Possible reason(s):
    Specified route cannot be satisfied, because it requires resources that are currently in use by another route.
    Property: RefClk.Src
    Source Device: Dev1
    Source Terminal: 10MHzRefClock
    Required Resources in Use by
    Task Name: _unnamedTask<0>
    Source Device: Dev1
    Source Terminal: None
    Destination Device: Dev1
    Destination Terminal: RefClock
    Task Name: _unnamedTask<1>
    eyal

    sorry...
    The AO tasks is very important they will be synchronize ,it is very importent the two tasks will start at the same time
    and after it run at synchronize mode i will need to make reading of voltage
    i gust try to make simulation of machin (i give that machin AO and reading from it voltage that all)
    first of all i make the two signals(synchronize signals).
    and after it i will need to reading voltage.
    i can make two signals synchronize together.
    i can make reading voltage
    but i can't make two signals synchronize together with reading voltage
    it throw to me this error message.
    i am looking for away to figer this out.
    thank's for any help 
    eyal
    Attachments:
    test11.vi ‏130 KB

  • Telnet two devices at the same time 1 C# program

    Hi, currently I have one 100% working program used to telnet my Arduino circuit.
    I use this C# class found somewhere around the web: Anyway, without this forum, I wouldn't be able to finish my program.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Net.Sockets;
    namespace USSR
    enum Verbs
    WILL = 251,
    WONT = 252,
    DO = 253,
    DONT = 254,
    IAC = 255
    enum Options
    SGA = 3
    class TelnetConnection
    TcpClient tcpSocket;
    int TimeOutMs = 100;
    public TelnetConnection(string Hostname, int Port)
    tcpSocket = new TcpClient(Hostname, Port);
    public string Login(string Username, string Password, int LoginTimeOutMs)
    int oldTimeOutMs = TimeOutMs;
    TimeOutMs = LoginTimeOutMs;
    string s = Read();
    if (!s.TrimEnd().EndsWith(":"))
    throw new Exception("Failed to connect : no login prompt");
    WriteLine(Username);
    s += Read();
    if (!s.TrimEnd().EndsWith(":"))
    throw new Exception("Failed to connect : no password prompt");
    WriteLine(Password);
    s += Read();
    TimeOutMs = oldTimeOutMs;
    return s;
    public void WriteLine(string cmd)
    Write(cmd + "\n");
    public void Write(string cmd)
    if (!tcpSocket.Connected) return;
    byte[] buf = System.Text.ASCIIEncoding.ASCII.GetBytes(cmd.Replace("\0xFF", "\0xFF\0xFF"));
    tcpSocket.GetStream().Write(buf, 0, buf.Length);
    public string Read()
    if (!tcpSocket.Connected) return null;
    StringBuilder sb = new StringBuilder();
    do
    ParseTelnet(sb);
    System.Threading.Thread.Sleep(TimeOutMs);
    } while (tcpSocket.Available > 0);
    return sb.ToString();
    public bool IsConnected
    get { return tcpSocket.Connected; }
    void ParseTelnet(StringBuilder sb)
    while (tcpSocket.Available > 0)
    int input = tcpSocket.GetStream().ReadByte();
    switch (input)
    case -1:
    break;
    case (int)Verbs.IAC:
    // interpret as command
    int inputverb = tcpSocket.GetStream().ReadByte();
    if (inputverb == -1) break;
    switch (inputverb)
    case (int)Verbs.IAC:
    //literal IAC = 255 escaped, so append char 255 to string
    sb.Append(inputverb);
    break;
    case (int)Verbs.DO:
    case (int)Verbs.DONT:
    case (int)Verbs.WILL:
    case (int)Verbs.WONT:
    // reply to all commands with "WONT", unless it is SGA (suppres go ahead)
    int inputoption = tcpSocket.GetStream().ReadByte();
    if (inputoption == -1) break;
    tcpSocket.GetStream().WriteByte((byte)Verbs.IAC);
    if (inputoption == (int)Options.SGA)
    tcpSocket.GetStream().WriteByte(inputverb == (int)Verbs.DO ? (byte)Verbs.WILL : (byte)Verbs.DO);
    else
    tcpSocket.GetStream().WriteByte(inputverb == (int)Verbs.DO ? (byte)Verbs.WONT : (byte)Verbs.DONT);
    tcpSocket.GetStream().WriteByte((byte)inputoption);
    break;
    default:
    break;
    break;
    default:
    sb.Append((char)input);
    break;
    My UI Code:
    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows.Forms;
    using System.Net.Sockets;
    namespace USSR
    public partial class mainForm : Form
    TelnetConnection tc;
    public bool keyPressChecker = false;
    public bool connectedChecker = false;
    public mainForm()
    InitializeComponent();
    // webBrowser1.Navigate("http://admin:[email protected]");
    this.tc = null;
    this.connectedChecker = false;
    private void radioButton2_CheckedChanged(object sender, EventArgs e)
    try
    if (submarineRadioBtn.Checked)
    System.Diagnostics.Process.Start("dummySub.exe");
    catch (Exception ex)
    MessageBox.Show(ex.ToString());
    private void centerBtnCamera_Click(object sender, EventArgs e)
    private void forwardBtn_Click(object sender, EventArgs e)
    if (connectedChecker)
    this.tc.WriteLine("W");
    private void connectToolStripMenuItem1_Click(object sender, EventArgs e)
    try
    //create a new telnet connection
    tc = new TelnetConnection("192.168.0.102", 23);
    if (tc.IsConnected)
    connectedChecker = true;
    catch (Exception ex)
    MessageBox.Show(ex.ToString());
    private void controlKeyDownCheckBox_CheckedChanged(object sender, EventArgs e)
    if (controlKeyDownCheckBox.Checked == true)
    keyPressChecker = true;
    else
    keyPressChecker = false;
    private void controlKeyDownCheckBox_KeyDown(object sender, KeyEventArgs e)
    if (keyPressChecker == true)
    if (e.KeyCode == Keys.W)
    if (connectedChecker)
    tc.WriteLine("W");
    if (e.KeyCode == Keys.S)
    if (connectedChecker)
    tc.WriteLine("S");
    private void reverseBtn_Click(object sender, EventArgs e)
    if (connectedChecker)
    tc.WriteLine("S");
    private void disconnectToolStripMenuItem_Click(object sender, EventArgs e)
    try
    tc = null;
    connectedChecker = false;
    catch (Exception ex)
    MessageBox.Show(ex.ToString());
    private void controlKeyDownCheckBox_KeyUp(object sender, KeyEventArgs e)
    if (keyPressChecker == true)
    if (e.KeyCode == Keys.W)
    if (connectedChecker)
    tc.WriteLine("O"); //decrease to MID PT.
    if (e.KeyCode == Keys.S)
    if (connectedChecker)
    tc.WriteLine("P"); //decrease speed to MID PT.
    private void exitToolStripMenuItem_Click(object sender, EventArgs e)
    Application.Exit();
    Now, what I want to know is this: IS IT POSSIBLE FOR MY C# PROGRAM TO TELNET TWO DEVICES AT THE SAME TIME? 
    Thanks
    Glenn

    try this links :
    http://www.codeproject.com/Articles/19071/Quick-tool-A-minimalistic-Telnet-library
    http://stackoverflow.com/questions/25116077/send-and-receive-commands-via-telnet-in-c-sharp
    http://stackoverflow.com/questions/12283241/ssh-to-server-then-telnet-to-device

Maybe you are looking for

  • Firefox takes a long time to close since a recent update and hogs memory.

    Since one of the recent updates that started using plugin containers, Firefox takes a long time to close. If I try to go back it, it tells me it is still running. I liik in Task Manager and about seven plug-in container. exe's are running and I have

  • Workspace  page in not loading in EPM 11.1.1.3  on windows 2003 server

    Workspace page is not loading , means i'm not able to see the admin, password and log on tab on page i'm able to open planning through url , EAS console and shared services consol working fine i'm installed EPM 11.1.1.3 on Windows server and configur

  • Issue with Mail

    Hi there, after upgrading my Snow Leopard to Lion on my client, I can not access my Emails on my Snow Leaopard server anymore. After some discovery, the situation is as follows: *Upgrading was flawless. *Launching mail was followed by the setup dialo

  • White space on desktop

    I was attempting to change the desktop background with a picture and I selected "Share" and "set desktop" the picture was in the background, but a big white space in the middle.. I am stumped how to change AND A NOVICE TOO with IMAC. Which btw, is IN

  • Automatic update of Flash has made all buildings on Pioneer Trail (Facebook) disappear. Using Chrome

    I saw where it said to reinstall the previous version but I do not know how - would appreciate any help that anyone can provide.