Jugglingdb has crashed… rumoured to be a php attack going around at the moment so i’m guessing it’s that. Thought I’d better capture my script files in case things go really belly up. it’s reminded me of another two items of note (1) the idea of creating a graphical regexp editor, and (2) this regexp for recognising web addresses (not strictly URLs, since it allows www.blah without the http://, but requires http:// if the server name is not www:
[ Note: this is cut & pasted from some PHP code, so there are extra \s in there! ]
// BitchASS regular expression for web addresses (like URIs, but includes those where the
// http:// is missed off:
// By steve@juggler.net
$preg = “(” // Opening ‘quote’
. “(?:(?:http://([\w_\-]+))|(www))” // opening gambit - match “http://(anything)” or “www”
. “(” // Capture remainder of address
. “(?:\.[\w_\-]+)+” // remainder of domain NOTE excludes domainless machine names
. “(?:/” // Got slash?
. “(?:(?:[\w_\-+\.\~]|%[0-9a-f][0-9a-f])+)” // Directory or ~user or filename
. “(?:/(?:[\w_\-+\.]|%[0-9a-f][0-9a-f])+)*” // Any number of subdirs
. “(?:#(?:[\w_\-+\.]|%[0-9a-f][0-9a-f])*)?” // #anchor
. “(?:\?\S*)?” // ?querystring: only terminated by space character
. “)?” // You might not have any of this.
. “)” // end capture
.”)i”; // ignore case
// NOTE the replace expression: for http://something, $1 will contain ’something’ and $2 will
// be blank. For those beginning www, $1 will be blank and $2 will contain ‘www’. So $1$2$3
// is the expression for the whole address.
return preg_replace($preg,”<A href=”http://$1$2$3″ TARGET=”_blank”>$0</A>”,$outbuff);
Please credit me (in the source code at least) if you use it, please mail me if you improve it.
Today I am once again plunged into despair by VBScript. If you create a dictionary object, billed as VBscript’s ‘equivalent to perl’s hashes’ then try to *READ* a value with a non-existent key, then the key is INSERTED into the hash. What rot. I recall a similar problem in reverse whereby you could not write to a non-existent key. I think that might have been collections. One day I might look into it and make a good strong case for why VBScript is WRONG on this count, but suffice it to get it off my chest today.
Gave my pages a quick tweak. Hopefully the geocities javascript ‘occlusion bar’ isn’t in the way any more. Looking for decent free (or cheap) hosting, preferably with php. Hope to someday soon get a fairly comprehensive set of coding ideas, tricks and guidelines up. Emphasis will be on method rather than techie achievement: reusable idioms for more robust code and a more robust development process. We’ll see. It’s only two or three weeks till my new job so I may have to shelve it all again.
I just typed up a review of last weekend. Took me, oh more than 20 minutes. Hit save. ‘Sorry you have timed out. We have thrown your work away. Do not try the BACK button it will not work. Muhahahh’
BASTARDS!
Went looking for a fix to my housemate’s dicky playstation problem. We (he) bought a new widescreen TV last week and we plumbed it in. Everything’s fantastic except (a) his VCR is mono and (b) his playstation imports don’t work any more. They run, but the display is black-and-white and jumps up and down. A bit of fiddling got a bit of colour into it, but with big vertical blue and red bands down the screen, and still skipping.
Found a page advertising a ‘PSX RGB Scart’ lead for 6 quid… that could do it maybe… but he’s now talking about not bothering and just bringing the PS downstairs… looks like I might be on for picking up my GT3 career again where it left off!
A spot of web free-association from there reminded me that I have a once-beloved atari 2600 lying around with a dicky display driver. Found a few pages on modding them but nothing concrete yet. This will go on hold again for a long while I think. The fantasy is to fix it up, then build a TV into a coffee table and have it running tanks (combat) , with one joystick at either end of the table… It would be even better to do this 4 player but there we go. Might happen one day…
K so I changed my blog template. Lots of Microsoft Script errors from the server. Then I couldn’t “post & publish” cos there was nothing to post… Well here’s something to post. Confounded machines!
note to self: this may well be the thing I need to get myself a site up and running. Looks like I’ll have to redesign the home page at some point (not least because I’m still hosting Jen’s CV 9 months after we broke up :-)
Kay so that clearly works. Just read in the Grauniad how everybody’s doing this blogging thing and it’s revolutionised the web again. This time I thought I’d go with the revolution and see what it had to offer. Just as well I’m running IE on a windows box I guess. The blogger service looks on first appearances to be very activeX, therefore windows-specific. Apart from a slight note of dismay from my linux-friendly half, I will withhold judgement until I’ve been playing with it for a while.
Blog opened