Category: Technology

This passage I came across recently in Yeats Is Dead, struck a chord:

“I think books are wonderful”, the woman said, evidently bent on conversation. “If they had never been invented and somebody thought of them now, they would be the greatest thing ever. I can’t think of anything that has given so much happiness to humanity. Or could do, except maybe a pill to make us live longer. Books are so simple. No batteries, no wires, no earphones. Absolutely silent, don’t interfere with anything else, you can take them anywhere with you, into bed, into the bath. And they can’t be broken. You can lie on them, sit on them, prop the door or the window sash open with them and you still can’t damage them.”

Add the ability to buy them second hand, and this is precisely why I think books will win. Nothing comes remotely close to the simplicity of a book.

Two Worlds

Jul 28, 2009

The media’s portrayal of the iPhone App Store in the US has been all about the triumph of the individual developer: how your regular Joe moonlighted on an iPhone app and found himself richer by a few thousand dollars. For example, see this Wired article.

I saw a similar attempt in India by Mint recently, and here it is all about how software outsourcing companies keep a steady trickle of revenue alive amidst the downturn – thanks to the iPhone App Store. The focus is not the individual but the organization. It’s about software factories. It makes me sick.

The article is here. Don’t miss a certain Mr. Palak Biswas posing with his prized possession.

A CAPTCHA is usually a severely contorted image of random characters that you are supposed to key in correctly to be able to get into a website. The idea is to thwart automated scripts/programs – the sort of stuff that spammers (among other bad guys) use to create hundreds of fake accounts for spamming. Now as optical character recognition (OCR) becomes sophisticated a simple image or one that is not significantly distorted, does not present a sufficient challenge to an OCR program. As a result we are seeing increasingly more distorted/noisy CAPTCHAs that are beginning to push the limits of even human readability – like the one below from Yahoo India’s e-mail sign-up page:

Yahoo Captcha

And then there are CAPTCHAs that just want to mock you, like the one blogger so affectionately threw at me this morning:

Blogger Captcha aka 'Visual Verification'

Since CAPTCHAs cannot be read by screen readers, a lot of sites also include an audio version of the CAPTCHA. I hadn’t heard one till recently (I happened to click on the accessibility icon accidentally), but what I heard was stuff of nightmares! Turn down your speakers a bit this stuff is not pleasant:

Obviously, the intent here is to stop sound recognition programs in their tracks by introducing a lot of background noise. The overall effect however brings images of prisons, misery and torture to one’s mind. (Or may be I watched one war movie too many this year!)

And then there is this minor matter of spammers with an army of CAPTCHA cracking humans at their disposal. Or may be that explains why CAPTCHAs are becoming increasingly painful even for legitimate users.

It’s been close to 9 months since I picked my 24″ iMac. Despite the initial scare (yes it was bizarre!), things have turned out to be great. Being a dyed-in-the-wool Windows user, I did tinker with Windows Vista inside Bootcamp but there was something alluring about Leopard (aka Mac OS 10.5) which kept pulling me back. Having mastered the OS for daily tasks, and having overcome the muscle memory of 8+12+ (I am older than I thought) years of Windows usage (from Windows 3.11 all the way to Windows Vista), I decided to tackle the next frontier – developing for the Mac.

After several attempts at using cross-platform frameworks (wxWidgets, Mono, GTK) with unsatisfactory results, I started exploring the native Mac development platform. The biggest hurdle here was Objective C. For someone who is coming from a C#/VB.NET/C++ background (with good exposure to PERL/Javascript thrown in), the syntax stumped me. Then I came across Aaron Hillegass’s brilliant Cocoa Programming book some 3 weeks ago, and it has been a smooth sailing ever since. It reminds me so much of my days in college spent learning Win32 and MFC programming.

Today I came up with a small app which I thought I’d share. This builds on the SpeakLine example presented in Aaron’s book. Instead of using a Text Field to take a string from the user, it uses the sample text which comes with each voice profile on the Mac, and says it when you click the Speak button:

My first native Mac app!

The sample text for a lot of voices is hilarious (just like the voices themselves). It is one of the many small things that add up towards making Macs a fun, playful platform.

p.s. The app, the complete XCode 3.1 project.

I recently had to install Moonlight (Silverlight on Linux) on Ubuntu 7.04. The Moonlight plug-in for Firefox is not available as a binary package and needs to be compiled from source. Moonlight has dependencies on Mono. The instructions on the Moonlight project page are not sufficient for a casual Linux user like me. Fortunately, this thread at the mono-olive group came to my rescue (thanks Chris!). I am reproducing its contents with minor changes and slightly more detailed instructions:

The instructions assume that you have a clean installation of Ubuntu 7.04 up and running on your machine. Fire up Terminal. First we’ll update the Ubuntu package list and install Subversion on our machine. The commands to accomplish this require admin privileges and we’ll be using sudo to execute them. Unlike a lot of other Linux distributions, Ubuntu doesn’t prompt you to create a root account during installation. When sudo prompts you for a password, just key-in the password of the account that you’ve used for logging into your current session.

sudo apt-get update
sudo apt-get install subversion

If you are attempting this at work, chances are you are behind a proxy. In which case apt-get will give you errors. Use the following command to indicate your proxy server and type the above commands again.

export http_proxy=http://YourProxyName:Port
sudo apt-get update
sudo apt-get install subversion

We’ll now create a folder for Mono source and pull down the required bits.

mkdir mono
cd mono
svn co svn://anonsvn.mono-project.com/source/trunk/mcs
svn co svn://anonsvn.mono-project.com/source/trunk/mono
svn co svn://anonsvn.mono-project.com/source/trunk/gtk-sharp
svn co svn://anonsvn.mono-project.com/source/trunk/gnome-sharp
svn co svn://anonsvn.mono-project.com/source/trunk/olive
svn co svn://anonsvn.mono-project.com/source/trunk/moon
svn co svn://anonsvn.mono-project.com/source/trunk/monodoc

Again, if you are behind a proxy, things will need to be done a little differently. The above commands would have given you errors. Go to the .subversion folder under your home directory open the file called “servers”.

cd ~/.subversion
vi servers

If you are from the Windows world and don’t know how to use vi, use gedit:

gedit servers

Scroll down to the end of the file, and add the following lines. Save and exit your text editor.

http-proxy-host  = sinproxy
http-proxy-port =  80

We’ll also need to re-run the svn commands. Notice that this time we’ll use the http:// prefix instead of svn://.

svn co http://anonsvn.mono-project.com/source/trunk/mcs
svn co http://anonsvn.mono-project.com/source/trunk/mono
svn co http://anonsvn.mono-project.com/source/trunk/gtk-sharp
svn co http://anonsvn.mono-project.com/source/trunk/gnome-sharp
svn co http://anonsvn.mono-project.com/source/trunk/olive
svn co http://anonsvn.mono-project.com/source/trunk/moon
svn co http://anonsvn.mono-project.com/source/trunk/monodoc

We’ll use apt-get again to install dependencies and tools required to build Mono and Moonlight.

sudo apt-get install libavcodec0d libavformat0d libgtk2.0-dev libnspr-dev firefox-dev libavcodec-dev libavformat-dev libasound2-dev librsvg2-dev
sudo apt-get install autoconf automake libtool build-essential bison

One of the dependencies required for Moonlight to build (libswscale-dev), is not available for Ubuntu 7.04 but is available from the upcoming 7.10 release. We’ll use a tool called prevu to backport the package’s 7.10 version to our present 7.04 installaiton. First, we’ll need to install prevu itself.

sudo apt-get install prevu

Next we setup the prevu environment. This step requires a few hundred megs of space under /var, and takes a while to finish.

sudo prevu-init

We now need to instruct prevu to pick the libswscale-dev package from the 7.10 repositories. Go to /etc/apt and edit the sources.list file.

cd /etc/apt
sudo vi sources.list

Add the following line right at the end of this file and save it.

deb-src http://us.archive.ubuntu.com/ubuntu gutsy main universe restricted multiverse

Next, we retrieve and build libswscale-dev.

sudo apt-get update
prevu libswscale-dev

The step above will again take a while to finish. If all goes well, you’ll have a bunch of .deb packages under /var/cache/prevu/feisty-debs that can be installed. Ignore any errors/warnings about being unable to install ffmpeg.

cd /var/cache/prevu/feisty-debs
sudo dpkg -i *.deb

We are a step or two short of being able to build Mono and Moonlight. To build Mono we need a working copy of the Mono runtime and the Mono C# compiler (mcs).

cd ~
sudo apt-get install mono-mcs

You might get some errors in the step above about missing dependencies. The following command should install the dependencies.

sudo apt-get -f install
sudo apt-get install mono-mcs

We also need to patch the Mono source for Moonlight to work. Browse to: http://tirania.org/tmp/mono-delegate-appdomain-patch using Firefox, select everything and save it to a text file (call it mono-delegate-appdomain-patch) in the mono/mono/mono under your home directory. In case you are wondering about the three mono folders – the first one was created by you, the second one got created when you retrieved the mono branch using svn and the third one came along with the mono source. Let’s switch back to the terminal window and apply the patch that we just saved.

cd ~/mono/mono/mono
patch -p0 < mono-delegate-appdomain-patch
cd ..

We are now ready to build Mono and co.

./autogen.sh --prefix=/usr --with-moonlight=yes
make
sudo apt-get remove mono-mcs
sudo apt-get autoremove
sudo make install
cd ../olive
./configure --prefix=/usr
make
sudo make install
cd gtk-sharp
./boostrap-2.10 --prefix=/usr
make
sudo make install
cd ../monodoc
./autogen.sh --prefix=/usr
make
make install
cd ../gnome-sharp
./bootstrap-2.16 --prefix=/usr
make
sudo make install
cd ../moon
./autogen.sh --prefix=/usr
make
sudo make install

This builds Mono and the Moonlight Firefox plug-in. We install it as follows.

sudo cp *.so moonlight.exe /usr/lib/mozilla-firefox/plugins
sudo ln -s /usr/lib/mono /usr/lib/mono/3.0

Launch Firefox and type about:plugins into the address bar. The Moonlight plugin will be listed on top (on my build it was called Silverlight). Visit any of the samples at the Silverlight website to check your installation or take the Silverlight Airlines demo for a spin!