Why Javascript Returns Zero For parseInt('08') and parseInt('09')?

Writing a simple Javascript function to create a Date object from a 'yyyy-mm-dd' string I found a small, but important, issue with the parseInt function, used to transform strings to integers.

Both parseInt('08') and parseInt('09') return zero because the function tries to determine the correct base for the numerical system used. In Javascript numbers starting with zero are considered octal and there's no 08 or 09 in octal, hence the problem.

To fix this just add the second parameter for parseInt, the base to be used for the conversion. The correct calls should be parseInt('08', 10) and parseInt('09', 10).

Another of those little details, uh?

How To Add Multiple Tags To Subscriptions In Google Reader?

Whenever I subscribe to a new feed on Google Reader I can choose a folder for it and that's the only way I see for adding a tag to that subscription. It makes me wonder why Google insists on confusing us using both folders and tags to refer to what it seems to be the same thing.

Other feed readers, like Rojo, allow you to add many tags at once by just writing them, on the same way you can add tags to photos on Flickr. I've used Rojo before but I really prefer Google Reader now.

Am I correct on assuming that the only way of adding more tags to a subscription on Google Reader is by going to Settings, Subscriptions and then checking the subscriptions and choosing a tag from the more actions list?

Don't we have an easier way? I hope I'm missing something really obvious here.

Opera 9.50b2 for Linux 64 bits

Opera, a nice browser

Opera is a great browser and the latest beta offers nice features, including a few tools for web developers.

I'm not sure why the 64 bits version for Linux is hidden on Opera's site but anyway, if you're looking for it get it here: Opera 9.50b2 for Linux 64 bits. It's Opera's FTP server.

How To Add Eye Candy To Ubuntu With Avant Window Navigator

A few days ago I visited a store selling Apple products at Lima (for those who may ask: It is not a real Apple store, sadly). I really like Apple, I own an iPod classic, recently got a pink Nano for Yesenia and am thinking about upgrading to a Touch soon.

At the store real everyday people, you know, the ungeek kind, stared at the MacBooks amid wows and fascinated looks and I guess mostly due to the nice effects Leopard offers. I am pretty sure many of these curious would-be-Apple-customers couldn't care less about the Core 2 Duo processor, video resolution and the polycarbonate shell (which it's quite nice) that MacBooks have.

Well, if eye candy is what most users are looking for these days let's give them a little with Ubuntu, without having to spend a grand in a new MacBook or, which is worst, having to install Vista. Let's focus in what impresses most users meeting a Mac: the Dock.

Apple Mac OS X Dock

Install Avant Window Navigator on Ubuntu

Avant Window Navigator is a dock-like navigation bar for Linux. It replaces your typical panels, contains launchers for your applications, tracks open windows and supports a few nice plugins that will make your desktop look cooler because, let's face it, a few of us, Linux dudes, want a desktop as cool as the one Mac guys have.

Avant Window Navigator

I ran my tests on a laptop and a desktop, both of them running Ubuntu 8.04 (Hardy Heron) 64 bits. As far as I know there are no different versions for 32 and 64 bits so these instructions should work for both architectures.

The short version: Just run
sudo apt-get install avant-window-navigator

The problem with this approach is that Hardy doesn't include the awn-extras (applets) package, and this is where most of the fun it's, hence I recommend taking a few more steps.

If this is all you want then jump to finishing touches below, if not, then keep reading.

The long version: The smart AWN developers have a few repositories with everything you need to get the whole dock experience on Edgy, Feisty, Gutsy and Hardy.

  1. Start by visiting the archive, choosing your Ubuntu version and copying the right entries.
  2. Open your sources.list file:

    sudo vi /etc/apt/sources.list

  3. Add the entries (I'm using the ones for Hardy), I suggest a comment as well, save and close:

    # awn
    deb http://ppa.launchpad.net/awn-testing/ubuntu hardy main
    deb-src http://ppa.launchpad.net/awn-testing/ubuntu hardy main

  4. Update your list of packages:

    sudo apt-get update

  5. Install the following packages:

    sudo apt-get install libawn0-trunk
    sudo apt-get install libawn-dev-trunk
    sudo apt-get install awn-manager-trunk
    sudo apt-get install awn-extras-applets-trunk
    sudo apt-get install avant-window-navigator-trunk

Finishing touches

Now you need to enable your new dock, you'll find the launcher, labeled Avant Window Navigator, under Accesories in Ubuntu's main menu.

Avant Window Navigator

  1. Right-click on an empty spot of the dock (it can be a little tricky, try a few different places on the sides) and choose Preferences to tweak the look and behavior as you need it and activate a few plugins.
  2. Drag some application launchers from Ubuntu's menu and drop them on the dock.
  3. Now disable the gnome panels by going to Sessions > Current Session and removing gnome-panel from the list of running applications. Finally click on Apply.
  4. To confirm everything works as expected press Ctrl + Alt + Backspace and login back.

Avant Window Navigator is a really funny application, it enhances your experience in the Linux desktop and isn't hard to install. Now I have more real state on my screen, enjoy the way my pidgin buddies jump and can hear a few wows from my visitors at home without having to get a Mac (even if I'll get one sometime just for the fun of it).

Avant Window Navigator

Cancun, Mexico, Here We Go!

Thanks to my cuate Manolo Guerrero (yep, the jQuery guy) I'll be offering a couple of keynotes at Mexico Web 2.0 next November. Many web guys from Latin America will be there, including a few of the great friends I met in Guatemala last year.

We'll have a few familiar speakers on the event as well: Leo Prieto, Christian van der Henst and Freddie Vega. I can only imagine what this gang will do during Cancun's nights.

The event's website is not ready yet but there's already some activity via Twitter.

So, start saving for your plane tickets and see you soon in Cancun!

Mexico Web 2.0

Repairing My Laptop: Amber Back To Life

Some days ago Amber, my loyal Pangolin from System 76, stopped working, apparently due to some power supply issue.

The System 76 guys were very kind, they helped me to discard the problem via email and offered me to repair it at not cost, honoring the warranty, but I was in Lima and couldn't ship it on time.

Family World of Warcraft

I'm enjoying World of Warcraft more and more lately. I recently started to play it with my Beatriz, I bought an account just for her, and it really kicks ass. Now we have to convince Yesenia to install it on her lappy for the whole family to be shouting for the Horde! all day.

It's a little hard finding time to play but I'm already planning my early retirement, super early, and dedicate my days to writing, making music and playing World of Warcraft.

What really amazes me is how after so many years, WoW was released on November 2004, a game keeps attracting so many users, a little more than ten millions as I write this post.

I'm still exploring Azeroth as the bad ass Zuska in Kalecgos so if you're around let me know.

By the way, if any of you, who's not playing it yet, want to give World of Warcraft a ten day trial just let me know to send you an invitation.

Family World of Warcraft

Install OpenVPN on Ubuntu, Hulu Outside the US and Network Security

Some days ago I started using Hulu, the new video star online, but, like many, I found the restriction imposed to users outside the United States, I live in Peru, rather annoying.

Hulu series and films

I started looking for solutions and found a few which I tested during one week. In this article I'll tell you about each and will guide you on setting up the one I think is the most convenient: your own VPN setup running on Ubuntu.

Your Options To Get Hulu Outside The US

Google quickly told me that using a virtual private network (VPN) with a server in the US would fit the bill for this problem. My connection would go thru the VPN and Hulu will see me as coming from a US based IP.

Hotspot Shield is perhaps the most known free VPN application for doing this these days, I tried it and it worked. Quite easy setup and I was using Hulu in just a couple of minutes.

The bad news? Hotspot Shield has a bandwidth limit per month, some say it's 10 Gb., shows ads and does not work in Linux. I really hate having to boot a Windows box just for using one application (World of Warcraft and iTunes are very special exceptions).

So, Hotspot Shield is option 1.

After a little more searching I found two paid services that offered Linux support: HotSpotVPN (afiliado) and WiTopia (both affiliate links). I tried HotSpotVPN, US$ 8.88 for one month of service, in Windows XP and it worked as advertised but they never replied to my email asking for instructions on setting up my Ubuntu laptop.

WiTopia has a US$ 39.99 per year plan, that's a really good price, but I didn't have enough funds in Paypal at the time and couldn't try. However I've read really good feedback about it.

That's option 2.

But a VPN is not good only for accessing limited-to-US-residents services like Hulu or Pandora (yeah, I missed that one too), it's much more. We'll learn about it while we review option 3: building our own VPN setup.

Ok, so let's see how to install OpenVPN on Ubuntu Gutsy.

A Facebook Bug Causes Lots of Headaches To Developers

Facebook logo

I had a good day yesterday. After spending almost six hours debugging a problem with Internet Explorer (yeah, old news) and a Drupal based Facebook application we're writing for 49st I finally found a solution.

However, this morning I found that the same code that was working yesterday showed some nasty error message. What now?

MacWorld 2008: Is Apple About To Launch A New Ultraportable?

Rumours onlike talk about Apple announcing a new ultraportable tomorrow at MacWorld 2008. Some have even guessed the new product could include Air as part of its name, maybe because of the There's something in the air message at Apple's website.

Looking forward to Steve Jobs' keynote in a few hours to decide if I start my gizmos wishlist for 2008 with an Apple toy.

Confirmed! It's the MacBook Air starting at US$ 1799.