August 30, 2004

Surreal beyond belief...

Tonight, at 5:30p, I'm going to be in Centerville, Utah filming a segment for an upcoming episode of "The Oprah Winfrey Show."

No, Oprah's not going geek. The reason for this is even more surreal, but the reason being requires some explanation.

I don't drive. I used to drive. I was usually the designated driver because while I enjoy the occasional drink, I don't like getting drunk. However, I'm a nervous driver. I get so nervous behind the wheel that I'm a hazard to others on the road. I know this, I acknowledge this. So, I let my driver's license lapse. Now, I just carry a state identification card. It's all I need.

Anyway, back on July 20, I was riding the #70 bus from Salt Lake City to Layton after attending an ADO.NET certification class. When we got to Parrish Lane and Main Street in Centerville (after being picked up nearly an hour late) around 6:30p, we stopped for the light. When the light turned green, the car in front of the bus moved, and we felt a small jolt. It felt like the bus had slipped a gear. It's happened before. No big deal.

The bus driver got out of the bus, went outside, came back in, smiled, and started handing out comment cards. He explained that the bus had been in an accident. Needless to say, we were all surprised.

When we got outside, the SUV that had caused the accident had pulled into the parking lot of the park we were next to. There were two additional vehicles behind the bus. The one in front had some rear-end damage. The one in back was smashed.

The paramedics came and carefully extracted the passenger from the rear vehicle. From what I learned, this gentleman nearly died as a result of his injuries.

The next bus came about 45 minutes later, but the police wouldn't allow us to leave on that bus. We were able to catch the next one, however.

So for me, the accident cost me a total of about two hours. I can forgive the delay.

I received a phone call at home on Thursday from UTA Customer Service telling me that the lady who caused the accident was going on the "The Oprah Winfrey Show" and wanted to apologize for causing the accident. She asked for my permission to give the show my personal information. I granted it.

Friday afternoon at work, I received a phone call from one of Oprah's staffers. She verified that I was in the crash, asked me what happened, and then started asking me a lot of questions about drunk driving. Turns out the lady who caused the crash had been drinking and driving.

I was livid. She then asked if I would mind appearing on the show. Given how I feel about drunk driving, I agreed.

Evidently, this lady wants to apologize to the people she affected by drinking and driving. Well, while I can forgive the consequences to me, I cannot forgive the act itself. She went out and got sloshed in the middle of the day, then went driving in rush hour traffic on the busiest surface road in the area. It's the equivalent of drunkenly firing a shotgun randomly into a crowd. Sure, you might not hit anyone, but chances are someone's going to get hammered. Someone did.

Personally, I think that the DUI/DWI laws in this country are too lenient. Driving is kind of like surgery. You mess up, and someone's going to die. If you operate drunk, you lose your doctor's license permanently. Let's extend that logic. If you drive drunk, you should lose your driver's license permanently.

I know that I'm a hazard behind the wheel. I've done the responsible thing by removing myself from the driving pool. Let's remove these schmucks from the road.

August 29, 2004

Grammar peeves...

I hate reading forums where the participants have little to no knowledge of, or respect for the English language.

Some friendly usage tips:

I do this due to it being my responsibility.
Do:
Act.
Due: Reason.

They're moving their bikes over there.
They're:
They are.
Their: Belonging to them.
There: A location.

I cannot hear you here.
Hear:
Listen.
Here: Location.

You're stepping on your own toes.
You're:
You are.
Your: Belonging to you.

d00d, eYe 0wnZ j00, b1yatch!
Get away from me, you prepubescent loser. Go back to camping your spawn spot and leave conversations to people who have no fear of using correct spelling and grammar.

August 27, 2004

ToTitleCase issue with ASP.NET

When I store data in my databases, I try to store everything in uppercase for ease of manipulation and speed in searching. However, when I display that data, I usually want it in title case (or proper case) because it's easier for humans to read.

In Windows Forms applications, I have a helper function that takes care of this for me by calling an insanely long shared function in the .NET Framework.

Public Function FormatTitleCase(ByVal s As String) As String

Return System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(s)
End Function
This function works beautifully. If I pass in "FUBAR", it returns "Fubar." However, in an ASP.NET application, it doesn't. It returns "FUBAR". Something is FUBAR here.

After talking to Scott McNairy, my ISV buddy at Microsoft, he made a small change that made it work in both WinForms and ASP.NET applications.

Public Function FormatTitleCase(ByVal s As String) As String

Return System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(s.ToLower(System.Globalization.CultureInfo.InvariantCulture))
End Function
Now I'm really glad I made a helper function. Typing all that in every time to get a title case string...I shudder to think about the blisters.

August 20, 2004

Miscellaneous Stuff

Still no progress on the spammer. GoDaddy.com still hasn't killed the domains, and BellSouth still hasn't yanked the spammer's line.

I'm extremely glad that I downloaded the Windows Media 7 Resource Kit Beta 3 while it was still available on the Windows Media site. (If you can ever find a copy mirrored, DOWNLOAD IT.) It has the most useful tool ever made for Windows Media encoding, and I can't believe that they got rid of it...

The Batch Encoder.

Today, I needed to convert nearly seven gigs of MPEG-1 video footage to Windows Media format to save on storage space and bandwidth. Because the old batch encoder still works with the new WMV encoding stuff, it was so extremely easy to handle. I'd hate to have to convert 85 separate videos using the stand-alone encoder.

I'll have to see if I can find some mirror space and post it. Maybe OldVersion.com would host it.

August 18, 2004

Spammer, Leave Me Be!

In a way, I'm kind of fortunate. I work for my home town as a developer and webmaster. I write programs to help our employees help citizens, I write webpages to make it easy to get information, and I get to go home at 5pm every night. So far, not exactly a bad thing. I don't get paid as much as I did back at Microsoft, but I get to have a life outside of work, so it balances out.

One of the great features that we added was a comment page so that citizens could leave feedback about how we are doing. We get tons of feedback on a large variety of topics, ranging from the web site to the ban on pets in our city parks.

As a security measure, we track the IP address, reverse DNS lookup, time and date of each piece of feedback. We also use Server.HtmlEncode() when displaying the feedback on our Intranet site and when forwarding the feedback to prevent malicious code from being introduced to our custom-written CMS.

Anyway, on Sunday, we got our first piece of comment spam. (The new site has been up since mid-December, so going eight months without comment spam can be considered a good thing.) They were advertising various drugs for allergies and impotence.

First thing I did was notice that the CMS was reporting:
(From 65.7.182.245 : adsl-065-007-182-245.sip.bct.bellsouth.net)

Now, I'm in Utah, not in Florida...so this wasn't a local guy.

Then, I checked the server logs. They showed that the user didn't browse to the page. It was either keyed in directly (unlikely), purchased (more likely) or Googled (most likely).

So, when I went into work on Monday, I sent off a complaint to abuse@bellsouth.net about the spam. I included a copy of the spam and a copy of my server logs.

Then, I decided to get a little sadistic. I checked all of the domains in the spam, and noticed a trend. All were registered through GoDaddy.com, and all were registered to the same individual: Damie Mait, 2175 N.W 157 St, Miami, FL 33167.

The fact that the DSL line was coming from the Miami area, as was the domain registration, well, it was too much for me to write off as coincidence. GoDaddy's terms of service specifically forbid the use of comment spam, so I wrote another E-mail to abuse@godaddy.com with all of the information included.

Since Monday was my 30th birthday, I felt that acting to rid the world of a spammer would be a good thing. It would have been if BellSouth and GoDaddy had acted. Tuesday evening, the spammer struck again...with the same message, the same IP address and the same fake Hotmail address.

So, I complained again this morning. I'll keep blogging as I find out more, but here is the DNS entry for the company in question.

Registrant: Damie Mait

2175 N.W 157 St
Miami, Florida 33167
United States
Registered through: GoDaddy.com (http://www.godaddy.com)
Domain Name: ********.COM (Not giving free advertising here)
Created on: 13-Jan-04
Expires on: 13-Jan-05
Last Updated on: 13-Jan-04
Administrative Contact:
Mait, Damie dmcommerce@yahoo.com
2175 N.W 157 St
Miami, Florida 33167
United States
8005398569
Technical Contact:
Mait, Damie dmcommerce@yahoo.com
2175 N.W 157 St
Miami, Florida 33167
United States
8005398569
Domain servers in listed order:
NS1.MYDOMAIN.COM
NS2.MYDOMAIN.COM
NS3.MYDOMAIN.COM


August 15, 2004

AVP: Alien vs. Predator

I went to go see AVP yesterday, and I must say that I was less than impressed. While there was plenty of alien and predator gore, the PG-13 rating meant that while you could easily infer what happened to the victims, you couldn't see anything. I didn't care about any of the characters, plot and motivation seemed to take a backseat to nearly everything else, one of the characters makes a big deal about bringing a gun that is never used, and to be dead honest, the entire thing reminded me of Jurassic Park III: 20 minutes of token plot development, 70 minutes of mindless action.

I give it 3 stars out of 5 for some good jump moments and action.

August 12, 2004

Nope...

Windows XP Service Pack 2 Limits Outgoing TCP Connections

In other words, if you are using any filesharing software, you should limit the number of sockets it will try to use at any given time.

Let's say that you are set to 20. We don't know what the limit is, but let's say that it's set to 8.

Your filesharing app will try to create 20 connections at the same time. However, only the first 8 will actually be created. The remaining 12 will be placed in a queue that will slowly be emptied based off of socket closures and connection successes.

However, mind you, this is not an application-specific limit. THIS IS A SYSTEM LIMIT. That means that any TCP connections that any other applications try to create will also go into the queue. However, most applications do not support the "queued" sockets. Internet Explorer, for example, will immediately pop up the "DNS Error" page if your unqueued sockets are full.

Sucks, eh?

DSL seems fixed...

We’ll see, though…from the way things were behaving, the switch/router that my DSL endpoint was plugged into at the CO was continuously rebooting itself.

August 10, 2004

Damn Connection Problems/Stream Of Consciousness Blog

At home, I use Qwest DSL Deluxe, and for the last four days, I’ve been getting extremely sporadic service.

 

Normally, I can ping my DNS servers in less than 10ms.  Right now, it takes over 340ms just to ping my DNS server.

 

To view any web page, I have to hit refresh 10-11 times.  Needless to say, this makes the morning “site roll” a major pain in the ass.

 

Every morning, I have 108 webcomics I view, 7 news sites, 4 development sites, and 3 gaming news sites.  Normally, this takes me about 40-45 minutes.  Lately, I’ve had to split it into sessions.

 

This wouldn’t be so bad if Qwest would provide decent services normally, but I’ve had nothing but problems with Qwest over the last ten years of service.  If there was any legitimate competition in the area, I’d jump in a heartbeat.

Windows XP Service Pack 2

Well, I installed Windows XP Service Pack 2 late Friday, and so far it’s been working quite nicely.  However, I do have a few issues.

 

First off, my computer acts as an ICS Gateway for all of the computers in my house.  Not such a bad thing, but SP2 keeps forgetting my ICS settings, so I have to reset them after every reboot.

 

Second, not all programs seem to query the firewall.  At work, I wrote an automatic update program for our primary line-of-business application.  It uses the .NET Framework, is digitally signed, and downloads the updated files from our company’s web site.  It isn’t in the exceptions list, but it doesn’t trigger the Firewall dialog.

 

Finally, I’ve had some odd DNS issues, but that could be MSN rather than Service Pack 2.

 

I’ll keep everyone posted as to what is going on.

Bug in Windows Forms MinimumSize property

I love my job, I really do. Nothing quite compares to being a developer, but in my previous life, I was a tester, and as such, it kinda sucks to be pulled out of the coding zone by a nagging bug...that isn't even your own.

There is a bug in the .NET Framework v1.1 implementation of the Form.MinimumSize property that can cause redraws to take a heinously long time. On some of the systems here, we have simple forms with less than 10 controls on them that will take up to five seconds to render.

If you want to reproduce the bug, here's how (code is VB.NET, conversion to C# is left as an exercise for the reader).

1. Create three forms (I'll call mine Form1, MinSize and NoMinSize.)

2. Enlarge Form1, and set the IsMdiContainer property to True.

3. Drag on a MainMenu control, add two menu items (NoMinSize and MinSize), and add the following code.

Private Sub MenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem1.Click

With New NoMinSize
.MdiParent = Me
.Show
End With
End Sub

Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem2.Click
With New MinSize
.MdiParent = Me
.Show
End With
End Sub



4. Open the NoMinSize form, and drag on a few controls. There is no need to hook up any logic.

5. Highlight all of the controls on the NoMinSize form, and select Edit->Copy.

6. Open the MinSize form, and paste the controls on.

7. Set the MinimumSize property for the MinSize form to whatever the Size property is. If you didn't resize the form at all, you should be able to set it to {300,300}.

8. Run your project. Click each of the menu items once, then drag them around rapidly.

Results: The one without the MinimumSize property set drags smoothly. The one with the MinimumSize property set drags extremely chunkily.

I do not know why the .NET Framework would be chugging with that property set. The only thing that I can think of is that it handles its own window move events. If that's the case, then rather than sending WM_MOVE messages to the window to move it, they're calling the MoveWindow() API, which sends WM_WINDOWPOSCHANGING, WM_WINDOWPOSCHANGED, WM_MOVE, WM_SIZE and WM_NCCALCSIZE messages.

Any thoughts?