Saturday, July 17, 2010

Bandwidth Woes

I've been noticing some oddities with the Road Runner cable internet connection here in Dallas, and those oddities have somewhat manifested themselves in the results of the 48 tests I've run over the past few weeks at SpeedTest.net. They're quite literally all over the map.

The best connection I've found is to a server in Newark, NJ. The connection routes via Chicago over the Telia net and achieves a respectable 23.49 Mbps average download speed.

Strangely, as the servers get closer to the Dallas area, the downstream bandwidth appears to minimize. The download speed from Wichita, KS, is about 23.0 Mbps, and the average download speed from servers here in Dallas is in the 16-17 Mbps range.

All across the US, the ping times are pretty reasonable, in the 40-100 ms range.

At the horrible end of the test results is, unsurprisingly, Accra, Ghana. Now, Ghana actually has pretty good internet connectivity in general, and they consistently beat the USA in average national broadband speed by a wide margin (2-3 Mbps in the USA vs. 7-8 Mbps in Ghana). However, the SpeedTest host there can really only deliver about 0.71 Mbps. It's amusing for amusement's sake, really, and not a reflection on Ghana as a whole.

The really depressing thing about all these SpeedTest tests I've been performing is upload speed. The cable connection here seems to have an upstream cap of about 0.5 Mbps. Note that's even lower than the downstream speed from Accra. It's pretty terrible, and it really limits my ability to do certain things on the internet, like use my work VPN at decent speeds. At least I'm not serving up web pages locally anymore.

Friday, October 9, 2009

Catalyst/DBIx::Class and DBD::Mock

I was writing unit tests for a Catalyst-based Perl application today, and, this being my first big application using DBIx::Class, I had no idea how to mock the database layer. I searched the web, to no avail, which leads me to this blog entry: here's how you mock your Catalyst model from a unit test script.

First, you don't have a $c object when you're in a unit test, but it turns out you don't really need it. You also don't need your DB class, which works out nicely. You do, however, need DBD::Mock, as a replacement for your usual DBD package, and, of course, you need to have your result sets in your Perl include path.

Let's say our application is called MyApp, following the convention of the Catalyst documentation.

Now it's easy enough to get a schema object.

my $schema = MyApp::Schema->connect('dbi:Mock:', q{}, q{});

Before you perform any queries, you need to seed that mock DBD with some data. Which means you need access to the DBI object.

my $dbh = $schema->storage->dbh;

Easy, right? Now, let's add some data to the underlying DBD.

my @data =
(
[ qw(column1 column2) ],
[ qw(foo bar) ],
);

$dbh->{mock_add_resultset} = \@data;

This gives the DBD a table with two columns, column1 and column2, and one row containing values "foo" and "bar", respectively.

You're ready to go! Use your schema and result sets as you usually would.

Sunday, October 4, 2009

Things I (Re)discovered Today

I'm in Texas with Helen right now, visiting her family and generally hanging out. It's been a good trip so far, but I had an unusually great number of epiphanies today.


  • I was given the chance to quantify my hatred of racism today, and I discovered that my hatred for it is well and truly deeper than I ever thought it could be.

  • While eating at Love and War in Texas, I was reminded of just how absolutely wonderful food in Texas is. The antelope (antelope! weird!) fillet, venison sausage, and chili were fantastic, but I was also reminded of why I don't like quail too much: all those tiny little bones are very inconvenient.

  • A storm system started pushing through the Dallas area today and will last for another few days. Over many hours of listening to the patter-patter of light rain this evening, I remembered how lovely a rainy day can be.

  • I should get new batteries for my phone and my laptop because they're both lasting about half as long as they originally lasted.

  • Cats, even those that are not my own, seem to like me quite a lot. Helen's mom has two cats, one who is generally stand-offish and another who pretty much just hates people, and they've both decided that I'm a really cool guy with whom they can hang out and purr and have a good time.

Wednesday, June 3, 2009

RSS on Twitter

I've been looking for some time for a web application that allows me to aggregate news feeds and other things I find interesting into a single page that I may use as my browser start page. Some of these exist: iGoogle, BlogLines, and so forth, but they all lack certain features that I find to be absolutely critical to these sorts of services. I used the New York Times aggregator (My Times) for quite a while, and I really enjoyed it, but they decided to discontinue support for it at the end of last year.

After many disappointments in my pursuit of a new browser start page, I found an unlikely candidate: Twitter. On and off over the past couple weeks, I've been writing what ended up being a 500-line Perl script that retrieves RSS feeds, does some sanity checking on the posts contained therein based on age and whether the post has been processed previously, and then crafts a short summary of the article and tweets it, along with a TinyURL link back to the original post. I just finished the script a little while ago, and so far, it's working brilliantly.

The fruits of my labor may be viewed for a short while at the Twitter page for cwetherbee_rss. After some initial testing, I plan to make my RSS updates private, but if you're interested in following along, let me know, and I'll do whatever I need to do to let you follow the feed.

Now that the script is finished, all that's left is to copy the script and the data cache over to my server in Paris and set up a quick cron job there to keep the Twitter feed updated.

Sunday, May 17, 2009

Twitter

I'm on Twitter! It's fun and much more convenient than writing lengthy, "real" blog entries. Check it out at my twitter page.

Saturday, April 4, 2009

Glasses

I've had glasses for about eight years, primarily because I have had quite a few 40-hour days and have needed to improve my vision a bit toward the end of them. All told, I've probably worn my glasses for a total of about 40 hours over those eight years.

Tonight, though, I was standing outside on the balcony while wearing my glasses, and I noticed the flickering yellow lights on the hillsides in the distance looked somewhat sharper than usual. And, indeed, according to my eyes, they were: I took my glasses off, and the lights turned into slightly blurry objects, not difficult to see but also not focused.

Sigh.

I guess this means I need to see an ophthalmologist, get an updated prescription, and resign myself to wearing glasses more often.

Tuesday, March 3, 2009

Trac

Over the years, I've developed a number of software tools to make my life easier: little scripts here and there that start up my computers in exactly the way I want or remind me when bills are due or backup my email database.

Recently, though, I've found the mother of all free, customizable project management tools, and it turns out to be, through the use of plug-ins, an exceptionally good way to manage and track household projects, bills, and so forth.

The software is called Trac, and it's written in Python and supports SQLite and PostgreSQL back-ends. It can run through Apache or under its own HTTP server.

Trac comes stock with a wiki, a ticket tracking system, a Subversion repository integration tools, and a bunch of other neat, little bits. A long list of plugins is available, too, covering concepts ranging from code documentation to a guest-book. Incidentally, it's also totally painless to wrap Trac in custom CSS to give it your own, personal look-and-feel.

If you're Linux-savvy and need something to help collect the bits of your life that seem to fall away once in a while, give Trac a shot. Using the SQLite back-end, setup is only a matter of about 10 minutes.