1,892 questions
241
votes
11
answers
143k
views
Accessing console and devtools of extension's `background` script
I just started out with Google Chrome extensions and I can't seem to log to console from my background js. When an error occurs (because of a syntax error, for example), I can't find any error ...
142
votes
7
answers
169k
views
How to read a single char from the console in Java (as the user types it)?
Is there an easy way to read a single char from the console as the user is typing it in Java? Is it possible? I've tried with these methods but they all wait for the user to press enter key:
char tmp ...
515
votes
33
answers
1.1m
views
How can I clear the interpreter console?
Like most Python developers, I typically keep a console window open with the Python interpreter running to test commands, dir() stuff, help() stuff, etc.
Like any console, after a while the visible ...
102
votes
9
answers
65k
views
Chrome/Firefox console.log always appends a line saying 'undefined'
Every time console.log is executed, a line saying undefined is appended to the output log.
It happens in both Firefox and Chrome on Windows and Linux.
1145
votes
28
answers
1.3m
views
How can I get the application's path in a .NET console application?
How do I find the application's path in a console application?
In Windows Forms, I can use Application.StartupPath to find the current path, but this doesn't seem to be available in a console ...
187
votes
14
answers
927k
views
How to clear the console using Java?
Can any body please tell me what code is used for clear the screen in Java?
For example, in C++:
system("CLS");
What code is used in Java to clear the screen?
221
votes
36
answers
629k
views
How to stop C++ console application from exiting immediately?
Lately, I've been trying to learn C++ from this website. Unfortunately whenever I try to run one of the code samples, I see that program open for about a half second and then immediately close. Is ...
170
votes
12
answers
114k
views
How can I make console.log show the current state of an object?
In Safari with no add-ons (and actually most other browsers), console.log will show the object at the last state of execution, not at the state when console.log was called.
I have to clone the object ...
537
votes
25
answers
588k
views
Preventing console window from closing on Visual Studio C/C++ Console application
I've used Visual Studio for years, but this is the first time I've done any 'Console Application' development.
When I run my application the console window pops up, the program output appears and then ...
190
votes
15
answers
415k
views
Changing default encoding of Python?
I have many "can't encode" and "can't decode" problems with Python when I run my applications from the console. But in the Eclipse PyDev IDE, the default character encoding is set to UTF-8, and I'm ...
456
votes
15
answers
392k
views
JUnit test for System.out.println()
I need to write JUnit tests for an old application that's poorly designed and is writing a lot of error messages to standard output. When the getResponse(String request) method behaves correctly it ...
158
votes
8
answers
168k
views
Capturing console output from a .NET application (C#)
How do I invoke a console application from my .NET application and capture all the output generated in the console?
(Remember, I don't want to save the information first in a file and then relist as ...
583
votes
31
answers
581k
views
Text progress bar in terminal with block characters [closed]
I wrote a simple console app to upload and download files from an FTP server using the ftplib.
I would like the app to show some visualization of its download/upload progress for the user; each time ...
62
votes
7
answers
26k
views
System.out.println and System.err.println out of order
My System.out.println() and System.err.println() calls aren't being printed to the console in the order I make them.
public static void main(String[] args) {
for (int i = 0; i < 5; i++) {
...
142
votes
33
answers
75k
views
How to add a Timeout to Console.ReadLine()?
I have a console app in which I want to give the user x seconds to respond to the prompt. If no input is made after a certain period of time, program logic should continue. We assume a timeout means ...