Archive for December, 2009

Farewell 2009

2009 was a trying year for the Bush family. To us, this will be known as the year in which we brought a child into this world. A year ago I had no idea what that really meant. Honestly, tonight I still don't fully understand it. What I do know is that my wife and child are asleep in the rooms next door and that I'm sitting here worried about what 2010 will bring for them; for us.

For me, this year I found out what it feels like to be truly worried. So far, I've worried whether or not I would be a good father. I've worried about my wife's safety while delivering our son. Most of all though, I've worried about Hudson himself. The burden of responsibility for a child is huge. I wasn't prepared for the intense amount of worry that I would have for Hudson's well-being.

He's 4 months old now and I'm not sure I've slept a full 8 hours since that incredible day. It's not because I haven't been given the opportunity. I just find myself waking up at odd times in the night with an incredible urge to go check on him. I get up, sneak into his room, lean over his crib, and touch his head while making sure he's still breathing. Seriously, just typing that makes me want to stand up and repeat that sequence of actions. A father's calling to protect his family is that strong.

I have no idea what 2010 holds for us. I felt like I lost control of my environment in 2009. Really I was just hanging on for dear life. I didn't accomplish nearly what I had planned. That's okay though; everyone is alive and we're moving forward. Here's to 2010! I wish you all a blessed year.

Hotlink Help

Since I moved my blogs onto a server which I control, I've been spending quite a bit more time looking at log files. While digging through a log file for the web server, I happened across some funny referrer names for my watermark plugin for jQuery. Hmmm. I pulled up the site, clicked view source, and sure enough there was a reference to digitalbush.com.

Hotlinking is bad. First of all, it's not nice. You are forcing your users to consume my bandwidth which I pay for. Granted, it's a trivial amount for my small plugins, but still, there is a principal involved here. Second, by hotlinking my javascript files, you are putting a whole lot of faith in my server staying online. This shouldn't be a problem going forward, but you can never tell when I'll decide to take the whole thing down to do some upgrades. Third and finally, your linking directly to javascript files which I host puts you and your users at risk of my scripts doing something malicious like capture keystrokes or put nasty images on your pretty site.

Now that I know there is a problem, I aim to fix it. I could be nice and put a friendly alert("Please don't hotlink to digitalbush.com"); at the top of the file. I could just yank the files off the server and leave your page broken slightly. Those seem too nice. It's almost a new year and I'm feeling empowered. I want to be a little mischievous. I love a good prank; especially when said prank can teach a little lesson. Besides, none of the sites I've seen so far seem very large or important.

The problem with all of this is that I'm a little torn. I'm not sure what to do. I mean, imagine the possibilities! In no certain order, here's what I've thought about doing:

  • Inject a banner at the top announcing how awesome digitalbush.com is.
  • Set a style display:none to the body of the page.
  • Cornify the offenders site.
  • For the watermark plugin specifically, I could hard code the watermark to say digitalbush.com.
  • Redirect to the google translated version of the site in Russian.
  • Alter the alignment of divs by a few pixels to mess up the layout.
  • Randomly animate things by timer or by event.
  • Change all of the links to point to digitalbush.com.
  • Change all image sources to point to a script which returns an upside down version.
  • A random selection of the above.

There are just too many options! Dear Reader, what should I do? Should I be conservative and just do an alert? Should I do something else? I'm not going to do anything profane, pornographic, or malicious. I just want to have a little fun. Please give me your input and ideas. I'd love to hear from you.

Where Did 2009 Go?

It seems like just last month I wrote about what I wanted to accomplish in 2009.  Sadly, it looks like I accomplished very little of what I set out to do.  2009 can best be described as a big old load of FAIL with a side of despair and some crazy pudding for dessert. For the sake of review, I:

  • Still haven't met my 2007 resolution of getting down to 250 lbs.
  • Didn't run a 10K this year.
  • Didn't do much to grow this blog. Currently I have 148 subscribers and had 211,000 visits for the year.
  • Didn't do anything with geekintoshape.com.  Which likely explains why I didn't meet goal #1.

That about sums up the measurable goals.  Now, for the unmeasurable, I think I did a little better. Let me explain.

I wanted to live a little more simply.  My wife and I have de-cluttered the house quite a bit.  With our new addition to the house, we've managed to make the most out of our small house.  I'm very proud of how well we've been able to shed some "stuff"

I wanted to get rid of unnecessary obligations.  This was a tough one to do.

Throughout the year I've been doing my best to re-focus myself at work.  I've been at the same place for 5 years and it's amazing just how much responsibility you can accumulate!  Once I sat down and thought about it, I realized that I was involved in every little thing on every little project.  I've made it a point to step back and let my immediate manager run interference for me so that I can actually get things done.  This puts me out of the loop a little, but my productivity gains have been huge as a result. I'm still involved in way more stuff than just writing software, but I feel good about my willingness to step back and let other people be responsible for things from time to time.

More recently I made a really tough decision to let go of a small source of revenue.  On the side I was running a small web hosting business.  I had about 10 clients paying me to make sure that their website worked and they could send/receive emails.  It wasn't much money, but it did allow me to host my sites for free and to have a little extra cash for toys.  Lately my web host has been a little less than reliable and it's caused me a huge amount of grief. I just decided that it wasn't worth the trouble.  I would rather spend my free time with my son, with my wife, writing a blog post or learning something new.  I still feel awful about it because in my eyes, I feel like I just gave up.  In the end though, my sanity won out.

I wanted to make better use of my idle time.  If you don't have children, let me be the first to tell you that having a child is the easiest way to consume all of your idle time.  In the time that it took to write this, I've taken a break to feed Hudson and another to comfort him when he woke up from his nap. There is no more idle time. :)

And there, my friends, is the answer to where MY 2009 went.  It was consumed entirely with the process of delivering and taking care of this:

digitalBush has a New Home

If you are reading this, then you are viewing the site on a new host. Over the past month or so I've had some serious issue with my previous host. I would reveal the name, but I'm still in the process of moving my personal and a few client websites from there. I'm just not going to risk anything happening with those while I migrate things over. Here's how bad it had gotten according to my pingdom account:

digitalbush-downtime

The odd thing is that everything has been excellent up till the point when it stopped being, uhhh, excellent. Technical support failed me over the course of a couple of weeks and I just gave up. I demand better for this silly blog of mine and my clients demand even better. I've managed to age a few years in a month's time.

I'm done with shared hosting. This blog is now hosted on a VPS at linode.com. Now I'm back in control of a few things and that makes me a little happier. I don't really enjoy being a sysadmin, but I do enjoy having control over the software and the ability to scale my VPS up if needed. Right now I'm running a base 360MB plan. We'll see how well that holds up to this blogs modest traffic.

Please let me know if you see anything weird.  I'll post an update later once I've had a chance to see what this little VPS can do.

More Radius Search Fun

In my previous post, I outlined the process which I'm using to speed up radius searches over a large pool of potential matches. With that I was able to answer the question "How many within n miles?" More recently I've been asked to answer the question "What is the minimum radius which contains n records?"

Example Radius Plot

Example Radius Plot

So, let's say that the red dot represents 2 records and the green dot represents 3 records. If I need to find the minimum radius to contain 4 records, then I'll need to go out to the green dot to satisfy that requirement. I think it's time I introduced my friendly query:

WITH available_records_by_zip as (
      select zip, count(1) locations
      from records
      inner join addresses a using(address_id)
      group by zip
)
SELECT origin_zip, radius
  FROM (
    SELECT
      origin_zip,
      radius,
      cnt,
      row_number() over(PARTITION BY origin_zip ORDER BY radius) rnk
    FROM (
      SELECT
          zr.zip_from origin_zip,
        radius,
        SUM(available_records_by_zip .locations) over( --This is the analytic function
          PARTITION BY  zr.zip_from                    --which makes this possible.
          ORDER BY radius
        ) cnt
      FROM
      zip_radius_map zr,
      available_records_by_zip
      where zr.zip_from=:search_zip
      and zr.zip_to= available_records_by_zip.zip
    )
    WHERE cnt >= 4 -- Number of locations needed
  )
WHERE rnk = 1

This is what it does: Given a pool or records, group then by origin zip and order them by distance. Only pull those which meet the minimum requirement by summing their count with all of the counts before them. Order that set by radius and take the first one. That guy is your minimum requirement.

In the real world, I'm joining to a table of target zips, but you get the idea. Doing it this way(cheating), I can do a single analysis for a few thousand target zips in a handful of seconds. The time it takes really just depends on the size of your set of available providers. These Oracle analytics functions are very powerful once you understand them.

Next Page »