Friday, January 23, 2009

amazing with python (string)

developers = set(['tuan', 'chau', 'hung', 'hoang', 'hoan'])
managers = set(['hoang', 'ngoc'])
* find manager who coding
managers & developers
* find manager who not coding
managers - developers
* find all
managers | developers
happy coding

Friday, January 16, 2009

backup and restore mysql in ubuntu

although i use ubuntu with shell, you can use whatever linux's distribution, command should like the same

backup mysqlmysqldump -u [username] -p [password] [database'name] > [backup'sname]
exp: mysqldump -u root -p 123 mysite > mysite.bak.sql


restore from file backup
mysql
-u [username] -p [password] [database'name] < [backup'sname]

note that the only different is mysql <> mysqldump and >
<> <exp: mysql -u root -p 123 mysite < mysite.bak.sql
click here for more details

happy coding!

Saturday, January 10, 2009

code it better guys!

here is the slide which i made for reviewing code of php's team