output

How to use colours in console output in Scala or Java?

How to use colours in console output in Scala or Java? ...

Print only twelve characters from user submitted string in Java

I have a user input their name as a string and then the name is printed out onto the screen. How can i limit what is printed to only 12 characters so that a user cannot type an insanely long name? Here is my code: Scanner input = new Scanner(System.in); System.out.print("Enter your player name: "); String name= input.next();...

LaTeX Conflict with references, no output generated

Hi So far I´ve managed my bibliography very well. I use JabRef to organize it. But now it bugged forever (might be my fault, of course). The output does not come. I tons of messages like "LaTeX warning citation x undefined in line y" I did try to fix it with your "Why won't Latex generate any output?" i found at http://www.andy-robe...

Printing debug output in Windows programs

I am starting to do some work with the Windows API. However, I noticed that you can not use functions like printf if you have a windowed application. What is the standard way of printing debug and logging information? Sorry if this is an obvious question. ...

Custom formatting including dates

VB2005 In my app I present to the user an option to customize the name of the file that gets produced. The format string the program reads is something like "yyyyMMdd-%1-%2-%3-%4" which the user can customize to his liking. in this case the format of the date is yyyyMMdd and the %1 is the trip number like 1000P, %2 is the origin code l...

how to filter teradata help table

hi all, I'd like to create a table out of the dataset generated by teradata's "help table" function so i can add some more information about the table, and be able to filter the rows by conditions. the table has 400+ columns, so this would be very convenient for management. I'd like to be able to do something similar to creating a tabl...

System.Diagnostics.Process: when I run a C++ program that creates an output file and writes something, the output file is not created

When I run a C++ program that creates an output file and writes something, the output file is not created, although the program works fine when I simply double click it from Windows Explorer. This is the C# code I use to run the program: try { Process p = StartProcess(ExecutableFileName); ...

Python set error reporting level like in PHP

Hello, How can I set error reporting and warning outputs in Python like in PHP error_reporting(E_LEVEL)? ...

Display line break in <div> tag from database

I have to display an article from database inside a < div> tag. This article was inserted into database from a textarea. My problem is: i could not display exactly the structure that i inserted from the textarea (including line break) I tried the below code to replace the enter character to < br> tag but it did not work <div id="tmpId"...

Generating output content with MSBuild and no VS projects

This is my first dive into MSBuild so I'm feeling pretty lost. The end goal is to run an executable which will output a file, and we want the output of the build to be that file. In this build there is no VS project what so ever. The build is being run by TFS build services. At this point all I'm trying to do is generate a file and...

Rails: Place text on page

Ruby doesn't seem to have any method to convert my text to HTML before putting it on the page, so newlines do not appear. What am I missing? ...

How to make a java program to print both out.println() and err.println() statements?

I have written the java code below, which executes another java program named "Newsworthy_RB". Newsworthy_RB.java contains both the System.out.printlln() and System.err.println() statements. I want both the outputs to be printed in the command prompt console. What has to be done inorder to obtain the same. The below program just prin...

Question about var_dump output

When I var_dump an object, the output looks like this: object(XCTemplate)#2477 (4) { ["id"]=> string(1) "1" ["attributes"]=> array(0) { } ["db_table_name"]=> string(14) "template_names" ["cache"]=> array(0) { } } XCTemplate is its class, of course, but what does the integer (here: 2477) after the # mean? ...

Access output from java compiler in C#

I'm writing a program in C# that will compile java files using the java compiler (javac). I am having trouble capturing the output from javac (a command-line tool) to tell the user of errors. I know how to start a process and capture the standard output, but javac returns nothing. Is there any other way that I can capture the output, or ...

Convert Byte Array into HTML Image with Rails?

I have a Byte Array field being returned to me by the database, and in the view, I need to somehow output that as an image. How would I do that in Rails? Many thanks, M ...

output error in c++

I am having a very strange problem in a simple program and have been unable to reach any logical conclusion. When I redirect output from my program to a file, then I get a different result that I get when printing to stdout. When I print to a file, the result is correct. I don't understand why it would be different in the first place. He...

How this simple program works, I/O related

This is my program: #include <stdio.h> int main(int argc, char* argv[]) { char buf[1024] = {0}; setvbuf(stdout, buf, _IOFBF, 1024); printf("error\n"); printf("%s\n", buf); } And this is the output: error error Exited: ExitFailure 7 Why are both lines 3 and line 4 blank lines ? Isn't the character '\n' flushing the output b...

Output a single column from a datatable

So this doesn't seem like it should be that difficult, but apparently I'm overlooking something..? I have a datatable that has 4 columns. I want to output only the second column from the datatable. Here's what I've got so far: Dim dt As New DataTable ** Datatable is set here ** Dim row As DataRow Dim col As DataColumn For Each row In d...

Sorting in arrays

While sorting an array for ex: A[5]={1,4,5,3,2} the output must be 1,2,3,4,5 in ascending order. in using the concept of bubble sorting my output is 0,1,2,3,4 what would be the problem in my code int A[5]={1,5,3,2,4}; for(int i=0;i<5;i++){ for(int j=0;j<5;j++){ if(A[j]>A[j+1]) { int t=A[j]; A[j]=A[j+1]...

Visual Studio 2010 Output Panel Not Updating Postbuild Output

I just recently upgraded from VS2008 to VS2010. Because I do a lot of remote debugging (over VPN), I use Post-Build events to copy the compiled binaries and PDB's to the target machine before running. I do this by calling a batch file that (among other things) executes Robocopy. In VS2008, the Output panel would display robocopy's out...