Monthly Archives: August 2006

Say no to Variable Pricing

ICANN is  hearing a proposal to charge variable prices for domain names. This has to stop before it starts. How are they going to determine a price? What’s the fair market price of something? Does it depend on how many whois queries there are? Someobody will just slam that, driving up the price. Is it arbitrary?

Look at Ken McCarthy’s blog for more info.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Worse than Y2K–what if gravity changes?

Though the danger to life, civilization, and future of all that is good and beautiful was greatly oversold, Y2K was still a pretty big deal. It required the detailed analysis and updated of millions of lines of legacy code in all sectors, levels, nooks, and crannies of computer civilization.

We survived, somehow. Planes didn’t fall out of the air. Elevators did not plummet to the basement. Satellites did not launch lasers and nukes at random targets. Cats and Dogs did not start living together.

But what if something even more fundamental than our calendaring system changed?

What if a fundamental assumption about the way Earth functions changed?

Take, for example, gravity. The force of gravity is defined by the following equation:

 

Constants are:

  • G – universal gravity constant. 6.6742×10-11Nm2/kg2
  • M – mass of first object. Earth = 5.9724 x 1024 kg
  • m – mass of second object.
  • r – radius from center to center of objects. Earth = 6,378,100 m

This can be simplified for use on earth to:

where

  • m – mass of object on earth’s surface
  • g – earth gravity constant.

We can compute g by setting both equations equal to each other, canceling the common term of m, we get:

If we substitute the values above, we get  g = 9.801585

That’s the value that is a hard-coded into all the missile launchers, satellite control software, airplane flight control logic, embedded physics math processors, and Scorched Earth games in the world.

So what if it changed? It’s not likely, but it could happen. If a significant amount of mass were added or taken from the earth due to, say, a catastrophic asteroid hit, gravity could be affected. 

But how much would it have to change?

Given the current values, F = mg for 50 kg yields 490.08 N of force on the earth. If earth’s mass increased by 1%, g would be equal to 9.899601, and F would be 494.98 N. Would we feel heavier?

It would certainly destroy precision instrumentation.

However, 1% is a LOT: 5.9742 x 1022 kg. By comparison, the moon is 7.36 x 1022  and the mass of all known asteroids is less than that. On the other hand, if you think gravity can’t be affected by a reasonable event, read this.

So just to be safe for future modifications, make sure all your software takes as parameters G, M, m, and r, and calculates g as needed. You can never be too careful.

😉


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

It isn’t Infectious…

My father-in-law was visiting this week and the first thing he said to me, extending his hand to shake mine was:

“Don’t worry, it isn’t infectious.”

 

(He has a temporary skin condition)


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

ClearType is like a new pair of glasses

Many have said it already, but let me just add my voice: ClearType technology is the most wonderful thing to hit Windows in a long time. I recently received a new computer at work (3.4Ghz hyperthreaded, 1 GB RAM, 80/200 GB disks–a screaming machine, at least compared to what I used to have). and during the setup process (3 versions of Visual Studio, Office, dozens of developer tools) I remembered that I needed to turn ClearType on.

Wow. It’s like the same difference when you’ve been needing glasses for a while and finally get them and realize that the world isn’t that blurry after all.*

It doubles the perceived resolution of LCDs.

(* only a little ironic that ClearType works by deliberately “blurring” edges through antialiasing.)


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Linux Reality Check part 2

Scoble has a great commentary on the state of Linux fonts. It’s something I never thought about much before, but now that he’s brought it up, I realize that poor font quality is something I’ve definitely suffered through when I did actively use Linux.

It’s just another example of one the seemingly-minor-but-actually-major issues facing Linux. It’s amazing how much effort must be expended in order to implement so many things we take for granted.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Linux Reality Check

Over at Slashdot, Fedora Project Leader Max Spevack responds to some frank question about the Fedora project.

He talks about a number of topics:

  1. Unified package managers across distros
  2. Propritetary drivers
  3. Differences in Linux over time
  4. Fedora’s biggest weakness
  5. Threat of Vista
  6. inclusion of NTFS driver in kernel
  7. Wacky package dependencies
  8. a few others…

What his article demontrates to me is that Linux is going through some growing pains and that the community is realizing the difficulties that Apple and Microsoft have already dealt with in their own ways.

For example,

I guess the “problem” with package managers is that they are so integral to the rest of a distro that it’s a major endeavor to switch them. One reason is that a switch of that kind would break the upgrade chain.

Welcome to the real world of computing. Upgrading, advancing, improving are all important issues for real users using their computers. The only reason we still use the x86 architecture is backward compatibility. The only reason Windows has universal marketshare is that it works with basically everything ever written.

Another fundamental issue:

In terms of getting people to use Linux instead of proprietary operating systems — I think that battle is best fought in the world of people who are new to computers. People will tend to be loyal to the first thing that *just works* and doesn’t cause them pain. Making that first experience for people a Linux one as opposed to a proprietary one — that’s the challenge.

How true. It’s been a while since I’ve installed Linux, but my memories of it were not all that pleasant. It worked well enough, I suppose, but it certainly isn’t as polished or streamlined as it should be. MS and Apple are still years ahead of Linux in this regard.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Windows Live Search Toolbar — not quite there yet

I forced myself to uninstall the Google toolbar and exclusively try out the new Windows Live Toolbar. I think I’m going to uninstall it today. First of all, I like a lot of things about it:

  • Customizable buttons
  • Lots of great features
  • Search history with automatic drop down list that shows past/related searches
  • Desktop search works as well as always. I couldn’t live without it.

I also noticed that the search results for Windows Live were just about as good as Google’s. That is a great thing–we need more competition in this space to keep things going.

However, with all that good there are some pretty significant issues (at least for me).

  • It is sloooooooooooooooow. I mean, noticeably slow, painfully slow, distractingly slow. I want my search results nearly instantaneous. None of the pretty features matter if I have to wait 15 seconds for search results to show up when your competitor can come up with the same result in 2 seconds. Is it the web-site or the toolbar–I’m not sure yet.
  • Lack of Instant Answers. One of the things I love about MSN search is the ability to track packages, get weather, and lookup addresses. Why wasn’t this built into Windows Live from the beginning? I know they’ll be adding them, but still…
  • Sometimes, the toolbar refreshes or does something that erases what I’ve already typed. I think this is an issue when it first starts up–if I’m too quick to begin searching. Not a huge issue…

I’ll be getting a new computer at work in a few weeks. I’ll try again after that. Hopefully Microsoft will have made some improvements. I’ve submitted my list of issues to their feedback page, and hopefully they will make this product better.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Checking all values of an enumeration in C#

I have a utility function that takes in a status enumeration and returns a string description associated with the given status code.

It looks something like this:

internal static string MailProcessCodeToString(MailProcessCodes eCode)
{
switch (eCode)
{
case MailProcessCodes.mpcGoodData:
    return “No errors detected in the order mail”;case MailProcessCodes.mpcNoHeader:
    return “Could not find header in order mail”;

//etc….
I wanted to create a unit test that ensure there was an error message for every possible value of the eCode. Rather than write a separate unit test for each value (there are over 30–don’t ask).It’s fairly easy to do in .Net (using NUnit):

[Test]
public void MailProcessCodeToString_AllSuccess()
{
   
int[] vals = (int[])Enum.GetValues(typeof(MailProcessCodes));
   
foreach (int val in vals)
    {
       
string errorString = Utils.MailProcessCodeToString((MailProcessCodes)val);       

        string msg = string.Format(“{0} has no error string defined”,
                      
Enum.GetName(typeof(MailProcessCodes), val));        Assert.IsTrue(errorString.Length > 0, msg);
    }
}

Enum.GetValues() returns an array of all defined values for an enum, and Enum.GetName() translates a value into the name of the constant.

Now I have a unit  test which will tell me which error code does not have a corresponding string.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Goodbye newsletters, hello RSS

I used to subscribe to tons of CNet, TechRepulic, PCMagazine, and Builder.com newsletters, but as of today–no longer. I’ve been unsubscribing from them as I get them. Unfortunately for them, I didn’t really use their content so I’m not bothering to subscribe to their RSS feeds. Maybe in the future…

I am relying more on RSS, however, to keep me informed on the world (technical and otherwise). I’ve got about 80 feeds.

When considering the spam situation alone, RSS makes a lot of sense. Will RSS ever overtake e-mail as a personal communications medium? I’m not sure. The way it’s setup right now is a little awkward–I would have to create a private feed for each recipient, we need better tools for publishing to multiple feeds, targeting individuals.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order:

Alexandria, Virginia has RSS Feeds available

My city of Alexandria, VA has a couple of RSS feeds available. They’re not much quite yet (DASH bus service notifications and city press releases), but there is the promise of more.

 What I’d like to see next? Daily crime reports and history and recreation news.

Alexandria also has a very impressive collection of online GIS applications that give you multiple views of the city.

It’s nice to see towns becoming more technologically adept, especially with their communications options. I already get some city news via e-mail, but I would prefer RSS.


Check out my latest book, the essential, in-depth guide to performance for all .NET developers:

Writing High-Performance.NET Code, 2nd Edition by Ben Watson. Available for pre-order: