2008-11-30

Did Thomas's mouth just move?

I finally got around to replacing the network cable on my wife's MythTV box, and it is back to recording TV shows for the kids again. I started up a new recording of Thomas the Tank Engine for the toddler, and I had to do a double-take when I saw his face actually move when he spoke.

If you're not familiar with the show, it's done with model trains that have faces. The faces change from scene to scene, but never "on-camera". The only thing that you ever saw move was the eyes, which could shift (or spin on some comical occasions). The faces were very expressive, but they were always static plates that would be interchanged when the camera cut away.

Well, no more. It appeared that the faces were now animated, although the rest of the show did appear to be the same model sets. A quick google did seem to confirm this guess, that as of this season, the face plates in filming were replaced with a target that a computer used to overlay with a CGI face. The effect is actually pretty well done; to me, the face does indeed look like it is part of the train.

Oh, and the people, which were before just wooden models, are now completely CGI. They still have the same look as their wooden model counterparts, but now they can move around, although they are animated to be almost robotic — probably to keep the impression of their wooden heritage?

Of course, the internet being what it is, as I was googling, I came across the melodramatic reaction that they've "ruined" Thomas the Tank Engine. I dunno, my kids (after getting over their initial shock of first seeing Thomas "blink" and then actually "talk") thought it was pretty cool.

I'm still a little undecided. Not that I spend a ton of time analyzing Thomas, but it is getting watched a bit more often now that our toddler has decided he likes watching "woo-woo" (train whistle, although the "word" also applies to cars) almost as much as he likes "Wawwy" (that's "Larry" from Veggie Tales). It's definitely different.

What does concern me a bit is that the press release indicates that while the faces are CGI this season, next season the entire show will be CGI. Because they use models now, it has that "model railroad" feel. Going all CGI would make it possible for them to completely change the look and feel of the show to however they want. Hopefully, they won't, because I think that's part of the show's charm.

I can definitely see, though, how it might be almost a little sad to think that there aren't actual model trains behind the show anymore. I grew up with model trains. But I also am a computer geek, and I can understand why they would want to move to using computers to produce their show. I imagine their models need a lot of maintenance, and creating a new character or even a facial expression is a costly amount of work, involving real, physical materials.

But they've always done it so well. Hopefully they don't end up trivializing it.

The press release also indicates they're moving the show Bob the Builder from stop-motion to CGI. I'm surprised they didn't do that sooner. I can't imagine how much time and energy and patience must go into making a stop-motion video.

2008-11-16

Don't say that word!

Religious discussions (particularly on the internet) rarely end well. No matter what forum, someone will bring up the ways religion has been perverted to propagate fraud for someone's financial gain, or how many people have died because of arguments that have led to violence that have led to wars over religious differences, or some other list of atrocities. And, nearly always, someone will posit that religion itself is the cause of those travesties, arguing they would not have happened if religion had not existed, and therefore, the world would be a much better place, and indeed would have been a much better place for all of history, if religion didn't exist.

It's a hurtful thing to say to someone of faith, that the world would be a better place without something that you believe to be important. I don't think it's necessarily said with the intent to be hurtful. It's just an expression of their opinion.

Because opinions differ to such a degree, however, it's considered "conventional wisdom" that, to avoid hurt feelings, one simply does not discuss religion.

I've thought about this, though, and something occurs to me. If I were Satan, and I wanted to stop people from drawing closer to God, it seems that one very effective way to do this would be to stop people from talking about Him. I think that spreading it around that it was somehow "impolite" to talk about religion might be a good way to make people stop talking about it. In fact, it might have the added bonus of making people expect a religious discussion to be impolite before it even began, to make them less likely to respect another's point of view (even if they disagree with it) and more likely to use absolute statements that are hurtful and mean, perhaps without even realizing it.

So that means the only appropriate response is to talk about it.

The argument goes that religion is the cause of so much evil and horror in the world, leading to many of the wars in history. However, I look at our current government. It has ruled under a policy of not governing according to a religion. And yet, it has had plenty of opportunity to wage wars for different reasons. So to suggest that wars were caused by religion would also suggest that, without religion, the wars wouldn't exist. And yet, mankind seems to find plenty of reason to wage war outside of religion.

Some people point to the instances of people using religious influence to swindle people out of money for their own personal gain, or even violations of person. This, too, has plenty of evidences outside of religion to be considered a flaw of religion itself.

The very argument that religion should be thrown out based on these examples is flawed anyway. It is an extreme solution that focuses on the negatives of people misusing the tool. One could make the same argument with governments. Or public schools. Or armies. Or the Boy Scouts. Or the internet. Guns. Television. Oil. You name it; somebody has used it to hurt someone. Maybe even lots of people. Maybe started wars over it. And yet to say "it" is bad is just scapegoating at best.

I'm not sure why someone would say the world would be better off without religion. Maybe it's scapegoating. Maybe it's just that they don't like it and would rather not hear about it anymore (akin to me saying "The world would be better off without rap music," no matter how many people like it). Maybe it really is an attempt to say something so extreme and hurtful that it closes off any further conversation. It's hard to say, considering a statement like that does close the door to any meaningful dialog.

Which, unfortunately, is probably very pleasing to a certain enemy to all righteousness...

2008-11-12

A boycott of United Airlines

Greg Dean of Real Life Comics posted a rant today about some really insulting fleecing from United Airlines. I know this blog doesn't get a whole lot of traffic, but it's something that I think is important to note. This kind of behavior is just inexcusable.

I already avoid flying for the expense. Even when gas prices were at an all-time high this summer, I chose to drive my family out to California rather than battle the airlines and airports who have seemed out to make flying as inconvenient and expensive as possible. You can be sure I won't be flying United if I have anything to say about it.

2008-11-06

Calling a Web Service in a loop

Wow, does this ever suck.

Ok, so here's the problem. I have a service that takes an XML file, which contains a list of parts from another system, and I need to synchronize the list of parts with our system. In order to do this, the service loops through the list of parts, and for each one, it attempts to look up the part in our system. If it exists, it gets it, and updates its properties with data from the file. If it doesn't, it creates a new one, with properties from the file. It gathers all these creations/changes into a collection, and then saves the batch to the database.

Seems pretty straightforward, right? The catch is, the interface to our system is through an authenticated web service.

Well, gee, that's not so tough, right? After all, in .Net, you just create a reference to the web service, and it does most of the work for you, creating all the wrapper classes and so forth. And, most of the time, it's as simple as that.

The problem, though, is that in this sample data set, we had about 5,000 parts. For each part, a query had to be made to the web service: Give me this part. (It'll return either the part, if it exists, or a null, meaning it doesn't, and I have to create one.) And for some reason, after about 3800 or 3900 calls to the web service in rapid succession, it would just quit. "Unable to connect to web service." The inner exception revealed a little more detail: "Only one usage of each socket address (protocol/network address/port) is normally permitted."

Huh?

After considerable digging and googling, I finally unearthed this blog post by Durgaprasad Gorti, which reveals the problem. An authenticated call closes the connection, but the Windows TCP stack holds the socket in a "TIME_WAIT" state for four minutes by default before it can be reused. While he does offer a registry hack to tell Windows to cut that time shorter, I wanted to find a way to do it in code, so it's one less variable to keep track of on a client's machine.

Unfortunately, all of my experimentation proved fruitless. No matter how I played with the ServicePoint, trying to forcibly close it, setting its timeouts to minimum values, whatever, the sockets stayed open too long.

So much for trying to out-think the Microsoft guy.

His code-based solution, therefore, is the one I'm using. Unfortunately, it's not great in that it basically just delays the problem — by expanding the range of sockets it can use, instead of crashing in under 4,000 calls, the limit is raised to 60,000.

He gives the basics of how to implement it, but unfortunately he doesn't indicate where the code needed to go. Fortunately, I found another blog post, by Kamil Pakur, that gave me just the clue I needed. (Incidentally, he's trying to solve the same problem, but his solution — forcing the KeepAlive to false and the HTTP protocol version to 1.0 — didn't change anything in my scenario; it still crashed in under 4,000 calls. In fact, it would seem that KeepAlive=false, which is automatic in an authenticated scenario, is the source of the problem.)

So, here's what I did:

  1. Copied the "namespace" and "public partial class" lines from the auto-generated Reference.cs file representing my web service into a new code file.
  2. In that file, copied Gorti's public static IPEndPoint BindIPEndPointCallback method.
  3. Added to that file a protected static int m_LastBindPortUsed = 5001; line (which is used in the "BindIPEndPointCallback" method).
  4. Added a method to override the service's GetWebRequest event that set the ServicePoint.BindIPEndPointDelegate to the BindIPEndPointCallback method (the first line on Gorti's code block).

My entire class file looks a lot like this:

namespace ProjectName.ServiceName
{

 public partial class Service : System.Web.Services.Protocols.SoapHttpClientProtocol
 {
  protected override System.Net.WebRequest GetWebRequest(Uri uri) {
   System.Net.HttpWebRequest webRequest = (System.Net.HttpWebRequest)base.GetWebRequest(uri);
   webRequest.ServicePoint.BindIPEndPointDelegate = new System.Net.BindIPEndPoint(BindIPEndpointCallback);
   return webRequest;
  }
  //protected override System.Net.WebResponse GetWebResponse(System.Net.WebRequest request) {
  //    if (request is System.Net.HttpWebRequest) {
  //        System.Net.HttpWebRequest httpRequest = (System.Net.HttpWebRequest)request;
  //        System.Net.WebResponse response = base.GetWebResponse(httpRequest);
  //        httpRequest.ServicePoint.MaxIdleTime = 1;
  //        httpRequest.ServicePoint.ConnectionLeaseTimeout = 1;
  //        httpRequest.ServicePoint.CloseConnectionGroup(httpRequest.ServicePoint.ConnectionName);
  //        return response;
  //    } else
  //        return base.GetWebResponse(request);
  //}
  protected static int m_LastBindPortUsed = 5001;
  public static System.Net.IPEndPoint BindIPEndpointCallback(
   System.Net.ServicePoint servicePoint,
   System.Net.IPEndPoint remoteEndPoint,
   int retryCount) {
   int port = System.Threading.Interlocked.Increment(ref m_LastBindPortUsed);
   System.Threading.Interlocked.CompareExchange(ref m_LastBindPortUsed, 5001, 65534);
   if (remoteEndPoint.AddressFamily == System.Net.Sockets.AddressFamily.InterNetwork) {
    return new System.Net.IPEndPoint(System.Net.IPAddress.Any, port);
   } else {
    return new System.Net.IPEndPoint(System.Net.IPAddress.IPv6Any, port);
   }
  }
 }
}

(I left in the code for the GetWebResponse override, just so you can see some of the things I tried to clear up the sockets. It's all commented out now, of course, because it, quite simply, just doesn't do a blasted thing.)

The service now completes the run on our test data. However, I'm still not comfortable with the solution. There is an upper limit to the amount of data that it can process at a time.

Maybe a better solution is to ship the file across to the web service and do the processing there. (It would certainly make for a cleaner interface, an actual web service that does tasks, instead of the glorified and bloated data access layer we have now.) But that, too, is a double-edged sword. Web services have limits on how much data can be shipped, plus timeouts on how long the client will wait for a response.

What really surprised me in researching this is how little information there was on this problem. I guess calling an authenticated web service in a loop isn't a common scenario. It was only when I googled the text of the inner exception that I found it, amongst a lot of results pointing to people actually opening a lot of TCP connections manually.

I did come across a few posts of people complaining about web services failing in a loop, but the responses (when there were any given) were nowhere near the actual solution (suggesting a timeout issue with the session or authentication cookies). Maybe this post will be of more help, since I tried to bring the problem and solution together.

2008-11-05

Cell-ing Out

This MSN Tech article asks the question, "Are all the extra features really necessary? Or should a phone just be a phone?"

An interesting stat mentioned is that "camera phones … outsold regular cell phones for the first time in 2007", but what it doesn't say is why. Last time I looked at cell phones (which must've been four or five years ago, as that's at least as long as I've had my current phone), you had to look hard to find one without a camera, whether you wanted one or not. It's almost like Microsoft bragging about how computers with Vista are outselling XP, when it's extremely difficult to find a computer with XP anymore.

Personally, I don't even use my phone for text messaging, let alone email; but that has more to do with cost than with preference for the feature. I would love to surf or instant message from my phone, or use it to play music. But a full-featured phone like that starts at over a hundred dollars, and a data plan would increase my monthly cell phone bill by close to 50% (just for my line, and if I got it, my wife would want it, too, thus doubling the cost). Even text messaging plans are getting expensive (as I've ranted about before).

I've used a Pocket PC for a time (before the battery stopped holding a charge), and I thought it was wonderfully convenient, even if it lacked connectivity. I think one with a built-in phone and Wi-Fi would be the cat's meow. But, it's just not a need, certainly not compared to not spending the extra money per month.

Makes me wonder about these people who do use the extra services — "the youth", the article says. Are they paying their own cell phone bills, or is it coming out of mommy and daddy's account?

The winds of "Change" stink

Well, media's darling boy has been elected president.

It's being said that this was a historic day, as it was the day when America finally elected a black man as president, thus proving that the color of your skin doesn't matter. (Looks to me more like the day we elected the wrong man president, chosen by the media months in advance, thus proving the content of your platform doesn't matter if you have a buzzword, a logo, and a catchy motto; but let's MoveOn, shall we?)

I don't think prejudice is out of the picture at all. To satisfy my own morbid curiosity, I snuck a peek at a certain online community I know of that is extremely left-leaning in its membership, just to see how hard they were patting each other on the back (and mentally compare it to the prophecies of doom and gloom of four and eight years ago).

Among the comments of smug satisfaction, I noticed one referring to "the new monkey in the White House". This post was followed by calls for moderation and censoring for such a racist statement.

What's very interesting, however, is that our current president, George Bush, has often been compared to a monkey. How many pictures have we seen with Bush's face side-by-side with faces of monkeys showing strikingly similar expressions? I know I've seen a few, probably had the same set in my email box a dozen times in the past eight years. However, to extend this same metaphor to president-elect Obama ("the new monkey" definitely alludes to there being an "old monkey") is now taboo because of the color of the man's skin.

This point was brought up in the forum. The administrative conclusion was that the initial comment would be allowed a pass, but a repeat comment would be considered malicious and subject to disciplinary action.

I predict we'll see a lot more of this during the next four years. Criticisms and jokes that would've brought cheers and howls of laughter levied against the Bush or Clinton presidencies will, when made against the Obama Administration, bring howls of protest and accusations of racism. Dis the president now, and you're not just unpatriotic, but a racist.

If this is used to shut down right-wing media outlets (at worst, or "merely" as a way to institute the "Fairness Doctrine"), it wouldn't surprise me.

2008-11-03

Bandwidth for October

Just to continue the analysis, bandwidth usage for October was 32,094MB down, 6,580MB up, 38,674MB total. Aside from the extra video watched one weekend earlier this month, there were a lot more demos to download from the Xbox Live Marketplace for my Xbox 360.

Still, the total bandwidth consumed was only 10GB larger than my September "baseline", and over 200GB shy of the cap.

Even the psychological effects of the cap are starting to wear off at this point.

I wonder if there's something I can torrent, to see what kind of effect that has on bandwidth.…

Morpheus, Grokster, Limewire and Kazaa!

Yep, I said some dirty words. Or at least according to MTV. Weird Al Yankovic, my most favoritest artist evar, mentions those file sharing sites (two of which don't even exist anymore) in his song "Don't Download This Song" (which he offered up for download upon release), but MTV refused to run the video with those names mentioned.

So, Yankovic obliged by censoring the video. But, he did so in the most obnoxious way possible, with very loud, irritating beeps. Why? In his words:

Instead of subtly removing or obscuring the words in the track, I made the creative decision to bleep them out as obnoxiously as possible, so that there would be no mistake I was being censored.

Techdirt reported on this here. They link to the New York Times article here, although I don't know if the Times will hide their article behind a paywall eventually (the major newspapers seem to be going back and forth on this idea), hence the Techdirt link.

I like Weird Al. :D And, he's a very nice guy in person, too, or so says my lucky brother who happened to meet him and was able to taunt me with this picture.

my brother and Weird Al

No, I'm not jealous. Why would I be jealous? Just because he happened to meet the one musician I happen to be a big fan of... :P

Sex on TV Increases Teen Pregnancy, Says Report

Just another reason why you shouldn't let TV raise your kids.

2008-10-30

Is this file open?

Coding problem of the day: I have a service (written in C# .Net) that monitors a folder for incoming files, and when a file appears, it needs to process it. At the moment, it is using a FileSystemWatcher object. I don't know if I'll continue to use that or not (it was written by someone else before I got here), as it doesn't guarantee any sequence of events, nor does it help if files exist before the service is launched. But that's beside the point.

The problem I discovered is, if the file is coming from another computer over a slow link (e.g. an FTP or other slow network transfer), the FileSystemWatcher will raise its Created event as soon as the file appears, but the file is not yet ready. (I simulated this by writing another program that slowly writes a very large file to the target directory, using a loop and a Thread.Sleep.)

The solution, like a lot of other things in programming, is a little convoluted, but it seems to work for the time being. The gist of it is, in the Created event handler, I first call a function that tries to open the file for exclusive read access. If the file is still open, this will fail.

Testing for this failure is the hard part. The exception that gets thrown is a fairly generic IOException, and while a "file in use" is one condition for which I want to stop and wait, there are other conditions that I would quite definitely not want to wait to magically resolve themselves. The MSDN doc on IOException lists several derived classes that, for example, I would rather treat as critical errors immediately, like PathTooLongException, DirectoryNotFoundException, FileNotFoundException…. If I waited on those, I have a feeling my code would be waiting a very long time.

So, here's my "is this file locked" function:

using System.IO;
using System.Threading;

/// <summary>
/// Makes sure a file is closed before attempting to use it
/// </summary>
/// <param name="fullFilePath"></param>
public void WaitForFileClose(string fullFilePath) {
 while (FileIsLocked(fullFilePath)) {
  Thread.Sleep(new TimeSpan(0, 0, 15));
 }
}

/// <summary>
/// Determines if a file is still locked by attempting to open it for unshared (exclusive) read access.
/// If an IO Exception occurs that includes the text "another process" in the message (i.e. "in use by
/// another process"), the file is assumed to be locked.  Any other exceptions are rethrown.
/// </summary>
/// <param name="fullFilePath"></param>
/// <returns>
/// true if the specific "another process" exception was found trying to open the file, false
/// if no error occurred.
/// </returns>
/// <remarks>
/// May not work on systems in other languages.  There is no specific "file locked" exception to
/// test for, and there are other exceptions that derive from IOException (like FileNotFoundException)
/// that should not be waited on.
/// </remarks>
private bool FileIsLocked(string fullFilePath) {
 try {
  using (FileStream fs = new FileStream(fullFilePath, FileMode.Open, FileAccess.Read, FileShare.None)) {
   fs.Close();
   return false;
  }
 } catch (IOException ioex) {
  if (ioex.Message.Contains("another process"))
   return true;
  else
   throw;
 } catch {
  throw;
 }
}

As I note in the comments, I'm concerned this might not work on other locales, since I'm specifically looking in the exception's message text for the string "another process". Unfortunately, I don't have a better way to determine what IOException got thrown. I set a breakpoint and tested it, and (at least in .Net 2.0 on Windows XP SP3), it was indeed throwing a base System.IO.IOException with that text in the message.

I'm open to any better ideas, though….

2008-10-28

The DMCA, 10 years later

The EFF is "celebrating" the 10th anniversary of the Digital Millennium Copyright Act with a report of the unintended consequences its use and abuse has had on research, trade, and civil liberties. It's a worthy read, even if they do leave out one of my favorites — that Sharpies were suddenly circumvention devices because they could be used to defeat CD copy protection*. :D

*Ok, no legal action was ever taken against Sharpies, or even web sites for describing the process as far as I know; but the fact that this joke popped up around the internet more than once just shows how ridiculous the whole thing is, and how easily it was recognized as such back in 2002.)

2008-10-27

If the MPAA Did Handbags

Continuing the theme I seem to have picked up lately, in linking to random articles I find interesting, was this one I saw via Techdirt. It's from the "Pure Purse Passion" site BagBunch.com, and it's an article that claims to, in its own words, "[show] the bad ethics, hypocrisy and stupidity of the companies behind our TV Shows, our documentaries, our movies, and our music." In short, what would happen if the handbag industry created an "HIAA" and adopted the same practices as the MPAA and RIAA? clicky

Granted, the analogy isn't perfect (and they admit as much in their opening statements). For starters, music these days as a digital good can be copied infinitely, with zero degradation, for essentially zero cost; whereas a handbag as a physical good would still require materials and labor.

Despite the flaws, I think it's a worthwhile article. By applying the *AAs' "logic" to a physical (and non-technical) context, perhaps it'll help make more people more aware of what is going on, instead of just being iTunes sheep who unknowingly lock themselves into whatever draconian DRM rules Apple throws at them.

2008-10-23

Biden's Bungles: A Blatant Bias

Wow. When the New York Post starts to report on media bias (and even Dan Rather is commenting about it), you know there are problems.

2008-10-21

Would the Last Honest Reporter Please Turn On the Lights?

Hear, hear!

How dare you obey the rules of the road

According to the Colorado Driver Handbook, which I just downloaded from the DMV website for confirmation, section 10.1a, if a traffic signal is malfunctioning or not operating, the intersection should be treated as a four-way stop. If the lights are on but flashing yellow, it is a warning of hazard, to slow and proceed with caution (but not "treat as a four-way stop").

For some reason, people in Colorado don't seem to understand these. When they're not completely ignoring them, they get these rules completely backwards.

Last week, I was driving home in the middle of the day to shuttle my wife to the auto shop, as we were down to one car while the minivan was having some maintenance (an $800 repair of the climate control system — ouch), when I noticed a stoplight was completely out. The road I was on was a six-lane divided road, and the intersection was with a small, two-lane road. A pickup was waiting on the cross street.

I slowed to a stop. A truck in the lane next to me blowed through the intersection, and I honked at him — which earned me an irritated honk from the truck behind me. I waited patiently as three more cars blew through the opposite direction before the pickup finally got his turn to go through the intersection, which, as you'll note in my first paragraph above, is legally a four-way stop at this point.

The next street light is also in a "non-standard" mode, but this one is blinking yellow. (The street I'm on has reduced to a two-lane road by this point.) Wouldn't you know it, traffic coming the other way is actually stopping at this blinking yellow light. I slow a bit, to make sure the car waiting on the cross street at his blinking red light doesn't try to pull out in front of me, and cautiously proceed through the intersection.

After I pick up my wife, we head back on the same road. I notice people are now treating the dead light like a four-way stop, but I believe this is due to the police car that has stopped beside the intersection, as a cop is donning an orange vest to direct traffic.

Slow down, so I can cut you off!

My friend, the "Top Hat Rabbit", just made a blog post that reminded me of a driving incident. This happened many years ago, but I still remember it clearly.

I was driving home from work one day, and to avoid traffic, I cut through a neighborhood, taking a route I had taken many times before. At one point, I came around a curve, where a side street joins the main road I was on. A couple guys in a little red convertible were at the stop sign. The driver was talking to his passenger, not paying any attention, and started to pull out in front of me as I came by. To avoid getting hit, I hit the gas and swerve around him. My sunroof was open, so I heard him yell, "Slow down, a**hole!"

Of course, he couldn't let this go. He had to prove to his friend how big a man he was. Up at the street light exiting the neighborhood, I waited to turn left, and he pulled up beside me in the right turn lane, arm and middle finger extended. When I refused to so much as glance in his direction, he tried to get my attention. "Hey a**hole!" he called. Still no reaction. (Nice language to be shouting in a neighborhood, I thought.)

He inched his car forward, I suppose so he could get a look at my front license plate, which I guess he wrote down, because he then started waving a piece of paper in the air, calling, "A**hole!!!"

The light turned green. I finally looked over at him, blew him a kiss, and drove off.

Hope I didn't make his boyfriend jealous.

2008-10-07

SQL 2005 getting too smart?

We had a bug with one of our clients that had just upgraded from SQL Server 2000 to 2005. In the process, we were deploying some new application features to them, and one was crashing. This same feature was working just fine for other clients (and in-house, of course), so we were puzzled.

The problem is actually from something I used to wish SQL Server was smart enough to figure out on its own for a long time. Namely, when you write a SQL statement such as this:

Select U.UnitId, U.UnitName, UT.UnitTypeName
From Unit U 
Inner Join UnitType UT On U.UnitTypeId = UT.UnitTypeId
Order By UnitTypeId

you will get an error to the tune of "Ambiguous column name 'UnitTypeId'", because (in this case) you reference it in the Order By clause but don't indicate which source table you want, since the same column name exists in both tables referenced in the From clause.

Logically, it doesn't matter which one, because you mandate in the From clause that both UnitTypeIds are equal, but SQL syntax dictates you must specify which one you want.

Despite seeing this many times, it's still not automatic that I'll specify the table in my Select and Order By clauses, so I still see this error a lot.

I hadn't seen it recently, but suddenly it popped up on this one client's database. Sure enough, I hadn't specified the table in the Order By clause again. Yet it was working fine on other clients' databases, and working fine internally.

Our QA guy managed to find the "SQL Compatibility Mode" option on the database. Because they had upgraded this database from a SQL 2000 database, it was still in "SQL 2000" mode. Because of this, it was revealing the error in my SQL that was going through undetected on servers running in native SQL 2005 mode. He flipped the switch to "SQL 2005", and it let my bug go through.

Needless to say, my local database is now in the more restrictive "SQL 2000" mode, so hopefully I can catch more bugs before they're revealed by environment. It should also help if we ever decide to migrate to other database servers, such as MySQL.

Impact of video on bandwidth

Continuing the saga of bandwidth, I had an interesting data point come up this weekend. My church has a general conference twice a year, where we have an opportunity to hear from the leadership of the church. This is streamed live over the internet in fairly decent quality video (in my completely unscientific opinion, it looked just as good as any standard TV show might look on a 12" laptop computer screen).

The conference spans the entire weekend, with two 2-hour sessions broadcast each on Saturday and Sunday. At the end of the second Sunday session, the thought suddenly occurred to me; I wondered how much bandwidth I was using up.

Fortunately, this is something I can check without too much difficulty. A quick call to vnstat reveals the following statistics:

DayInOutTotal
Saturday4.68 GB206.82 MB4.88 GB
Sunday3.98 GB123.33 MB4.10 GB

Saturday will of course include some extra bytes for online gaming, which doesn't happen on Sunday.

Interesting thing about those stats: if that happened every day, watching four hours of streaming video, I still wouldn't hit the cap. I'd come far short of it, in fact.

2008-10-01

Bandwidth - the Baseline

September is now over, so I now have my baseline for monitoring my bandwidth, to see how I fare against the bandwidth cap. Total data used for the month of September: 22.36GB down, 5.44GB up, 27.80GB total.

September was a bit of an odd month, though. For about a week and a half, I was without an Xbox 360; and for almost the whole month, my wife was using my laptop while we tried to get hers repaired (the wireless network card was fried). However, even with those odd variables, there are some worthwhile data points.

First off, there is only one day in the entire month of September that shows a total over 2GB (2.24GB used on 1 Sep) — every other day is under 2GB, and only 5 days total are over a gig and a half, with an additional 7 days between the 1G and 1.5GB marks.

There is a definite dip in usage around the time my 360 died, so its effects are noticeable. There's also a spike on the 13th that would represent when I got my new 360 and proceeded to play the heck out of it all day. Another sweep up starts on the 23th, which could represent when I and three others decided to make a speed run at a Halo campaign level for a competition that Friday night (we practiced every night that week). The extra boost starting on the 25th may come from my wife finally getting her laptop back from HP and having to download updates and reinstall software.

Even with the up-ticks, there's still not a lot of bandwidth being used. If you take the heaviest of the days that should represent things getting "back to normal", the 25th, and multiplied that by the entire month, it's only 50GB, or about a fifth of the cap.

But how could that change? If I wanted to ditch the $40+/month "digital voice" service from Comcast and shop around for other VOIP options, I'd be looking at an increase in usage just for using my phone. If I wanted to take advantage of the upcoming Netflix integration with the Xbox 360, that would cause a huge increase in bandwidth, depending on how many movies I tried to watch. For that matter, the "New Xbox Experience" is creating a new paradigm for interacting with friends (i.e. they're ripping off "Miis"); will this have an impact on how much bandwidth is used just sitting in the dashboard, while my friends' avatars are displayed on my console?

I think I've come to the conclusion that it's safe not to worry yet, but it still makes me nervous about trying new and potentially high-bandwidth-eating applications or services. And I still think that's just the way Comcast likes it.

2008-09-16

Zune Software Revisited

The Zune software player has gone through an update or two since I last checked it out at the beginning of the year, so I thought I'd give it another look. Unfortunately, I'm still not impressed.

The player is responding to the media keys on my keyboard, so I can play, pause, and skip quickly. It also does the neat (and useless, but I like it, so there) trick of updating your Windows Messenger status line. And it hasn't caused my computer to blue screen (yet).

However, when I set up the software, plugged in my Sansa media player, and told Zune to watch the E:\MYMUSIC folder, it did absolutely nothing. I thought it was supposed to automatically add the files to the library? I tried dragging and dropping the files from Explorer to Zune, but still nothing happened. It wasn't until I selected the files in Explorer, right-clicked, and said "Play with Zune" that the Zune player would play the files. It still didn't add them to the library, but it did at least create a playlist of all the files.

There are still features that are just missing. Automatic volume leveling, quiet mode, a graphic equalizer, crossfading, a mini-mode... These are all features that I can remember being built-in to programs for years, and are, in fact, built-in to Windows Media Player.

Now, when I first started writing this post, it was about a week ago, and as I was checking the Zune.net forums to see if I was the only one to complain about this, I noticed that Zune 3.0 was to be released very shortly. New features, including crossfading, were coming. So I decided to wait until now to install the new version and finish this post.

Unfortunately, if there are any new features, they seem to be reserved for the Zune device itself, as the desktop player is almost entirely unchanged.

I'm not suggesting the Zune team reinvent the wheel. There's no point. What they should be doing is making this a WMP plug-in. Not only would I, as a user, be able to take advantage of the features that already exist in WMP, but I could also download and/or purchase other plug-ins for WMP that enhance my music however I like, and I'd still have the "Zune Social" connection.

I've posted this suggestion in the Zune wishlist forum, and basically the response I got back was, "The Zune team couldn't do everything they wanted with the software within the confines of a WMP plug-in." To which I say, "Do they have to?" Keep their software with whatever it does as a separate app. Heck, all I really want is a plug-in for WMP that updates my Zune card with my plays, but let me use WMP as my player.

I suppose what I'm asking is not entirely reasonable. The Zune Social is meant for people who own Zunes and is meant to interact with Zunes. I don't expect any sort of DirectX plug-in that adds the PC games I play to my Xbox Gamercard, as that is meant for people who own Xboxes and is meant to interact with Xboxes. Still, it seems almost cruel to have a taste of this "social experience" thing and have it be so crippled when it could be solved by the simplest little piece of code.

*sigh* Maybe I'll check on it again in another nine months...