Archive for June, 2010

Do iframe pages show up in browser history?

The answer is yes and no.

This Google R&D guy gives a good rundown.
http://codinginparadise.org/weblog/2005/08/ajax-tutorial-tale-of-two-iframes-or.html

Long story short… The first IFrame src url will not be included in the browser history for static IFrames. However, all subsequent page urls within the IFrame will.

Unless… You do something tricky like insert the IFrame using JS or manipulate the src attribute in which case the behavior differs by browser and version.

What’s in a name

I’ve been using this as my source of device names for several years.
http://www.playdota.com/items

I have or used to have:

  • BUTTERFLY – A brand new (refurbished) Asus UL50Vt Notebook named after Butterfly
  • MJOLLNIR – A new Core i7 desktop named after Thor’s hammer, Mjollnir
  • DEFIANCE – A used 1U dual 3.06Ghz HP Proliant DL360 G3 webserver with 2Gb RAM running Centos 5.5 in a rack at HE in Fremont named after Hood of Defiance
  • MANTLE – A new Ubuntu VMWare guest instance running on Mjollnir with shared folders named after Mantle of Intelligence
  • IRONWOOD – A deceased Ubuntu VirtualBox VM instance named after Ironwood Branch
  • SANGE – A deceased desktop named after Sange (Sange and Yasha)
  • YASHA – A deceased desktop named after Yasha (Sange and Yasha)
  • RADIANCE – A previous company-owned laptop named after Radiance
  • TRAVS – An Asus Eee 1002HA netbook named after Boots of Travel (stolen)

Linus Torvalds thinks you are ugly.

… ugly AND STUPID (unless you use git).

Best way to store an ip in mysql

I used to use varchar(15).

But a little poking around yielded a better solution.

Turns out there’s a standard set of MySQL functions for translating an IP address to and from an integer.

ALTER TABLE `sessions` ADD `client_ip` INT NOT NULL AFTER `created_at`;
 
mysql> SELECT INET_ATON('192.168.10.50') AS ipn;
+------------+
| ipn        |
+------------+
| 3232238130 |
+------------+
 
mysql> SELECT INET_NTOA(3232238130) AS ipa;
+--------------+
| ipa          |
+--------------+
| 192.168.10.50 |
+--------------+

Here’s the algo in case you’re curious:

(192 * 2^24) + (168 * 2^16) + (10 * 2^8) + 50 = 3232238130

UI anti-pattern: Cross Column Alpha Sort

The human eye is trained to follow edges. In the case of a list such as this, the eye’s natural inclination is to move from top to bottom along the column of icons, not left to right across jagged gaps between columns. Splitting the first 4 in the sort across 4 columns is highly illegible.

 

Shame on you, Microsoft. You should know better.