jQuery Verification Plugin

I’ve created my very first jQuery plugin. It’s fairly simple in that it simply verifies an input field’s value via AJAX after a short delay from the key up event handler. Put more simply, you can verify emails, URL’s, usernames, etc. directly as the user is typing them into the input box.


$(document).ready(function() {
    url = '/verify.php';
    options = {
         verifying  : "urlVerifying",
         valid      : "urlValid",
         invalid    : "urlInvalid"
    };
    $('#email').verify(url, option);
)} 

This will, after a short delay, verify the value of the input with id="email". The script passes the value to the URI as /verify.php?value=foobar@example.com. The script should then echo 1 for a valid value or 0 for an invalid value. See the example for more information.

Download jQuery Verification 0.0.1

Framework 0.1.4

This is a fairly major upgrade for the little framework that could. I haven’t stopped developing Framework. Quite the contrary, I’ve been working on it extensively as I’m starting to build sites utilizing it. Other than the extensive changes, fixes, etc. anybody wishing to try this out will be pleasantly surprised that there is now an example document root in the examples.

  • Added Framework_Exception
  • Added Framework_Template for unified templating in modules
  • Added __sleep() and __wakeup() to Framework_Object and Framework_Object_DB
  • Added $this->template->plugins_dir = array('plugins',$path.'/'.'plugins') to Framework_Presenter_Smarty
  • Added Framework_Auth_ACL to handle Access Control Lists based on module/event pairings
  • Added Framework_Request
  • Added Framework_User::__isset()
  • Added Framework_Site_Common::stop() which is ran from Framework::stop() when processing has completed
  • Added config.xml for site configuration data
  • Added Framework_Presenter_JSON which utilizes php-json
  • Fixed a bug when creating custom user classes in Framework_Uset::singleton()
  • Fixed how Framework_User::__construct() detected the userField from Framework_Session
  • Fixed misspelled function call in Framework_User
  • Fixed a bug where Framework_Object was attempting to create a log file before Framework_Site_Common had been created
  • Fixed mispelled return code in Framework::start()
  • Fixed a bug where a module’s event was running before the session/user had been authenticated
  • Changed Framework_Presenter_REST to include XML_Serializer options
  • Changed all Exception‘s to Framework_Exception
  • Changed Framework_Object::__construct() to use Framework_Site_Common::$logFile to create instance of PEAR Log in Framework::$log
  • Removed a few references to deprecated constants in Framework_Presenter_Module
  • Deprecated Framework_User::$userTable, Framework_User::$userField, Framework_User::$defaultUser, Framework_User::$userClass (see config.xml)

Download Framework 0.1.1

Jamba Juice Triathlon in San Diego

Right after the finish!

I flew down to San Diego last Thursday to spend some time with Dana and participate in my second triathlon, the Jamba Juice Triathlon. Dana and I spent a few nights hanging out with friends, eating copious amounts of quality mexican food and, generally, having a good time.

On Sunday, October 1st, Dana’s friend Felipe and I did the triathlon. I ended up 52nd out of 119 in my age division and 450th overall out of about 1,480 participants. Not too shabby for my second outing. My overall time was 1:06:30, which was 13 minutes faster, but the course was quite a bit different than the Kirkland triathlon. It was a slightly longer swim, but the bike was three miles shorter and didn’t include any of the Seattle hills I had to deal with in Kirkland.

Next up is the half marathon this Saturday.

Zorka Visits Again, This Time He Brought Company

Myself, Keith and William

Keith, in the middle above, his friend William Wallace (I can’t make this up) and Joe (not pictured) came up from Hatteisburg, MS for a visit to Seattle. Keith had a conference, William had some free miles and Joe was along for the ride.

I picked up William and Joe downtown after work and we headed to one of my favorite pubs in Fremont, the George and Dragon. The George and Dragon is a proper English pub so imagine the bartender’s response when Joe, a true blue good ‘ol boy from the south, asked for “a bud”. With some reluctance he sat down with a Pilsner Urquell and we talked a bit about the area, the nuances of American beer versus good beer, etc.

The next night, though, I heard quite possibly the funniest quote ever from the weekend of which there were many. Upon hearing my bike cost about $3,800 new and that I had paid $1,000 to buy it used, Joe retorted in a thick souther drawl, “Shiiiiiiiiit! It ain’t got a motor or nuttin’!” Hilarity, as they say, did ensue.

All joking aside, the guys had a great time wandering around the city, enjoying the Fremont Oktoberfest and generally taking in the sights. Who knows, maybe I’ll make it down to Hattiesburg, which is supposedly the birthplace of Rock n’ Roll!

Speeding up InnoDB table imports

We switched to InnoDB tables a while ago. They offer transactions, foreign key constraints and a few other goodies that are missing from MyISAM. We knew writes would be slower due to foreign key checks, etc, but we didn’t imagine that importing a table with about 160,000 records would take almost an hour to import, while it only took about 15 seconds to import using MyISAM. I did some digging and figured out the solution. Add these lines to your dumps.

SET AUTOCOMMIT=0;
SET UNIQUE_CHECKS=0;
SET FOREIGN_KEY_CHECKS=0;

... Your dump here ...

COMMIT;
SET AUTOCOMMIT=1;
SET UNIQUE_CHECKS=1;
SET FOREIGN_KEY_CHECKS=1;

This sped up InnoDB imports to pretty much the same speed as MyISAM imports for the table in question.

2006 Kirkland Tri-It Triathlon

My heat in the water

Above is a picture of me as I and about 60 others start the 2006 Kirkland Tri-It Triathlon. The Tri-It differs from a regular sprint triathlon in that the swim is 0.25 miles instead of 0.50 miles. The race started off with a 0.25 mile open water swim in Lake Washington, followed by a 12 mile bike ride through the city of Kirkland, WA and finished with a 5k run along the shores of Lake Washington.

My training included miles and miles of running, biking and swimming. I’d bike 20 miles and then run 2.8 miles or I’d run 5.6 miles and throw a 0.25 mile swim in the middle for fun. Most of my training I did on my own, which I think makes this all the more of an accomplishment. I didn’t race because a friend of mine was racing and training. I trained and raced to prove to myself that I could do it. I did this for me.

I got out of bed at 5AM Sunday morning to get over to the race for registration. After setting up in the transition area I wandered around for a bit, chatted with a few of the other participants and got myself a coffee. At 6:45AM I went over for the pre-race briefing and watched the first of fifteen heats start, which was the “elite” heat. My heat, the Tri-It heat, which is for beginners like myself, was the last heat to take off at 8:00AM.

After meeting up with Carly and John to hand them my camera and phone I went off to wait for my heat. A short time later I was 50 yards from shore swimming for the first time in a wetsuit. I felt like I had a motor attached to me. The wetsuit kept me warm and boosted me out of the water, which I swear made me faster.

A short change later and I was running my bike out of the transition area starting my 12 mile bike ride. The ride was simply amazing. I was making decent time and taking full advantage of my aero bars on some of the flats and longer downhills. This was by far, for me, the most fun part of the race, but that’s probably because I like my bike so much.

The transition from biking to running was by far the worst. I’ve heard about your legs being all messed up during this transition and it’s true. My legs felt like putty and my left calf started cramping up. For the first few hundred yards I ran peg legged to get over the cramping. After that it was smooth sailing all the way to the finish.

So how did I do? Well, for my first triathlon I’d say first place is a pretty good way to start things off (No, it’s not April 1st, the original results proves that). Granted this is amongst a field of all beginners (including me) of all ages, but I’m still quite happy with the results. You can view the entire photo set over at Flickr.

I’d like to make a special thanks to John and Carly who climbed out of bed before 7AM on a Sunday morning to come to the race, take pictures and cheer me on. I’d also like to thank my training buddie, Ben, who introduced me to The Hill. The Hill made the run seem like a joke.

Crossing the finish line. I'm tired.

The triathlon has arrived

I recently mentioned that I was going to be participating in my first triathlon. A sprint triathlon to be specific. To be even more specific, I’ll be participating in the Kirkland Triathlon at Carillion Point. Since it’s my first triathlon I’m planning on doing the non-competitive version which I still find daunting. It starts with a 0.25 mile open water swim in Lake Washington followed by a 12 mile bike ride through the streets of Kirkland and finishes up with a 5k run.

I’ve been following a fairly stringent training program. I haven’t been drinking during the week, I’ve been bricking events, etc. My normal training routes include 13 miles on the bike and a 2.8 mile run around Green Lake or a 2.6 mile run down Madison to Madison Park, a 500 meter open water swim and then 2.6 miles back up Madison, which is about 400 feet of elevation difference. To gauge my training I ended up running the Lynnwood Hi-5 5k Fun Run. In early June I ran a 27:29 during my first 5k. During my second 5k a few weeks ago I ran a 23:44 and placed 12th out of a field of 77. Clearly, my training is going well.

Well, it was going well until about 1.5 weeks ago when condo projects and, in general, life started to get into the way. Recent attempts were foiled by a lack of a bike lock one day and a popped bike tire the next day. The condo projects have really put a damper on my back and my legs aren’t in great shape, but I’m resting for the rest of the weekend.

Overall, I’m a bit worried and really excited to compete in this race. It’s by far one of the most challenging physical tests I’ve ever put myself through. At the very least, I’ll complete it. I’m currently hoping to finish in 1:45:00. I shall post pictures and a followup on Monday if I don’t die.

My new ride

Trek 5200

To say that I’m excited to get this hot ass ride out onto the road would, quite possibly, be the understatement of the century. This is, essentially, the same bike that Lance Armstrong road to victory in the Tour de France. I found her on craigslist, of course, and snapper her up for a song. I’m a bit intimidated by the bike since I’ve never ridden a proper road bike and the aero bars pretty much freak me out, but you know I’m going to give it the ‘ol college try!

How to tell if you have great friends

I've got great friends

Dana, being the man that he is, sent me a special package overnight. The contents of which can only be truly appreciated by eating said contents. He sent me California burritos from Ramiro’s in San Diego. For the uninitiated, California burritos are regular cheese/meat burritos with french fries added to them. When mixed with the hot sauce provided they provide an absolutely orgasmic mixture of cheese, meat, grease and spices. Thanks D!

Stump does PDX

The last time I took days off was in April so it was definitely time to take a few days off and get out of town. I decided it was time to finally fully explore the wonders of Seattle’s little brother, Portland. I have to say I’m thoroughly impressed.

I met a bunch of new people, hung out with some current friends, and, oddly enough, re-connected with an old friend from college. Kate and I actually went to our dorm’s semi-formal together at the ripe old age of 19. The pictures are terrifying.

Looks like Garren and I will be making it down for the beer festival on the water this weekend as well. Now, rounding out the post is Kate singing karaoke.