Compiling libpng for Mac OS X

I thought Mac OS X comes with libpng pre-installed. It’s pretty clear that I was wrong after I failed to compile a game that uses libpng. The good thing about OS X is that, you can just use fink to easily install Unix/Linux binaries. However, the weird thing is, the game configuration still complains that libpng could not be found. So I decided to install libpng from the source code. For those out there who may face the same problem, you could try as what I describe below. ...

April 20, 2006 · 1 min · 170 words · kenno

LBreakOut

I’m pretty bored today, and I wanna take a break from learning Python. So, I decided to compile an open source game, LBreakOut (L is for Linux), for my PowerBook. In order to compile this game, you need obviously the source code of the game where you can get it from here. Additionally, you need the SDL library, where you can get it from http://www.libsdl.org. Here is the screen-shot of game running on my PowerBook: ...

April 19, 2006 · 1 min · 165 words · kenno

How to Decompress .tar.bz2 File

Normally, I would bunzip the file first, then untar it next. But I found something after googling for a shortcut: it can all be done with just one tar command. $ tar -xjvf example.tar.bz2 Notice that, we use j flag to decompress bzip2 file and z flag for gzip file. 🙂

April 18, 2006 · 1 min · 51 words · kenno

Temperature Conversion v0.2

I just learned how to implement basic command-line argument with Python. Hence, I would like to incoporate this feature in the previous Temperature Conversion program. # convertc2f.py # Version: 0.2 # A program to convert Celsius temps to Fahrenheit # Date: 4/13/06 # by: S. San (Kenno)` import sys if (len(sys.argv) == 2): celsius = int(sys.argv[1]) else: celsius = int(input("What is the Celsius temperature? ")) fahrenheit = 9.0 / 5.0 * celsius + 32 print("The temparature is", fahrenheit, "degrees Fahrenheit.") Example with the command line argument: ...

April 13, 2006 · 1 min · 114 words · kenno

Using Java 5 on Mac OS X Tiger

Mac OS X Tiger still uses the J2SE 1.4 as default Java virtual machine and compiler. If you need to upgrade to JDK 5, you have to download it from Apple download site. After you install it, you need to change a symlink to point to the JDK 5: $ cd /System/Library/Frameworks/JavaVM.framework/Versions/<br /> $ sudo mv Current Current.old<br /> $ ln -s 1.5 Current<br /> $ mv CurrentJDK CurrentJDK.old<br /> $ ln -s 1.5 CurrentJDK ...

April 7, 2006 · 1 min · 110 words · kenno