Thursday, January 10, 2013

Dear diary

Enjoyed a lot programming with Yii this week. I'm really amazed at how the modelling layer, CActiveRecord, is implemented. With just a few lines, you're up and running. It's like a breath of fresh air. I take back what I said before about missing Symfony's schema descriptions.

I'm already using it on a project and the client's happy with the initial results.

In line with the clean ups I'm doing, I got to play with a couple of Pear modules, too. HTML_AJAX and Pager. Chances are that I won't be using them anytime soon on a project, but the opportunity to see and pick up some styles or ideas makes it worth. Come to think, I have to play yet with the new nifty features of PHP5.3.

Will also be playing with RaphaelJS. I believe it is the best choice for the seating plan project I'll be working on in the near future.

HTML_AJAX tutorial: http://devzone.zend.com/1356/building-ajax-applications-with-php-and-html_ajax/
PEAR::Pager tutorials: http://www.alberton.info/pear_pager_tutorials.html
RaphaelJS introduction: http://net.tutsplus.com/tutorials/javascript-ajax/an-introduction-to-the-raphael-js-library/

Sunday, January 6, 2013

Yii (Yes, it is!)

Recently had time to play around with Yii and just about halfway on its guide. Coming from a Symfony background, hope I can catch on quickly with this framework.

Two years had gone by since the last time I've programmed with Symfony and reading through the Yii's guide make me wonder about the difficulties I encountered during that time on complex requirements. Honestly can't seem to recall any at this point yet.

I love the way guide is written. Many of the sections devote a few sentences or some to explain recommended practices, not just how something is done with the framework. I also think browser-based code generator, Gii, kicks ass. I miss Symfony's ability to generate database tables from schema descriptions and populate them with sample or backup data.

Oh, Yii also claims to be faster against the other popular PHP frameworks.

Yii: http://www.yiiframework.com/

Saturday, December 29, 2012

Haiku

Besides Linux, BeOS was another operating system I fell in love quickly. OpenBeOS was the first open source project I joined way back. Unfortunately, I wasn't able to really contribute and it is still  one of my hopes that I could.

OpenBeOS has come a long way and also it's called Haiku now.

I grabbed the anyboot installer from Haiku's site and immediately proceeded to install on a virtual machine. Oh, the glory days of distro hopping. I have not read the installation guide yet but setup is straightforward, one just have to initialize the hard drive manually.

The installer seemed to hang though on getting to the restart, but everything was running very nicely after a manual restart. It might have something to do with using plain qemu instead of kvm. Using kvm provided a very noticeable boost.


It is very impressive so far.

Finally, I was looking for the old newsletters but took some time to locate copies. They're a good read, the developers were also quite the visionaries on their own right.

Haiku: https://www.haiku-os.org/get-haiku
OpenBeOS Newsletters: http://haikuware.com/directory/start-download/utilities/miscellaneous/my-haiku-newsletters

Thursday, December 27, 2012

Updates

Been mostly busy on projects the last months that I haven't got to play and write anything. Also been through with the church wedding this month.

Merry Christmas.

Had been able to clean up some stuff, like closing off of the minix experiment. Will be sifting through my old wordpress blogs and articles still relevant could end up here.

Oh, and noticed there's something wrong with the twitter update gadget.

Linux-0 #3: Minix Dead End

Using the last version on the Minix 1.x series proved to be dead end. Getting the old gcc to work needed patching the system with a set compatible only to 1.5.

Will figure out another way.

Monday, September 10, 2012

Parents, Non-public Methods and Eyes

Only now have I developed a greater appreciation for parent classes and private/protected methods. Besides hiding implementation details and reusing logic, they turn out to be very more useful than just that.

Last week I was updating a module and I was really having a rough time following the logic. I was troubled and stopped for a moment wondering why I'm having difficulty understanding code I myself had written just days before. Then I had an epiphany.

I loathed breaking down functions (or procedures if you will) in the past. I wanted everything to be in one place as much as possible, believing that avoiding those extra calls will make some huge difference in execution performance.

I, too, have tried many styles and methodologies over the years of programming and took some ideas that generally worked out for me. However, there are three particularly interesting ideas I've read before but never gave much thought:


  1. In Perl, you have lots of shortcuts that allows you to write programs that don't take up more than a screenful of lines
  2. If you're moving your eyes too much when reading a line of code, you would do well to break that and rewrite than line
  3. A person's eyes look up when that person is engaged logically, and you can also tell whether he/she is mental constructing or recalling depending on which side the eyes lean

OK, the third one isn't really a programming thing but something I picked up in Nursing.

So there I was moving my eyes all over the screen left and right, scrolling back and forward, looking up then back to the screen. Aside from the activity being stressful to the eye muscles, it was also stressing my thought processes. No wonder I was having difficulty 'visualizing the process', or going with the flow as one would say.

I then proceeded to re-factoring the module with the following thoughts:


  1. If a line is lengthy or nearing the edge of the screen, break it up
  2. If a function doesn't fit on your screen, break it up. You can tolerate up to three levels of nesting, more than that you usually need to rethink your approach
  3. When you already have a handful of functions (and class variables) for support purposes, like say for formatting or conversion that aren't needed much to understand what your class strives to do, move them to a base class


When I was done, I had a module that I can read like plain English. I no longer have to scroll back and forth to figure what's being done. Couple with string search, I can quickly locate where a particular problem is. Picking out a bug is easier than before because I don't have too much to look at a time.

Logically, I no longer have to look up a lot.

Saturday, September 1, 2012

Trip and Perl

It had been pretty busy the last few weeks. Never had time for playing around the lab. However, I had fun particularly at our company's team building activity. It was held in Samar, and it is a beautiful place there.



Yup, that's the Coding Avenue team right there in Caluwayan.

It was a good experience, and once again been reminded of my biggest bane... communication. As a child, I was always keeping to myself when hacking a problem and easily irritated when interrupted. Hrrmm, a very unsociable kid back then I was.

Well, what made me knowledgeable also turns out to be a problem. I've been keeping tabs to overcome this problem.

Anyway, through the trip I managed to finish reading 'Learning Perl'. I'll be looking for exercises to pound my Perl senses back, might also look at joining a project too. Here's a nice collection of Perl videos for anyone reading this: https://vimeo.com/channels/perl