Prince of Persia – Source Code Notes

Here’s some retro geeky awesomeness… Prince of Persia source code notes!

Download (404kb)

USB Webserver 8.0 (unofficial)

UPDATE (15 July 2010): An “official” version of USB Webserver 8 has been released, please use this instead of my “unofficial” version. You can download it from http://www.usbwebserver.net/

This is an unofficial updated version of USB Webserver. The original USB Webserver was created by http://www.usbwebserver.nl – but their site is currently down, and they haven’t released an update for a while.

This version contains:

Apache: 2.2.11
PHP: 5.2.10-dev (with GD and cURL)
MySQL: 5.1.30-community (with InnoDB)

It defaults to “English” (the original was “Dutch”), and you may need to change the ports if you have been using USB Webserver previously.

Download: “USB Webserver 8.0 (unofficial).zip” (17.6mb)

(and yes, I know the main USB Webserver screen still says “USB Webserver 7.0″ – ignore that :P)

PHP-SciTE

As a PHP developer I’ve tried many different IDEs but have always ended going back to SciTE. I started using a version with modifications by Bruce Dodson, but got frustrated with it not listing PHP files in the default “File Open” window, and not recognizing PHP5 files as PHP files, so I got to tinkering.

I changed the font and colours (for PHP files anyway), removed the other languages, enabled the auto-complete dropdown, changed the menus, included the PHP binary to check files for syntax errors, and included phpStylist to beautify source code. I also made a new icon, and added the latest “php.api”, and made F1 (help) open the PHP manual (included).

MySQL auto-timestamping triggers

I used to be dead against things like triggers… mainly because I hated coding them (and SQL) back when I learnt Oracle PL/SQL at college, and I’ve always been a “bare-minimum, must-be-backward-compatible, code-it-yourself” programmer… but now I’ve decided it’s just much easier to use them, and it’s not my fault if people refuse to upgrade to MySQL 5.

So here’s my niffty trigger code for the day, which automatically updates the “last_updated” (timestamp) field in a table, when a record is inserted or updated:

CREATE TRIGGER `database_name`.`last_updated_insert_trigger`
BEFORE INSERT ON `database_name`.`table_name` FOR EACH ROW SET new.last_updated := UNIX_TIMESTAMP();

CREATE TRIGGER `database_name`.`last_updated_update_trigger`
BEFORE UPDATE ON `database_name`.`table_name` FOR EACH ROW SET new.last_updated := UNIX_TIMESTAMP();

There’s probably a better way to do this (and I think you can combine both triggers, using “OR BEFORE UPDATE”?) but this is the first I’ve worked with triggers in MySQL and I’m too lazy to fiddle. Hope it helps. As I’m sure you can guess, `database_name` is your database name, `last_updated_update_trigger` is the name of your trigger, `table_name` is your table name, and `last_updated` is your field name that will contain the timestamp.

Turn your S60 phone into an SMS interface for your web application

A company called Fromdistance has released a program for Series 60 Symbian cell phones, which allow you to use your phone as a Web Application SMS Gateway.

Basically you download the Series 60 (Symbian) client and install it on your phone. It will check their server for any “queued” messages, and if it finds any it will send them out – so the message will come from your number, at your expense (or for free, if you have free SMSes).

You can “queue” message by sending an HTTP POST to their server, which means you can implement it into a website, intranet, Facebook App, etc.

It can also check your received SMSes for a keyword or phrase, to flag them as “inbound” messages, which are then sent to their server and forwarded on to your web application.

That allows your web app to communicate with people via SMS, and allows them to communicate via SMS with your web app.

See FromSMS

Hope someone found this interesting, helpful, or financially beneficial (in which case feel free to share with me).

FaceWound hacks

There’s a game called “FaceWound“, a (self-titled) “Zombie Murder Simulator“, which the author of Garry’s Mod has been working on for a few years. He recently released the latest version for free, though he says “it’s totally unfinished, unpolished and should be treated with the same attitude you’d treat a leaked alpha with” – despite this it’s suprisingly bug-free, and fully playable (not to mention lots of fun).

So far the only thing people seem to be moaning about is that you don’t get extra lives or health during the game, making it rather difficult to finish. There have also been requests for “Infinite Lives” and “Infinite Ammo” cheats for it – so I decided to make some hacks ;)

Learning LINGO

My brother has to learn “LINGO” for varsity… basically it’s a programming language “to make building and solving linear, nonlinear and integer optimization models”. Yeh I’m not really sure what any of that means either, but I’m the computer programmer in the family, and my brother’s the genius/mathematician so I said I’d try and figure it out and teach him…

LINGO

Ruby on Rails

I’m trying to learn Ruby… on Rails.

sereNity is helping me :)

Ruby

Copyright © 2010 Hypn.za.net

CSS Template By RamblingSoul | WordPress Theme by Theme Lab and Best Hosting.