MySQL Union is column name and data-type agnostic

I stumbled upon a rare care while working on one of my projects. The data in one of my variables in PHP was being jumbled up. It took an hour of debugging my PHP code till I realized the the … more

Tags: , ,
Posted in lab | 4 Comments
• • •

Greedy Regular Expressions

By default the pattern matching in regular expressions is greedy in nature. The regex engine will try to match the largest string possible for the given expression rather than the first smallest match, which may not be desired behavior every … more

Tags: , ,
Posted in lab | Leave a comment
• • •

Base62: Convert a number to base 62 for short URLs in PHP

Base62 is a PHP class to convert a number to and from any base between 2-62. There is no native function in PHP to convert upto base 62. The native function base_convert converts numbers upto base 36, ie. using 0-9 … more

Tags: , , , ,
Posted in lab | 3 Comments
• • •

XML2Array: Convert XML to Array in PHP

XML2Array is a class to convert XML to an array in PHP. It returns an array which can be converted back to XML using the Array2XML class. It can take a string XML as input or an object of type … more

Tags: , , , ,
Posted in lab | 10 Comments
• • •

Array2XML: convert PHP Array to XML (with attributes and CDATA)

Array2XML is a class to convert an array in PHP to XML. It allows you to parse a multidimensional array into XML including attributes unlike other scripts available on the internet. It returns the XML in form of DOMDocument object … more

Tags: , , , ,
Posted in lab | 58 Comments
• • •

Ternary nuances in PHP

Yesterday while working on one of my projects, I came across a weird scenario: a very simple statement written in PHP was not behaving the way it should. Below is the simplified version of the code I was working with: … more

Posted in lab | 1 Comment
• • •

Getting most out of Amazon S3

Amazon S3 is a very useful service. S3, according to the official Amazon Web Services website is Amazon S3 is storage for the Internet. It is designed to make web-scale computing easier for developers. Its a no frills service and … more

Tags: , , ,
Posted in lab | 17 Comments
• • •

Powerpoint / Slideshow Karaoke

Last year while I was at SlideShare.net, me and my friends were thinking of some cool ways to use our API. At the same time we were checking out emails from our users about how they are using sideshows in … more

Tags: , , , ,
Posted in lab | Leave a comment
• • •

At the end of the tunnel… there is Internet

Linux is so cool. Using Linux or Linux tools can give you tiny moments of joy, just like anything built by geeks, like iPhone, Skype etc. Today as I woke up, I found that one of the 12 servers we … more

Tags: , , ,
Posted in lab | 3 Comments
• • •

Aksharabhyas

Aksharabhyas is a interactive game for children to learn Oriya. I made this game for the school Akshara to promote multilingual education among children and to encourage the use of Oriya (Odia) in schools. Download: Aksharabhyas (zip 605kb)

Tags: , , , , ,
Posted in lab | 4 Comments
• • •