Archive for April 2009

iPod Dock Recommendations?

Published on April 26, 2009

I have lots of music that I like to listen to, and I sometimes want to listen to it while lounging around my living room. The most convenient (and obvious) way to access my music is through my iPod, which houses my entire collection. At the moment, I don’t have a way to play my music in the living room (besides busting out my headphones, which I don’t always feel like doing).

Does anyone have recommendations for how I might go about doing this? I don’t want the music to play through the TV (I’m willing to buy external speakers). A user friendly interface would be beneficial as well (maybe a way to change tracks, volume, etc from the couch?).

What does everyone else do?

Replacement for Add_Delta_Days

Published on April 22, 2009

One of my Perl scripts here at work used the Add_Delta_Days subroutine from the Date::Calc module to do some calendar date arithmetic. I’m in the process of building a new machine on which this script will run, and I don’t have access to an external network. Unfortunately, the install process for Date::Calc is fairly difficult. The module relies on a C library which must be compiled with the same compiler as was used to build the local Perl install. To make matters worse, the modules that Date::Calc is dependent on have similar requirements. As a result, I decided to skip installing this non-standard module, and instead use a home-brew replacement. It turns out that Add_Delta_Days is fairly straightforward to replace:

use Time::Local; # Standard module

sub addDaysToDate
{
    my ($y, $m, $d, $offset) = @_;

    # Convert the incoming date to epoch seconds
    my $TIME = timelocal(0, 0, 0, $d, $m-1, $y-1900);

    # Convert the offset from days to seconds and add
    # to our epoch seconds value
    $TIME += 60 * 60 * 24 * $offset;

    # Convert the epoch seconds back to a legal 'calendar date'
    # and return the date pieces
    my @values = localtime($TIME);
    return ($values[5] + 1900, $values[4] + 1, $values[3]);
}

You call this subroutine like this:

my $year = 2009;
my $month = 4;
my $day = 22;

my ($nYear, $nMonth, $nDay) = addDaysToDate($year, $month, $day, 30);

This subroutine isn’t a one-to-one replacement, obviously. Unlike Date::Calc, my home-brew subroutine suffers from the Year 2038 problem (at least on 32-bit operating systems). It likewise can’t go back in time by incredible amounts (I’m bound to the deltas around the epoch). However, this workaround saves me a bunch of setup time, and works just as well.

Giant Grocery Portions

Published on April 19, 2009

It’s no surprise to anyone that obesity in America is getting worse every year. This animated map shows the progression in the US between 1985 and 2007, and it’s quite a depressing sight. Lots of factors are contributing to everyone’s weight gain: poor eating habits, no exercise, etc., but part of the blame certainly lies with food manufacturers. In recent times, food portions have increased by an incredible amount, and they only seem to be getting worse. Not only are the larger portions contributing to our weight gain, they are also making it much harder for people like me to shop in the grocery store.

Before I go much farther, I must confess that I’m not a big eater. Growing up, I knew guys who could eat two or three times as much as I do at each meal. And there are plenty of my peers today who can do the same thing. So I realize that I’m already starting out on the low side of the curve. However, this doesn’t change the fact that food manufacturers have gotten out of control with portion management.

Shopping for one is difficult enough to begin with, but I’ve noticed that it’s gotten more so in recent times. While at the grocery store recently, I picked up some potato chips for lunch through the week. The bag I bought had “20% more chips free,” making it even larger than the normal bag (which is a little too big to begin with). A sign below the bags of chips offered the following deal: buy 2 get 2 free. So, you have to buy four bags of chips to get a deal! Who in their right mind eats four, full-sized bags of potato chips? Even in reasonably sized families, that’s an insane number of chips to buy at once.

Similarly, doughnut manufacturer Krispy Kreme apparently no longer sells their half-dozen doughnut boxes. Instead, they offer a new box of 9. Every once in a while (maybe once every two months), I used to pick up a half-dozen doughnuts and eat them through the week with my breakfast. By the end of that week, the last doughnuts had nearly grown stale, but were still good enough to reheat. A box of 9 would certainly not last the way I eat them.

There are plenty of other examples, but these two stick out in my mind since I encountered them recently. If food manufacturers would provide smaller portions, at somewhat lower prices, I would be able to enjoy their products more often and I wouldn’t be wasting perfectly good food. As an added bonus, I wouldn’t eat as much, and would feel better as a result. Does anyone else feel the way I do?

Monkey Album Updated

Published on April 15, 2009

I’ve just rolled out a new version of the software that powers my photo albums. The only external change is a modification of the breadcrumbs when viewing an individual image. Instead of the image file name, you will now see a ‘X of Y’ progress indicator. This should make it a little clearer where you are in the album, and removes unimportant information from the breadcrumb list. Page titles for individual image pages have likewise been updated, making back history a little clearer.

One of the largest back end changes in this release is the ability to reorder album images. Previously, album images relied on their file name for sorting purposes. Albums now default to this when uploading, but the order can be changed after the fact. I plan on making some changes to at least one of my old albums using this new functionality.

I hope to offer a behind-the-scenes look at my photo album software in the coming days. Lots of updates have been made to the admin panel, and I’d like to share what I’ve learned. Stay tuned!

Preventing Pirate Attacks

Published on April 13, 2009

It was great news to hear that captain Richard Phillips was rescued yesterday. I’m amazed that snipers could hit someone on a boat, from another boat, at a distance of nearly 100 feet.

As a result of this hostage situation, there has been a lot of news about pirate attacks around Somalia. It’s clearly a big business for these people, seeing as their country is essentially a nonexistent entity. The problem is that these pirates have yet to be punished for their actions. 100% of their ransom attempts (up until now) have been carried through. In other words, they always win.

The other day, it occurred to me how we can solve this problem. All we need is a throwback to the days of World War 2. It’s fairly apparent that these pirates have little naval power. They aren’t heavily armed, they attack in small boats, and they haven’t (yet) appeared in large numbers. As a direct result, this is a perfect opportunity to employ the use of the convoy system.

All we need to do is establish a perimeter around the problem area. If you want to go inside this perimeter, even if you’re just passing through, you have to be a part of a convoy. Multiple convoys would leave daily, protected by the various naval ships that are already patrolling the area. This would make attacks much harder, much less infrequent, and would (I claim) put a large stop on the activity going on.

Random Photos

Published on April 10, 2009

I’ve been sitting on a collection of random photos for some time now (some of which are nearly two years old). After all of that time, I have published a new photo album. Locations for the photos vary wildly. One of my top five favorite photos of all time is in this set, as is the source for one of the random header images here at this site (the only one that hasn’t already been published in an album, as a matter of fact).

Copyright © 2004-2018 Jonah Bishop. Hosted by DreamHost.