colored grep output
If you add export GREP_OPTIONS='--color=auto' to ~/.bashrc or setenv GREP_OPTIONS '--color=auto' to ~/.cshrc your life will be much easier
. Variable name speaks for itself.
If you add export GREP_OPTIONS='--color=auto' to ~/.bashrc or setenv GREP_OPTIONS '--color=auto' to ~/.cshrc your life will be much easier
. Variable name speaks for itself.
Jabber is great. I like the technology, i like the clients, and i love the ability to chat with users of every possible IM network from one program (that’s what transports for).
Most people i know use ICQ or MSN, so i really need those transports. Here lies the problem. As a jabber user you can register on any public server, and register on a transport on any (possibly other) public server. Jabber usually works just great. But it’s not the case with transports. Sometimes transports are down. Sometimes they are up but not working - and as a user i only know it when I’m asked by someone in email: “Why are you offline?”.
I really don’t know how to solve this problem. Suggestions anyone? Reliable jabber servers with low downtime?
Technorati Tags: jabber, jabber+transport, transport
Just run: touch ~/.xpdfrc ; echo 'initialZoom width' >> ~/.xpdfrc and your life will probably be easier
. Mine certainly is.
Technorati Tags: xpdf+config, xpdf
Coming from a C++ programmer:
const checksobj.xxx = 12 and the real member variable name is Xxx it takes ages to find the problem Technorati Tags: python, c++, programming
I’m writing a genetic algorithm, which is pretty time consuming. I was thinking - why not use memoization and save some time. It appears pretty easy to do and there’re several examples for copy-paste in the internet, but it appeared that’s it not as simple as i thought it would be.
I’m trying to memoize (i’ll use cache from now) objects of a certain class. The class has some double precision data members, which i want to allow to be a little different, for example abs(self.a - rhs.a) < 0.1. It’s easy, just define __eq__ method. Now, let’s put objects into a dictionary (for caching)… oops - there’s an exception thrown - they are unhashable now.
Fast search in google revealed i need to define __hash__ method which must return equal results for equal objects…. Now it becomes non trivial at all.
In c++ it’s easy since std::map (stl equivalent of python’s dictonary) is based on operator< (or on comparison functor with the same functionality), and in python dictionary is based on hash value, which is faster but not easy calculable in my problem.
Is there something like std::map ready? Currently the solution was to round floating points members and cache them. Any better solutions?
Technorati Tags:
python, memoization, optimization, programming
Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers