Archive
Darth Vader is not a bad person
Problem
Prove that Darth Vader is not a bad person.
Solution
- “If you like flowers, you can’t be a bad person.” (idiom)
- Darth Vader likes flowers. (see the images below [click for larger images])
- Therefore, Darth Vader can’t be a bad person.
Using deductive inference, the conclusion follows from the first two premises.
LaTeX formula to image (PNG)
Problem
With LaTeX you produce a nice formula that you would like to crop and convert to an image.
Solution
Let’s see the following simple LaTeX source:
\documentclass{article}
\pagestyle{empty}
\begin{document}
$a^2+b^2=c^2$
\end{document}
Save it as file.tex and execute “latex file.tex“, which will produce a DVI output (file.dvi). The image conversion is done the following way:
dvipng -T tight -x 1200 -z 9 file.dvi -o file.png
Ref.: I saw this conversion technique in justinvh’s Markdown-LaTeX project. If your goal is to include LaTeX formulae in HTML, try his script.
Glider Rider
Glider Rider is one of my favorite tunes on SLAY Radio. Among the several remixes, I prefer the Makke version the most. This song is like a time machine, brings me back to the ’90s when we were listening to Marusha, Dune, Scooter, Prodigy, etc. Today it’s “old school rave”. Damn, time is passing…
Lyrics: (from here)
As we sail across the sky
No longer visible to the eye
We are free from reality
We are the ones you cannot see
Keep on gaining altitude
Higher and higher, me and you
Until the Earth is a bright blue dot
Until each other is all we’ve got
Glider rider in the sky
Take me with you for a while
Life is so hard to live down here
Take me with you way up there
Glider rider in the sky
Take me with you for a while
Life is so hard to live down here
Take me with you way up there
Keep on gaining altitude
Higher and higher, me and you
Until the Earth is a bright blue dot
Until each other is all we’ve got
Glider rider in the sky
Take me with you for a while
Life is so hard to live down here
Take me with you way up there
Glider rider in the sky
Take me with you for a while
Life is so hard to live down here
Take me with you way up there
Alarm script
Problem
I managed to reach a state that I don’t hear my alarm clock any more in the morning. Somehow I’ve become immune against it. So the problem is: how to get up in the morning? Well, the best way would be to go to bed early but it’s not that easy… So I made a simple alarm script that starts playing a list of MP3s at a given time.
Download
You can get the script (alarm.py) from here.
Usage
./alarm.py -p
Play music. First do this to adjust volume! If the volume
is low, you won't hear it in the morning.
./alarm.py -t 7h15
Set alarm time. The format is HhM, where H is the hour
(24-hour system), M is the minute, 'h' is the separator.
./alarm.py
Set alarm with the default time. In my case it's 6h55.
Tip
If you want to jump out of your bed as if you had been shot out of a cannon, use the song Green Hornet. For me this is one of the most annoying songs ever. This song could simply kill me :)
Update (20110601)
Here are some tips How to Get Up Right Away When Your Alarm Goes Off.
Update (20110701)
The script was updated a bit. Now it can collect songs recursively too. When the alarm is activated, only the first 60 seconds of a song is played. Collected songs are played in a random order. If you use the -p option, songs are played from beginning to end (not just the first 60 seconds).
Tip: if you use it with “./alarm.py -p“, it works like a media player. It collects recursively all your MP3s from the specified folder and plays them in a random order.
UTF-8 demystified
A nice and clear post about the ASCII and Unicode character sets.






You must be logged in to post a comment.