Educate Yourself

Dec 29
2009

http://educate-yourself.org

socket.error: (99, ‘Cannot assign requested address’)

Dec 27
2009

Enable the localhost interface:
/sbin/ifconfig lo up

Git Cheat Sheet (Debian based)

Dec 17
2009

apt-get remove --purge gitk gitosis git-gui git-core
apt-get install mercurial

`mkdir` and `cd` at once

Dec 16
2009

I am sick of mkdir dir_name; cd dir_name;
The solution (put this function in “.bashrc” or whatever shell config file you use):

_mkcd () {
       mkdir -p $1
       cd $1
}
# usage: _mkcd /tmp/dir_1/dir_2
# pwd will show: /tmp/dir_1/dir_2

Projects’ Hosting

Dec 16
2009

Why Assembla free plan:

  • Subversion Hosting with Integrated Tickets
  • Trac and Subversion Hosting
  • Team Collaboration
  • Subversion Repository
  • Git with Integrated Tickets

P.S. If you are like me - spitting on GIT on a daily basis - Mercurial is included in the other plans.

Christmas names

Dec 15
2009
>>>from nltk.corpus import wordnet as wn
 
>>>wn.synsets('Christmas')[0].lemma_names
 
['Christmas', 'Christmastide', 'Christmastime', 'Yule', 'Yuletide', 'Noel']

unarchive files

Dec 14
2009

a sample BASH function (usually resides in $HOMES/.bashrc)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
extract () {
        if [ -f $1 ] ; then
                case $1 in
                        *.tar.bz2) tar xjf $1;;
                        *.tar.gz) tar xzf $1;;
                        *.bz2) bunzip2 $1;;
                        *.rar) rar x $1;;
                        *.gz) gunzip $1;;
                        *.tar) tar xf $1;;
                        *.tbz2) tar xjf $1;;
                        *.tgz) tar xzf $1;;
                        *.zip) unzip $1;;
                        *.Z) uncompress $1;;
                        *) echo "'$1' cannot be extracted via extract()";;
                esac
        else
                echo "'$1' is not a valid file"
        fi
}

the actual meaning of “Merry Christmas”

Dec 14
2009
import re
 
greeting = "Merry Christmas"
 
greeting_list = map(chr, [ord(i) - len(greeting) - 1 for i in greeting])
greeting_list = filter(lambda x: re.match('[a-z]|[A-Z]', x), greeting_list)
 
# greeting_list is set(['c', 'b', 'd', 'i', 'Q', 'U', 'Y', 'X'])
# the 1st 3 elements are not clear to me: c,b,d
# 'i' means 'I', 'Q' means 'question', 'U' means 'you', 'Y' means 'why', 'X' means 'Christmas'
# which makes the compound: 'I question you - why Christmas?'

Right?

Calendar

December 2009
M T W T F S S
« Nov   Jan »
 123456
78910111213
14151617181920
21222324252627
28293031  

Tags