Bob Mitchell

bob-o-rama: The Art of Slack.

Illiterate Walk

An illiterate walk into Crawley - broken signs

26th October 2010 - 14:43 - bob

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.

walk into crawley 1 - Click to enlarge.
Click to enlarge.

Read more...

Linux Ramdisks

Making things go faster - less waiting on disks

18th August 2010 - 22:01 - bob

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.

Read more...

pwned

Why can't people just write better code?

10th July 2010 - 21:25 - bob

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.

onblur textbox

using javascript onblur events on an html textbox

9th July 2010 - 22:54 - bob

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.

SGD Cleartype

Cleartype in SGD using Windows XP

21st January 2010 - 17:09 - bob

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

HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlTerminalServerWinStations

I added the key

AllowFontAntiAlias

that has a dword value of

00000001 (1)

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.

2010 windows xp cleartype registry - Click to enlarge.
Click to enlarge.

The screenshot above was taken via SGD AFTER cleartype enabled, here showing it zoomed-in:

2010 windows xp cleartype result

...which looks about right from here.

This should work just as well with a virtual Windows XP instance in a VDI environment.

Igloo

It is sooooo cold - how about building somewhere warm?

11th January 2010 - 13:07 - bob

It's been a bit chilly here - not that bad, but bad enough.

Some folks down the road have built an igloo:

2010 january igloo