Portable text based console manipulator

Alright, i finally found a portable and easy to use library: rlutil.h Usage: #include <iostream> #include “rlutil.h” int main() { for (int i = 0; i < 16; i++) { rlutil::setColor(i); std::cout << i << ” “; } std::cout << std::endl; return 0; } but, i will be glad for other suggestions.

Rails 3 – Speed up Console Loading Time

I finally found my startup bottlenecks using Benchmark. In particular, navigate to the bundler gem and in lib/bundler/runtime.rb, find the line that does Kernel.require and wrap it like this: puts Benchmark.measure(“require #{file}”) { Kernel.require file }.format(“%n: %t %r”) You may have to add require ‘benchmark’ somewhere in your app, like in config/boot.rb. That will show … Read more

Is “std::cout” usable in Android-ndk

You can create a class derived from std::streambuf which uses the Android specific functions to send the produced sequence of characters. I don’t know where the default implementation of std::cout sends characters on Android, however. Basically, this would look something like this: class androidbuf : public std::streambuf { public: enum { bufsize = 128 }; … Read more

Node.js: How to attach to a running process and to debug the server with a console?

From http://nodejs.org/api/debugger.html: Advanced Usage The V8 debugger can be enabled and accessed either by starting Node with the –debug command-line flag or by signaling an existing Node process with SIGUSR1. Find the PID of your node process and then sending SIGUSR1 should do the trick: kill -s SIGUSR1 nodejs-pid Then run node-inspector and browse to … Read more