output

Partially read standard output of another process created from c# application

I have a GUI application within which i'm spawning a console application using Process class. Process p1 = new Process(); p1.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p1.StartInfo.CreateNoWindow = true; p1.StartInfo.UseShellExecute = false; p1.StartInfo.FileName = Path.Combine(basepath, "abc.exe"); p1.StartInfo.Arguments = "/pn...

How can I calculate a time span in Java and format the output?

I want to take two times (in seconds since epoch) and show the difference between the two in formats like: 2 minutes 1 hour, 15 minutes 3 hours, 9 minutes 1 minute ago 1 hour, 2 minutes ago How can I accomplish this?? ...

Replace 'keys' in file with DB data

Currently I have a the following way of retrieving data from my DB: $school->get('studentCount'); I required a shortcut to access these fields within the page and so came up with a format like this: <p>Blah blah blah [[studentCount]]</p> I have output buffering turned on but just need an easy way of replacing that key ('[[field-nam...

How can you print an Ada.Calendar.Time variable in Ada?

The title says it all... need to know how to print a Time variable in Ada. I assume there is no portable way because Time is implementation defined. I've already seen the GNAT.Calendar.Formatting package available under GNAT, I'd also be interested in a GHS for VME. ...

file input optput

i want to read a microsoft word file without use of data connection, ...

How can I capture another process's output using C?

How can I capture another process's output using pure C? Can you provide sample code? EDIT: let's assume Linux. I would be interested in "pretty portable" code. All I want to do is to execute a command, capture it's output and process it in some way. ...

JSTL <c:out> where the element name contains a space character...

I have an array of values being made available, but unfortunately some of the variable names include a space. I cannot work out how to simply output these in the page. I know I'm not explaining this well (I'm the JSP designer, not the Java coder) so hopefully this example will illustrate what I'm trying to do: <c:out value="${x}"/> ...

ASP .Net Output Caching and Ajax Control toolkit

I'd like to know if there's a special way of implementing output caching and using a control from the ajax control toolkit. I keep getting a javascript error on a page with output caching and a tab control that says: ajaxtoolkit (my assembly prefix) is undefined. This is the directive I added: <%@ OutputCache Duration="3600" VaryByPara...

When will an EOFException occur in JAVA's streams

I am working with a DataInputStream and had a question about EOFExceptions. According to java docs: Signals that an end of file or end of stream has been reached unexpectedly during input. This exception is mainly used by data input streams to signal end of stream. Note that many other input operations return a specia...

Output conflicts between C & C++

Greetings Everyone I am currently trying to write a multi-language program (C, C++ and fortran) though am achieving segmentation errors. I've ruled out vectors and the like in: http://stackoverflow.com/questions/666320/accessing-public-class-memory-from-c-using-c I've narrowed now the cause to the use of 'cout' experssions in my C++ se...

Easiest way to Filter Eclipse Console Output text

I'm asking this in relation to Flex Builder, but it might apply to Eclipse in general. Trace statements in Flex Builder get sent to an Eclipse Output Console. What is the easiest way to filter this text on the Eclipse side? Specifically, I'd like to be able to filter (ignore) lines by patterns. I came across Logback, but it seems like...

How can I capture rsync progress messages in Perl?

I want to capture all the progress messages emitted by an rsync process from a Perl script. In certain circumstances this isn't working. Here's a typical rsync command line I use: rsync -aL --verbose --progress --bwlimit=100 \ --include-from=/tmp/78hJ2eDCs1 \ --include '*/' --exclude '*' \ /srcdir/* \ hostname:/target/ 2>&1 I...

Can AMF be used as "just another output format" from a web service?

I'm working on a RESTish server project that responds to HTTP requests in a variety of formats. This allows us to write user facing applications and retrieve whichever format seems most convenient at the time. For example, to see if there is a user logged in, we can send: http://serverurl/Authentication?command=whoami&amp;format=xml A...

Suppress output in Python calls to executables

I have a binary named A that generates output when called. If I call it from a Bash shell, most of the output is suppressed by A > /dev/null. All of the output is suppressed by A &> /dev/null I have a python script named B that needs to call A. I want to be able to generate output from B, while suppressing all the output from A. From w...

Is there an easy way to output two columns to the console in Java?

As the title says, is there an easy way to output two columns to the console in Java? I'm aware of /t, but I haven't found a way to space based on a specific column when using printf. ...

How can I read an HttpServletReponses output stream?

Hi there. I want to make a Servlet filter that will read the contents of the Response after it's been processed and completed and return that information in XML or PDF or whatever. But I'm not sure how to get any information out of the HttpServletResponse object. How can I get at this information? ...

process has exited but the buffer is still being printed, c#

hi i created a process in C# to execute an external program, i used the asynchronous methods to read on the standardoutput and all is working fine. However i have an issue, i'm printing a line indicating the process has finished. The problem is that, some times it may so happen when the data in the buffer is huge that, the process may ex...

How do I print outputs from calls to subprocess.Popen(...) in a loop?

I wrote a script to run a command-line program with different input arguments and grab a certain line from the output. I have the following running in a loop: p1 = subprocess.Popen(["program", args], stderr=subprocess.STDOUT, stdout=subprocess.PIPE, shell=False) p2 = subprocess.Popen(["grep", phrase], stdin=p1.stdout, stdout=subprocess....

Attach to a processes output for viewing

How would I 'attach' a console/terminal-view to an applications output so I can see what it may be saying? How would I detach from an applications output without killing the application? Normally if you fire up a talkative application using the command line you get to see all kinds of wonderful output. However lets say I have a particu...

input and output without a library in C

I'm writing a small kernel for my programs in C. This is not (at the moment) an OS kernel, it's merely a way for me to keep track of input and output in programs without relying on external source (i.e. stdio.h). You might ask me why I'd ever want to do this; it's just so I know how this works, and so that I have more, and more (end goa...