output-formatting

How do I enable msysgit colored output when using console2

I'm having a hard time enabling git colored output on windows when using console2. To trick git I've already SET TERM = 'cygwin'. This enabled the colors from a standard cmd.exe prompt but not in console2. I've verified that console2 can see the env var as well. Anyone know how to get this working? ...

Elegant ways to print out a bunch of instance attributes in python 2.6?

First some background. I'm parsing a simple file format, and wish to re-use the results in python code later, so I made a very simple class hierarchy and wrote the parser to construct objects from the original records in the text files I'm working from. At the same time I'd like to load the data into a legacy database, the loader files ...

Rewinding std::cout to go back to the beginning of a line

I'm writing a command-line tool for Mac OS X that processes a bunch of files. I would like to show the user the current file being processed, but do not want a bazillion files polluting the terminal window. Instead I would like to use a single line to output the file path, then reuse that line for the next file. Is there a character (or...

Is there any setfill() alternative for C?

In C++: int main() { cout << setfill('#') << setw(10) << 5 << endl; return 0; } Outputs: #########5 Is there any setfill() alternative for C? Or how to do this in C without manually creating the string? Thanks in advance. ...

Output or Input filtering?

Output or Input filtering? I constantly see people writing "filter you inputs", "sanitize your inputs", don't trust user data, but I only agree with the last one, where I consider trusting any external data a bad idea even if it is internal relative to the system. Input filtering: The most common that I see. Take the form post data or ...

.Net: How to suppress TraceSource header ("SourceName TraceEventType: Id : ")?

I have a TraceSource object that I use to log the initialization of a VB.Net application. It has several TraceListeners attached: ConsoleTraceListener TextWriterTraceListener EventLogTraceListener For the first two I want the entry output to be "raw" - that is, without the standard header: SourceName TraceEventType: Id : I have im...