chxo internets RSS

A network of memes,
by Chris Snyder

See also
CHXO Internet
twitter.com/64

Archive

Nov
29th
Mon
permalink

How to build a BOM in PHP

Byte order marks are the secret bane of many a PHP coder, and usually you want to remove them from documents that you are about to process.

But if you are sending UTF-8 CSV data to Excel, then you need to add one, otherwise your unicode is gonna be gibberish.

// send BOM
echo pack( 'C3', 0xef, 0xbb, 0xbf );

// then immediately send output
print $csv;

Note that this doesn’t work with Excel 2004 (Mac). As far as I can tell, there is no way to force Excel 2004 to read unicode CSV files. I mean, who would want to? :-p

Nov
3rd
Wed
permalink

GMail in Safari, no cursor in replies

Man this one is annoying: after you upgrade Flash on OS X, the cursor disappears from your GMail replies.

The fix is here, which is that you should go to Settings, scroll down to Attachments, and select “Basic attachment features”. 

Why in the name of HTML5 does Google still use Flash for file uploads? Grrrr.

Oct
4th
Mon
permalink

Icons disappear from Dock (OS X 10.6)

Every now and then an application’s icon will randomly disappear from the Macintosh Dock. The application is still on the Dock, you can click on it like normal, but its icon is blank. What to do?

1) Quit the Application if it is running.

2) Right-click on the blank Dock icon and click Options > Show in Finder.

3) Right-click again and choose Options > Remove From Dock.

4) Relaunch the Dock using the Terminal command: killall Dock

5) Launch the Application from the Finder window and drag it back to its rightful place in the Dock. 

Annoying, yes, but at least it doesn’t happen very often.

Sep
18th
Sat
permalink
OLPC/iRobot/Pyrobot control an irobot and an olpc from anywhere in the world. 
Does it find it’s own way back to the charging station?

OLPC/iRobot/Pyrobot control an irobot and an olpc from anywhere in the world. 

Does it find it’s own way back to the charging station?

Sep
17th
Fri
permalink

There’s a great post at Tomorrow Museum declaring The End of Sexism. It’s a bit of a manifesto, actually, the point being that there are no excuses, other than outright stupidity, for sexist behavior.

I agree and disagree at the same time. Based on reactions to valid claims of sexism in technology (I’m looking at you, IT) and politics, I think that a disturbing number of people are unwilling to acknowledge that there is a problem. It’s too big to even see—unless you’re looking for it, and then it’s everywhere.

So we are in a strange place: the majority have agreed for a long time that sexism is bad, the enlightened are adopting a zero-tolerance policy, but the male-dominated, mainstream everything is still completely oblivious to the issue.

Sep
16th
Thu
permalink

Beyond Fusion

If the the repulsive force of squabbling bureaucrats could be overcome using conference-room confinement, the resulting release of energy would power the world forever.

Slashot post by sakdoctor

Sep
9th
Thu
permalink

The Perfect Blogging, Tweeting, Broadcasting Platform

Ideally, you would have one site, that you own and control, and you would post everything to that site. Then you would make decisions about how to republish those posts (or protect them):

  1. Short posts get re-posted to Twitter and/or Facebook
  2. Photos get re-posted to Flickr
  3. Videos get re-posted to YouTube
  4. Copyrighted media gets protected with a password so you can share it with friends and family only.

Because you control the site, it’s okay to store credentials for other services (like your Facebook password) in there.

Baked into the site would be tags, RSS newsfeeds for everything, a built-in URL shortener, and simple photo/audio/video editing tools.

Sep
1st
Wed
permalink

EC2 on EBS: Taming the Amazon

I upgraded my old Debian 4 AMI to Debian 5 yesterday, and switched it from S3 storage to the more permanent (and more easily clone-able!) EBS.

With EBS-backed instances, we can finally have a boot drive that doesn’t go away if the instance gets hosed! There is dancing in my street.

Create a bootable EBS AMI from a running instance is more pro, but Creating an Amazon EC2 EBS AMI from a running instance is more helpful. Take your pick, but do not use dd to copy an active file system. My sshd_config ended up with a bit of syslog in it somehow, what a nightmare.

permalink

Beware of the default Apache 2 config for PHP

Ilia Alshanetsky points out that AddHandler is the wrong directive to use for executable file types like PHP, because Apache could execute the file bad.php.jpeg (I haven’t tested this yet, but plan to).

The safer directive is apparently AddType:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

Jul
20th
Tue
permalink

Firefox Audio Fail

You would think that if your browser doesn’t support playing audio/mp3 content using an html5 <audio> tag, it would do the right thing and fall back to the fallback markup under it.

Consider the following html5 markup:

<audio controller=”controller”>
  <source src=”sound.mp3” type=”audio/mp3”>
  <a href=”sound.mp3”>Click here to play audio</a>
</audio> 

I’m just getting started with html5, but it seems to me that a browser should embed an audio controller if sources of type audio/mp3 are supported, and fall back to the link if not.

Firefox (which doesn’t support mp3) embeds the controller, but shows a big red X because it can’t play the file.

So I ask you, internets, am I misinterpreting the standard?