Programming: “It pays the bills” vs “It satisfies me”

At this point in my career I find myself increasingly frustrated with my day to day work. You see, living in the DMV area (DC-MD-VA), a lot of the jobs available are in government contracting and as many will tell you, those are well paying jobs with a certain level of job security added. For a while I did it and enjoyed it but deep inside i knew that this was not really what i want to be doing for the rest of my life. With things being the way they are, even when trying to switch jobs, it has been easier to do so going from one government contract to the next, with my attempted moves to the private sector being unsuccessful primarily because first my experience is mostly related to government projects, and second, the pay range was below was I was willing to go for. It is not greed on my part, but being married with kids means ” I got mouths to feed man! “(<= in Dave Chappelle’s voice) and obligations I have to tend to and can’t ignore.

This has limited the number of opportunities I considered and from a passing thought in the back of my mind it has grown into a daily contemplation of my future in this business. Over the years, I have gravitated toward doing and enjoying more of the front end work, and it’s a coincidence that the field in itself, especially when it comes to enterprise J2EE development, is becoming a full position in itself as opposed to being lumped in the “Java Developer” category just a couple of years ago (It still is, i just got another inquiry from a recruiter looking for a Java Developer where most of the work is front end related). My frustrations with the projects I have been on mostly stem from the technological limitations of working on government projects which sometimes involves outdated technologies,¬† security limitations and convoluted requirements that end up taking the fun out of the development process. From a design and functionality point of view, these applications lacked the “Wow” factor and being internal applications, even if they were, they were not of the “living portfolio” type of web applications that customers companies want to see when interviewing a developer.

I’ve realized that the type of work I want to be involved with has to be challenging, innovative, and current to what’s getting done today. It has to be a good mix of creative and technological skills that keeps me on my toes and gets the “Cool!” approval from family and friends when presented with it or when explained to, instead of a blank stare and a “Uh?”.

To work towards achieving that goal, I’ve started working on projects of my own, ideas i have been nurturing for a while with the hope of turning it into a startup if it gains traction. It’s a combination web/mobile app developed with CakePHP and Sencha Touch that has helped me turn some of the concepts and techniques I have been reading about and itching to try into actual code and challenged my thinking and skills in a way I had never experienced before. It has forced me to step out of my comfort zone and try new skills I didn’t practice before and it is a continually rewarding experience. I’ve also started working on side projects for friends of mine in order to expand my skill set and keep it sharp and relevant.

Through discussions with others (friends and colleagues) I’ve found out I was not the only suffering from this programmer’s “existential malaise” but some choose to go with the status quo while others like me find other projects to get involved with on the side that keeps them interested and challenged.Some have started their own startups, non-profits and organizations, building on the skills they have and pushing into new directions. Me, I figured I could spend my free time better than racking up “The Feared” accolades on Modern Warfare 2 or shouting angrily at my TV because my players messed up again in Fifa 11.

All this in waiting for that project that will bring the good mix of creativity, innovation, coolness and most of all, “will keep the kids fed, man!”(<= in Dave Chappelle’s voice).

Mysql: Remove Duplicate Values on Creating A New Table

I had a reference table for all of the World Countries that i wanted to extract Currency data from to another new table. I initially use this code which created a new table with 263 records.

CREATE TABLE currencies SELECT tld, currency, currencycode FROM countries ; 

I quickly realized that for the purpose I was creating this table, which is to have a unique list of currency codes, this didn’t work. The 263 rows were 99 too many as there are only 164 unique currency codes in my table. Dug around the net for a while and came up with this query:

CREATE TABLE currencies SELECT tld, currency, currencycode FROM countries GROUP BY currencycode; 

That took care of my initial problem.


Using the CakePHP 1.2 Email component

I was following the documentation at

about sending an email with CakePHP using the Email component, used the sample code they provided but could not get my application to send email. A little bit of googling helped me figure out what was going on. I have CakePHP setup within my XAMPP htdocs directory and my MercuryMail server was not started. You need to have a mail server setup to be able to send email and there are a few more steps you need to do as well to get up and running. It’s beautifully summarized here:

Once your Mercury is properly setup, you are good to send emails from CakePHP!!!

Lesson learned i guess!

Hope It Helps!

Validating a checkbox in CakePHP 1.2

I was looking for a good way to validate a checkbox for a site i was working on, and came upon this link that pointed me in the right direction:

I followed the instruction, mainly:

'agree' => array(
'rule' => array('comparison', '!=', 0),
'required' => true,
'message' => 'You must agree to the terms of use',
'on' => 'create'

But for some reason, it would not work for me no matter what i tried, my checkbox still failed validation, even when the box was checked. I narrowed down the problem to the:

'required' => true,

line. It seemed to break the validation for a reason I do not know. So removing this line should get you through the validation correctly. I did my validation another way by using a new CakePHP core validation function, inList. Here is the code i use to account for all possible values i am expecting my checkbox to have when checked. I added it to the necessary model class:

'rule' => array('inList', array('1',1,'true', true,'on')),
'message' => 'You need to accept the Terms Of Use to be able to register.')

As you can see, the ‘inList’ validation will check to see if the checkbox value is within the array values submitted so you can account for all possible values you need your checkboxes to have to pass validation. This will improve reusability within your code.

Hope It Helps.