5th element style condo!

You’d think the real estate market crashed everywhere and there’s plenty of available square feet, but check this out: what you saw in the 5th element has actually become a reality, in Hong Kong!

15 minutes with iPad: too heavy!

15 minutes with iPad: too heavy!

I was at a conference in Amsterdam last week and although we don’t have the iPads in Europe yey, I had the opportunity to play for 15 minutes with an iPad brought by a US attendee.

My first impression was: it’s really nicely designed, extremely intuitive and responsive. I gotta get one. I also loved the little switch to lock the orientation. Super useful for reading while lying on your side in bed! (Unlike on the iPhone)

However, after a few minutes I started to realize that a) I don’t quite know how to hold that thing (whether with or without the Apple carrying case) and b) it’s getting damn heavy if you hold it in your hand. Those impression were shared by the owner as well as the other people who played with it.

I believe this is going to limit how much you actually want to use that device in different situations. I think it’s actually very impractical to use when you don’t sit down. Also, I believe Apple should actually drop the stupid glass screens: they’re heavy and the glare is just annoying!

Anyways, until then it looks like the Apple product segmentation goes like this:

  • If you’re standing, use your iPhone
  • If you’re sitting in an armchair, couch or other laid back situation, use your iPad
  • If you’re sitting at a table, use your MacBook
  • If you’re sitting at your workdesk, use your iMac or Mac Pro

Ah yes, also:

  • If you want to watch something on your TV, use your Apple TV or better yet: Mac Mini.

How to automatically start playing movies in QuickTime X

Apple has removed that features in Snow Leopard and QuickTime X has no preferences panel to enable this. So you need to go through the command line to get it back…

In Terminal, copy/paste:

Code

defaults write com.apple.QuickTimePlayerX MGPlayMovieOnOpen 1

Now movies will autploay when you double click them.

How to enable X-Ray folder previews in Mac OS Quick Look

In Terminal copy/paste this:

Code

defaults write com.apple.finder QLEnableXRayFolders 1

Then relaunch the Finder by Pressing Cmd+Alt+Esc.

Press space on a selected folder and admire :)

Update: it seems this no longer works in Moutain Lion.

Why echo is slow in PHP and how to make it really fast

You may have noticed that PHP scripts that echo a lot of content appear to be running with poor performance…

Well, the operative word here is “appear". It is a common misconception that “echo is the slowest PHP command"! :p

The problem is actually just a bandwidth issue! When you try to pump a lot of content though the Internet, at some point you experience “load time"… and at some point PHP actually experiences “send time"!

You may measure the execution time between the begining and the end of your script, and, on a slow connection, it may show you that it took 500 ms to execute. You may even narrow it down to a single echo statement that takes 480 ms to execute. But that time actually includes wait time where PHP cannot send any more data back to apache!

There is a common trick that consists of starting output befering before echoing, like this:

PHP

ob_start(); 
echo $a_lot_of_content;

This will allow PHP to move on and appear to terminate fast. But the truth is, all the content is now in PHP’s output buffer, and although your script is done, PHP is still working in the background to send all that data to your web server (apache for instance).

Read more »