Input and output from child process

Hi all,
I am developing an IDE for the Haskell functional programming language. The application runs the Haskell interpreter as child process, and sends and receives input from the interpreter. At the moment I'm programming the integrated console through which the IDE should communicate with the interpreter. The problem is that when I send a command to the interpreter to execute the code I can't detect when the code is running and when it waits for input, so I'll be able to dissable and enable input in the the console respectivly. Please answer as soon as possible, and if my explanation of the problem is not clear enough please just comment about it. Thank you in advance.

Generally the way I have seen that sort of things designed is like this: You have a script in mind. For example:
1. Send command "ABC DEF" to the interpreter.
2. Wait until it responds with "OK" or "Failed".
3. If it responded with "Failed" then quit.
4. Send command "XYZ XYZ" to the interpreter.
5. ... and so on
You can do this in simple or complicated ways, of course. But if you can't do it, then you're going to find it difficult to do anything at all. For example you won't know when the interpreter is waiting for input (that seems to be your problem already).

Similar Messages

  • XiFi and Audigy Take Over Input and Output from Bluetooth Head

    I am having trouble with my bluetooth headset when making phone calls in any VoIP application (Skype, Yahoo!). I usually use the headset as the input and output for my VoIP bits so I can move away from my desk, etc... First, it worked under XP with my Audigy no problem. I bought a XiFi and installed the latest drivers and it began stealing my audio. Oddly, it does not do it until the call connection is made (so I hear the ringing in the BT headset and once the call is answered the system reverts to the mic, a Logitech USB, and main speakers, directly plugged to the soundcard).
    I decided to put my audigy back in, because I was planning on upgrading to Vista and thought the XiFi may be bad. I did a fresh Vista install with the Audigy and everything worked (i.e. audio for phone calls stayed in my BT headset). I then upgraded from the Microsoft drivers to Creative?s Vista drivers and the problem then happened with the Audigy as well.
    This leads me to believe that some sort of regression happened in the latest drivers. Everything else works great, games, movies, etc? but this is a show stopper because I want to use my bluetooth headset. I tried to downgrade to the Microsoft drivers but the card would no longer work. I have tried a driver install only, then added the software, removed that and did a full install. This is with BETA drivers on Vista, but the problem existed in XP as well which were not BETA drivers AFAIK. I have updated to the latest Bluetooth drivers as well with no luck.
    I have confirmed this on two of my PCs and a friend of mine is having the same problem (XP, XiFi) so he went and bought a Skype phone which works correctly.
    Thanks in advance

    thanks for reply..
    Please help me out with the entire setp by step procedure that i have to follow in getting the output in variable
    i am using to get the emp name from webservices and i am passing empno from form.
    INPUT STRING
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
       <soapenv:Header/>
       <soapenv:Body>
          <tem:ALL_GetEmpNamefrmID>
             <!--Optional:-->
             tem:EmployeeLogin>{$ /process_data/@emp_no $}</tem:EmployeeLogin>
          </tem:ALL_GetEmpNamefrmID>
       </soapenv:Body>
    </soapenv:Envelope>
    when i hard coded emp no for testing EG: 1234 the out put i am getting the folloeing XML when i click tes
    OUTPUT:
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <soap:Body>
          <ALL_GetEmpNamefrmIDResponse xmlns="http://tempuri.org/">
             <ALL_GetEmpNamefrmIDResult>SUBBA</ALL_GetEmpNamefrmIDResult>
          </ALL_GetEmpNamefrmIDResponse>
       </soap:Body>
    </soap:Envelope>
    Please help me out what are the steps i have to follow for getting out put SUBBA to my variable

  • How to synchronize analog input and output from two different USB daq boards

    Hi all,
    I have two very differnt USB boards the NI USB 6008, which I am using to acquire the data (Analog Input) and a NI USB 9263, it is an Analog Output only board that I am using to deliver a signal (in this case a square pulse). The reason why I am not using the 6008 Analog Ouputs is because I need to deliver negative voltages and need the full +/-10V range.
    Looking at similar posts I am pretty sure that I can't use an external trigger or a shared clock, I also tried to use the synchronization of timed structures but no cigar.
    I am including a quick vi that I whipped out showing how the signal jitters due to the lack of synchronization. The AO from the 9263 connects to the AI in the 6008 in this example.
    Solved!
    Go to Solution.
    Attachments:
    Test Pulse.vi ‏117 KB

    I talked to a specialist in the phone and tols me that it is not possible.

  • Simultaneous Digital Input and Output from NI 9403

    Hi,
    I was wondering if it is possible to digital output through one line in this module(NI 9403) while simultaneously reading from 10 other lines?
    Basically what I need is for line0 to always be closed(true), and read lines1:10 - at very least 1sample/second.
    I have attached a stripped down version of my code illustrating my error. I thought I was getting the error because the two tasks were using different clock configurations, but I tried using the same inputs and that doesn't work for me.
    Any input is greatly appreciated.
    Thank you
    Attachments:
    Digital I-O.vi ‏22 KB

    Hi Matthew,
    The behavior you're seeing is expected for the 9403 module, since it is a serial module. The DAQmx help has the following restrictions in the Digital I/O Considerations for C Series Devices section.
    Timed digital input/output restrictions:
    You cannot use parallel and serial modules together on the same hardware timed task. 
    You cannot use serial modules for triggering. 
    You cannot do both static and timed tasks at the same time on a single serial module. 
    You can only do hardware timing in one direction at a time on a serial bidirectional module.
    So you can only do timed input or output at one time, but not both. However, based on the VI you attached and the description of what you want to do, you don't necessarily need both timed tasks in your loop. You can create a static output task to update that one line and after that, you can just start your timed input task on the rest of the lines. This should maintain the state on the DO line, since you're not acquiring from it.
    Cheers,
    Cristina
    Cristina

  • Multiple Input and Output from a 6534

    Hello
    I am after some advice regarding my PCI 6543 digital I/O card and the best way to achieve my desired results. I am programming in Visual C++ with Ni-DAQ 7.
    I want to generate a pattern output from one of the ports, Port A, following a software command. This pattern consists of a 10uS pulse on DIOA0, that repeats 200 times with a period of 100uS. I want this DIOA0 output line to initiate an input on ports C and D, possibly through the REQ pin. Consequently the input should acquire 200 times for each call to the pattern output.
    I want this to repeat, so the pattern output goes again (as in a FOR loop), and the input occurs again for an as yet undetermined number of times.
    I have managed to get something worki
    ng for 1 iteration, and I can generate multiple pattern outputs, but the inputs only seem to acquire for the 1st iteration. However, if I step through the code in debug mode I can get the input to work correctly.
    Any ideas would be gratefully appreciated.
    I am still trying to get some earlier problems with this application solved.
    Kind Regards
    Jamie

    Hi Jamie,
    There are a couple different ways you can loop from a buffer. You can either use the onboard memory of the 6534 and loop from there or you can specify as a software configuration that the board loop through the PC memory buffer.
    For the onboard looping you need to specify the following:
    iStatus = Set_DAQ_Device_Info (1, ND_PATTERN_GENERATION_LOOP_ENABLE, ND_ON);
    For software, PC memory looping, the following function specifies this:
    iStatus = DIG_DB_Config (iDevice, iGroup, 1, 0, 1);
    I attached a couple programs that might be of use. Check this post:
    http://exchange.ni.com/servlet/ProcessRequest?RHIVEID=101&RPAGEID=135&HOID=5065000000080000008BA10000&USEARCHCONTEXT_CATEGORY_0=_31_%24_12_&USEARCHCONTEXT_CATEGORY_S=0&UCATEGORY_0=_31_%24_1
    2_&UCATEGORY_S=0
    Hope that helps. Have a good day.
    Ron

  • Comparing digital input and output from two different DAQs

    I want to create this program where the digital output lights up LEDs at random and push buttons are the digital input part of another DAQ are pushed. When the correct button is pushed, the score will increase by 1. My code doesn't work though. Can someone point my errors to me? Both the DAQs i'm using are USB-6008 DAQs. thanks
    Attachments:
    Untitled 1.vi ‏41 KB

    Let's start with the digital output
    What is this code all about?
    Do you want only one of the 8 led's to lit randomly or are multiple led's also ok?
    The two possible codes are in attached file SNAG-003.jpg
    Connect the output of the "Scale by power of 2" function or the "Multiply" output directly to the Write DAQmx vi
    I don't understand the purpose of the "Boolean Value" and "Replace subset array" thing, so I skipped it
    Attachments:
    SNAG-002.jpg ‏49 KB
    SNAG-003.jpg ‏22 KB

  • Patterned input and output from a single port w/ NI 6534 DIO

    Is it possible to configure certain lines in a port to be read and others to be write? I am interested in doing patterned I/O with a single port, first output, then input. Not both at the same time. Is it possible to perform patterned output on one line and patterned input on a different line within the same port?
    Thanks
    -Scott

    Hi Scott,
    I understand that you'd like to do digital I/O on a PCI-6534. All of the scenarios you outlined in your question should be possible with this board.
    1. You can configure some lines of a port to output signals while others input signals by using a line direction map.
    2. You can do patterned I/O on the same port at the same time.
    I'm not sure what software you're using to interface with the 6534, but if you happen to be using LabVIEW, then there is a shipping example which demonstrates the basics of patterned I/O on a single port of a DIO board. The example is called Digital Multi-line Direction (E).vi and can be found in Help >> Find Examples. If you are using another programming language, then there may be examples on ni.com.
    Hope this helps
    Marcus G.
    National Instruments

  • WaitFor() hangs if output from child process is bigger than few lines.

    I'm using j2sdk1.4.1_01.
    it seems like the bug which was reported many times, but supposed to be fixed in current version.
    any ideas, sugesstions?
    is there any way to change the size of the buffer?

    Coincidence? It should be 4096, actually - the size of the I/O buffer.
    Runtime.exec() gives you a handle to a process. You have to spawn a couple of threads to read the standard output and standard error of the process, or the process will hang after filling the output pipe, which is usually 4K.

  • How to control (the input and output) EXE file after I call it using exec?

    Hi,
    I knew that I can use runtime.exec() to call one EXE file, and this works. But this EXE has two characteristics:
    1. After this exe starts, it asks user to input number such as 1 or 2 onto computer screen, then press return. Then the exe will start the calculation.
    2. after it starts calculation, it prints 3 columns of numbers onto the screen.
    My two questions are:
    1. How to use java to input the number such as 1 or 2 automatically? this EXE can not work like this in DOS command line:
    C:> file.exe parameter
    The parameter is the number such as 1 or 2 that I wanna input.
    2. how to redirect the 3 columns of numbers from computer screen to txt file?
    My colleague can solve these two questions using Mathematica. So I know that definitely there is at least one solution for it. I just can not do it using Java. This wierd exe file bothered me a lot and I really wish that I can get help from someone in java community.
    Thank you!
    Tony

    When you call Runtime.exec, you get a Process object. (I presume something similar happens when you use ProcessBuilder.) Process has methods with names getOutput, getInput, and getError. These correspond to the standard input, standard output, and standard error streams of the spawned process.
    You can read and write to the process on the streams corresponding to input and output that the process writes to the console.
    [add]
    In fact, you should be grabbing and reading the output/error streams anyway, because of the points raised by the Traps article. Google "Java Runtime exec traps" and you'll probably get a link to this JavaWorld article, which describes common Runtime.exec problems and how to solve them.
    Edited by: paulcw on Jun 15, 2010 4:09 PM

  • FINALLY INPUTTING and OUTPUTTING Annotations!

    Ok, before everyone thinks that this is a very bad solution, I have to tell that I`m no programmer and my knowledge of PostgreSQL, Ruby or any other language is very poor.
    With useful help from Jamie Hodge, fbm and Nicholas Stokes (mainly)
    I could manage to write a command for inputting and outputting from Final Cut Server Annotations.
    So lets go to the fun part:
    INPUTTING:
    1- Create a Response called "Annotations IN" (or whatever you want):
    a - Reponse Action: "Run an external script or command"
    b - Run Script > *Commnad Path: /Library/Application Support/Final Cut Server/Final Cut Server.bundle/Contents/Resources/sbin/fcsvr_run
    Command Parameters: psql px pxdb -c "COPY pxtcmdvalue FROM '/FCSRV/annotation-in.txt' USING DELIMITERS '|';"
    2 - Create a poll Watcher with name: "Watch for Annotations IN"
    a - Enable: true
    b - Monitor Address: Chooses a Device (create a new one or use a tmp one) and path to where you`ll going to put a txt file with the annotations.
    c - Response List: Choose the Response you created "Annotations IN" in my case.
    d - Event Type Filter: Created, Modified
    e - Poll Watcher > Listing Frequency: 2 (or any number of seconds you feel like it).
    Listing multiple: 2
    Wildcard include Filter: *.txt (or any custom extensions you want)
    3 - Create a txt file and use this as a template:
    {ASSET_ENTITYID}|1527|{TCIN}/(30000,1001)|{TCOUT}/(30000,1001)|{Annotation}|{USE RID}|{DATE}
    Where:
    {ASSET_ENTITYID} = Is the entityid of your asset. You can find what number it is by issuing:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "SELECT pxmdvalue.entityid, pxmdvalue.value AS asset_name FROM pxmdvalue INNER JOIN pxentity ON pxentity.entityid = pxmdvalue.entityid WHERE pxmdvalue.fieldid='1543' AND pxentity.address LIKE '/asset/%';"
    This will output ALL your assets, so if you know the name or want to parse the name you can use:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "SELECT pxmdvalue.entityid, pxmdvalue.value AS asset_name FROM pxmdvalue INNER JOIN pxentity ON pxentity.entityid = pxmdvalue.entityid WHERE pxmdvalue.fieldid='1543' AND pxmdvalue.value='ASSETNAME' AND pxentity.address LIKE '/asset/%';"
    Where in ASSETNAME you`ll have to put your Asset Name without extension.
    {TCIN} and {TCOUT} is, of course, the TC`s points. In the form of: HH:MM:SS;FF
    {Annotation} is the commentary.
    {USERID} (in my case was 1)
    {DATE}: This one is tricky. My example is 2009-03-15 19:31:15.839795-03
    So is in the form YYYY-MM-DD HH:MM:SS.????? I really don`t know the rest. Could be milliseconds?
    Of course one can write a script to translate everything from a txt file like:
    ASSETNAME | TCIN | TCOUT | ANNOTATIONS | USER
    But as I`ve said I`m no programmer
    Ok.. now the time for the OUTPUT:
    The command-line is:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "SELECT pxmdvalue.value AS Asset_NAME, pxtcmdvalue.value, pxtcmdvalue.begintc, pxtcmdvalue.endtc FROM pxmdvalue INNER JOIN pxtcmdvalue ON pxmdvalue.entityid = pxtcmdvalue.entityid WHERE pxmdvalue.value='ASSETNAME';"
    Where ASSETNAME is the Asset name without the extension.
    Or issuing the following to OUTPUT ANNOTATIONS from ALL assets:
    /Library/Application\ Support/Final\ Cut\ Server/Final\ Cut\ Server.bundle/Contents/Resources/sbin/fcsvr_run psql px pxdb -c "select * from pxtcmdvalue;"
    Adding "> /PATHTO_WHERE_IN_WANT/ANNOTATIONSOUTPUT.TXT" at the end will put all output into a txt file.
    It`s possible (in theory) to:
    1- Create a boolean md field in FCSRV called "EXPORT Annotations" (don`t choose lookup)
    2- add or create a md group called "Export Annotations" and add the above md field to it (don`t choose lookup)
    3- Add "Export Annotations" md field to Asset Filter md group
    4- Make a Response for Running external command. Command path: /Library/Application Support/Final Cut Server/Final Cut Server.bundle/Contents/Resources/sbin/fcsvr_run
    Command Parameters: psql px pxdb -c 'SELECT pxmdvalue.value AS Asset_NAME, pxtcmdvalue.value, pxtcmdvalue.begintc, pxtcmdvalue.endtc FROM pxmdvalue INNER JOIN pxtcmdvalue ON pxmdvalue.entityid = pxtcmdvalue.entityid WHERE pxmdvalue.value=[FileName];' > ~/Desktop/ann-out.txt
    (I`m having problem with this, it doesn`t work).
    5- Make a Subscription that if Export Annotations modified = true, trigger if changed and trigger the Response above.
    6- Add exporting annotations md group to Media md set.
    In theory it`s possible to modify the FinalCutServerIntegrationSample get and input annotations instead of adding another "comment" field to md group list.
    Few!
    Ok so please help beautify this out!
    This will be very useful for a lot of people.... We know that it`s only a matter of time to FCSVR have this function built-in... but this "time" could be years.
    So let`s start ourselves!
    Thank you very much!!
    Regards!

    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 change the input and output schema in BPEL process

    hi',
    Please tell me how to change the input and output schema in BPEL process after the process is made.
    thanks
    Yatan

    If your intention is just changing the content you are passing to bpel/returning from bpel
    Here is another way
    just update your default created xsd files with new elements, update wsdl elements in message definition and chnage bpel code to reflect new elements in activities
    Regards,
    Praveen

  • How to Create a Rich Dynamic Input and Output PDF to insert and get data into, from Database (MSSQL)

    HI ,
    I want to use Adobe LiveCycle Designer and Adobe LiveCycle Workbench features to create a Dynamic PDF form which can allow me to store data into database(MSSQL Server) and Can also provide me the Output PDF form with all the information which has been been filled in by the User in input form. Both Input and Output forms must be Dynamic. I am stuck in this process and Need Experts Advice on the Complete optimal process flow of the Adobe.
    Regards
    Ritesh Grover

    HI
    Go to the lay out of your screen and doublr click on the table control fields, you can get the Properties/Attribute of the screen or table control Fields
    Assing a Group GRP1 for all the fields i n the table control.
    in PBO
    if ok_code = 'INPUT'.
    LOOP AT SCREEN.
    IF screen-grp1 = 'GRP1'.
    screen-input = 1.
    modify screen.
    endif.
    ENDLOOP.
    elseif ok_code = 'OUTPUT'.
    LOOP AT SCREEN.
    if screen-grp1 = 'GRP1'.
    screen-input = 0.
    modify screen.
    endif.
    endloop.
    endif.
    Regards
    Ramchander Rao.K
    Edited by: Ramchander Krishnamraju on Aug 8, 2009 5:27 AM

  • How to remove items from INPUT and OUTPUT?

    I installed a Movavi demo and deleted (uninstalled) it, but the Movavi sound Grabber still exists in my INPUT and OUTPUT section under sound options. It's making the sound screwy and I often lose audio when I switch from headphones, to blue tooth speaker. Please help!

    You have not uninstalled it correctly, check the directions and do so.

  • XSLT Generation from input and output XML

    Is it possible to generate an XSL mapping file in Java if we have input and output XML.
    If yes, then how to achieve this when user defined functions are used during mapping?

    Hi Prateek,
    check the following links for Business connectors and adapter:
    http://help.sap.com/saphelp_nw2004s/helpdata/en/92/3bc0401b778031e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/2c/4fb240ac052817e10000000a1550b0/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/3f93404f673028e10000000a1550b0/frameset.htm
    Hope these help you.
    Regards,
    Anuradha.B

  • (Input and) output formats from Photoshop Elements 6 for Mac

    I noticed that (until midnight PT, anyway) Amazon has Photoshop Elements for the Mac at a lower price than usual.  This brings up a question for me: What output formats can Photoshop Elements 6 produce?  In particular, can it produce PNG?  Also, can it accept PNG as input?

    I think that all the formats like .bmp, camera RAW, EPS,PICT, TIFF, Filmstripn, IFF, JPEG, Photoshop pdf, Photoshop RAW,PNG etc are supported for both input and output.

Maybe you are looking for

  • Problem in starting Managed weblogic server

    Hi, I have Weblogic 8.1 with SP4 in production mode with admin server(port :7001) & managed server(port:7004) configured as a Windows services. so when ever i Restarted the windows service of the managed server. The ear previously got deployed is not

  • X240, T440 case design frustrations

    It is difficult to sum up the frustration in dealing with this new X240 and T440 case design.  I can't believe I am no longer able to swap a hard drive or update memory without taking apart the case.  Replacing the keyboard is next to impossible wher

  • Unable to find Local Ejb home in websphere 6.0

    Its really anoying as am unable to guess . I am invoking an EJB locally using code as below . The Ejb works fine while testing with UniversalTestClient However when i try to invoke it from my Client it gives jndi error. Am using RAD 6.0 IDE and WebSp

  • Best way to super-impose multiple people in 1 shot?

    Hi all. I filmed a scene with myself running in 4 different places, and now I want to merge them all together into a final shot (so that it looks like there are multiple of me, all in the same shot), but I'm having trouble with the Garbage Matte and

  • How to handle an asynchronized scenario?

    Hi, there: I had an asynchronized scenario in my web application. After client side collecting information and click "submit", my servlet in server side is supposed to wrap those information in a transaction and send it to 3rd party engine, however,