output

When should I use out parameters?

I don't understand when an output parameter should be used, I personally wrap the result in a new type if I need to return more than one type, I find that a lot easier to work with than out. I have seen method like this, public void Do(int arg1, int arg2, out int result) are there any cases where that actually makes sense? how a...

How do you use the multi-line Console in Firebug?

The Firebug addon for Firefox supports a multiline Console, but how do you return values to show up in the Console's output? When I press "Run", all I see is a copy of my source code. ...

MSVC++ how to ouput something to the "output"-window during compilation

hello, sometimes i see that certain projects write something to the output during compilation. how can that be achieved in MSVC++ thanks! ...

Formatting text into boxes in the Python Shell

I've created a basic menu class that looks like this: class Menu: def __init__(self, title, body): self.title = title self.body = body def display(self): #print the menu to the screen What I want to do is format the title and the body so they fit inside premade boxes almost. Where no matter what I pass...

How do I use that "<<<HTML" thing in PHP?

I know I shouldn't be outputting things directly in PHP, but using a template instead, but whatever. I remember perl being able to do this, and as I reached for my perl book, I realized: I already packed it, as I'm moving. It's incredibly difficult to search for "<<<", as well. So, I know I can go, echo <<<SOMESTUFF blah blah blah ...

Oracle - output not coming in right format

Hi All, I have set the below parameters in sqlplus to display my view out put on unix box,However it is displaying one line gap between two records.I don't want that one line gap between two records Ex- set feedback off SET NEWPAGE NONE set HEADING Off set pagesize 0 set linesize 125 SET TRIMSPOOL ON set termout off spool /export/home/4...

Java - size of compression output-byteArray

When using the deflate-method of java.util.zip.Deflater, a byte[] has to be supplied as the argument, how big should that byte[] be initialized to? I've read there's no guarantee the compressed data will even be smaller that the uncompressed data. Is there a certain % of the input I should go with? Currently I make it twice as big as the...

Delphi 6 - read console app's output while running

How do I read a console apps output as it is running. I start the console application and would like to read the output as it is printed by the console app. ...

How to redirect the output of a PowerShell to a file during its execution

I have a Powershell script for which I would like to redirect the output to a file. The problem is that I cannot change the way this script is called. So I cannot do: .\MyScript.ps1 > output.txt How to redirect the output of a Powershell script during its execution? Thanks! ...

write() to stdout and printf output not interleaved?

#include <stdio.h> #define MAXLEN 256 int main() { int n; char buf[MAXLEN]; while((n = read(0,buf,sizeof(buf))) != 0){ printf("n: %d:",n); write(1,buf,n); } return 1; } The output of the program is read read write write n: 5:n: 6: The output of printf comes after pressing Ctrl+D at the standard input and not alon...

How to export the definition of an R object to plain text so that others can recreate it?

Let's say you have this data in R, and you want to post a question on stackoverflow. For others to best help you, it would be nice if they could have a copy of your object (dataframe, vector, etc) to work with. Let's say your data is in a data frame called site.data > site.data site year peak 1 ALBEN 5 101529.6 2 ALBEN 1...

Edit HTML output from Tomcat

Hi, I have some apps running over a Tomcat Server (Jira, COnfluence & Jforum). I want to add to all of them a banner at the top of the page. Is there any way to modify the output of all of them to show it? Basically, I want to ad a frame for showing it. Thanks! ...

Visual Studio 2008 Output - Hide dll loads and unloads

Visual Studio automatically displays dll loads/unloads in its output panel, like so: 'DialogAppDEBUG.exe': Unloaded 'C:\WINDOWS\system32\wbem\fastprox.dll' 'DialogAppDEBUG.exe': Unloaded 'C:\WINDOWS\system32\ntdsapi.dll' 'DialogAppDEBUG.exe': Unloaded 'C:\WINDOWS\system32\wldap32.dll' 'DialogAppDEBUG.exe': Unloaded 'C:\WINDOWS\system32\...

How to flush the io buffer in Erlang?

How do you flush the io buffer in Erlang? For instace: io:format("hello") or io:format(user, "hello") This post seems to indicate that there is no clean solution. Is there a better solution than in that post? ...

Slow MySQL Query

Hi, I have a query in MySQL (used in a stored procedure) which searches by name and another field. When I use different combinations of these search parameters, I get quick results (between 1 and 2s) but with some particular values, I get a query which takes 9s to return results on the production website. The following is what I got out...

Can gcc be configured to not print out a full path in warning/error messages?

When gcc prints out a warning or error, it shows the full path of the file that contains the error. Is there a flag to shorten the output to just the filename? ...

Best way for testing compiled code to return expected output/errors

How do you test if compiled code returns the expected output or fails as expected? I have worked out a working example below, but it is not easily extendable. Every additional test would require additional nesting parentheses. Of course I could split this into other files, but do you have any suggestions on how to improve this?. Also I...

Latex command line line length

When running latex, the command-line output it cut after 80 characters: LaTeX Warning: Reference `fig:assign-by-x' on page 76 undefined on input line 2 41. Any idea how I can stop this? Version is: pdfTeX using libpoppler 3.141592-1.40.3-2.2 (Web2C 7.5.6) kpathsea version 3.5.6 on Ubuntu Linux 9.04, bash shell. ...

How can I capture the error output from the ipython shell?

I'm writing an ipython macro that processes the output of a program. The thing is, the program can sometimes write to stderr , so if I do something like this : out = !my_program the out variable will not contain the output. I think it will contain the exit code ( correct me if I'm wrong ). How can I capture both stdout and stderr st...

Cron job: keep last 20 lines

I have a process that dumps millions of lines to the console while it runs. I'd like to run this in a cronjob but to avoid sending multi-MB mails, I'd like to restrict the output in the case of a success (exit == 0) to 0 lines and in case of an error (exit != 0) to the last 20 lines. Any ideas to achieve this with little effort? Maybe a...