Open source in corporates

Last month, my first application went live. I’ve been writing code for 20 years. Not one line of my code has been officially deployed in a corporate. (Loser…) It’s a happy feeling. Someone defined happiness as the intersection of pleasure and meaning. Writing code is pleasurable. Others using it is meaningful. But this post isn’t quite about that. It’s about the hoops I’ve had to jump through to make this happen. I’ve been living in a nightmare since March 2009. That was when I decided that I’d try and get corporates to use open source. March 2009 It began with a pitch to a VC firm. They were looking to build a content management system (CMS). Normally we’d pull together slides that say we’ll deliver the moon. This time, we put together demo based on WordPress’ CMS plugins. The meeting went fabulously well. We said, “Here’s a demo we’ve built for you. Do you like it?” The business lead (Stuart) was drooling and declared that that’s exactly what they wanted. The IT lead (another Stuart) was happy too, but warned the business users: “Just remember: this isn’t how we do development, so don’t get your hopes up that we can deliver stuff like this :-)” Time to make my point. I asked, “What’s your policy on open source software?” The business lead went quiet. “I don’t know,” he finally said. Fair enough. I turned to the IT lead. “Well, we don’t use it as a matter of policy… there are security concerns…” he said. “Which web server do you use?” ”Oh, OK. I see what you mean. We use Apache. So on a case to case basis, we have exceptions. But generally we have security concerns.“ ”Why? Do you believe open source software is more insecure than commercial software?“ He thought about it for a while. “Well… maybe. I don’t know.” We debated this a bit. Then we found the real issue: “It’s just that we don’t have control over the process. We don’t know enough about it to decide.” A couple of weeks later, I tried pitching to a newspaper company. This time, it was our sales team that raised the same question. “But… isn’t open source insecure?” I didn’t even bother pitching any open source stuff to them. But I’d learnt my lessons: ...

Inline form validation

A List Apart’s article on Inline Validation is one of the most informative I’ve read in a while — and it’s backed by solid data. Some useful lessons: Inline validation can reduce form completion time by 40% Use inline validations where the user doesn’t know if they’ll get it wrong (e.g. is a username available?). Don’t use them if user knows the answer (e.g. their name) Validate on blur, not on keypress (it’s distracting, and users can’t multitask) Comments jesse 25 Sep 2009 4:15 pm: maybe u should add some inline validation on your comments form, instead of the wordpress error page?

A flaw in rationality

I found this piece from “The Happiness Hypothesis” pretty interesting: In the 1990s, Damasio found that when certain parts of the orbitofrontal cortex are damaged, patients lose most of their emotional lives. They report that when they ought to feel emotion, they feel nothing, and studies of their autonomic reactions (such as those used in lie detector tests) confirm that they lack the normal flashes of bodily reaction that the rest of us experience when observing scenes of horror or beauty. Yet their reasoning and logical abilities are intact. They perform normally on tests of intelligence and knowledge of social rules and moral principles. ...

IE6 in Corporates

PPK’s State of the Browser – IE Edition mentions one reason why IE6 will probably stay on for a while. Now why do I expect IE6 to stick around while IE7 goes down? The answer is simple: Intranets… many office workers will continue to be condemned to IE6. At work, that is. It’s quite likely that on their private computer at home they run another browser — IE7 or 8, Firefox, or maybe one of the smaller ones. ...

The Bing effect

This graph is the number of referrals Microsoft’s new search engine, Bing, sent to my site over the last few days. Looks like the hype is dying out. Though Bing did leapfrog Yahoo briefly, that lasted just one day.

Round buttons with Python Image Library

After much hunting, I finally settled on Hedger Wang’s simple round CSS links as the most acceptable cross-browser round button implementation. The minified CSS is about 2.5KB, and the syntax is very simple. To make an input button into a round button, just wrap it within a <span class="button">: <span class="button"><input type="submit"></span> … and it’s just as easy to convert a link into a rounded button: <a class="button" href=”/”><span>Home</span></a> It works by using a transparent PNG / GIF that looks like this: ...

Error logging with Google Analytics

A quick note: I blogged earlier about Javascript error logging, saying that you can wrap every function in your code (automatically) in a try{} catch{} block, and log the error message in the catch{} block. I used to write the error message to a Perl script. But now I use Google’s event tracking. var s = []; for (var i in err) s.push(i + "=" + err[i]); s = s.join(" ").substr(0, 500); pageTracker._trackEvent("Error", function_name, s); The good part is that it makes error monitoring a whole lot easier. Within a day of implementing this, I managed to get a couple of errors fixed that had been pending for months. ...

15 years of Dilbert searchable

The Dilbert search index now carries 15 years worth of Dilbert comics — over 5,500 strips typed out. This is mainly due to the contributions of BFMartin (over 6 years worth of strips) and Paul Dorman (over 3 years worth of strips), myself (over 3 years worth of strips) and a long tail of contributors. You can search the strips here. While you can find strips as far back as 1989, you won’t see the images earlier than 2002 because geek.nl (whose images I’m shamelessly hotlinking without permission) only holds images that far back. But once you know the date of the comic (say 1991-02-03), you can visit the Dilbert official site at dilbert.com/1991-02-03/ and see the strip. ...

Short notes

I’m quite busy on a project right now, and don’t get time to write long articles. So for a while, I’m going to stick to short notes on interesting stuff. Peter Bregman has a very interesting piece on Why You Should Encourage Weakness. It boils down to a choice: do you focus on on improving strengths or minimising weaknesses? Conventional performance evaluations focus on the latter. I very strongly support Bregman’s view on this. The weakness isn’t why you hired the person! Unless it’s killing the organisation, just leave them to focus on their strengths. Google Analytics has a fairly interesting API that I hadn’t explored until recently. Picked up [Advanced Web Metrics with Google Analytics](http://www.s-anand.net/amazon-browser.html#advanced web metrics with google analytics) and learnt that you can track outbound clicks, page load times, Javascript events and error logs, almost anything at all using Google Analytics. You can also mirror the logging on your local server using pageTracker._setLocalRemoteServerMode() The whole concept of a Sandbox environment seems to be picking up within Google. There’s a Checkout sandbox, an AJAX API playground, an AdWords sandbox, an AdSense API sandbox, the Mapstraction API sandbox, even an event called Developer Sandbox. (After saying Sandbox 6 times, I feel a bit like Hobbes.)

Organisational amnesia

It’s amazing how much of a dependency there is on individuals writing IT systems. Reminds me of that Dilbert strip: A few weeks ago, I was trying to figure out in what happens when there are multiple promotions. (Our client is a retailer.) I mean, if there’s a phone that costs £100 and there are 2 promotions: 10% off on phones and £10 off on phones. Do you apply the 10% off first and pay £80 or the £10 off and pay £81? ...

Short URLs

With all the discussion around URL shorteners, Diggbar, blocking it, and the rev=canonical proposal, I decided to implement a URL shortening service on this blog with the least effort possible. This probably won’t impact you just yet, but when tools become more popular and sophisticated, it would hopefully eliminate the need for tinyurl, bit.ly, etc. Since the blog runs on WordPress, every post has an ID. The short URL for any post will simply be http://www.s-anand.net/the_ID. For example, http://s-anand.net/17 is a link to post on Ubuntu on a Dell Latitude D420. At 21 characters, it’s roughly the same size as most URL shorteners could make it. ...

Automating PowerPoint with Python

Writing a program to draw or change slides is sometimes easier than doing it manually. To change all fonts on a presentation to Arial, for example, you’d write this Visual Basic macro: Sub Arial() For Each Slide In ActivePresentation.Slides For Each Shape In Slide.Shapes Shape.TextFrame.TextRange.Font.Name = "Arial" Next Next End Sub If you didn’t like Visual Basic, though, you could write the same thing in Python: import win32com.client, sys Application = win32com.client.Dispatch("PowerPoint.Application") Application.Visible = True Presentation = Application.Presentations.Open(sys.argv[1]) for Slide in Presentation.Slides: for Shape in Slide.Shapes: Shape.TextFrame.TextRange.Font.Name = "Arial" Presentation.Save() Application.Quit() Save this as arial.py and type “arial.py some.ppt” to convert some.ppt into Arial. ...

Random quotes generator

The Random Quotes Generator is a simple tool that creates quotes by mixing up words on a web page. The results are often funny, but sometimes surprisingly insightful. Yes, this is the equivalent of a million monkeys typing Shakespeare, except that they’re using the works of Shakespeare as a starting point. And it doesn’t have to be Shakespeare. It could be you or your friends. ...

Motion charts in Excel

Creating motion charts in Excel is a simple four-step process. Get the data in a tabular format with the columns [date, item, x, y, size] Make a “today” cell, and create a lookup table for “today” Make a bubble chart with that lookup table Add a scroll bar and a play button linked to the “today” cell For the impatient, here’s a motion chart spreadsheet that you can tailor to your needs. For the patient and the puzzled, here’s a quick introduction to bubble and motion charts. ...

A R Rahman Hindi songs

By popular demand, here are interludes from 15 Hindi songs of A R Rahman. Can you guess which movie they are from? Don't worry about the spelling. Just spell it like it sounds, and the box will turn green. Comments Guru 13 Mar 2009 5:08 am: 8/15, seems to be the lowest so far … Steve 12 Mar 2009 7:26 pm: Got 15/15 :D Ashwin Krish 13 Mar 2009 2:06 am: got 14/15 stumped by 9. I do not listen to remake songs (as matter of principle)… so if this is a tamil song remade in hindi with different mix, I wold not know Swapnil 12 Mar 2009 12:08 pm: Gr8 quiz…got it all right!Bingo!~ Lavanya 12 Mar 2009 10:18 am: can any one tell me no.9….i COMPLETELY forgot the answer!! gowrishankar 12 Mar 2009 3:42 am: bang 15/15 expecting few more… Jay 11 Mar 2009 10:50 pm: aaarrggh…. 9 is driving me nuts… and 12 is stumping me big time…. the rest i guessed it less than 3 seconds flat… Aravind 12 Mar 2009 2:26 am: good quiz!! :D got 15/15… struggled a lot on 12, though!! Rivjot 12 Mar 2009 8:31 am: 15/15 Yayy!!! I love myself :D Jayram 13 Mar 2009 10:19 pm: Stuck in three songs 9,10 and 12. Overall score 12/15.. Good selection… Srinath 12 Mar 2009 1:13 pm: 15/15.. yay!! :) the answer for 9th is saathiya. mera yaar mila de song :) Rams 13 Mar 2009 5:31 pm: Yay… got all 15! good one dude! subbu 13 Mar 2009 3:40 pm: YEAHHHHHHHHH!!!!!! 15/15 was stuck at 12 but made about 5 guesses to get it right. so , strictly speaking I don;t deserve that one point cuz I dont even know the song. Fameeb 13 Mar 2009 7:22 pm: Ho!!! WoW! What a feeling !! Got 15/15 !! No.12 was a real tough one. It was troubling that am not getting this song. Obviously one of those albums which we heard a lot in Tamil but not in Hindi. Original is always original.Rest of them were all cool. Great Job by Anand. Really enjoyed this one ! Real Good work buddy. Long Live ARR !! bujji 13 Mar 2009 1:16 pm: hey can anyone tell me 11….except tht i got evrythng Ananth 13 Mar 2009 12:06 pm: 12/12… happy… 9 & 12 were thougheee… @Ashwin - nice principle… but this song is not there in tamil though the movie is there :) Vijai Ananth 14 Mar 2009 3:21 am: Way to go…Got all right too…..RAHMANIA MALAYSIA Dheepak Narsimhan 14 Mar 2009 4:41 am: Good quiz… Really gud job n its challenging.Got 15/15. yahooooooo…. Aditya Pai 14 Mar 2009 8:04 am: Yes…. scored 15/15. Good quiz. Chandra 14 Mar 2009 6:14 pm: I dont know answers for the 9th, 10th, and the 12th songs. I know the 10th by-heart but am not able to get it… its stuck at the “tip of the tongue” as they say..! Niranjan 18 Mar 2009 9:54 am: Am puzzled by 12……:-( not getting in any way… rekha 28 Mar 2009 5:23 pm: got stuck on 1o and 12th…….please post answers smriti 7 Apr 2009 12:14 pm: 14/15…..someone please helpme on 12…arrr!!! its eating me up! pls post the answer. arun 15 Apr 2009 8:05 am: 15/15…yipee..feels great rachna 27 Apr 2009 5:35 pm: got 14/15 Nihal 1 May 2009 7:22 am: wa super! fantastic and elastic and plastic Shrikant, Aditi &Meera 15 May 2009 10:57 am: Struggled quite a bit on 9. All three of us. Separately. ;) I guess it falls into the li’l old-songs category now.. And to think, we work for a Bollywood Radio Station!!:D Cheers! Shrikant sridharan 28 May 2009 9:45 am: 12song was very nice and arrahman was the maestro.jai ho Viju 23 Jun 2009 4:25 am: Awesome one.. I still don’t get the 12 though! :( Renuka 7 Jul 2009 11:56 am: 9/15. Bad! Awesome quizzes :-) Anup 4 Nov 2009 11:09 pm: Hurray, I made it. 15 on 15 mate :) Mohan 29 Nov 2009 5:54 pm: 13/15. unable to figure out 7 & :0( Naveen 5 Mar 2010 9:14 am: Finally !!! 11 took me time !!! finally 15/15!!ufff! tulsi priya 5 Dec 2011 4:17 pm: 12/15.. i really cant guess 3, 11 and 12 chethana jadhav 22 Nov 2011 5:57 am: 12/15… !!! took time to guess 10 th.. :( Akila 12 Dec 2012 10:10 am: 14/15…. couldn’t get 9 right.

WordPress themes on Live Writer

One of the reasons I moved to WordPress was the ability to write posts offline, for which I use Windows Live Writer most of the time. The beauty of this is that I can preview the post exactly as it will appear on my site. Nothing else that I know is as WYSIWYG, and it’s very useful to be able to type knowing exactly where each word will be. The only hitch is: if you write your own WordPress theme, Live Writer probably won’t be able to detect your theme — unless you’re an expert theme writer. ...

Hiccups

This morning, I was watching an episode of Finley the Fire Engine in which one of the trucks had hiccups. Reminded me of this Calvin & Hobbes — especially Hobbes’ remark in the second strip. ...

Client side scraping for contacts

By curious coincidence, just a day after my post on client side scraping, I had a chance to demo this to a client. They were making a contacts database. Now, there are two big problems with managing contacts. Getting complete information Keeping it up to date Now, people happy to fill out information about themselves in great detail. If you look at the public profiles on LinkedIn, you’ll find enough and more details about most people. ...

Client side scraping

“Scraping” is extracting content from a website. It’s often used to build something on top of the existing content. For example, I’ve built a site that tracks movies on the IMDb 250 by scraping content. There are libraries that simplify scraping in most languages: Perl: WWW::Mechanize Python: BeautifulSoup Ruby: HPricot PHP: XPath (built-in) Javascript: jQuery on env.js on Rhino But all of these are on the server side. That is, the program scrapes from your machine. Can you write a web page where the viewer’s machine does the scraping? ...

No copyright

I don’t have any copyright declaration on this website. The problem with that is: content is copyrighted by default. As Jeff Atwood indicates, this means that people with experience in such matters won’t copy the content because they have no legal right to use it. Let me clarify: I don’t care what you do with my content. Feel free. You don’t have to ask. You don’t have to attribute it to me. You can change it. You can misquote me. Whatever. ...