2007年12月9日日曜日

20 words a day

I need to learn more English words and I've been so lazy. So I'll try to learn 20 words a day. I picked a Barron's How to Prepare for the GRE TEST from my bookshelf. I know some of the words in the 3500 words list, but mostly I either don't know or vaguely recognize the items in it(I tried to learn them all before, but failed :P). If I don't get too lazy, I should be able to cover all the items in the list by the end of June 2008, so let's see...

20 words for today:
abase, abash, abate, abbreviate, abdicate
aberrant, aberration, abet, abeyance, abhor
abject, abjure, ablution, abnegation, abolish
abominable, abominate, aboriginal, abortive, abrasive
20/3500 words

FlashcardExchange seems to be a helpful site to me:
http://www.flashcardexchange.com/

2007年11月28日水曜日

writing in python

I'm trying to prototype a file archiver with python. Initially I started with bash and made a script that works for my limited type of tasks; taking a list of files, source directory, and destination directory and then copying to a temporary directory.
I simply call tar command to finish archiving.

Then I realized I wanted to add several features like being able to read a recipe for a particular archive from a file, to use substitutions and matching of key words in recipes, to handle remote files, ... Now it's getting hard for me to make the script simple, so I decided to rewrite it in python to make it easier for me and practiceusing python.

So far I needed to find basename, dirname, file testing, getting options, key inputs, ...

Key inputs are easy:
val = raw_input("type a value for val")

http://docs.python.org/lib/module-shutil.html

For getting options in commands, there are two choices afaik, and I gave it a try to optparse:
http://docs.python.org/lib/module-optparse.html

I liked the notations, so I am going to stick with it.

There are other features of python I need to learn, but that's all for today...

2007年11月19日月曜日

Code reviews to make your life easier...

When I was looking for some advise on code reviews, I encountered this article:
Effective Code Reviews Without the Pain

It was a fresh idea to me that reviewing process could be positive rather than negative. I think finding bugs is the primary reason to review codes, which makes me feel it's like a trial in a court. There should be bright sides indeed, as described in the article.

Nevertheless, finding bugs and getting rid of defects are important, and I needed to know how to improve the process. Another article on:
http://opensource.mit.edu/

seems like a good start...

2007年11月17日土曜日

I needed to write a script to avoid repeating similar commands yesterday.

http://www.ibm.com/developerworks/library/l-bash.html
http://tldp.org/LDP/abs/html/
http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html