Ultra Tiny Address Book

Oct 29
2008
#!/usr/bin/perl
 
$s = shift;
$"  = "\n";
$/  = $\;
$_  = <data>;
@_ = /(.*?$s.*)/gi;
 
print "@_\n";
 
__DATA__
 
me "some address" my_phone_here
etc...
etc...</data>

Getting Negative Number

Oct 28
2008
positive = 10.01
 
# the negative equivalent: -10.01
 
negative = positive - (positive * 2)
negative = positive * -1 # or
negative = positive / -1
negative = -positive # or 
negative = ---positive

“Beautiful is better than ugly.”

Oct 21
2008

python -c ‘import this’ | head -n3 | tail -n1

Sequence Types and Slice

Oct 21
2008

Ruby slice:

a = [1, 2, 3, 4, 5, 6]
a[0..-1] # [1, 2, 3, 4, 5, 6]
a[(0..-1)] # tha same

Python slice:

a = [1, 2, 3, 4, 5, 6]
a[:-1] # [1, 2, 3, 4, 5]
a[:] # [1, 2, 3, 4, 5, 6]
a[0:len(a):2] # [2, 4, 6]  Nice, isn't it?

Custom Google Search

Oct 08
2008

IT manuals (mostly programming)

Yes it takes a lot of time (in my case almost 5 hours) to get into the goog search manuals and goog appengine. But that’s ok goog is doing fine.

Calendar

October 2008
M T W T F S S
« Sep   Nov »
 12345
6789101112
13141516171819
20212223242526
2728293031  

Tags