Thursday, April 26, 2007

One thing at a time...

I am not saying that things should be accomplished in steps. I am talking about myself.

My mindset is one thing at a time. Once a subject takes over my mind, that thing has it all. When I learned and worked computer programmings before my son was born, I used to hadve topics of programmings in all of my mind. I thought about coding when driving, walking, and sitting on my desk. This was very productive way so that I was always ready to jump in.

Not any more. My son has my mind all. I need a warm-up period for my brain to get up to speed when coding. Evaluation of 'Okay, what is the situation that I am in? ' takes longer than I used to evaluate. Worse thing is that I forget all of my work as soon as I see the pictures of my son on my desk.
Back in my young life, I was indulged in playing guitar. After my high school, I practiced my guitar like professional. At least 10 hours a day, and 12 hours straight playing was easy. I remember that sometimes I couldn't speak. I lost my verbal ability temporarily because of music. One thing at a time went very extreme.

My wife mentioned that she felt that she lost a bit of her short term memorization after having our first son, Jake. Biologically, that was a proper side effect of pregnancy. But, me??? I was not the person carrying a baby and suffering for 10 months. But, why am I losing my memory? And ability to concentration?

To tell the truth and conclusion, this is good. I have never been happier than these days. Especially, we will have our second son in 6 weeks. I always thought I have been a lucky man with my basic needs were always met. But, these days are the happiest moment.
Losing my productivity is my side effect, but that's okay as long as I meet the expectation for my performance review. Eventually, I will get my productivity back. Enjoying with my family is more fun at this moment, and that's what my mind said, 'One at a time.'

Wednesday, April 25, 2007

Dynamic prefix of PYTHON

autoconf suggests --prefix switch. Probably, anyone who has compiled a package from source(such as apach or mysql) may be familiar to this switch. If we look into a little further, any binary file needs to be copied into memory (we call this process image), all of file locations must be known beforehand. Therefore, compiling C/C++ sources requires where to find other objects, especially if the objects are *.so.
Then, once it copied into process memory, the process doesn't care where this object file came from. This is a different problem. Probably, anyone who has compiled a package from source for multiple versions suffered for libraries of different versions. One of the primary reason is that compiled object remembers wrong places for library, but different object file exists there as the same name. 'make clean' or 'make distclean' should be used in proper time.

Python, on the other hand, is an interpreted language. Compilation is not required. (*.pyc matters, but let's simplify at this moment. ) Python searches library at runtime, and it loads the library at runtime. So far, no difference. But, the library location does not need to be known beforehand. The most beautiful thing is that the location can be determined by looking at stack frame! This can eliminate the needs of compilation '--prefix' switch.
Consider this segment of code.

http://lucky.umd.edu/code/dynamic-prefix.py

This segment of code is very simple (6 lines of code including spaces.) It just prints what is the absolute path of the executable. Regardless how it is called, it should return the same path. If we have [Arbitrary App Home] and, under this [Arbitrary App Home] are subdirectories of bin, etc, and lib. And bin subdir has executable runme.py. Regardless of how runme.py was called, it knows where it is and set right value of the [Arbitrary App Home]. Therefore, we don't need --prefix at all.

This is VERY Nice.

Monday, April 23, 2007

begin to flickring..

I started to use flickr.
I thought about using picasa first, because I like what google is doing. While I was playing with Gdata client, picasa client wasn't in the package. There were Java and .Net client, but no python. Since there were 3 posts on picasa python client/library, I could wait until they release the code. Or I checked flickr and found flickrapi written by beej. :)
I just uploaded 80 pictures from infamous cyworld. Since cyworld didn't expose an interface downloading pictures, I had to work around. It was annoying..

Tuesday, April 17, 2007

rundl132.exe

I was reading a book when my wife was complaining about her laptop. During our conversation, she asked to me, "Do you know something about rundll-132 ?" Okay.. I said, I have heard rundll32.exe (I don't know much about it. Is it shared object manager? Linux doesn't even need this. How clean it is to give an identity of being static or shared in compile time! )
Where did the number 132 come from? First, it is not a power of 2. So, when my wife called me, I saw that it is 'rundl132.exe' which tries to have a similar look of 'rundll32.exe' Quick googled and found that it is malicious code. I actually applauded for this nice name. This guy who wrote this malicious piece has a sense of humor :)
Well, anyway, it was a nice piece of joke.

Monday, April 2, 2007