Optional Parameters - Extending Existing Functions

Both PHP and javascript allow optional parameters and variable arguments.

PHP

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

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

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

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: Color OK

Greyscale image: Greyscale OK

dojox Grid Select Indicator Demo

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.