For my final AP Computer Science project in June 2008, I worked with Brandon Liu and Yuzhi Zheng to develop FINALE, a falling block game based on the PSP game Lumines. The object of the game is to match colored blocks into squares, which are cleared away when the “time bar” passes them. Clearing more squares in each pass of the time bar gives an exponentially larger number of points.
Here are some screenshots. (I’m happy to say our graphical presentation was spectacular, with all graphics, backgrounds, and game pieces custom designed in Inkscape.)

- Main Menu

- Instructions

- Matching squares - zooming animation

- Multiple levels and particle-based explosions

- The Final Level - How long can you survive?

- High Scores
Continue reading ‘FINALE: a falling block game’
I recently switched to running XP as a limited user after getting a virus. However, I soon realized that I couldn’t use my Sony VAIO S260’s power management features anymore. When I went into the VAIO Power Management tab, everything was grayed out. Logging in as Administrator, I could create profiles, but then I wouldn’t be able to see them in a regular user. Here’s the solution:
- Allow the limited user account (LUA) to change power options. This will let you change the Windows built-in options, but not the VAIO-specific options.
- Temporarily make your LUA administrator either manually (requires logout/login) or using MakeMeAdmin.
- Open up the Power Options control panel (
powercfg.cpl).
- Set up your power profiles as you want them, using the VAIO Power Management tab. These will be visible since they’re created in your own user account, rather than Administrator’s.
- Now you’ll be able to switch between profiles without using MakeMeAdmin–just click the battery icon in the notification area. Changing the VAIO-specific options of profiles still requires MakeMeAdmin though.
Finding out how to get my charts into LaTeX took way longer than it should have. First, I tried pasting it into a Writer document and then using Save As Picture, but its EPS output resulted in 0-byte files, SVG output was broken, and raster images came out at screen resolution. (I couldn’t find a way to export higher-resolution charts in Excel either!) So here’s how I finally did it:
- Copy and paste the chart from OpenOffice.org Calc into OpenOffice.org Draw.
- Export the drawing as PDF.
- Use
pdfcrop <image.pdf> (provided in the texlive-extra-utils package on Ubuntu 8.10) to crop out the whitespace
- Now just use the image with
includegraphics{image-crop.pdf}.
The results are crisp and clean. Amazing!
For future reference, the cryptic error from mod_fcgid:
[Thu Feb 12 22:10:27 2009] [warn] (104)Connection reset by peer:
mod_fcgid: read data from fastcgi server error.
[Thu Feb 12 22:10:27 2009] [error] [client X.X.X.X] Premature end of
script headers: dispatch.fcgi
means that dispatch.fcgi failed to start. Possible reasons are:
- Missing Perl modules. Unfortunately, I don’t know where the stderr output ends up. Try running the script directly; e.g.
perl dispatch.fcgi.
- Missing Perl modules that you installed locally (e.g. local::lib) but Apache doesn’t have it in
$PERL5LIB.
Remember that the folder must not be group-writable, and that any executable must be run from the directory root that suEXEC was compiled for! These will fail with a more useful error though, complaining of “suexec policy violation: see suexec log for more details” (the log is at /var/log/httpd/suexec.log for CentOS systems).
The Catalyst Framework is an elegant Model-View-Controller based web framework for Perl, with similarities to Ruby on Rails. It is a popular choice for Web 2.0 applications based on Perl, speeding up and simplifying development.
Catalyst is very nice to use, but has a reputation of being hard to use, particularly on Windows. Windows has historically been regarded as the “outcast” of Perl development environments—the lack of proper build tools had made installing most modules (including Catalyst) difficult, to say the least. ActiveState’s binary PPM packages are hard to find and often outdated. The effect has been that the complex dependencies of Catalyst were nearly impossible for the average mortal to manage on Windows.
I recently discovered Strawberry Perl, which has made building modules on Windows easier than ever. It includes a bundled MinGW toolchain for compiling and pure-Perl equivalents for other necessary tools. Now, it is no longer necessary to install Visual Studio or Dev-C++ just to build Perl modules. Using the CPAN installer from the command line Just Works.
If you have tried to install Catalyst on Windows before, you’ll know that hunting for PPMs and building the missing modules takes hours and leaves you with an installation that isn’t up-to-date. With Strawberry Perl, I was able to install the newest Catalyst fresh from CPAN in about 10 minutes.
Read on for easy instructions in 5 steps.