console

How can I determine whether Console.Out has been redirected to a file?

If my program is printing to the console, I perform word-wrapping in a certain way according to Console.WindowWidth by inserting newlines - and this works perfectly. However if the output of the program is redirected to a file or another program I would like it to skip the word-wrapping. How can I detect when this is the case? Console....

What's the best way to suppress a runtime console warning in Java?

I am using the getResponseBody() method of the org.apache.commons.httpclient.methods.PostMethod class. However, I am always getting a message written to the console at runtime: WARNING: Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended. In the code I have to write the response...

C#: How do you configure for a string[] to accept input of a whole string the way the console's main entry point accepts it broken up?

Exact duplicate: Split string containing command-line parameters into string[] in C# C#: How do you configure for a string[] to accept input of a whole string the way the console's main entry point accepts it broken up? When you execute a console application made in c#, it's main method accepts any other arguments typed into it ...

How can I direct log4j output so that different log levels go to different appenders?

Is it possible to have "debug" and "info" output written to the console while the "info" output is only written to some log file? For example, given this logging: LOG.debug(fileContent); LOG.info(fileLength); What does a corresponding log4j.xml look like? ...

.Net Console Application in System tray

Is there a way I can put a console application in the system tray when minimizing ? I use .Net 3.5 with c# ...

How would I create a remote admin console for a WCF Service using telnet/raw?

I have a WCF service currently using a TCP endpoint. Rather than create a separate console client app to administer the server I want the ability to telnet into the server or even just connect using a raw connection using putty and execute ascii commands straight on the server. Any ideas how I would go about doing this? Not an expert on...

Programatically opening and closing a console

I'm writing a windowed program in C++, but I would like to have the option to pop up a console to output to from inside the program (such as various things that go on behind the scenes of my program, to see that everything is acting correctly). Is there an easy way to do this? EDIT: In this particular case I'm using sfml on windows, bu...

Why does my QT4.5 app open a console window under Windows?

I've been playing around with Qt Creator 4.5 under Linux. My application builds just fine under Linux, but if I build in Windows, the app always opens a console window at startup. Can I stop it doing that? I'm building using the default MinGW setup, perhaps that is related. If need be I can build with Visual Studio, but I'd like to und...

copy and paste from terminal with keyboard in linux (ubuntu)

Heyas So I'm trying to move away from using the mouse as much as I can (just a pet project). I know that in the terminal you can do c-k to cut a line and c-u to paste that line back into that same terminal, but I'm looking for something where I can copy a line in the terminal into gnomes clipboard so I can paste it into say a browser o...

Outputting to the Console in C# on IIS

We are trying to debug some web services code we're running in C# on IIS. I am new to Windows programming and have no idea how to view output to the console. We've got some write statements in the code, but I can't figure out how to view the console while this thing is running. Help? ...

Why 3 threads for a basic single threaded c# console app?

I created a console app in c# with a single console.readline statement. Running this app within visual studio and stepping into the debugger shows 7 thread in the thread window (6 worker threads, one is .NET SystemEvents and the other is vshost.RunParkingWindow and the main thread). When I run the app outside visual studio I see a total ...

How to hide console window in python ?

Hello Everyone ! Well ... I am writing an IRC bot in python. I wish to make stand-alone binaries for Linux and windows of it. And mainly i wish that when the bot initiates .. the console window should hide and the user should not be able to see the window. What can I do for that ? The python way will be better. ...

How to clear the Console in c#.net?

Just that. I found a similar question here : http://stackoverflow.com/questions/377927/c-console-console-clear-problem but that didn't answer the question. UPDATES : Console.Clear() throws : IOException (The handle is invalid) The app is a WPF app. Writing to the console however is no problem at all, nor is reading from. ...

Ruby on Rails on Windows XP CTRL+C in console not stopping mongrel

I am currently in the process of learning Ruby on Rails. I have been following the Learning Rails podcast and screencasts. I've run into a problem, well more of an annoyance. Every time the screencast has me kill the mongrel server I am forced to close the console window because CTRL+C isnt killing it as it should. I then have to open ...

launch a gui program from windows console and then make it 'detach' itself

I'm trying to modify a legacy Delphi 5 app so that it can be launched either from it's icon/via Explorer, or from the console (command-line). When it gets launched from the console, I want the program to detach itself from the console process, so that the console can continue to execute other instructions without waiting for my program t...

Connecting console application to access database problems

Hey Everyone, I am trying to connect a console application to a access database. This is the query that i have am using: "SELECT [Type], [Name], [Phone Number], [Start Time], [End Time], [IM Session File], [Notes] FROM [Call History] WHERE [Start Time] >= ?" The problem is that for some reason when i take that data from the access da...

how to best design a wrapper for an access database using c# 3.0?

hi guys, i have only very limited exposure with .net 1.1 and a bit of 2.0, so i'm actually pretty excited and confused with the many changes that they have in .net 3.5. so i have this access database but we don't want the other programs from calling into this database directly. so i'm writing a wrapper exe which will contains functions w...

Prevent new line when outputting to console

I've set the buffer size to the window size to get rid of the scroll bar. Now, I'm trying to fill the console with a value, but there is always a new blank line added to the end, which causes the first line to be cleared from the buffer. I know why it's happening, but is there any way that I can prevent it? I've tried moving the buffer...

Is there any Python-like interactive console for Java ?

I spent a lot of time programming in Java recently, and one thing I miss from scripting languages was the ability to test them in a console. To quickly test a java program, I have to edit a file, then turn it to bytecode and execute it. Even using an IDE, it loses its fun after the 372 th time. I would like to know if there is a prod...

Auto-complete a HTML form using a C# program.

I want to write a C# program (for purely educational purposes) that would auto-complete a HTML form which resides at a specified URL. The thing is I don't know if that's possible or how can I get started? I thought of downloading the HTML, parsing it for the form's elements' names and then make a GET on that URL with the necessary parame...