Skip to main content

Posts

How to get a frequency distribution table in MySQL

Sometimes when we are searching for something, we tend to look too deep and with wrong keywords. Forget about SQL procedures, the REPEAT() function and setting variables. If you want a result set with two columns, one the ID, and the other a frequency count, then use this: SELECT id, COUNT( someValue ) AS frequency FROM tableName GROUP BY someValue; Your welcome!

A useful shortcut in PHP 5

Recently I started using a shortcut for my $_GET variables in PHP 5. It seems that instead of doing the following: <?php     $page = $_GET['page'];     $article = $_GET['article']; ?> There is an easier way where all the $_GET variables can be assigned automatically.

Dynamically changing the background color in Adobe Flex Builder

Recently I have been messing around a bit with Flex 3.0. In one particular occasion I was wondering what would be the easiest way to let a user change the background of a Flex based website. The project consisted of just a standard color picker component (just to illustrate the point). Basically what you want to do is capture the selected color when a particular event is being fired, and use this information to dynamically change the background color of the Flex application.