output

Printing BFS (Binary Tree) in Level Order with _specific formatting_

Hello, To begin with, this question is not a dup of this one, but builds on it. Taking the tree in that question as an example, 1 / \ 2 3 / / \ 4 5 6 How would you modify your program to print it so, 1 2 3 4 5 6 rather than the general 1 2 3 4 5 6 I'm basically looking for intuitions on the most efficie...

DataAdapter Update() requires input parameter for Auto increment primary key column

While updating a DataTable to a SQL Server database I get the error message "Column 'PK_Column' does not allow nulls" after calling GetErrors() I don't want to provide a value for PK_Column because it is a auto increment primary key column in the database. My insert statement looks like this: INSERT INTO [Order] ([Customer_Id], [OrderTi...

Android ACTION_IMAGE_CAPTURE Intent

We are trying to use the native camera app to let the user take a new picture. It works just fine if we leave out the EXTRA_OUTPUT extra and returns the small Bitmap image. However, if we putExtra(EXTRA_OUTPUT,...) on the intent before starting it, everything works until you try to hit the "Ok" button in the camera app. The "Ok" button j...

How can you color NAnt output?

We are looking at using NAnt as a deployment tool for our internal (usually web based) applications. One of our (many) current solutions uses colored output on the commandline to indicate if there was a problem with the installation (green and red). Is there an easy way to change the output to be a particular color when NAnt is execu...

How to enable Line Number Shown in Visual Studio Build Output?

Running Visual Studio 2008 express, notice that the output windows there it doesn't show the number such as: (example) while compiling, (even though running a project with multiple solution inside) 1 > adsfgafkgja;l 1 > asdfafas 1 > asdfaf ... 2 > asdfasf 2 > safas trid a fresh installation, wonder why it isn't displaying the line num...

Save output error messages to file in MATLAB

Is there a way to save MATLAB error messages to a file? This may be a simple issue, but Google couldn't give me an answer. I've compiled a GUI executable for use without a MATLAB license, and occasionally it freezes. For aesthetic purposes, I suppressed the command window normally accompanying such an executable, so I can't get an erro...

Is there an output difference between php 4 and 5?

I noticed the other day that a new script I wrote for php 5 began outputting html that was viewable before the php script had actually finished. Did this happen with 4? For instance, I have a long loop that echos something out with each iteration. The output was small in terms of kb, so I dont think it was lag due to the download speed....

PHP Mixing server code with HTML output

I'm coding up a small script that'll take form data and do something with it. If it fails, it shows the error and the form again. If it succeeds, it'll show a success message. The backend code is using classes that'll throw exceptions if there's an error with the form data. The calls to the classes will be wrapped in a try{} catch{}. W...

make output parallel with php code based

Hi all, I need your some help... How to create parallel output from many pages in one pages, see examples: I store all data in plain text e.g. old-book-version.txt 1:1 dadidedodu.... 1:2 cacecocuci.... 2:1 papopupepi.... 2:2 lalilolule.... 2:3 and more...... mid-book-version.txt 1:1 dedadodedu.... 1:2 cacicecuca.... 2:1 popapepupi......

Transfer a variable to earier point without goto

How to write this without goto: ob_start(); $a = 0; echo "START of LEFT<br />"; begin: if($a > 0) { echo "CONTENT LEFT: $a<BR />"; <VERY DIFFICULT ALGORHITM> goto end; } <... ALL THE REST CODE OF LEFT ...> echo "END of LEFT<br /><br />"; $output1 = ob_get_contents(); ob_end_clean(); ob_start(); echo "START ...

Daemon writing output to file twice instead of once in C++.

I've written a daemon that writes the word "Beat" to a file, followed up the current date and time at 15 second intervals. However, each time I check the output file, the daemon appears to be outputting twice like this: Beat: Fri Jan 1 18:09:01 2010 Beat: Fri Jan 1 18:09:01 2010 where it should only have on entry. the entire...

How to write console output to a txt file

I have tried to write the console output to a txt file using this code suggestion (http://www.daniweb.com/forums/thread23883.html#) however I am not succeed. Whats wrong? try { //create a buffered reader that connects to the console, we use it so we can read lines BufferedReader in = new BufferedReader(new InputStreamReader(...

Supress SQL Output

When running a SQL query with output to text we typically get back output like this. AssetID Occurs -------------------- ----------- (0 row(s) affected) Since I am doing thousands of select statements to audit data in my table is there a way to suppress this output on SQL server? ...

Simple Macro Output/Console Logging in Visual Studio 2005?

I'm trying to log output to the Output window from one of my macros in Visual Studio. I thought that Debug.Print would do the trick like it does in Visual Basic.NET and VBA, but it doesn't do that. I found this, and tried this, it is not simple, nor does it work in Visual Studio 2005 (see bellow): Private Function GetMacroOutputPane...

Printing output of another program to a java text area

I am creating a GUI using Java. This GUI launches a program from the command line using the ProcessBuilder class. A little information on the process being launched: from the command line, it creates another window and prints information to said window. In my GUI window, I have a text area to where I would like to redirect said ou...

Should I use printf in my C++ code?

So I generally use cout and cerr to write text to the console. However sometimes I find it easier to use the good old printf statement. I use it when I need to format the output. So one example of where I would use this is: // Lets assume that I'm printing coordinates... printf("(%d,%d)\n", x, y); // To do the same thing as above us...

AJAX page + SQL query behaving vaguely ?!

I'll try my level best to describe the problem in words here since it's quite confusing. An 'sql' query gives no output, Through ajax page, when variables are passed in the query. Even the count of number of rows gives 0. So, I 'echoed' the same query which has the passed variables now having the values. When 'copy'-'pasted' the same (re...

Getting output from server side python script

Hey, I'm doing this project where we are supposed to connect a javascript client side application/web page on server A with a python server side script on server B. I need to get the output from the python script and store it into a variable but am running into some problems. I was trying to use XMLHttpRequest for this, and even though ...

Create Editable plots from R

Hello, I'm creating a series of plots in R (I'm using ggplot2, but that's not essential) and I want to be able to save my output so I can then edit it for furthur use, For instance, I might want to move legends about, or adjust colours etc. I have seen that ggplot2 has a save command but that seems to produce pdf's or bitmaps, neither ...

Pipe R commands and results from within a for loop to a file

We want to log the commands and results of a R script into a text report file. The pipe into the text file works well with sink(), but not within a for loop. The script is called with source("myscript.r",echo=TRUE) We need the loop to extract all rows of a data.frame consecutively into a vector and do some vector based analysis with ...