Sandisk SSD v/s HDD

March 4, 2009
2 comments Misc. links

Sandisk SSD v/s HDD I have for a long time been excited about getting one of those SSD drives to boost my laptop. Especially one of those SanDisk 40,000 RPM drop in replacement drives. Skimming around on YouTube there seem to be lots of videos showing how fast the new SSDs are at booting the operating system compared to HDDs.

BUT! These comments caught me attention:

chinesemilkman
"I've worked with those newfangled SSD Macs at my student computing support job and if memory serves, they run applications slower than your standard HDD Macs. I doubt any SDD storage product would run audio and visual as fast as a SATA II. Maybe one day they will optimize performance but in actuality, I have my doubts that any current SDD out performs top of the line HDDs in performance. AND COMPARING BOOTUP SPEED IS NOT A RELIABLE PERFORMANCE TEST! Lame marketing gimmick is what it is."

johnnyfast
"Interesting how NONE of the SSD tests show a real world multi-tasking environment.
I have an OCZ SSD 64 and it totally fails, as soon as my PC is doing 2 or more read/write multi tasks I get horrendous lock ups. It is going back to the shop as unfit for purpose.
SSD is a one trick (read speed) pony."

I mean, they "promise" speed, higher durability and lower power consumption. I was ready to almost accept the extreme prices and the disappointingly small sizes but if speed is only in boot up and single operations then I'd rather spend my money on RAM or CPU or something.

To $('#foo p') or to $('p', $('#foo'))

February 24, 2009
2 comments JavaScript

For the performance interested jQuery users please check out this thread

For the impatient, read Stephens reply He benchmarked what I asked and concluded that $("p", $("#foo")) is much faster in jQuery 1.3.2. I've been coding this style in jQuery for all recent projects so I'm happy with this outcome.

UPDATE

John Resig himself joined in on the discussion and had this to say:

"You should always use $("#foo").find("p") in favor of $("p", $("#foo")) - the second one ends up executing $(...) 3 times total - only to arrive at the same result as doing $("#foo").find("p")."

UPDATE 2

Not only did John join in on the discussion but it also made him work on jQuery 1.3.3 (not yet released at the time of writing) so that it doesn't matter which format you use you get the same performance. See the benchmark here

Propeller Island City Lodge Orange Room

February 23, 2009
0 comments

How cool are these rooms? This is a hotel in Berlin that was recommended to me by a friend. I haven't been there but after having seen the pictures I definitely want to go to this hotel if/when I visit Berlin.

Founder of Islamic TV station accused of beheading wife

February 17, 2009
0 comments Politics

Funniest sad news of the week:

"Muzzammil Hassan was charged with second-degree murder after police found the decapitated body of his wife, Aasiya Hassa"

And what makes this horrible sad news so funny:

"He launched Bridges TV, billed as the first English-language cable channel targeting Muslims inside the United States, in 2004. At the time, Hassan said he hoped the network would balance negative portrayals of Muslims following the attacks of September 11, 2001."

D'oh!

To assert or assertEqual in Python unit testing

February 14, 2009
17 comments Python

When you write unit tests in Python you can use these widgets:


self.assertEqual(var1, var2, msg=None)
self.assertNotEqual(var1, var2, msg=None)
self.assertTrue(expr, msg=None)
self.assertRaises(exception, func, para, meters, ...)

That's fine but is it "pythonic" enough? The alternative is to do with with "pure python". Eg:


assert var1 == var2, msg
assert var1 != var2, msg
assert expr, msg
try:
   func(para, meter)
   raise Exception
except exception:
   pass

I'm sure there are several benefits with using the unittest methods that I don't understand but I understand the benefits of brevity and readability. The more tests you write the more tedious it becomes to write self.assertEquals(..., ...) every time. In my own code I prefer to use simple assert statements rather than the verbose unittest alternative. Partially because I'm lazy and partially because they read better and the word assert is highlit in red in my editor so it just looks nicer from a distance.

Perhaps some much more clever people than me can explain what a cardinal sin it is to not use the unittest methods over the lazy more pythonic ones.

Incidentally, during the course of jotting down this blog I reviewed some old inherited code and changed this:


self.assertEqual(len(errors),0)

into this:


assert not errors

Isn't that just nicer to use/read/write?

Female body builder picture galore

February 12, 2009
1 comment

Female body builder picture galore If you, like me, is equally fascinated by female body builders this is a great page. It's quite incredible. I'm sure there's a large community of those who do it (men and women) and there's probably men out there who actually like this. I wish Michael Moore would do his next documentary on this instead.

The Albion, Shoreditch

February 4, 2009
1 comment Web development

The Albion, Shoreditch There's a new restaurant on my street called The Albion. I went there for lunch today and had the steak and kidney pie with bread. It's a proper restaurant so including tip it came to £11 with tap water. Not cheap but the service was good and the food was really great. They've got a great delicatessen section with the usual tins of overly prices Italian olives and organic vegetables and yummy desserts.

Now, this blog is not a restaurant review blog but rather a (web) technical one. What strikes me is that these guys don't have a website! How can you not have that these days? Or perhaps they do but I just can't find it anywhere on Google. There's a Albion London advertising agency a stone throw from the restaurant and there's a The Albion in Islington but no Albion restaurant in Shoreditch London on Google.

If you're going to spend thousands of pounds on a nice chairs and lamps, like this restaurant clearly has done, then why not spend a couple of pennies on SEO and getting a decent website. Granted, it's a new restaurant but it only takes Google a couple of weeks to review its indexes. Come on my-new-favorite-restaurant-around-the-corner!

Acupuncture works for headaches

January 22, 2009
0 comments Misc. links

Acupuncture works for headaches But so does poking needles in at random places. Basically, this article talks of a study that proved that acupuncture does work to treat headaches.

"The Cochrane reviews involved a total of 6,736 patients, who were given acupuncture to prevent either mild to moderate "tension" headaches, or migraine attacks.

Following a course of at least eight weeks, acupuncture patients suffered fewer headaches than those given only painkillers."

That's interesting. So it is better than painkillers. But like my colleague Shane said "I bet it's because it's so relaxing to take a break and sit down and get the treatment unlike painkillers where you don't stop". The report continues

"The scientist leading the review said the results showed that putting needles into particular locations might not be that important."

If you're wondering. I take neither painkillers or acupuncture and I personally think both western and eastern medicine has merits.