Fish Tank Extravaganza

I posted a pic or two last post about our new fish tanks. I wanted to share some more about what we’ve done. It’s been really fun to hang out with mom (in-law) who gets all giddy whenever we talk about the marine (saltwater) tank. It looks sharp and we’re really happy with the outcome so far.

We went to several stores and I’ll admit that the start up cost is a bit higher on a marine tank than a freshwater tank when you add salt, a hydrometer, live sand and so on but its not prohibitive, in my opinion. Every store we went to has had really enthusiastic and helpful folks who knew what we’re getting into. They’ve pointed us to the Puget Sound Aquarium Society and we’ve gone to the library and Google to learn a lot.

Also we had our final visit to the midwives. This last Tuesday was the due date. We’re doing everything now to get the baby out!

Share on Twitter
Posted in Uncategorized | Tagged | 2 Comments

Quick Blurb On b2evolution

I have been avoiding saying anything but wow it is amazing how much I love blogging and working on web stuff for personal project since I switched to WordPress. I don’t think my blogging frequency has increased but the tools, plug-ins, and features of WordPress is phenomenal compared to b2evolution which I had been using for what, 4 years? I did some pretty neat stuff with b2evo but it required too much meddling to get it to work right. I know some folks have the time to dick around with things and tweak them. I’ve gotten to a point where I want things to just work.

Share on Twitter
Posted in Uncategorized | Tagged | Comments Off

Getting Ready for Baby

We’re all sorts of ready for baby number three. Our family has grown and there are moments I stop and think wow, Crystal and I made it through quite a bit. Immature high schoolers, self righteous “Christians”, financial pains, career pains, and our own stupidity. Heh, I am so happy my wifey and I held it together. Crystal has been keeping writing about her own stuff but also a wee bit at our family blog. Check them out, leave comments, encourage her. It’s a good thing to share.

We’ve gotten our birth tub set up, I’ve rounded up hoses to fill it, we’ve ordered the kits and supplies, the crib is put together and fully furnished with soft blankets, bumpers, and linens, and we’ve stretched ourselves to pay for some midwives to have this kid at home. Unfortunately the litigation in our state has scared most hospitals from allowing post-Cesarean vaginal births (commonly refereed to as V-Backs). We have been gravitating towards the natural in everything anyway from nutrition to how we consume and where we buy stuff this seemed like a natural thing for us to do. Don’t get me wrong though. We aren’t tree hugging, granola crunching hippies. It’s more like we feel God’s made us to be self sufficient and should embrace doing things to be good stewards of everything. We aren’t perfect but we try our best.

I feel like I have to explain everything sometimes. People hear “home birth” and think its weird. I guess its weird for me to think of birth as a medical condition requiring strange people in bizarre smocks and weird face masks staring at your who who and pumping you full of drugs. Sometimes a hospital visit is necessary and there is no shame in choosing whatever you need but having a baby isn’t easy! I guess we get the same flak about having another kid. You’d be amazed how many assholes rolled their eyes and said things like “You know where babies come from, right?” and other stupid shit like that. Just wow. And in those uncomfortable moments you have to play the part and laugh it off or reciprocate “asshole-ness” and make them feel idiotic for saying something so immensely idiotic. I won’t make excuses for not playing along with the rest of our society and committing infanticide. Yes, I’m one of those people who think babies are born from conception not birth as some hypocrite judge, Congress, or populace believe. Anyway, its quite infuriating to hear stuff about a second, third, or whatever baby in such a way. It bothers me every time it happens. I just don’t understand why instead folks don’t bust out cigars and give me a congratulations. Okay, hold the phone. There have been a few people and coworkers that have been extremely nice about it. I guess the insensitive minority won my attention.

Nanna recently came across a fantastic deal on a huge 150 gallon aquarium. The fella had it custom built along with the cabinet for about $2,700. Also the tank came with a pair of Fluval 404 canister filters. The tank has a built in 10 gallon sump built into it. I am super excited about it. I remember when I met Kathy (AKA Nanna) she had a couple salt water tanks going. One was a medicine tank and the other was a reef tank complete with metal halide lamps, protein skimmers, live coral, sea anemones, and beautiful fish. It’s always been something I wanted to get into and now that this set up came along for such a great price I really didn’t want to let it pass. She has gotten excited about helping us to get it going too. It should be a fun learning experience and with her expertise I am not worried too much. We’ll probably just get the tank going with salt water, sand, and a few fish until we move. Then we’ll get into all the coral, day/night cycle lighting, and symbiotic ecosystem building.

We also got a 29 gallon (I think that’s how big it is) tank to put in the kid’s room as a freshwater tank. It’ll be something nice for the kids to watch, see, and learn from. Henry is already talking how he wants to study fish and save the oceans. All I can do is give them opportunities to satisfy curiosity and expand their exposure to new things. In the end Henry, Helen, and new guy/gal will have to decide what they want to do.

Finally, a few people have been telling us its an excellent time to buy a house right now so we have looked around again. For a while we were looking at North Tacoma in the Proctor and Ruston Way area but we decided that with a baby on the way we’d wait until we healed up from that. With our lease up in September its looking like we will want to move. We went out and looked at a couple homes. The one amazing house we found has no yard but it was new, not too pricey, on a hill, and within 10 minutes of the train station in Sumner. After all, who wants to buy a house on a flood plain within lahar range of Mount Rainier? The other home was in Edgewood on an entirely usable .7 acre lot. It was more expensive, had a deck, and the house was a dump, in my opinion. I suppose we’ll keep looking at a comfortable pace. I don’t know if we’ll end up buying, move and rent, or just stick it out here. It’s definitely cramped especially with a third kid on the way but over all with a little shuffling around we should be ok.

Share on Twitter
Posted in Uncategorized | Tagged | Comments Off

PHP, AJAX, and Race Conditions

We came across a pretty interesting race condition regarding AJAX requests and our PHP back end. A quick search will find a few articles about the problem; this one I think sums it up best. There are some comments there that are worth skimming over if you want more ideas. Unfortunately, nothing in there about a definitive solution.

To summarize briefly, asynchronous calls are made from the client web browser which are then processed by the server without making sure previous requests are completed. A lot of solutions seem to focus on the front end using Javascript to prevent this. Although it is a good practice to avoid making rapid requests of your server from the client, you will still need to address this issue on the back end. I am sure we can come up with ways to help mitigate this issue but eventually the back end must always be the final say in serving requests relying on nothing from the client.

/**
 * Create and release database locks to prevent concurrency issues. This is a rough
 * solution and you may want to look at try-catch, closing db connections, throwing
 * exceptions, etc.
 *
 * Also, keep in mind that using persistent connections isn't ideal and neither is
 * sleep. This isn't an ideal solution, IMHO.
 *
 * @author Michael Hradek
 */
final class DatabaseLock
{
    /**
	 * @var int Seconds before lock times out.
	 */
    const LOCK_TIMEOUT = 10;

    /**
     * @var int Retry limit count.
     */
    const LOCK_RETRY_LIMIT = 5;

    /**
 	 * Create a lock using MySQL. This is a wrapper for that functionality.
	 *
 	 * @param String
	 */
    public static function lock($lock_name)
    {
        $i = 0;
        do
        {
            if(self::isLockUsed($lock_name) === false)
            {
                $dbObj = /** Your DB obj instantiation. Persistant connection. */
                $sql = "SELECT GET_LOCK(?, ?)";
                $result = $dbObj->query($sql, $lock_name, self::LOCK_TIMEOUT);
                if($result && $result->getColumn(0) === 1) {
                    return true;
                }
            }
            usleep(1000); $i++;
        } while ($i < self::LOCK_RETRY_LIMIT);

        return false;
    }

    /**
 	 * Release an existing lock.
	 *
 	 * @param String
	 */
    public static function release($lock_name)
    {
        $dbObj = /** Your DB obj instantiation. */
        $sql = "SELECT RELEASE_LOCK(?)";
        $result = $dbObj->query($sql, $lock_name);

        if($result && $result->getColumn(0) === 1) {
            return true;
        }

        return false;
    }

	/**
	 * Checks to see if a lockname is in use. Calling GET_LOCK release previous
	 * lock if the lock name is identical.
	 *
	 * @param String
	 * @return bool
	 */
	private static function isLockUsed($lock_name)
	{
        $dbObj = /** Your DB obj instantiation. */
		$sql = "SELECT IS_USED_LOCK(?)";
		$result = $dbObj->query($sql, $lock_name);

		return ($result === false);
	}
}

The solution my colleagues and I came up with above requires use of MySQL’s get_lock and release_lock functionality. We spent some time thinking about Session flags/semaphores, horribly un-scalable sleeping, and semaphores via PHP itself. In the case of session flags we found that session was too slow to keep up with multiple incoming requests. We had between four to six to n requests come through and announce that they are starting the session lock. Wha?!

This solution requires InnoDB and a version of MySQL that allows locking. I believe that in conjunction with solid abuse monitoring on the web server side we create a solution that ensures served requests are not abusive and properly handled. Is it scalable? Better than say sleep but still can have problems. Any time we introduce code dealing with timing out we run the risk of trouble. Also, according to the MySQL documentation calling get_lock multiple times overrides the previous lock so you must check to see if its currently in use before calling it.

Share on Twitter
Posted in Programming | Tagged , | Comments Off

Getting A Little Agile

My manager Mark and I left the Domaintools office around noon and drove to Portland, Oregon. It was about a three hour journey. Our little company had (or has) a tiny stake in AboutUs.org and with that we were able to get some face time with the developers here. They’re a Ruby on Rails shop and have a huge benefit of having one of Agile’s biggest proponents working for them. Their offices are located on the fifth floor of a cannery converted into trendy, industrial styled offices filled with several stories of small businesses. Looking out the windows you see a big part of the Eastern side of Portland and the Columbia River.

Talking with Ward Cunningham is like talking to a great mentor or a professor.

The amount of knowledge and information to learn is staggering and awesome. At ArenaNet I ran into a couple people like this. Pat Wyatt, for example. It’s simply fantastic to have people in your career who can share with you tomes of experience, advice, and direction. I soak this up like a sponge. I hope I can always be humble and continue to get better and more able as a developer.

Back to the “exchange”, we had a chance to observe several processes. Paired programming, task planning and estimation, and task tracking. I think there was a lot to learn here. There are definitely some differences between our shops. Their code is cleaner and more easily adaptable to rapid change. Their managers all the way to the developers have bought on to a process involving open and constant communication. The deadlines are the end of sprints but even they aren’t concrete. It was good to interface and learn some ideas about development. Tomorrow we’ll be doing some more.

Portland is a nice city. The architecture is clean and the lines interesting. It’s level and it’s easy to access. I really like it here. We are staying at the Hotel Vintage Plaza. It’s an okay pad. Trendy and right in downtown. My first complaint is that the water pressure is really low.  The most amazing book store I have ever been to is right here in Portland called Powell’s. Nothing, as far as I know, comes close to the amazingness of this store in Western Washington.

Dinner was at Deschute’s Brewery Pub which was very good. I had a rib eye steak that was grilled nicely and had a layer of BBQ sauce and blue cheese on top. Very tasty indeed. If you ever go there make sure you get the pretzel with cheese. I thought it was amazing. Mark enjoyed it and so did our two guests.

Tomorrow we go in for round two with our hosts to see planning and some more processes. After that I’d like to swing by Powell’s again and check out their technical branch filled with technical books and stuff.

Share on Twitter
Posted in Uncategorized | Tagged , , | Comments Off

D’oh Too Much

We’re planning on releasing a video on the 26th to show off Flicka. We’ve got some issues to fix and tomorrow’s Code-a-thon would have been perfect to set up and get ready to do this.

And tomorrow at noon I’m headed down to AboutUs for a sort of developer exchange. It’s more like they have a great understanding of Agile and we at Domaintools would love to learn a little more about their immensely productive sprints.

I remain cautiously optimistic. Our products are vastly different and so is our code base so I fear that also their process may be great, it’s great for them.

So with me being gone tomorrow and most of Friday I am afraid we won’t get to release the video. It’s a little demoralizing. We started talking about Flicka a while ago and although I know we won’t hurt people by delaying the video by a couple days it’s super nice to stay on target. Here’s to late nights and willpower.

Share on Twitter
Posted in Uncategorized | Tagged , , | 2 Comments

Transitions Abound

Thank goodness for headphones. I hate furious typers and loud conversations. Speaking of music, my initial set of ear bud cushions are falling apart so I’ll need to replace them. Fortunately, the set came with 4 sets of replacement cushions.

Next I’ve been putting a little here and there to update this and my resume site. Things, I think, are taking shape. I’ve been so busy with work, family, and life that it is hard to put time into much.

Remember that m1710 laptop I’ve been lugging around? I don’t regret ever owning it and I would still bring it on trips where weight wasn’t as big of an issue. Coming in at ~10.2 pounds, though, I can’t believe I’ve been doing that as long as I have. Crystal, after tons of research and sneaking around got me an Asus Eee PC netbook for my birthday and I am completely thrilled with it.

At ~2.8 pounds and a great battery life, it seems I’ve found the perfect commuting companion. No need to carry the AC power adapter. I can blog, email, and program. I immediately installed Ubuntu 9.10 (removing Windows 7 Starter [what a pile of crap! You can't even change the wallpaper. No way am I paying $80 to upgrade.]) using a 4GB thumb drive I ran out and purchased. Eclipse, Android SDK; everything works fine. Some of the function keys are a little wonky but I’ll work that out over time.

Yesterday was a strange day. Work came and went. I got home and the kids were happy to see me. I grilled some delicious steaks. It was good. I love my family. The kids have been hard on Crystal. She’s at 37 weeks and it’s definitely getting to a point where being home alone with the kids is hard

Oh, I finished my first issue of The Economist. Bullshit to the reviewer that said it takes 2-3 hours to read. Over 100 pages in length minus a few pages for job posting and adverts, it took me triple that. Of course, it is a bit much. I guess I could be more picky. I only skipped the book and media review section. Anyway, I don’t want to miss my book reading so I need to find a way to balance my time.

Share on Twitter
Posted in Uncategorized | Tagged , , | Comments Off

Rox0r Gamez y0 & Other Stuff

I’ve been super busy, first off, so although I’m about to go off about how awesome Dragon Age: Origins is keep in mind I play a few hours a week. Anyway, the story writing and just everything is awesome. Some of the modeling for when characters are speaking is off. There are some wonky parts in the story. Overall, though, it’s been fun.

The expansion (Dragon Age: Awakening) came out yesterday and it looks like it’ll continue where I left off. Inside was a curious card with 2.11.2011 printed on it. I am a little worried about a sequel being rushed out. I haven’t played any of the Mass Effect series. With how good this has been I might have to broaden my horizons.

Now for some interesting viewing. It’s long but chalk full of so-called conspiracies and stuff. I dig it. I know Alex Jones and some of the Prison Planet/Infowars stuff can go off the deep end but I appreciate some of the things these guys point out.

It’s been a stressful couple weeks. Work issues. Church issues. The office has been fairly quiet this week since most of the team is out on vacation or sick. As a lead developer I’ve seen my code time drop significantly. I still have a lot to look at and learn but my contributions are more about what I can provide for the team rather than lines of code I can push out.
I’ve been working on Flicka and it is coming along quite nicely. The library we have been using has been relegated to a wrapper for the Flickr API. It’s disappointing how limiting it has become especially since it doesn’t offer a lot of the functionality offered up by the API itself. The developers are probably busy but I actually wouldn’t mind helping out and working on the library. Might be neat to be part of an open-source project.
It’s a good learning experience. I’ve gone in and torn apart and added functionality to the source, learned a lot about Java and the Android SDK, and managing my time even when I don’t really want to go through and test that bug for the 100th time! Right now I am fleshing out the Groups and Group Info sections. After that I need to rethink the caching for Contacts and Contact Info sections. Then off to working out notifications and uploading pictures.
I recently subscribed to The Economist to get my fill of news and analysis. It has some bias but overall seems fairly comprehensive without all the useless sports and celebrity gossip you find elsewhere. I’ve been reading Good Soldier Švejk. It’s been quite a hilarious journey. The translation isn’t the best but the gist is all there. It’s actually got me contemplating finding some more stuff to read by Czech authors.
Share on Twitter
Posted in Uncategorized | Tagged , , , , | Comments Off

Oh Snap

I got tired of the old blog, the history with it, and just everything about it so I’ve deleted everything and started over. It was spontaneous which isn’t my style but I am glad to begin fresh. I’m not sure how and what I am going to share here. Kind of going with the flow. I guess just like everything else about the web – it’s evolving.

Eventually I’d like to migrate some of the more meaningful posts from the old blog. We’ll see. For now I am going to be playing around with what I like so things might be in a constant state of upheaval.  Stay tuned.

Share on Twitter
Posted in Uncategorized | Tagged | 3 Comments

First Round: Car Wins

I’ve embarked on an unknown round fight with ol’ Sadie. It’s been sitting for what, five years now? The last time I started that car it ran for 10 minutes and then quit. I came out to it and tried to start it again and nothing. Just a disappointing rotation with no spark.

What was it? Fuel? Spark? Shifted distributor? Blown coil? The possibilities are endless but fortunately there is a fairly good (although probably) expensive path to fixing it.

Today we all went out to the car and I cleared it from all the junk my dad has piled around it. Opened the hood, attached the battery cables, and gave it some cranks. Seriously, after sitting for over 2 years the battery still held a good charge. That was at least some good news.

Then I went off to the car parts store and picked up a $20 multimeter. It was wonderful to get into all the different parts of the ignition and try and figure out what was running current. The battery was at around 10 volts.

Anyway, I figured the ignition coil was bad since it was returning about the same from the what was coming out of the battery. That made no sense. The fast that it looked 20 years old and has a 12 month, 12,000 mile warranty tells me it should have been replaced long ago anyway. So I replaced it. Still no spark. I am afraid it may even be bad fuel. Not sure.

The cap and rotor are basically brand new. I’ll probably replace the wires next and work my way through the ignition system and then into the fuel system. I’m hoping to get it fixed so we can use it as a Sunday car since it will easily fit 5 of us. I suppose I’d rather have this initial challenge than another loan. Besides, if this gets fixed I would love to get it fixed up and partially restored.

All in good time.

Share on Twitter
Posted in Uncategorized | 1 Comment