Thursday, May 29, 2008

Flex 3 on Ubuntu Hardy (8.04)

Finally found a post that got Flex 3 to work on Ubuntu Hardy Heron, the post is located here.

A couple of additional points or issues that I ran into:
  • I ran without sudo and received an ominous warning to read a flash player notice in the application directory. The file highlighted the fact that the system might not utilize the debug version of Flash. Figuring I was going to have an issue I removed everything and ran the install using sudo. Running as sudo caused some other issues to crop up. I went back and re-ran as a normal user, tested and everything was fine.
  • Starting Eclipse caused an error window to display, "Could not initialize the applications security component...", the fix can be found here (in short manually create a directory ./mozilla/eclipse).
  • The Eclipse download location mentioned inthe article can be found here.

PHP Coding Standards

With an article in April 2008 issue of PHP Architects magazine, there was an article that touched on coding standards. At PHP Architects 2008 conference in Chicago one of the sessions touched on coding standards.

I typically work individually or in a group of two on development projects. There are always differences in standards followed by programmers. There are endless debates on the intertubes on this subject. This post is not to sway anyone one way or the other. I have spent some time looking into two common recommendatiosn for coding standards, the PEAR and Zend coding standards.

Why with an if is the '{' on the declaration line and with a class or method the '{' goes after the return? My goal is to follow the coding standards on future projects to create a standard.

Upon quick review I do follow 90% of the coding standards, as do most of the programmers I work with. The one that will take sometime to digest is:

if ($a != 2) {
$a = 2;
} elseif ($a == 3) {
$a = 4;
} else {
$a = 7;
}

and

class Foo
{
/**
* WRONG
*/
public function bar()
{
return($this->bar);
}

/**
* RIGHT
*/
public function bar()
{
return $this->bar;
}
}



Why with an if is the '{' on the declaration line and with a class or method the '{' goes after the return? My goal is to follow the coding standards on future projects to create a standard.

Wednesday, May 28, 2008

Ubuntu Start Up Programs

Nagging issue that I never got around to look at was auto starting applications after a delay in Ubuntu. Depending on the location, my wireless might take a few seconds to authenticate to the router. This delay in some environments would trip up GMail notify and display connection errors. A small issue. After installing firestarter I would get an error dialog box stating that the connection was unavailable.

The solution was presented in an Ubuntu thread located here. So now I have an auto_start folder in my home folder with scripts for each application that requires a delay. In my instance firestarter and gmail notify. In Ubuntu under System->Preferences->Sessions I then point to the above scripts in my auto_start folder.

Not sure if there is an easier solution but the above solution works.

Tuesday, May 27, 2008

Virtual Box Kernel Upgrade 2.6.24-17-generic

Upgrade to Hardy Heron to kernel module 2.6.24-17-generic cause Virtual Box to stop working. No updated kernel-modules were found in the existing repositories. I followed various web postings to try to get this working. Non worked. Here's what I ended up doing to get this Virtual Box working again:

Step 1 (found via this link):
sudo sh -c 'echo "# VirtualBox repository for Ubuntu Gutsy
deb http://www.virtualbox.org/debian gutsy non-free" \
> /etc/apt/sources.list.d/gutsy-virtualbox.list'
wget http://www.virtualbox.org/debian/innotek.asc -O- | sudo apt-key add -
sudo apt-get update
sudo apt-get -y install virtualbox

Step 2:
sudo /etc/init.d/vboxdrv setup

Step 3:
sudo apt-get install virtualbox-ose

Step 2 was mentioned repeatedly as solutions to the kernel module issue. More than likely I had an issue with my initial set-up where reinstalling everything flushed the problem.




Monday, May 26, 2008

Hail




Sunday (5/25/2008) wasn't fun. Driving back on Highway 169 in the morning, just north of Princeton, MN we ran into a hail storm. A few dents in the car, nothing to serious.

Later in the evening in Lino Lakes, MN, our house was hit with another hail storm (just missing a tornado that just went north of us in Hugo, MN). A few images taken from inside the house during the hail storm.

Last fall our roof and siding was replaced from last years hail storm. There are going to have to replace everything again, the siding and roof took a worse beating this time around than last year.

The next day or so will be a clean-up day around the neighborhood, more tech related postings will occur following clean-up.

Wednesday, May 21, 2008

Wednesday at php|tek in Chicago, IL

I attended a number of great session today at php|tek in Chicago 2008. Thanks to all of the presenters. I'm on absolute information overload. My gross oversimplification of a couple of notes are listed below, all warrant further research:

  • When implementing mod_rewrite rules enable the Rewrite Log for troubleshooting. For every incoming URI (depending on the error level) the log will contain the incoming URI and what if anything your mod_rewrite rule is doing to the string. Make sure to only use in development.
  • Using the flag [R=301] you can use mod_rewrite to return a 301 permanent redirect header.
  • For distributed apps consider specialized subdomains that serve discrete purposes. This can aid in the breakup of an application into discrete scalable modules.
  • For an immediate boost in performance on one box, implement some version of the following: /var/www/webapp map to www.domain.com for serving application content (i.e. PHP scripts), /var/www/static map to static.domain.com for serving static content (i.e. Images, CSS, JS) as IE will open another pipe to retrieve this content.
  • For scalablity in your models seperate read and write functions as this will serve in scalability for when your database scales. One "easy" database scalability model has one database for writes and one or more for reads. By seperating your model upfront you allow for the before mentioned scalability.
  • Not using AutoIncrement in your apps will make scalability to a Master-Master set-up less painful. Master-Master with AutoIncrements introduces some serious application issues.
This slides will be posted to this location when they become available.

Tuesday, May 20, 2008

Rapid Application Development with Flex

This is probably an issue with how I program and my unframiliarity with Flex. I'm going through a serious of small tweaks and error trapping on a widget. Normally when I'm doing web development I naturally do a Shift->Refresh in the browser to clear the cache. This wasn't flushing the local cache in Firefox 3.0b5. I was expecting a reload of the flash object and reload of the web service XML. This wasn't occurring causing some undue gray hairs. I'm injecting a timestamp in the GET request to avoid caching of the GET request, so that shouldn't be the issue.

How I got around the issue was to disable the Net monitoring in Firebug and then re-enabling. This setting change seemed to force a reload of everything on the page.

I'm guessing I am missing something obvious?

Monday, May 19, 2008

Flexing

I spent the day developing in Flex. It's always fun and challenging working in a new environment. Of course I'm under an extremely tight deadline so it's learn as I go trying to create a relatively simple widget. I'll post again when the widget has been released for public consumption.

Some resources that I ran across in my Flex adventure are listed below. Of course given more time in using Flex these observations might be trivial:
  • Installing the environment on Ubuntu, click here.
  • Apparently the getUrl() to goto a URL is something new in ActionScript 3, click here for an example.
  • This article provided good insight into ActionScript3 for those with programming experience.
The Flex framework is a blast to pick up and learn.

Adobe Air seems like a great technology in bringing web principles to the desktop. I recently started using Twhirl (Adobe Air desktop app for Twitter), great simple functionality utilizing Adobe Air.

Sunday, May 18, 2008

To framework or not to framework

Finishing a code review for a local start-up. The application is fairly complicated out of necessity. The issue is that the site has a number of small bugs and an ongoing issue of a bug fix usually breaking a number of other features.

My first assumption was that the application was a custom job. The application was built using a build from scratch framework. It is the most complex pile of code I've seen in a long time. It's a nice object oriented approach with the concept of a controller and a mix of views and models. This is where the niceness wears off, there are countless layers of abstraction, non conformity to a MVC approach and a hodgepodge of OO code, functional code, OO SQL abstractions and handcoded SQL that is ten times more complicated than it needs to be.

Now off my soapbox, I've done custom frameworks for my PHP work for years. In the past 2 years I have sworn off personal custom frameworks and now utilize Symfony (for complex and controllable environments) and CodeIgnitor (for flexible virtually hosted solutions).

I realize there are detractors to the framework approach. I'm not one of them, one to many times trying to figure out the mindset of the programmer I guess.

Friday, May 16, 2008

Minnesota PHP Opportunities

One of the overarching themes at the Minne-Bar event on May 10, 2008 was local development talent. I met a large number of local developers and a fair amount were utilizing PHP as their primary language.

I'm in a position were I am passively looking for PHP related opportunities in the Twin Cities area. Part of my intent here is to keep a list of companies that are utilizing PHP talent.

The following is a list of local companies that are utilizing PHP (in no particular order other than Workface is my current employer):

I will continue to post more companies using PHP as I encounter them. Again this is not a comprehensive list, more of a reminder list to myself regarding PHP opportunities.