August 23rd, 2009

Fairly common..?
How many times have you had to do one of these things? A group of items, each with a checkbox. You want a button/checkbox to select all the checkboxes within that group.
I ran across this again today, and making the javascript to do the work I was once again reminded why I love Mootools so much:
With just three lines of code (1 line to do the actual checking/unchecking), I had this up and running. It couldn’t have taken longer than 30 seconds to write. I love quick snippets
Obviously, this wouldn’t be hard to do in jQuery or any other JS framework, but I love how elegant and intuitive Mootools does it. I shudder when I think of how many times I’ve done things similar to this in plain old Javascript.
Anyway, there’s a demo page available, and here’s the code I ended up with, for anyone interested:
1
2
3
| $$('li.head input[type=checkbox]').addEvent('click', function() {
this.getParent('ul').getElements('input[type=checkbox]').setProperty('checked', this.checked);
}); |
Tags: html, Mootools
Posted in Mootools | 1 Comment »
July 11th, 2009
My fileserver has 10 disks in a linear setup (JBOD, BIG, whatever you want to call it). I’ve been using software raid on Linux to do this. Today, one of the drives seemed to fail, giving me a read-only filesystem. Without too much experience in the field, I assume this harddrive is on it’s way out. I did a simple disk info and found it was 1 of 3 Samsung drives… Which one though? And is it really faulty?
I downloaded a utility from Samsung that lets you run a disk diagnostic, which would hopefully give me an answer to that question. However, I had to choose between a bootable CD and a floppy, neither of which works for me since I don’t have an optical drive or a floppy drive in the fileserver. So! Here’s how I made a bootable USB thumb drive:
Note: This will only give you a bootable MS DOS drive.
- Download the “HP USB Disk Storage Format Tool” from bootdisk.com (it’s under “method 2″, first link, currently version 2.0.6)
- Install the app.
- You will need the files from a MS DOS boot floppy. You can get plenty of different versions from bootdisk.com. I chose the Windows 98 OEM version.
- Most of these will want to write straight to a floppy (to get the boot sector right). If you’re like me and a don’t have a floppy drive anymore, you can download and run an awesome little app called Virtual Floppy Drive. This will emulate a floppy drive on your windows box. Pretty awesome for stuff like this.
- Create the floppy using the downloaded boot disk creator.
- Insert an appropriate USB thumb drive into the system. I’ve tried different drives and it handles most of them just fine. This time I used a simple MicroSD => USB adapter and a small memory card.
- Run the HP USB Disk Storage Format Tool thingy, select your USB device, select FAT as the file system, choose a quick format and to create a DOS startup disk. Browse to your (virtual?) floppy drive and click OK, then Start.
- When it’s done, feel free to copy any applications you want to run from it over to the thumb drive. I downloaded the bootable CD diagnostics from Samsung, opened the ISO file and extracted the application files onto my thumb drive.
- Plug it into whatever system you want to boot, be sure to set the BIOS to boot from it and you should be good to go
Hope this helps someone, it took me a little while to figure this out a while ago and figured I’d write a small howto.
Tags: boot, floppy, Hardware, thumbdrive, usb
Posted in Hardware | 1 Comment »
June 23rd, 2009
I’ve been developing some Android stuff lately, and finding it a real joy to work with.
It gets rather tiresome to look at the same fake phone all the time though, so I decided to take a break and see if I could create a skin based on the upcoming Samsung i7500 (I believe they’ve named it Galaxy now, at least in Germany). The screen position and such may not be spot on, but it has the right resolution at least. I mapped most of the buttons too, but the zones had to be cut off a little due to the emulator not supporting weird button shapes (afaik).
Should anyone be interested in downloading it, feel free to get it. Just extract this to your Android/platforms/android-<version>/skins folder and you should be good to go. Run the emulator with the flag “-skin Galaxy” (or if you’re using Android 1.5 or upwards, just select Galaxy as your skin in the AVD Manager). Here’s a screenshot of how it looks in action:

Samsung Galaxy Android Emulator skin
Tags: Android, emulator, galaxy, samsung, skin
Posted in Android | 6 Comments »