Archive for September, 2008

Facebook, the new long-distance phone line

Tuesday, September 16th, 2008

My friend’s cousin (we’ll call him P., because that’s his initial) added me on Facebook. I know P from a camping trip a few months back.

After confirming P’s add, I took a look at his Facebook wall and recent actvitity. He’s connected to other members of the extended family: my friend, my friend’s little sister, cousins and aunts and uncles from all around the family. There’s a running conversation on his wall with a cousin of the same age from a different side of the family1. P’s status is “looking forward to tomorrow to find out if we are going to have a boy or a girl. :)”. I fully expect he’ll post the news, and potentially an ultrasound picture.

Families usually keep in touch like this with periodic phone calls. I suppose the white-collar 20-35 demographic uses email too, since we’re so used to it in school and business. But I wonder if this is an isolated case of a family using Facebook, or the first I’m seeing of a larger progression. Rushi has pointed out that he has seen high school friends’ parents online, connecting with their high school friends.

Addendum 22 Oct: This is Why You Don’t Friend Your Boss on Facebook. That kinda changes the workplace dynamic, I suppose.

  1. Her husband is on Facebook too.

We prefer to call it Chromatically Challenged

Tuesday, September 9th, 2008

Scott and I got ice cream today at the cafeteria. I had Ultrachocolate1 and Banana. Scott got Mint Chip and Concord Grape.

As I picked up mine, he asked “Did you just take my ice cream?”.

Scott is colorblind.

  1. It wasn’t really Ultrachocolate. I’d call it a good Extrachocolate. I think they called it Ultrachocolate to more clearly disambiguate it from the Vegan Chocolate on the other side of the display case.

Chrome’s User-Agent string

Tuesday, September 2nd, 2008

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13

It upsets me how many product names other than Chrome are in there just because stupid JS tries to guess what the browser can do. Next time, we need a new way to detect browser capabilities. I suggest we detect the actual capabilities, not try to guess based on who shipped what feature first in 1997.

It’d be cool if the browser vendor cartel got together one day and decided all User-Agent strings would be simple again, like “Chrome/0.2.149.27 (Windows NT 5.1; en-US)”. And any jankety-ass copy and paste image rollover script from 1997 that breaks if the string doesn’t start with “IE” or “Mozilla” can get stuffed.

How to compute the size of a tar archive before you tar it

Tuesday, September 2nd, 2008

Suppose you have a tree of files and directories, and you want to pack them up into a tar archive. Here is how to find the size of the resulting archive. This is useful if you want to stream an archive out to a browser, but want to send the correct Content-Length header first.

  1. let F = number of files in the tree
  2. let D = number of directories in the tree, counting the root
  3. if there are any non-ordinary files, stop here. results undefined.
  4. let S = 0, H = 0
  5. for each f in F, S += ceil(size(f)/512.0)*512, H += 512 – that’s the size of f rounded up to 512-byte blocks
  6. for each d in D, H += 512
  7. for each p in (F D), if the full path and name of p (as stored in the archive) is greater than 100 characters, H += 1024
  8. The size of the archive is S + H + 1024 bytes of zero-fill at the end of the tar
  9. Round up to (tar blocking factor) * 512 byte records. GNU tar defaults to blocking factor 20. Blocking factor 1 makes the math easier ;)

No, you cannot use ‘du’. I have tried.

Update! Added #7.

Just another WordPress weblog