contact

Archive for October, 2008

jquery ajaxForm and validate with ajaxSubmit()

Tuesday, October 14th, 2008

I am currently working my way into the jquery universe and I really like the great plugins that take a lot of the workload of off your back. I am developing an application that uses the ajaxForm plugin and it worked nicely. Then I implemented the also great validate plugin and it for it self also worked really well.

The problem:

it seems that the ajaxForm keeps getting submitted with or without errors using the ajaxForm submission and if the form contains no errors it gets submitted a second time via this method discribed by the plugin author:

</pre>
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
target: "#result"
});
}
<pre>

The solution / workaround:

I found the only way to get this work is to completly ignore the submitting capabilities of the validate plugin and use the ajaxForms built in beforeSubmit option to check the form using the validate valid() function.

</pre>
beforeSubmit:checkForm // add this to your ajaxForms options

function checkForm(data,form){ // this method will tell the beforSubmit method if the form is valid
 return $(form).valid();
 }
<pre>

note: I have

Choosing a mass data storage solution for a mac household

Sunday, October 12th, 2008

I am replacing my old server / htpc with a mac mini – hopefully with a new model if they appear on 14.10.2008.

I am looking for a external mass data storage solution that offers me at least two terabytes of storage distributed among 2 or more drives in order to achieve a secure and redundant storage capacity of 1 terabyte without data loss in case of the inevitable hard disc failure.

I am looking for he following features – ordered by importance

1. Security through redundancy. I want to have all my data stored twice on two separate drives. Raid or regular back up software are both fine. I do not want to pay for backup software, there is enough free software to get the job done. It has to be automatic.

2. Noise – the system will be in my living room and I don’t want loud fans without running the risk of overheating. This is one of the main reasons I am dumpping my current pc.

3. Power management – I want the system to have some sort of idle state where the discs spin down on order to cut noise an usage of the discs. This should be automatic. I do not want to turn the drives of manually.

4. Accessability through out the entire network and over the internet – FTP is a big plus. I have a gigabit lan airport extreme base station and the mac mini that will always be on plus I also consider NAS an option.

5. replacability and expand ability. In case of a broken drive I want to be able to buy a new drive in a local compute store in install it. Even more important is that even though 1 terabyte is an insane amount of storage the day might come soon where I want to add more storage to the system without having to repurchase the entire setup.

6. Warranty - it should have decent warranty on the drives from the manufacturer.

8. Speed – I did a lot of reading and I think for my purposes of backup and media storage / streaming USB 2.0 and faster are good enough. FireWire would be nice since I have macs.

Things that ate not important.

1. Design – I can hide it all in a tv table so it does not have to be pretty.

2 .Many connectivity options – the system should be connected to my network only at one point – AEBS ,mac mini or via Ethernet.

3. right now I have two fairly new 500 gb SATA hard drives I would like to reuse but it’s not a must. I am willing to drop cash on new terabyte drives.

Most importantly the pricepoint. I figure I can get the 2 terabyte drives + enclosures for arround 350 euros which is about what I want to spend. But since this should be a longterm investment I could be convinced to spend a bit more.

These are the options I have in mind right now.

1. Buying two terabyte drives and putting them in decent enclosures, although I would not know which enclosures, and just hooking them up to the mini on 2 usb ports. –>probably the cheapest and can easily upgraded but problemantic in terms of noise and power management.

2. Getting a two bay raid enabled enclosure like the LaCie Big Disk Extreme+ Dual –> quite expensive – but excellent quality and feature rich. Are there cheaper options?
3. Getting a nas device like the dlink DNS 323. since I actually already have a mac mini always running or the airport extreme basestation I am not sure if its a good idea to bring in another stand alone device.

Please tell me what you suggest and about solutions you use for your self.

Mac OS X disk utility – resource busy error

Friday, October 3rd, 2008
WD mybook 500GB pro edition

WD mybook 500GB pro edition

I noticed that time machine kept preparing for a backup on my western digital mybook 500GB pro edition external harddrive that is connected to an Apple Airport extreme basestation. At first I thought it was a time machine problem but soon I realized that my external harddrive was the source of the problem.

Sympthoms:

  • the disk is not mountable
  • the disk does not show up in finder
  • the airport utility can not access the base station as long as the disk is connected
  • the disk does show up in the disk utility

After screwing with it for a bit I decided to wipe the entire drive in order to fix the problem. Both erasing and repartitioning the disk resulted in an error message saying “resource is busy”.

What did not help:

  • restarting the disk
  • restarting the computer
  • booting from the os x disc and using the disc utility from there will not help either

So I was ready to give up and looked up the warranty information on the western digital website – which is really really good by the way. They had a small windows diagnosis tool for download one should try befor applying for a replacement. So I booted up in windows XP ran the diagnose and it toled me everything was perfectly fine.

The solution to the problem:

just use the standard built in windows XP disk management and wipe the old apple partition and replace it with a new windows NTFS partion( just for now). After this step windows should already be able to see and use the disc under my computer. Now simply reboot to OS X and launch the disk utility, reformat the disk to apples file system and reconnect it the base station.

Note:

Unfortunatly this solution results in complete loss of all your data that was on the drive. But I found no better way.