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.

September 22nd, 2008 by Hypn | No Comments »

HOW TO: Switch back to the “old” Facebook

1. Go to: http://www.new.facebook.com/apps/application.php?id=2345053339

2. Click “Go to Application

3. Click “Allow

3. Go to: http://apps.new.facebook.com/?fbnew_opt_out=1

September 18th, 2008 by Hypn | 1 Comment »

Spore sucks, have h4x

I bought Spore. I played Spore. It sucked. In the words of an Amazon.com reviewer: “Dumbed down experience”.

The levels/stages leading up to “Space Stage” were WAY too short, though very helpful and informative, while “Space Stage” was just way too frustrating and tedious. And how come I always have to be the woman, laying the egg?

For that I say… h4x!!! And not even good h4x, but the really lame kind that only take a few minutes to write:

Download: Hypn’s sPOOR hack v1.0 (4kb)

Get it? sPOOR.. as in POOR? Did I mention I want my money back? :(

September 8th, 2008 by Hypn | No Comments »

Hypn’s QFG2VGA Beard Hack

I wrote a hack that lets you keep selling the Whirling Dervish’s beard to Keapon Laffin in the remake of Quest for Glory 2, like you could do in the original version of the game (it was a bug). It’s probably really buggy, and might crash your game and/or corrupt your save game(s) so use at your own risk - and what ever you do, please do NOT report bugs while using this hack on the AGDInteractive forums… this hack is not their doing/fault/problem/whatever.

That said, feel free to download: Hypn’s QFG2VGA Beard Hack v1.0.zip (3kb)

UPDATE: this hack only works on version 1.0 of QFG2VGA, and not on the latest version they’ve released.

September 5th, 2008 by Hypn | No Comments »

Quest for Glory (fan) art

There’s a thread on the Quest for Glory 2 remake’s forum dedicated to fan art - which I saw today for the first time. One of the forum members, by the name of “Lady Pyro”, has some incredible sketches that are definitely worth checking out.

My two favourite are below, along with coloured in versions by Hollister. Check out the thread here: QFG Artwork

Read more…

September 4th, 2008 by Hypn | No Comments »

Google Chrome

So Google have released their own browser, called “Chrome” - am I the only one who thinks it’s logo looks like a Pokeball (from Pokemon)?

You can download it from here: http://www.google.com/chrome

September 3rd, 2008 by Hypn | No Comments »

Quest for Glory 2 Remake: Blue Frog and items

I found a few extra items in the Quest for Glory 2 remake, including the elusive Blue Frog (which allowed you to cheat, in the original - “suck blue frog” anyone?)… Apparently you get it using the bellows with the air elemental in, and use it by pressing F10, or something like that?

Read more…

September 3rd, 2008 by Hypn | No Comments »

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).

August 30th, 2008 by Hypn | No Comments »

Lamborghini Countach, on my way home from work

I saw this on my way home from work - it’s a Lamborghini Countach. I want one. When I was younger a had toy of one next to my bed, it was my dream to own one (but white).

More info here: http://en.wikipedia.org/wiki/Lamborghini_Countach :)

August 27th, 2008 by Hypn | No Comments »

The Dark Fortress (TF2 video)

A scene from “The Dark Knight”, reenacted by Team Fortress 2 :D

August 27th, 2008 by Hypn | No Comments »