console

How to set default input value in .Net Console App?

How can you set a default input value in a .net console app? Here is some make-believe code: Console.Write("Enter weekly cost: "); string input = Console.ReadLine("135"); // 135 is the default. The user can change or press enter to accept decimal weeklyCost = decimal.Parse(input); Of course, I don't expect it to be this simple. I am ...

Is it possible to write extension methods for Console?

While looking at this question and it's answers I thought that it would be a good idea to write an extension method for System.Console that contained the desired functionality. However, when I tried it, I got this compiler error System.Console': static types cannot be used as parameters Here's the code: using System; using Sys...

Programming Games and Applications/OS

Hello, I am 13 years old and am interested in programming for games. I am currently building an iphone game with Shiva using Lua as the scripting language. After that, I am not sure what I should do or what languages I should learn. My goal is to keep building games but I also want to build my own game console. Of course, that wont be fo...

UTF-8 output on Windows XP console

The following code shows unexpected behaviour on my machine (I'm using Visual C++ 2008 SP1 on Windows XP here): int main() { SetConsoleOutputCP( CP_UTF8 ); std::cout << "\xc3\xbc"; int fail = std::cout.fail() ? '1': '0'; fputc( fail, stdout ); fputs( "\xc3\xbc", stdout ); } I simply compiled with cl /EHsc...

How can I get pyplot images to show on a console app?

I'm trying to create an image using matplotlib.pyplot.imshow(). However, when I run the program from my console, it doesn't display anything? This is the code: import matplotlib.pyplot myimage = gen_image() matplotlib.pyplot.gray() matplotlib.pyplot.imshow(results) But this shows nothing. ...

How do I redirect the input and output of a console C# program to a socket?

How do I redirect the input and output of a console C# program to a socket? I need to start the program from within another process, and make it receive input and emit output to another process running on another computer in the network. What I'm trying to do is to programmatically run an application on another station, while controlling...

Console application prompting for input

I'm trying to put together a wrapper around a console application using StandardInput and StandardOutput. I'm getting stuck where the console application would prompt for input such as a password. I'd like to read from StandardOutput, prompt the user using the read text, and write the user's input back to the console application using ...

How to read number and display it to unix console with pipe symbols.

Hi. Id like to make simple digital clock just from symbols. My idea was to make this template: { System.out.println(" _"); System.out.println("|" + "_"+ "|"); System.out.println("|" + "_" + "|"); } _ |_| |_| BUILD SUCCESSFUL (total time: 0 seconds) _ _ _| | _| |_ | _| ....etc and t...

Is it possible to get the output of a program while it's running?

If I have a windows console program written with c++, is it possible to retrieve that program's standard output, while the program is running? And if not, what would be the best way to rewrite the program? I know I could output to files and continuously check those files for updates. Is there another way? Is there a better way? ...

Redirect Embedded Python IO to a console created with AllocConsole

I am having some trouble getting Python IO redirected to a console that I've allocated for my Win32 app. Is there a Python-specific stream that I need to redirect? Here's more-or-less what I'm doing now (error checking removed, etc.): int __stdcall WinMain(/*Usual stuff here*/) { // Create the console AllocConsole(); SetCon...

Removing pause after reading using readLine in java

I am reading several lines from the console in a java program using the readLine command from the BufferedReader class. However, the program pauses at the end of the last line and does not proceed until i press return. How do I eliminate this pause? ...

WCF Service Library - make calls from Console App

Hello there, I have a WCF Service Library with netTcpBinding. Its app.config as follows: <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="netTcp" maxBufferPoolSize="50000000" maxReceivedMessageSize="50000000"> <readerQuotas maxDepth="500" maxStringContentLength="50000000" maxArrayLength="500...

Is there any "remote console" for twisted server?

I am developing a twisted server. I need to control the memory usage. It is not a good idea to modify code, insert some memory logging command and restart the server. I think it is better to use a "remote console", so that I can type heapy command and see the response from the server directly. All I need is a remote console, I can build ...

Java prints output twice in a very specific circumstance

System.out.print("My string: "); My string: BUILD SUCCESSFUL (total time: 1 second) System.out.print("My string "); My string BUILD SUCCESSFUL (total time: 1 second) System.out.print("My string: "); My string: My string: BUILD SUCCESSFUL (total time: 1 second) Printing a string that ends with a colon and two spaces will make...

How to start the java console when launching an application from Eclipse?

When I start a java application, the Java Console is started. But when I start a java application from Eclipse, the Java Console does not start on its own. How can I make it start also when I run an application from Eclipse? ...

How to interpret some of the Error messages from Xcode console?

Hi As my programs involves more and more code Im starting to get a bit frustrated with the error messages that are thrown in the console: 2009-11-14 14:31:57.513 FC[915:5b27] *** -[SearchResultParser respondsToSelector:]: message sent to deallocated instance 0x82d28e0 This one is not the worst as it actually tells me that it has t...

More lines in command window

Is there a possibility to get "more" lines into the command window (Console)? When I debug my programs I output quite a bunch of lines to the window and the beginning of the ouput keeps disappearing out of the range I can scroll back the window so I don't see my complete output from the beginning of the program. How can I get the comma...

Reading and writing to console in Java

What is the most efficient class to use to read from and write to console in Java? ...

saving console messages to file in iphone

hi, Is there any way to save all the console messages to a file in iphone ? Thanks ...

How to loop a Console App

Hi all i just need to be able to loop a console app. what i mean by that is: program start: display text get input do calculation display result display text get input. REPEAT PROCESS INFINATE NUMBER OF TIMES UNTIL THE USER EXITS THE APPLICATION. program end. i hope that made sense. can anyone please explain how i would go about doi...