Archive for the 'Personal' Category

Saturday procrastination - how to recognize a good programmer

Sunday, January 13th, 2008

I found this essay on Slashdot yesterday: how to recognize a good programmer. Some of the comments were quite insightful, but many followed the following pattern.

"I am a good programmer myself and I match X% of the qualities you mentioned. Therefore, your article is excellent/good/not so good/crap (depending on the value of X) ;-)

I also read two other articles on the topic:

Pondering about a prime lens for my camera - a scientific approach

Tuesday, March 27th, 2007

I recently got caught up in a discussion about getting a prime lens (== a fixed focal length lens) or another zoom lens for my camera. It seems that I will not be getting a lens anytime soon, but I wrote a cool perl script, which I want to share here ;-)

I decided I should analyze what focal lengths I used while taking my photos so that I can take a more conscious decision. After some trials and errors, what I came up with was:

find . -exec exiftool {} \; | perl -ne  '/^Focal Length.*equivalent:(.*)\)/ && print "$1\n";' | sort | uniq -c

which runs exiftool on all my photos, extracts the 35mm equivalent length (I took my photos with at least 2 different cameras) sorts them and generates a pseudo-histogram.

I thought I was done, but I then realized that something must have been wrong with the data as some of the focal length ranges were well beyond what any of my camera has. I investigated a little and found out that some of the photos from my G3 have an incorrectly calculated 35mm equivalent. This means that such a simple script will not do.

Here is my second try:

find . -exec exiftool {} \; | perl -ne '
if (/^ExifTool/) { $camera = ""; $lens=0; };
if (/^Camera Model Name.*: (.*)/) { $camera = $1; };
if (/^Focal Length.*: (.*)mm/) { $lens = $1; print "\"$camera\" $lens\n"; }; ' > photos-lengths.ssv

Now I have a text file with something like:

"Canon PowerShot G3" 7.2
"Canon EOS 350D DIGITAL" 38.0

This file can be conveniently read into R so that I can plot a real histogram:

lengths <- read.table("photos-lengths.ssv")
lengths_camera <- split(lengths, lengths$V1)
num_cameras <- length(lengths_camera)
old_par <- par(mfrow = c(floor(sqrt(num_cameras)), ceiling(num_cameras / floor(sqrt(num_cameras)))))
# one chart for each camera.
for (c in names(lengths_camera)) {
   l <- lengths_camera[[c]]$V2
   # filter likely corrupted data.
   l_filt <- l [ (5 < l) & ( l < 100) ]
   hist(l_filt, xlab="focal length [mm]", ylab="#photos", main=c, breaks = 30);
}
par(old_par);

This little script produces a nice matrix charts with histograms of focal lengths for all the camera. So the conclusions is that I could get a 30mm prime lens, but also a 10-20mm lens would not be a bad idea ;-)

Recovering deleted photos - my experiences

Thursday, January 4th, 2007
  • (playing with the camera) Cool. You can change the format of the CF card… Whops….
  • My CF card got corrupted.
  • The photos I thought had been already uploaded to the gallery were deleted from both the CF card and the harddisk. Moreover, I already took 50 photos on the CF card after reformatting it.

Time and time again, I realize how precious my photos are, only after they are gone. The last time they were my PhD defense photos… Auch. Fortunately, they are gone, but not forever ;-)

You will find several tools for photo recovery on Google, but most of them either commercial or give you a only a “free preview”. Thinking about it, it’s a very good business model: people are very willing to swipe their card if they can see that they get their photos back. Should have written one as well ;-) Fortunately, there are also free ones, two of them I tried by myself.

PC Inspector Smart Recovery is an excellent and easy-to-use Windows application for photo recovery. It is extremely easy to use and does an amazing job. It is also completely free, but I think is fair to reward the author with a PayPal donation.

PhotoRec is a cross-platform program for photo recovery. In fact, it runs on Dos/Windows/Linux/BSD/Solaris/MacOSX, which is really impressive. It also supports a whole range of filesystems, including FAT/NTFS/Ext2/3/HFS+. It has a simple (n)curses based interface, which is a bit of a disappointment in the age of cool animated GUIs, but it’s also relatively easy to use. Also, it has an impressive range of configuration options. And it works on Linux and my Mac. I no longer need Windows! Simialrly, the program is really free (including the sourcre) and you can rewerd the author with a donation.

Both tools worked for me smoothly and (unlike some other commercial ones I tried which ran out of memory) managed to recover almost one thousand photos from my 4GB CF card, including the wanted defense photos ;-) I don’t know which of the tools is better and I recommend both (although I would lean slightly towards the PhotoRec as I don’t have Windows anymore). Also, if you don’t get what you’re looking for, you can try both of them (as a rule all image/disk recovery tools are read-only so you can try all of them many times with no risk).

Two friends: GeoWebStats and GeoBroStats - visualizing Apache and Bro logs with Google Maps

Tuesday, January 2nd, 2007

One of my pet (a.k.a. procrastination) projects has been to visualize my server logs using Google Maps. In fact, this has been my ‘procrastination hub’ giving me excuses to work on a variety of pet projects, including:

  • playing with Bro and packaging Bro for Debian
  • playing with Apache logs and importing them to the relational database
  • playing with Bro logs and importing them to the relational database
  • learning Python and Javascript
  • playing with Google Maps
  • writing a web application to visualize the collected logs on Google maps
  • creating a webpage documenting all the above.

As with procrastination projects, they are by definition never complete. I do have something working now, and you can see it in action (works best in a decent browser, but should show something in IE as well).

GeoWebStats

Visualizing Apache logs on a webpage. Here are three links (it might take a while to load them for the first time, so please be patient):

The script is quite customizable (for example you can specify the regular expressions you want to filter on, group stuff) but for security resons those demo links are locked.

GeoBroStats

Simiarly to GeoWebStats, GeoBroStats visualizes raw TCP/UDP conections based on Bro conection summaries (this might also take a while to load):

The script is also quite customizable, but for security resons those demo links are locked.

Let me know what you think about it. I know that the user interface is very crude and needs some work. I have also almost finished GeoWebStat’s website, but knowing me, it will take a while ;-)

Dr. Tadek

Friday, December 8th, 2006

Woohoo!

After 3.5 years of work, 0.5 year of writing, 5 months of waiting, 2 months of nerves, 2 weeks of getting really nervous and 1.5 hours of defense it finally came through!

That means that after I publish my thesis, I can be called Dr. Tadek ;-)

I feel a big relief to have successfully closed this chapter of my life. To celebrate this we opened a 1975 Colheita Port, which we have kept for over a year for this occasion (I’ve been saying that I will open it only if and when I graduate).

Now it’s time to do all the stuff I have be putting of until I finish and of course enjoying the first really free weekend!

Tadek’s new mobile: 076 394 2998

Wednesday, October 25th, 2006

After more than 6 years with my current S35 (and something like 3 years with a crappy Orange prepaid card) I purchased a proper mobile (K800i) with a contract. Personally, I’ve been reasonably happy with my old mobile, in spite of Annie’s hostility towards this seemingly innocent device (this may have something to do with the high-pitched sound it produces when the battery dies in the middle of the night) and friends’ teasing remarks (my favourite is: “Noooooo, I can’t believe your mobile is SIX years old!”… I wonder what they would say knowing how old my car is…), but I will definitely benefit from things like a built-in 3MPix camera, Bluetooth or Edge for data transfer.

More importantly, my new mobile number has changed and is now 076 394 2998 (076 FYI AXYU). My current mobile 078 857 3165 is no longer valid.

As a final remark, I got a sunrise relax plan, which means that I am charged by hours (something like 0.49CHF/hour or 0.05CHF for <5s) when making calls to the sunrise network or fixnet. Therefore, if I’m calling your sunrise or fixnet, I might be either extremely talkative or very succint. If you have another mobile, the latter is far more likely ;-)

Sailing the Greek islands - planning vacation ahead

Sunday, September 10th, 2006

Planning ahead the next vacation (haven’t had much vacation this year, so it’s nice to dream ;-)), sailing in the Greek islands, here are some links I found:

I found a bunch of charter websites (just googling for “greece bareboat charter gets you a lot of results) but still need some time to sort them through. I also need to figure out which the boat I want. So far it looks that a 6-8 people boat is an expense on the order of 1500-2000 EUR/week. Also, you can get an early-booking discount until sometime in February.

Any experiences/suggestions/recommendations about chartering a boat in Greece?

Goodbye IBM, welcome Google

Wednesday, August 30th, 2006

After 3.5 years of work on my PhD and two months after submitting my thesis I left IBM Zurich Research Laboratory I left the Zurich Lab. Many thanks for the superb farewell lunch and all warm words!

Now, I am enojoying my week long vacation at home (or more precisely, trying to enojoy vacation while touching up on my MLJ submission. Still not done yet… grrr) and getting mentally ready for a new start (and my PhD defense in some time).

On Monday, I am starting a real job at Google in Zurich. I’m a bit anxious, but very much looking forward to it.

Wow. My blog is getting really personal this time… that’s second to last time, promise ;-)

Pusterla Elektronik

Tuesday, August 22nd, 2006

Ever wondered where to get some electronic components in Zurich and was unhappy with what quadruple “M” Migros offers in the hobby section? Or looking for a non-typical power supply for your favorite toy that just died? Or need some fancy cables? Or maybe just want to look at cool stuff? ;-)

I found a really nice electronic store in Zurich - Pusterla Elektronik to help you.

Thesis Submitted!

Wednesday, July 5th, 2006

After almost 3.5 years of work I submitted my PhD thesis today. I feel relieved, although I still haven’t fully realized this yet. It will come… On the funny side, now after having (hopefully) done most of the work, I am currently not even at the first out of 11-point Ablaufplan describing the quest of a poor PhD student. However, now that the machinery has been started, actionable items for me start at point 8 (”pass the defense”), which will take place some time in October ;-)

Finishing the blog entry, here’s a funny thing that happened to me on the train. I was carrying the a cardboard box, filled up with 5 copies of a nicely printed and bound dissertation. During the passport control (rarely happens, but today was my lucky day) a very bored customs officer got interested in what was in the box. The conversation followed like this.

Customs Officer: So, what is in this box?
Me: Papers.
C: How much are they worth?
M: Well… nothing? (I did not want to go into details of three-and-a-half years of pain or how much I was paid during that time)
C: Can I see?
M: Sure.
C: (opens the box takes one and starts browsing) Are they all the same?
M: Yes. Would you like to read? ;-)
C: (at this time I got a kind of look which tells you that you shouldn’t be joking with a customs official). So… were they printed in Switzerland?
M: Yes.
C: And you say they are worth “nothing”?
M: Exactly.
C: Why were they printed in Switzerland and are being brought here?
M: Because I work there?
C: Well…OK. Do you carry anything else that is also worth “nothing”?
M: No, I don’t think so.
(custom officer leaves)