Ben Godfrey

Archive for October, 2001

Webthought 2222

Edit message super-page should have a delete button if you are editing. Keep down the number of links in each message footer.

Louise’s birthday

We had big food, fajitas and then choc fondue. Mmm mm good. Lots of people and jolity, nice.

I wrote Louise a game as a present. It’s just javascript and a bunch of images, but it’s neat, I think. I was kind of thinking of trying out tetris. A grid of images in a table would be manipulated by javascript functions, including some use of setInterval. Ah, javascript rules. While writing the game I found that it is possible to attach abritrary members or, presumably, functions to objects. I did it with bog standard images.

I have been thinking about reading up on the DOM, my lax period at work is giving me opportunity to expand and learn. Mac OS X now runs Fireworks and is my primary OS at work now.

Another idea would be to take the foundations in Flake (Flash Snakes) and build that up into something a bit more Alpha Centauri like, isometric terrain, other people etc. Flash could read XML from the server (fed by PHP) — tile data on scroll and then smaller update packets — and maintain a small grid view, perhaps even a map view. It would nice to go this far in javascript, but that would be slow and perhaps straining the point a litte. Ah, tetris though.

Lastly, I inherited a new phone from a guy at work. It’s diddy, but has less functionality than my old one. Never mind, it’s a novelty for now and I’ve got a free upgrade waiting at Orange for when I tire of it.

More solid PHP know-how

Using the putenv and getenv functions UNIX enviroment variables can be used to store info on the server, but without tying it to any particular user (session). Probably only variables called PHP_something can be used, but this is sysadmin configurable. Maybe this can be used thus: getenv(“PHP_WHOS_LOGGED_AT_HYPE”) would return a list of user id’s active recently (maybe their times also as the names will need to be removed at some point). getenv(“PHP_HYPE_01010_START”) could be used to record when the page generation started, but this would be more usefully put into the code.

Default values in PHP

function blah($blah1, $blah2)

rewritten as

function blah($blah1 = "", $blah2 = "")

will have default values set on each of the variables. Useful for security and for predictability. Also, try Secure Software Solutions’ RATS system, as it works on C, C++, PHP, Python and others maybe.

Is this what a working flash detect javascript looks like?

<!--
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0);
if (plugin && parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= 4) {
document.write('<EMBED src="detec.swf" quality=high bgcolor=#ffffff ');
document.write(' swLiveConnect=FALSE WIDTH=80 HEIGHT=72');
document.write(' TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">');
} else {
document.write('<IMG SRC="images/animation.gif" WIDTH=80 HEIGHT=72 BORDER=0>');
}
//-->