output

console output formatting.

Are there any conventions for formatting console output from a command line app for readability and consistency? For instance, do you indent sub-information, when do you print a blank line, if ever, how should you accent important statements. I've found output can quickly degenerate into a chaotic blur. I'm interested in hearing abou...

XSLT Transformation Problem with disable output escaping

I have an xml in which i have stored some html under comments like this <root> <node> <!-- <a href="mailto:[email protected]"> Mail me </a> --> </node> </root> now in my Transform Xslt code of mine i am giving XPathNavigator which is pointing to node and in xslt i am passing the comment value of as a paramete...

Visual Studio Filter Debug Output

I have some code that causes a bunch of exceptions (which can safely ignored) but it floods my debug output window. It always has the same form and would be easy to filter out. How do i write a macro(?) to filter out these lines in realtime ...

printf() functionality in Java combined with a CharBuffer or something like it

I am a little confused here. I would like to do something like this: create some kind of buffer I can write into clear the buffer use a printf()-like function several times to append a bunch of stuff into the buffer based on some complicated calculations I only want to do once use the contents of the buffer and print it to several Pri...

Simplest way to print an array in Java

What's the simplest way of printing an array of primitives or of objects in Java? Here are some example inputs and outputs: int[] intArray = new int[] {1, 2, 3, 4, 5}; //output: [1, 2, 3, 4, 5] String[] strArray = new String[] {"John", "Mary", "Bob"}; //output: [John, Mary, Bob] ...

output window to file (visual studio 2005)

in visual studio 2005 how can i save whats written to the out put window to file (i cant change the code writing to the output window and it writes a lot i just want to save the output window content to file) thank you Arik ...

How can I print out string records stored in a two-dimensional array?

I am working on a project using C. I store several records in a two-dimensional array of strings, where one string is the record name and the other string is the actual value. For example: myArray[0][0] = "filename1"; myArray[0][1] = "somefile.txt"; myArray[1][0] = "filename2"; myArray[1][1] = "anotherfile.txt"; // and so on ... I kno...

Is it possible to ignore an output param of a stored procedure?

How can I ignore an output parameter of a stored procedure. I'm calling the sp from another sp. e.g.: DECLARE @param1 integer EXEC mystoredprocedure @in_param_1, @in_param2_, @param1 OUTPUT, what do I type here to ignore the second output param I'm using T-SQL (MS SQL 2005). Thanks for your help. ...

gfortran: how to control output directory for .mod files

Is there is a way to put .mod files, generated by gfortran (GCC), into a separate output directory? I know how to place object files or other output with the -o flag as in: gfortran -c test.f03 -o /path/to/output/dir/test.o But the .mod files (which are generated by the above call) are not affected by the -o flag and placed in the curr...

What Healthy Tricks Do You Use to Stimulate Your Brain and Increase Code Output?

There have been a few posts around the place as to what is the best music for coding, etc. While music can certainly make coding more enjoyable, I don't believe it actually makes me more productive and in fact probably distracts me more as I want to mess around with iTunes playlists, ratings and find good music to listen to. I find that...

Print leading zeros with C++ output operator (printf equivalent)?

How can I format my output in C++? In other words, what is the C++ equivalent to the use of printf like this: printf("%05d", zipCode); I know I could just use printf in C++, but I would prefer the output operator <<. Would you just use the following? std::cout << "ZIP code: " << sprintf("%05d", zipCode) << std::endl; ...

Started Process from .NET but RedirectedStandardOutput doesn't support UTF-8

I am trying to call php's HTML purifier from .NET using this code: Process myProcess = new Process(); myProcess.StartInfo.FileName = "C:\Path\to\php.exe"; myProcess.StartInfo.Arguments = "C:\Path\to\purify.php"; myProcess.StartInfo.UseShellExecute = false; myProcess.StartInfo.RedirectStandardOutput = true; myPro...

Getting input and output from a jar file run from java class?

Hi, I have a jar file that runs this code: public class InputOutput { /** * @param args * @throws IOException */ public static void main(String[] args) throws IOException { boolean cont = true; BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); while (cont) { System.o...

How can I redirect STDERR to STDOUT, but ignore the original STDOUT?

I have a program whose STDERR output I want to inspect and run grep on etc. So I could redirect it to STDOUT and use grep, but the problem is, I do not want the original STDOUT content. So, this one won't do cmd 2>&1 | grep pattern because it will mix the original STDOUT and STDERR. And this one doesn't work since grep doesn't read...

how to use a ByteBuffer with an OutputStream

I need to put the contents of a java.nio.ByteBuffer into an java.io.OutputStream. (wish I had a Channel instead but I don't) What's the best way to do this? edit: and I can't use the ByteBuffer's array() method since it can be a read-only buffer. edit 2: I also may be interspersing writes to the OutputStream between using this ByteBuff...

Linux terminal output redirection

I want to redirect the output of a bash script to a file. The script is: #!/bin/bash echo "recursive c" for ((i=0;i<=20;i+=1)); do time ./recursive done But if I run it like this: script.sh >> temp.txt only the output of ./recursive will be captured in the file. I want to capture the output of time command in the file. ...

Grab console output launched with elevated privileges

I'm writing a command-line tool which requires privileges elevating. This can be successfully implemented using manifest. But if this tools is launched from cmd.exe or Far Manager (far.exe), a new console window is created. So all tool console output is written to it and is lost on close. So my idea is about implementing a fork, where ...

Print Date and Time In Visual Studio C++ build?

How would I print the date and time for the purposes of the build. Ie: When the console for my application starts up I want to do this: Binary Build date: 03/03/2009 @ 10:00AM I think this would be a super useful function for all applications to have behind the scenes for programmers, especially in a team environment. Is there a si...

MSSQL 2005 C# Assembly & OUTPUT

I'm having a problem OUTPUTing a variable in my assembly. Do I need to add a "out string var1" to the parameter list of the function in C#? I get an error - something related to var1 not being set... I tried parameter.Direction = ParameterDirection.Output I can't find any good examples Edit: My assembly SP currently returns a records...

Error in outputting to a file in C++ that I can't find

Not as in "can't find the answer on stackoverflow", but as in "can't see what I'm doing wrong", big difference! Anywho, the code is attached below. What it does is fairly basic, it takes in a user created text file, and spits out one that has been encrypted. In this case, the user tells it how many junk characters to put between each ...