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.