Skip to main content

Posts

Photo got published in Kumudam magazine

I'm extremely surprised to find that the photo I took in Dakshina Chitra and later uploaded to Wikipedia got published in Kumudam magazine (dated July 1, 2009).

How to interview a candidate?

How to interview a candidate/programmer -- Version 0.0.1 Note : It's based on my process of short-listing candidates/programmers and experiences so far in selecting and building my great team. I'll expand it whenever I get time and will amend versions. Not many of you were wise in the way the world judges wisdom. Not many of you had great influence. Not many of you came from important families. But God chose the foolish things of the world to shame the wise, and he chose the weak things of the world to shame the strong. - St. Paul Core facts Interviewing is a serious effort and interviewing has great career prospects. Take it as a serious profession. Interviewer/interviewee – no one is genius. You cannot find a person who knows everything. You're not a foreteller and so you cannot identify people by appearance. That's the need for the interview. No interview question is right or wrong. You need to take good decision based on many factors—not just...

jQuery.favicon - jQuery plugin for adding favicons next to the links

It's easy to add little favicons next to all or external links using CSS's background properties: a[href ^="http://jquery.com"] { background: url(http://jquery.com/favicon.ico) center right no-repeat; padding-right: 16px; } But, to automate that for all links in a page, I wrote a nifty jQuery plugin-- favicon (posted to jQuery group). Side note I don't know of anyway to parse the domain name of a link using JavaScript and so thought of using RFC compliant regexp and had to write a PHP helper to import regexp in JavaScript: <?php // Generate JavaScript regexp for matching URL for getting host part // set user agent; otherwise getting 403 ini_set('user_agent', 'Mozilla/5.0 (Windows; U; Windows NT5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11'); echo str_replace(array( "\n", // remove newline '/', // escape / to \/ '?:' // remove--we really need mach ) , array( '', '\/...

Sad demise of Suresh Kumar

When my spirit was high in pain, I wrote "If there is a God, he must be a sadist!" and also added that in my Usenet sig-block. God proved to be cruel again, by taking Suresh Kumar, a great hacker, a good human being, an inspiring Team Leader who worked with me on February 25, 2009. Suresh joined my team in October 2008 and have shown his leadership skills immediately around November 2008 and started building his own team. His knowledge and involvement in CSSilize.com, an online PSD to XHTML conversion website that we're developing was a great asset. It's a great shock that a low BP or any unknown disease can kill him at the very young age. We have had a discussion on February 24th but a bad news came the next day--all to prove absolute vanity in life--and to prove "We live to die; we die to live" May his soul rest in peace.

Detect identical & black frame in video with ffmpeg?

Thumbnail creation is a very needed feature for any social networking site. Obviously, ffmpeg is the ideal solution for generating thumbnail. Problem-1: Detecting identical thumbnails Fortunately, we have a good solution-- libpuzzle . It would be ideal to have a filter in ffmpeg for that. Problem-2: Detecting black/dark frames I'm still keenly looking for a solution tied up with ffmpeg. When Google turned no help, Heleena (my wife) solved it by calculating average luminance value of the frame and ignoring the frames based on certain preset threshold value--which worked better at that time.

Converting PSD with PHP/ImageMagick

After seeing feature rich options in Imagick PECL extension at Mikko Koppanen 's (the author) website and also impressed with ImageMagick 's features, I have decided to use it for the PSD to XHTML conversion website that I'm architecting and managing. Since, the team wants programming help for converting PSD images, I have tried it (documentation is sparse on PSD handling) Converting PSD to PNG/JPEG/etc Note that, flattenImages() is needed for layered/multi-page PSD file. <?php $im = new Imagick('test.psd'); $im->flattenImages(); $im->setImageFormat('png'); $im->writeImage('test.png'); ?> Extracting PSD layers One by one <?php $im = new Imagick('test.psd'); $im->setImageFormat('png'); for ($i = 0, $num_layers = $im->getNumberImages(); $i $im->setImageIndex($i); $im->writeImage('layer' . $i . '.png'); } ?> Note that, there is a better version below In a single call with writeIm...

CakePHP security issue - even in thechaw.com (written by core dev)

CakePHP security issue Recently I have stumbled upon thechaw.com --written by CakePHP core dev and developed in CakePHP. I just wanted to check if they have fixed the old security issue in CakePHP and found that the issue is still open. Proof of concept CakePHP memory error In another time, found a famous memory error even in bakery.cakephp.org Bottom line CakePHP is open source and so you can fix these issues by yourself

Save American College, Madurai

This post was written in 2008 and outdated now. For update, please check Save American College, Madurai (Update 2011) Update (2011-01-16) : Save American College, Madurai (Update 2011) I'm highly privileged to have 3 degrees (B.Sc. (Spl. Physics), PGDCA and MCA) from The American College, Madurai, South India . Unlike other "commercial" colleges, American College has given room for poor students and uplifted them. And unlike other "elite" colleges who'd give seat only for "intellectuals", American College has produced geniuses. In the recent months, the saddening thing is that the college is under divide (Principal Vs. Bishop). Here is the email I sent to alumnae lately informing about the informations that I received about the developments: Update (2011-01-16) : Save American College, Madurai (Update 2011) All: I was thinking that the " Save American College " campaign was a FUD . But, when I tried to understand the problem through my...

Rasmus Lerdorf's humbled LinkedIn profile

I recently stumbled upon Rasmus Lerdorf 's (creator of PHP) profile in LinkedIn. His profile humbly reads "Developer at PHP". On the other side, I also stumbled upon John Resig 's (creator of jQuery) profile in LinkedIn. His profile reads "Creator, Lead Developer at jQuery JavaScript Library". I'm really surprised by Rasmus Lerdorf's humbleness which reminds me of Dr. Dennis Ritchie's (creator of C) humble email to me. Long live Rasmus Lerdorf and his humbleness.

Solved: Safari Flash full screen issue

Some common problems when trying to use Flash video embed code (e.g., YouTube like embed code) 1. When using lightbox on the page, it's getting hidden behind the Flash video player Solution: Add wmode="transparent" to the embed tag 2. On IE7, getting "click to activate" Solution: Inject the embed code through JavaScript. (Useful libraries: jQuery Flash Plugin , SWFObject ) 3. XHTML validation issue Solution: Use unobtrusive JavaScript embedding. (Useful libraries: jQuery Flash Plugin , SWFObject ) 4. On Safari the full screen doesn't work -- even if we add allowfullscreen="true" (this is the issue I faced lately and google wasn't helpful). In all other browsers, it works fine. Solution: Add type="application/x-shockwave-flash" to the embed tag

Problems with CakePHP - follow-up

Some people have responded including the Datepicker fame Marc Grabanski . So, this follow-up... First of all, I was not ranting nor complaining; I've just blogged/documented my experience. The common problem most of the people pointed out are that it scales for addons.mozilla.com. Those who have accessed their source code can understand that they've done lot of things and also the site is not database-intensive. You should really create a real database-intensive website to understand what I mean. The other point that been pointed out is about open source and community. Lot of people may not be knowing that it's 2 people pushing it and don't want others to be credited . The generic model or dynamic model idea was originally been from grigri and Marcel . It's hard to be called as open source as only few and sycophants are driving it's direction (I'm not talking about svn access) So, here are my humble checklist before you start shouting at me Did you read a...

Open source PHP frameworks and problems

I was using CakePHP for sometime and proposed CakePlus , another UIMS toolkit on the top of CakePHP but also altering some problematic core of it. The thread should explain the outcome of the post. And, then I noted Akelos framework has most of the things built in. Issues with frameworks esp. CakePHP Scalability not a priority - Developers aren't aware that we can't throw more and more hardware Excessive use of regular expressions Evangelist isn't aware that the framework throws many queries unnecessarily More memory consumption - 100M would never be enough for a simple project Poor coding standards and practices - Prolong use of extract() often leads to more memory consumption Can't use the native approaches or baked codes. The override approach always lead to hard to debug codes Poor architected codes and no clear defined approaches. People belong to the cult drives the direction and often throws unprofiled codes. No native provision to share codes between M-V-C and...

Working with Jeremy Zawodny, Alan Knowles, Cal Henderson

My life and career are full of surprise... I wanted to work in film direction Wanted to work in AT&T Bell Labs with Dr. Dennis M. Ritchie (creator of C) Wanted to work in Borland with the great developers of Delphi But, none of these dreams came true. And, after 6 years of my career into Web Application Development, I informed the company about my humble desire to work with the great minds I came to know through internet--to see if the company can offer employment for them: Jeremy Zawodny , Alan Knowles , Cal Henderson . Peter (who is actually from UK), who approached them updated me that Jeremy cannot join the company due to his marriage and Alan feels that the company may not offer the international salary. And, my dreams are just dreams! If anyone wants to work with me, ping me through LinkedIn

Track previous link of a site in PHP

I just spotted through Google that Raj Shekhar has quoted my post to comp.lang.php in his Blog Ideas page: mr_burns wrote: > Is it possible to get the previous url. For example, if I am on page > page01.php - and I then click to - page02.php - from page02.php, can > use script to determine that I have come from page01.php? It doesnt > have to be the entire url, even just the file name. Cheers Add this line in the beginning of every script or possibly using a global-common include file say config.php output_add_rewrite_var('referer', htmlspecialchars($_SERVER['PHP_SELF']));

www.php.net online manual user notes contributions

Sometime ago I had lot of interest in contributing to the www.php.net online manual's notes. Thought lot of them are deleted now and not even relevant now, I'd thought of archiving them for my own reference: http://www.php.net/ref.pdf#32797 Date: 7 Jun 2003 06:42:11 -0000 If you want to create PDF without using PDFlib library, you may try FPDF ( http://www.fpdf.org ). If you want to know, how to use FPDF in PHP scripts, you can look at the source code of phpMyAdmin as phyMyAdmin uses this FPDF. ( http://www.phpmyadmin.net ) http://www.php.net/ref.array#32969 Date: 12 Jun 2003 11:32:58 -0000 If you want to remove a particular element from the array without loosing the keys, you can use the following function: function RemoveArrayElement($arr, $element) { if (($key=array_search($element, $arr))!==false) unset($arr[$key]); return( $arr ); }/*---------RemoveArrayElement()----------*/ Example: $arr = array("a","b","c","f","x...

"A to Z of C" book turns 5

A to Z of C , the DOS/Turbo C programming book written by K. Joseph Wesley and myself turned 5 on August 1. Initially, we felt bad for spending our time in writing a book that were rejected and deceived by publishers. Now we get quite reasonable appreciations from people around the world--even though it's having technical and grammatical errors. Long live the internet publishing! Probably a time for "A to Z of PHP" ?

I'm Zend (PHP 5) Certified Engineer:-)

As of January 13, 2007, I'm ZCE/ Zend Certified Engineer (PHP 5)