Android Development: How the Spinner and PopupWindow finally clarify my misconception about Context

In my recent development, I have received a requirement to put Spinner inside a PopupWindow. I expected an easy task. When the popupwindow is shown, there was no error whatsoever. But whenever I click on the spinner, the program F.O.R.C.E.D C.L.O.S.E.D. (On a side note, Forced Close should be replaced by a swear word). The logcat gives a BadTokenException and asked if my Activity is still running. You must be kidding me, I was calling the Spinner when the Activity is running, and of course it is in the UI thread. I am not able to pinpoint the problem, and Google doesn’t really help much this time. I was forced to use my brain at last. I was excited.

Read More

PHP is English

Recently many software gurus(e.g.: [Jeff Atwood](http://www.codinghorror.com/blog/2012/06/the-php-singularity.html & Fabien Potencier) whom I admired debates how good/bad PHP is. Some criticized, with strong technical reasons that PHP should be cast to hell and leave them rot like what we did to COBOL. I wholeheartedly agree with them. PHP is simply not suitable for large projects. My experience with plain PHP, Wordpress and Drupal makes me want to strangle myself over and over.

Read More

Gotcha in CodeIgniter

After 2 months of hustling, the development phase of my first “big” project is over. In this 2 months, I had to spend half of my brain debugging and implementing new features in a now defunct version of a group buying site. Another half was working on the new version of it in the same time. The old version is simply a “tar pit” - spaghetti of PHP HTML MySQL CSS Javascript soup is taking me back to the “good old days”. I simply cannot understand why someone in the 2012 get stuck in the 2001 web development style, I will not allow such non sense in the new version.

Read More

My follow-up on dynamic typing

In my previous post, I’ve mentioned that it is up to the implementation to define whether the function will behave properly. Another issue that I can came out with is the readability of your code to average Gilbert. I have once written a function, which came back to bite my team. The function briefly return whether the user is activated or not, and return NULL when the user is not found.

Read More