
Optional Parameters - Extending Existing Functions
Apr 14th
Both PHP and javascript allow optional parameters and variable arguments.
PHP
- func_get_args() - allows you to get the arguments for a function. Great if you need a variable number of arguments, perhaps for something like sprintf. http://us3.php.net/manual/en/function.func-get-args.php
- Default arguments - allows you to set a default value for an argument. This also effectively makes the argument optional, since if it isn’t passed, the function won’t crash. Important if you have to add something to a function without disrupting existing code that calls it. http://us3.php.net/manual/en/functions.arguments.php#functions.arguments.default
javascript
- The arguments sent to a function in javascript can be accessed as function_name.arguments. To find out how many arguments were passed, you can use function_name.arguments.length. http://www.w3schools.com/jS/js_functions.asp
- Implementing default arguments with javascript can be done by using the arguments array.

Multi-Dimensional Array Sorts for PHP
Apr 2nd
To sort a multi-dimensional array in PHP, you can use usort, like so:
usort($aArray,"cmp_func");
function cmp_func($a,$b)
{
return strcasecmp($a['x'],$b['x']);
}

Finishing Projects as Fast as Possible
Mar 30th
All tasks have a certain minimum amount of time to complete, and no amount of persuasion, management, pressure, technology, or people can change that.
Reducing development tasks to the barest minimum is to define completion as delivery of a reasonably stable component. Unit testing is simply not done. The QA department, or another person or organization becomes responsible for the vast majority of testing.
Automated testing tools can greatly speed the cycle of delivery, defect identification, and verification. This is one way to speed a project along.
Although it is likely there will be a lot of bugs, if the software has a good architecture, most will resolve quickly.
This approach does require experienced engineers, because in order to build good code fast, people need a wide skill set, good tools, and plenty of self-discipline.

Double Your Icon Set
Mar 12th
I use an icon set that has beautiful, full color icons (http://everaldo.com/crystal_project). However, sometimes a grayscale version of an icon can be used as a subtle control, or to allow other icons and page elements to appear more prominently.
ImageMagick can be used to convert full color icons into beautiful greyscale icons, very quickly.
convert ok.png -colorspace Gray grey-ok.png
Original image:
Greyscale image:

dojox Grid Select Indicator Demo
Mar 7th
Demonstration of a selection indicator for a dojox grid.
Notes:
- Grey checkmark serves as select all/deselect all, if no rows are selected, clicking on the checkmark will select them all, if any rows are selected, all will be deselected.
- Row selector uses a green checkmark to indicate selection. Additional styling can be applied.
- Add and remove rows work, but no save is performed.
- Icons from Crystal Project (http://everaldo.com/crystal)
* Demonstration is for the design, not operation of grid.