Wednesday, November 18, 2009

Removing last character of a string in PHP

Simple :

$string = substr_replace($string ,"",-1);

That is the quickest I have found. Alternately I have done :

$string = substr($string,0,strlen($string)-1);
or
$string = substr($string,0,-1);

Thursday, November 5, 2009

Dvorak Programmer

Programming can take its toll on your hands. That is why I switched to Dvorak Programmer keyboard layout. It is hard to change something you have done your whole life.

I have ordered the layout stickers from eBay, as they were very inexpensive. This is the second major change, the first was switching to Linux as my primary work computer a month ago.

I may be a slow typer now, but I can already tell that Dvorak is superior in design.

Statistics on Dvorak :

  • Fingers are on home row 70% of the time, as qwerty is 30%.
  • Home row can spell 5,000 english words
  • Programmers Dvorak has brackets and operational characters easily accessable with out use of the shift key.

Many more statistics at http://wiki.df.dreamhosters.com/wiki/DvorakHowTo