An illiterate walk into Crawley - broken signs
We had a little walk into Crawley town to visit the Library (is that ironic? not sure) - without any real effort or detours we spotted the following examples of encoding errors or just plain idiocy.
Firstly, this is probably a character encoding issue, but why it didn't get checked before being printed in three-inch high letters, I really don't know.
Making things go faster - less waiting on disks
Thinking about using /dev/shm for fast storage (in my case for Apache) made me think about ramdisks in general.
The last time I tried anything to do with ramdisks was on my old Amstrad 5286, when I created a massive 1MB (ish) ramdisk under MS DOS 3.3 (probably). This time I was using a £500 server from ebay with 16GB of memory.
Why can't people just write better code?
A few weeks back someone took advantage of some crappy code (thankfully not mine) and successfully compromised my dads site (it wasn't his code either). unfortunately that site is hosted on the same server as this one, so I had to take them all down.
Since then I don't seem to have had much time to fix things (sorry dad) and it's taken a while to get things back to normal.
Working on it.
Using an onblur event in a textbox couldn't be simpler:
The blur event, that's handled by an onblur function is triggered by an element when it's losing focus - typically caused by a user clicking 'out' of the element or 'tabbing' to the next element, perhaps in a form.
There are two sorts of textboxes that you have to think about - a basic input element with one line and the larger multiline textarea.
In the case of an input element that may look like :
<input name="firstname" size="20" />
all you'd need to do is something like:
(in all of these examples I've used the xhtml style '/>' on the end of the tags - if you're using more traditional html then a simple '>' may be enough.
<input name="firstname" size="20" onblur="doSomething();" />
of course, you'd need to define doSomething() somewhere else.
For testing, to understand when the onblur event is triggered you could use:
<input name="firstname" size="20" onblur="alert(this.value);" />
or, to check if a field is valid (very very simplistically)
<input name="email" onblur="if(this.value.indexOf('@')==-1) alert('That's not an email address!');" />
The case of a text area is similar, although a textarea generally always has a closing tag, so you'd need something like:
<textarea name="comments" onblur="alert('comment: ' + this.value);"></ textarea>
(only without the extra space I had to pop in between the '/' and 'textarea' - sorry)
If you use MS Internet Explorer then you'll probably find that you can attach an onblur handler to most elements, but this may not be supported on other browsers which will limit the use of this in some cases (although textboxes of any sort should be fine).
Finally, consider the use of the change event and the onchange handler - this will trigger at the time time as onblur (more or less) but will only trigger when a field has changed its value - so if someone is clicking around a form before filling it in, it won't cause your stuff to fire unnecessarily.
Cleartype in SGD using Windows XP
I sometimes connect to my own Windows XP workstation using Sun SGD (Sun Secure Global Desktop (Soon to be Oracle SGD). I was thinking about cleartype.
This isn't something new that I'm claiming, mostly just a way to document what I'd found for the next time I need it.
I remembered that there was some cleartype hack, and managed to re-find the following ClearType in Remote Desktop with XP - and wondered if it would work with SGD (considering that it uses a different RDP client internally).
So, using regedit, in the following location
I added the key
that has a dword value of
Now the site I took this from says Windows XP SP3 - and that's what I'm using. A quick reboot and then everything is better.
The screenshot above was taken via SGD AFTER cleartype enabled, here showing it zoomed-in:
...which looks about right from here.
This should work just as well with a virtual Windows XP instance in a VDI environment.
It is sooooo cold - how about building somewhere warm?
It's been a bit chilly here - not that bad, but bad enough.
Some folks down the road have built an igloo: