Thoughts, rants and commentary from a husband, father of five and professional web geek

Web Forum Lightbulb Maintenance

Posted on July 31st, 2007 in Funnies, Geek Stuff, Web Technologies | 2 Comments »

I thought this was funny, so I am sharing it.

How many online forum group members does it take to change a lightbulb?

  • 1 to change the light bulb and to post that the light bulb has been changed.
  • 14 to share similar experiences of changing light bulbs and how the light bulb could have been changed differently.
  • 7 to caution about the dangers of changing light bulbs.
  • 27 to point out spelling/grammar errors in posts about changing light bulbs.
  • 53 to flame the spell checkers.
  • 41 to correct spelling/grammar flames.
  • 6 to argue over whether it’s “lightbulb” or “light bulb”…another 6 to condemn those 6 as anal-retentive
  • 2 industry professionals to inform the group that the proper term is “lamp”.
  • 15 know-it-alls who claim *they* were in the industry, and that “light bulb” is perfectly correct.
  • 156 to email the participant’s ISPs complaining that they are in violation of their “acceptable use policy”.
  • 109 to post that this group is not about light bulbs and to please take this discussion to a lightbulb group
  • 203 to demand that cross posting to hardware forum, off-topic forum, and lightbulb group about changing light bulbs be stopped.
  • 111 to defend the posting to this group saying that we all use light bulbs and therefore the posts *are* relevant to this group.
  • 306 to debate which method of changing light bulbs is superior, where to buy the best light bulbs, what brand of light bulbs work best for this technique, and what brands are faulty.
  • 27 to post URL’s where one can see examples of different light bulbs.
  • 14 to post that the URL’s were posted incorrectly and then post the corrected URL’s.
  • 3 to post about links they found from the URL’s that are relevant to this group which makes light bulbs relevant to this group.
  • 33 to link all posts to date, quote them in their entirety including all headers and signatures, and add “Me too”.
  • 12 to post to the group that they will no longer post because they cannot handle the light bulb controversy.
  • 19 to quote the “Me too’s” to say “Me three”.
  • 4 to suggest that posters request the light bulb FAQ.
  • 44 to ask what is a “FAQ”.
  • 4 to say “didn’t we go through this already a short time ago?”
  • 143 to say “do a Google search on light bulbs before posting questions about light bulbs”.
  • 1 forum lurker to respond to the original post 6 months from now and start it all over again….
Back to top

Toying with design patterns in PHP

Posted on July 30th, 2007 in PHP, PHP Design Patterns, Web Development | No Comments »

Wordpress sucks when it comes to posting PHP Code. Plain and simple.

And this example uses the WP-Syntax highlighter (which works as I’d have it work). In all cases, these posts used a regular opening PHP tag which was subsequently split by Wordpress. If you view the source of this post you will see that there is actually another opening PHP tag that is completely not shown above the phpinfo(); function.

I went ahead and ran my code snippet through my own, home grown highlighter and posted from that. It really sucks that I have to do that. You would think it would be something simple for Wordpress to be able to post code without a bunch of hoop jumping. Anyway, it sucks. That is that.

The following example code is a PHP version (with some minor changes) of the strategy pattern Java code from the first chapter of Head First Design Patterns. I am really starting to like that book because of the way it makes you learn, with or without your involvement in it.


<?php
abstract class Duck
{
    public $flyBehavior;
 
    public $quackBehavior;
 
    abstract public function display();
 
    public function performFly() {
        $this->flyBehavior->fly();
    }
 
    public function performQuack() {
        $this->quackBehavior->quack();
    }
 
    // Added this afterward
    public function setFlyBehavior(Duck_Fly_Behavior $fb) {
        $this->flyBehavior = $fb;
    }
 
    public function setQuackBehavior(Duck_Quack_Behavior $qb) {
        $this->quackBehavior = $qb;
    }
 
    public function swim() {
        echo ‘<p>All ducks float, even decoys.</p>’;
    }
}
 
interface Duck_Fly_Behavior
{
    public function fly();
}
 
class Duck_Fly_Winged implements Duck_Fly_Behavior 
{
    public function fly() {
        echo "<p>I’m flying!</p>";
    }
}
 
class Duck_Fly_Not implements Duck_Fly_Behavior
{
    public function fly() {
        echo "<p>I can’t fly.</p>";
    }
}
 
// Added this behavior
class Duck_Fly_Rocket implements Duck_Fly_Behavior
{
    public function fly() {
        echo "<p>I ’m flying with a rocket</p>";
    }
}
 
interface Duck_Quack_Behavior 
{
    public function quack();
}
 
class Duck_Quack_Loud implements Duck_Quack_Behavior
{
    public function quack() {
        echo ‘<p>Quack!</p>’;
    }
}
 
class Duck_Quack_Mute implements Duck_Quack_Behavior
{
    public function quack() {
        echo ‘<p>__ silence __</p>’;
    }
}
 
class Duck_Quack_Squeak implements Duck_Quack_Behavior
{
    public function quack() {
        echo ‘<p>Squeak.</p>’;
    }
}
 
class Duck_Mallard extends Duck 
{
    public function __construct() {
        $this->flyBehavior = new Duck_Fly_Winged();
        $this->quackBehavior = new Duck_Quack_Loud();
    }
 
    public function display() {
        echo "<p>I’m a real Mallard Duck.</p>";
    }
}
 
// Added a new duck type
class Duck_Model extends Duck
{
    public function __construct() {
        $this->flyBehavior = new Duck_Fly_Not();
        $this->quackBehavior = new Duck_Quack_Loud();
    }
 
    public function display() {
        echo "<p>I’m a Model Duck.</p>";
    }
}
 
class Duck_Simulator
{
    public $mallard;
 
    // Added
    public $model;
 
    public function __construct() {
        $this->mallard = new Duck_Mallard();
        $this->mallard->performQuack();
        $this->mallard->performFly();
 
        $this->model = new Duck_Model();
        $this->model->performFly();
        $this->model->setFlyBehavior(new Duck_Fly_Rocket);
        $this->model->performFly();
    }
}
 
$duck = new Duck_Simulator();
//$duck->mallard->display();
//$duck->mallard->swim();
?>

Output:
Quack!
I'm flying!
I can't fly.
I'm flying with a rocket

Back to top

Gilroy Gardens Gonzalez’s

Posted on July 29th, 2007 in On Family, On Parenting, Personal Messages | No Comments »

It appears that in my zest to do things with my family I find something to do every weekend. This weekend was no exception.

A friend of our family called us a few weeks ago and asked us if we wanted to take a trip with her family to Gilroy Gardens. Looking at the calendar, and seeing it being the day after my birthday, I decided “What the heck?” and so we said we’d go.

Now for the fun part… we learned about a week ago that the Gilroy Garlic Festival was also this weekend. In just about the same spot as we were going. Which meant that we would have to leave earlier than normal. Gilroy is about 45 minutes away, and we were meeting at the gate at 10:00 AM. So I figured we’d leave at about 8:15 AM to get there on time.

We didn’t leave when I said we would
I made a series of decisions that made things start out whacky. The first thing I decided to do was get cash. I should have done that yesterday. But I figured since it was only 7:50 AM. I had plenty of time to get money from the ATM and get gas and get a new pair of sandals at Target (seems logical right?).

As I made the trek my wife stayed home to finish feeding the kids and getting them ready to go. I was driving down the street as I remembered that Target sandals really don’t fit me right, but Nike’s always seem to fit me right. And what store would be better to get Nike sandals at than Kohl’s department store at 8:00 in the morning? So I diverted my course. It made sense, as there is a Costco and branch of my bank at Pacific Commons, which also houses a very large Kohl’s.

I got into Kohl’s, went to the shoe section and was horrified to find three entire pair of sandals, two of which I liked, one of which was on sale at $10 but was a size nine (I am a size 12, and you know what they say about men with big feet right?… yup, little brains). The other pair was a $60 pair of some brand I have never heard of.

So after a frustrating period of time I decided to leave, get the cash and get gas, then get home to get going. We left at 8:50 AM. Carp (that is crap, but the child reader friendly version).

So I was stressed out about being late, and I drove as such. So much so that I missed the turn off from CA680 to US101. Carp. Now we were going to be later. I made the next turn off and got back onto the freeway and we were off. And the next thing you know, we were at Gilroy Gardens.

There was no traffic at all. We actually got to the park at 9:35 AM. Sweet. Front row parking, a cool day, no rushing around once we got there. After that, all went well. The park was great. People really didn’t start showing up until about 1:00 or so, so we had a run of the place for almost three hours. We chilled, walked the entire park twice over, rode almost every ride, hit the water features up three times and generally had a great day. Except for the part where I lost my phone (but I got it back, so it turned out good).

We left at about 4:45, got home at about 6:15 after picking up dinner along the way home and spent the rest of the day eating and preparing for Sunday morning. It was a great family day with friends. And I would highly recommend Gilroy Gardens to any family.

Back to top

A very extensive list of code editors

Posted on July 28th, 2007 in Web Development | No Comments »

A few weeks (perhaps months) ago I wrote a brief posting about the top five editors that I use to write code. Well, there has been an ongoing mega-thread at the PHP Developers Network Forums regarding favorite editors. And a member decided to scour 30+ pages of postings to compile the following list of editors that users have mentioned they use/like/favor. Thanks to swiftouch for the initial compilation of this list.


Anjuta
Arachniphilia
Arisesoft Winsyntax
BBEdit Lite
CoffeeCup HTML Editor
ColdFusion Studio
ConText
Crimson Editor
Dev-PHP IDE
Dreamweaver
DZSoft PHP Editor
Eclipse
Editeur
Editplus
Emacs
Emacs for Windows
EmEditor by EmuraSoft
Extremepad
gEdit
Glimmer
GoLive
gVim
Homesite
HTMLKit
Jed
JEdit
Jext
JOE
Kate
Komodo
Maguma
nedit(ncl)
Notepad
Notepad++
Notepad2
NoteTab Pro
PC Pico
PHP Coder
PHP Designer 2005
PHP Expert Editor
PHPed
PHPEdit
Programmers Notepad
PSPad
Quanta
RapidPhp
SciTEFlash
TextMate
TextPad
TextWrangler
TSW webcoder
TS Web Editor
UltraEdit
VI
Vim
VS.Php
Wordpad
xemacs
Zend Studio

Back to top

Essential tools for any PHP developer

Posted on July 27th, 2007 in Apache Server, MySQL, PHP, Web Development, Web Technologies | No Comments »

The following list was written by Chris Neale, of ooer.com fame, and reproduced with permission from the PHP Developers Network Forums

I’m sort of writing a new article listing all the things I use, or should use, to write awesome websites. If you fancy adding to the list then please do, it’d help.

The Obvious
PHP - I think we all know what this is.
MySQL - And this.
Apache - My personal choice of web server mainly because I understand htaccess.

Libraries
Swiftmailer - The best PHP mail sending library available bar none.
ADODB Lite - The best database abstraction layer around.
Template Lite - The best template engine.
FPDF - Awesome PDF library.
SHA256 - Hashing replacement for MD5/SHA1.
HTMLPurifier - Stop XSS attacks before they happen.
SimpleTest - Unit Testing library that’ll improve your code no end.
JQuery - Javascript AJAX/effects/make stuff easier type of thing.
JPGraph - Delightful library for charts and graphs in PHP.
ExCanvas - Get < canvas > working seamlessly in IE.

Browsers
Firefox - Best browser around.
Internet Explorer - Needed for testing because there’s still people who suffer it.
Opera - Again, needed for testing.
Safari - And again.

Extensions and Plugins
Web Developer - Absolutely critical for finding out information about the clientside things.
Firebug - Brilliant javascript console that makes AJAX so much less of a headache to debug.
YSlow - Site speed profiling plugin (needs Firebug).
NoScript - The easy way to test a site with JS and more switched off.
SearchStatus - Site search profiler, find out keyword information, page rank, Alexa rank etc.
XDebug - An awesome PHP debugger/profiler.

I’m not really interested in what editor/IDE you use, that’s a very personal choice. I’m interested in things that are absolutely top of their class couldn’t live without them essentials.

Any new developer would do well to glean something from this information.

Back to top

Happy birthday to me

Posted on July 27th, 2007 in Personal Messages, Rants | No Comments »

Thank you Lord.

Finally the birthday season can pare down a bit. With the coming of my birthday today (hey everyone, in case you were wondering I am 20-13 today), I can say that I don’t have to worry about any more kids parties (of my own) until the end of September. I feel like taking a long nap and resting for a while.

But alas, I must prepare for the rigors of work today, so I am off to shave. I just wanted you all to know it was birthday today in case you wanted to send presents, or, in lieu of presents, large amounts of cash.

Back to top

Does this sound fishy to you?

Posted on July 26th, 2007 in Funnies | No Comments »

I was flipping through the radio channels this morning trying to get an idea of what traffic was going to be like (there were two fatal accidents in the Bay Area this morning) and ran across a radio show where a man (Pete) was vehemently accusing his wife (Alejandra) of having an affair as she was just as vehemently denying it.

The show does something sneaky in that they call a spouse and tell them they are being offered a free dozen roses as part of a promotion for a new local flower shop. They then tell you that you can have the flowers delivered to anyone in the Continental United States and they ask for the name of the person. After you give them the name, they ask for the message to put on the card.

Well in this episode, Alejandra was asked who she wanted to send the flowers to and she said she wanted to send them to Miguel with the message ‘To my perrito. Looking forward to seeing you soon.’ That is innocent enough. Except her husband’s named is Pete. And Pete was on the phone to the radio station listening to this conversation setting Alejandra up.

When asked by Pete, her husband of seven years, who Miguel was Alejandra replied that it was her uncle. The husband had never heard of Uncle Miguel in his 7 years of marriage to Alejandra and asked where Tio Miguel lived. She said Mexico. Which was not really a possibility, since the flowers could only be delivered in the continental United States.

Oh yeah, her explanation for the nickname perrito… Her abuelo (grandfather, tio Miguel’s daddy) was called ‘Perro’ back in the day and naturally his son would be called ‘perrito’.

So do you think Alejandro is cheating on her husband Pete?

Yup, me too.

Back to top

A long day long needed

Posted on July 25th, 2007 in Geek Stuff, Rants | No Comments »

Today we upgraded our company’s account management application. I have been developing this for about the last nine months or so, and it keeps growing.

With that comes new and exciting challenges as a developer. Like this one… I need to be able to switch the application into maintenance mode at the drop of a hat. I built that. But at the same time, I need to be able to keep users out and allow myself in for testing. I have not figured that one out yet. There are still several features of the application that need to be fleshed out at the moment, but all in all I am happy with what it does at this point.

I do need to do a heap of refactoring and recoding. The app has just gotten fat and it needs to go on a diet. I also need to be able to make the needed admin tools to allow me to do things that I cannot do at this point, like become a user to see exactly what the user sees. But those are things to get to work on in a bit. Right now, I get to spend time working on our framework and interface to our new WWW site.

I can’t wait. But I can rest, because I was at work almost 12 hours today, and I need to take my mind off of code for a bit.

Back to top

Vendor unfair

Posted on July 24th, 2007 in Geek Stuff, Rants | No Comments »

Have you ever had the misfortune to work with a supplier or vendor that was supposed to do something and was not able to?

I have been working on this project at work that will allow our customers to be able to see there past statements online and pay their current bill through our online account management tool. That is nothing major, a lot of developer have done this. But I was done with our part of the app almost a month ago (on time for our goals) and our payment provider has just fallen to pieces.

I can’t get into too much detail, but needless to say we are the point that we are going to roll this out and let the chips fall where they may. We’ll see tomorrow, as that is when we said we’d launch.

This ought to be fun.

Back to top

My champion speller

Posted on July 23rd, 2007 in General, On Parenting | No Comments »

A few weeks ago we rented “Akila and the Bee”, a movie about a girl living in the gang invested ghetto town of Crenshaw, who was gifted with a knack for spelling and was able to go all the way to the Scripps National Spelling Bee. Ever since then, my daughter Adrianna, the six year old, has not been able to stop spelling.

It took a while to move into larger sounding words, and it took even longer to teach her to bounce back after spelling a word incorrectly. But now she wants to spell everything. She will ask, without regard to time, ‘Daddy, give me a word to spell”.

So I try my hardest to give her words that will challenge her but still allow her to grow her confidence by getting them correct (or mostly correct). On occasion I will really giver her a doozie, but for the most part, she is up to the task at hand for a six year old.

Seeing my daughter take to spelling like this is an amazing sight to behold. She has such a never ending imagination in all areas of her life. Her brain is alway working. And for a six year old, that is not that uncommon. But when you listen to her come up with new dessert ideas (and actually make them) you begin to realize that her creativity and intelligence are far from common for a kid her age.

I like to think that she inherited this quality from me, but since I am as far from quality as a Ford Pinto, I have to admit that my wife has had a great deal more responsibility handing off the good genes to the children. She teaches them constantly, even when it looks like they are playing or enjoying a movie or reading a book. Our kids have always been advanced, and they show it regularly in the way they learn and recall things that other kids would have swept under their intellectual rugs.

I am proud of my children. And I am proud of my wife for the job she has done in raising them and teaching them. In a word, they are A-M-A-Z-I-N-G. Amazing.

Back to top