Thursday, November 27, 2008

EOL character conversions

I need to inspect/process large text files (mostly dictionary data) on a regular basis, and for a quick preview I'd use the trusty less. But one thing nearly always drives me crazy: end of line (EOL) characters.

So what's up with all the EOLs? Read all about them.

Luckily since I'm working on *nix systems anyway, there are nifty little utilities, nay, bash commands that'll do the EOL conversions in a blink.

For conversions between DOS files (CR-LF EOL) and *nix files, use dos2unix and unix2dos. (Or use sed if you're old school, as shown in this Linux FAQ HowTo.)

On the other hand, if you need to convert Mac files to/from *nix files, try out this trick with tr, or awk, or perl.

And finally, if you also need to convert between character encodings/sets, you might want to use the versatile recode utility instead. I use it all the time now since I need to process multilingual dictionaries very often.

Thursday, November 13, 2008

Transitional and Strict DOCTYPEs

Every now and then, I write some HTML with some CSS thrown in. I'd insert the ol' XHTML DOCTYPE directive, but I'd never bothered validating my code (aaaarrghhh you sinner!!), nor finding out about the differences between Transitional and Strict DOCTYPEs. Well, I just found out today when I came across this article, extolling why we should go Strict (and CSS).

Wednesday, November 5, 2008

Picasa Albums in Facebook

A while ago I was finally egged on by Hussein to get into Facebook. I was really reluctant at first, since I'm quite skeptical with most other social networking sites (except LinkedIn, which sorta has a more career-oriented feel to it and hence, feels less "adolescent" — sorryyyyy, didn't mean to offence!).

I was pleasantly surprised once I joined. Apparently Facebook's new interface was already in operation when I joined, so all my user experience only applies to the new Facebook. Clean interface, useful tools (non-obtrusive friend invites, people-you-may-know), etc.

I had only one gripe though. I've already uploaded tons of photos (mainly of my baby) to Picasa Web Albums, and was loathe to re-upload them to Facebook. Now there should be Facebook apps to embed/link Picasa albums in my profile/wall, right? Right. Only that they don't work with the new Facebook.


Today I finally found a new Facebook app, Picasa Tab, that actually works.


It pulls all your public Picasa albums into a Wall tab, and displays the photos right inside the Facebook interface, unlike the other apps which would actually redirect you to the Picasa website.


Viewers can even comment on the photos right in Facebook, although these comments won't be updated through to Picasa itself, as the app author wanted to keep Facebook comments more private.


The only caveat right now is that you'll only get a photo still for videos, but I guess that's asking too much for now. :)

US election day on Facebook


The whole world is watching eh.