Goran, Wimbledon, 2001, last game
Posted in Culture, VideoTags: goran, Video
The project I'm working on was crying out for autofill boxes etc all over the place. jQuery has a very nifty autocomplete plugin, but that works by building urls using a '?' followed by values -- a GET instead of a POST. Hunting around, I found this - a modified autocomplete plugin by Dylan Verheul.
In the beautifully written source code I could easily make out where he was building the URL. All I had to do was change the separator from a question mark or an ampersand to a slash (/). And the function was ready to rock and roll.
UPDATE: I played around with the plugin a little more. Here's what I wanted it to be able to do -- when I type and find in a value, let's say a city's name, on select I wanted to store the city id in a hidden input field. So if the hidden input field's value stays 0 I know there's a new city I need to add to my DB. (I throw in a couple of checks in the backend, but that's the subject matter of another post.)
So, now I've created an option called elementID -- which basically passes the ID of a DOM element to the function you call via onSelectItem in the parameters. Basically, you can keep a generic selectItem function for most autocomplete input boxes.
Have updated the JS/Controller/Plugin code:
Posted in Culture, TechnologyWhen I was a reporter, there was a tremendous amount of emphasis on being fair and balanced, and not letting one's personal opinions get in the way of reporting the news. I figured that the only way to do to that was to be conscious of one's biases, and ergo, consciously avoid letting one's personal opinions get in the way. But, that was then.
Fox News went and buried the whole fair and balanced thing a while back. Today, a video I found on the Huffington Post that had me cringing in disbelief ... and that took care of every other notion I had about reporting.
A reporter from the Times of India just showed the world what role bias plays in the news today. Oh, just watch the video.
Posted in Media, VideoStratpost.com has a wonderful post about a story that appeared in the Jerusalem Post about a defense deal with India that's gone sour for an Israeli Defense company.
Posted in Links, Media, PoliticsA news report published by the Jerusalem Post has blamed the controversy over the $1.4 billion Medium Range Surface to Air Missile (MRSAM) contract awarded to Israel Aerospace Industries (IAI) on Russian and US defense companies, Muslims in India and has speculated on the involvement of Iran as well, in attempting to scuttle the deal.
According to the report, ‘Muslim political parties in India as well as Russian and American defense corporations are suspected of working behind the scenes to torpedo a $1.4 billion deal signed recently between Israel Aerospace Industries and India for the development of a missile defense system, Israeli defense establishment officials said on Wednesday.’
Try it for yourself ... me and my wife have been having a great time with it since @prasnation's tweet pointed us to it.
Posted in Culture, Media, Technology, Video
MUTO a wall-painted animation by BLU from blu on Vimeo.
via SoulPancake
Posted in Culture, VideoI've been trying to explain away my absence from the interscape by citing work (lots of work, even). But that's only half the story. Most of the work has involved making choices that will affect my life, and the nature of my work over the next couple of years (perhaps, longer). So, I decided to explain some of those choices, today I'll focus on technology.
I'm working on an enterprise app. For the moment, the team comprises me, myself and a domain expert who can't code to save his life [for eg. $.hanging_from_cliff( function() { fly(); }); ] ... It's a web app and should eventually (fingers crossed) morph into a SAAS. The team of developers will also grow over the next few months. And the app needs to be able to scale (vertically, horizontally, and morphologically).
The first thing I had to do was figure out what frameworks I would use. The last time I was coding apps, I was using C/C++, Java, Clipper, Cobol, ASP (no .net, just ASP) ... we're talking turn of the century stuff here. The world has changed since then, so I decided to ask people I know who've helped change the world. Three choices came up:
I was clear on a couple of things: I am a huge fan of MVC code. Basically, that means I love to separate code into three parts: the bit that handles interaction with databases (the model), the bit that handles all the program or business logic (the controller), and the bit that shows stuff to people (the view). I like these bits to be separate enough so that I can make changes to one without needing to make changes to any of the others. Drupal fell by the wayside very quickly because I found that while it calls itself a content management framework, it isn't an app dev framwork and there was no MVC to speak of.
So, that left me with Zend and CodeIgniter. Which is when Ruby on Rails decided to put in an appearence thanks to someone who makes sense on and off (I think it has to do with the phase of the moon, but further research is needed here.) Now RoR is very attractive. She's a girl, with all these curves in just the right places. But I did not want to invest time in learning a new language, even one as intuitive and English-like as Ruby (Funny that someone in Japan came up with it). I was super comfortable with PHP, and decided I wanted something that worked like the Rails framework.
Now, I'm not very fond of templating engines, I'd much rather just write my views in HTML/CSS/Javaquery then be forced to used a templating engine to show stuff. I'm also old fashioned in the way I view resources (last century hangover). So, I really wanted something with a small footprint that let me be me.
Shyam turned out to be right .. this is not something new, he usually is right, but after a point, it is a bit galling : The framework that I liked best was CodeIgniter, a throwaway suggestion from him during a phone conversation that he will now promise to remember, and pretend to have put deep thought into.
I quickly found a couple of libraries that helped me write better code. Most notably, DataMapper, an ORM implementation for CodeIgniter. Basically, it takes all the headache out of relational database models.
For eg.
// Person Model
class Person extends DataMapper() {
$has_many = array('address', 'phone');
function Person() {
parent::DataMapper();
}
}
// Address Model
class Address extends DataMapper() {
$has_one = array('person');
function Address() {
parent::DataMapper();
}
}
// Phone Model
class Phone extends DataMapper() {
$has_one = array('person');
function Phone() {
parent::DataMapper();
}
}
That's all the code I needed to write to create three models with one to many relationships defined, and a host of functions that let me perform all the CRUD I want to do. Pretty sweet, eh
And yes, it is a lot like Rails.
With the backend framework out of the way, I turned to the frontend. Since I like pretty frontends, and care about User Interfaces, and get hot and bothered when an interface isn't as efficient as I can make it, this was a fundamentally important choice. My options:
I played around with Prototype / Scriptaculous, before recoding all my views to work with JQuery. Mostly because JQuery had far better documentation that I could find, and was far, far lighter. Again, my whole last century psychosis had some role to play in this. And, again, Shyam was right. Bugger.
So, here's where we're at: App, codename Candy, is progressing well, chugging along at a merry pace, with all the repetitive drudge coding taken care of by fantastic, lean frameworks that I like more with every passing day.
Posted in Personal News, TechnologyI'm being very sarcastic with that headline.
So, here's how Kotak "inspires" staff to achieve targets: they give out medals in a public ceremony to various people for having achieved their sales targets the moment the targets are defined. Two months later, they hold another public ceremony, where they take back the medals from people who haven't achieved those targets.
The last time they did this (that I know of) was during the November and December period. Oh, and they hire an auditorium to humiliate employees.
I don't know if this is standard practice amongst financial institutions, but I do know that Kotak seems to follow this practice with a great deal of enthusiasm.
I don't know about you, but I find this sort of behaviour appalling. And I'm talking through my wallet here: Kotak is never going to get any business from me.
Posted in Business, Fiscal BarbequeLessons in Journalism, Part I.
Business journalists everywhere, and especially in CNBC/UTVi/ETTV need to watch this three part interview:
Jim Cramer Unedited Interview Pt. 1
Jim Cramer Unedited Interview Pt. 2
Jim Cramer Unedited Interview Pt. 3