October 2003 - Posts

SpamBayes Follow-up

Not 5 seconds after posting about my experience with SpamBayes, SharpReader finishes updating and shows me that Steve Smith likes it too. But the titles of both of our posts bear a striking resemblance -- I promise: It's pure conincedence!

Posted by PSteele | 1 comment(s)

SpamBayes Rocks!

Based on positive comments from someone else (can't find the link right now), I downloaded and installed SpamBayes for Outlook. Two words: It rocks! It's easy to install and get running. One thing to note if you're considering using this for SPAM: It needs to be trained on what is SPAM and what isn't. If you think you *might* try SpamBayes some day, then save your SPAM in a folder. When (if) you ever do try SpamBayes, you can point it to that folder and it will help the training process go much quicker.

Posted by PSteele | 3 comment(s)

DVD Burner

I've been researching DVD RW drives for quite a while now. Waiting for the price to hit the right spot. A number of $130 - $150 range brands have been showing up in the weekend ads (CompUSA, BestBuy, OfficeDepot, etc...) I had been eyeing the I/O Magic for a while. I had found a few positive reviews on the drive across the Internet and Circuit City had them on sale this week for $139.

Upon arriving at the store, I noticed the Sony DRU510A. I've wanted this drive since it was first announced close to a year ago. It was the first dual-format DVD drive. It supports DVD-RW, DVD+RW (they're different!), DVD+R, DVD-R (yep, they're different) as well as CD-R and CD-RW. However, at the time it was announced, it was MSRP at $399. Too much for me at the time. This drive is now down to $279 -- before a $30 mail-in rebate. So I was looking at the name-brand Sony which has had a lot of praise in the press for $250 or the IO Magic for $140. I decided I'd spend a litte more and go with the name-brand Sony.

So far, so good. I got it installed the other night without a problem. Formatting a DVD+RW only takes about 30 seconds -- then I have 4.7GB of storage available. Very nice. Now it's time to work on a backup strategy.

Posted by PSteele | 1 comment(s)

Plink!

We've all read about this. Maybe even it's happened to you. The hard drive crash. I got my first 10MB hard-drive back in the "old" days (1990?) and hooked it up to my Atari ST. In the past 13 years I've only had one hard drive go bad, and that was simply an over-heating problem. Maxtor promptly sent me a new drive out and I've been good ever since. Until this past weekend...

The 60GB Maxtor in my wife's machine (actually, the one used to backup important stuff) died on Saturday. Not sure exactly what happened, but when the drive powers up, it makes sort of a "plink" sound right about the time the head is supposed to unpark. The really bad part is that (a) I'm not sure exactly what was on this drive (it was shared and I threw stuff on it too) and (b) it was the only place I kept all of my digital pictures. Oh yeah -- and when I pulled the drive out it had a warranty end date printed on it: Aug 2003. Six weeks ago.... <sigh>

I backed up the digital camera pics to CD back in Jan 2002 -- 18 months ago. I'm not sure exactly how much I've used the camera since then (it's an aging 1.1 megapixel camera), but I know I *have* used it. There's a data recovery place about 20 minutes from where I work. I'm going to give them a call and see how much it might cost to recover the info. I know it's not going to be cheap.

Heed this: A hard drive crash *will* happen to you. You *need* a good backup strategy -- now! Not next week. Not tomorrow. Now. Take a moment now to think about what it would be like if you got up tomorrow morning and your hard drive was toast. How much would you loose?

Posted by PSteele | 2 comment(s)

No COM+ Statistics?

For an exercise, I whipped up a simple little object that would be poolable in COM+

using System;
using System.EnterpriseServices;
namespace PooledObject
{
 public interface IGetData
 {
  string XmlString();
 }
 [ObjectPooling(Enabled=true, MinPoolSize=2,
 MaxPoolSize=5, CreationTimeout=20000)]
 public class Data : ServicedComponent, IGetData
 {
  private string sXML;
  public Data() : base()
  {
   sXML = "The Time is Now: " + DateTime.Now.ToString();
  }
  public string XmlString()
  {
   return sXML;
  }
  protected override bool CanBePooled()
  {
   return true;
  }
 }
}

I strong named it, ran regsvcs.exe to get it installed and generated the type library. I then started VB6, added a reference to the generated type library and created a few instances of this object. Everything worked fine. But when I go into Component Services (MMC), I don't see any statistics for the object! I know it's running and pooling properly. With a MinPoolSize of 2, after the first object is instantiated, asking for a second one produces the same time string returned from XmlString. I even single-stepped through the VB6 app and I don't get the spinning icon when the component is active. Anyone have any ideas?

Posted by PSteele | 1 comment(s)

GANG Meeting Tonight

GANG (Great Lakes Dot Net Users Group) is having their monthly meeting tonight. Richard Hale Shaw of The Richard Hale Shaw Group will be presenting "Utilizing Code Access Security". Should be a good one! The meeting starts at 6:30pm at Microsoft's Southfield, MI office.
Posted by PSteele | with no comments

Perfect Software

Julia is looking for perfection in her designs. Designing the "perfect" system is difficult. But when you design software for the space shuttle, you need to get as close to perfect as possible:

They Write the Right Stuff

An article about the development process for the software used in the space shuttle. It's old (1996/1997), but it's an interesting read when you see stuff like this:

Even the smallest error in space can have enormous consequences: the orbiting space shuttle travels at 17,500 miles per hour; a bug that causes a timing problem of just two-thirds of a second puts the space shuttle three miles off course.
Posted by PSteele | with no comments

Be careful of your conditionals!

Doug Reilly posts about C#'s conditional operator in response to Rachel's post on VB.NET's IIf() statement.

One important distinction needs to be made between these two -- and it has serious implications for the VB.NET version. C#'s conditional operator is built into the language. When C# compiles the conditional operator into IL, it emits IL very similar to an if/then/else statement. VB.NET's IIf is a library function in the Microsoft.VisualBasic namespace. When VB.NET compiles a call to IIf, it has to evaluate all three parts of the IIf (the condition, the true part and the false part) and then send them to the IIf function for evaluation. This presents a huge problem in a scenario such as:

Dim info As String = IIf(foo Is Nothing, "EMPTY", foo.data)

Guess what happens? VB.NET emits IL to:

  • Evaluate the "foo is Nothing" conditional
  • Load the string "EMPTY"
  • Load the value of foo.data

How can you load the value of foo.data if foo is null? You can't! Can you say "NullReferenceException"?

The behavior in VB.NET is the same as it's been in past versions of VB. This is probably to preserve some backwards compatibility with code that may call a function to return the true and false parts such as:

Dim info As String
info = IIf(foo Is Nothing, GetDefaults(), GetObjInfo(foo))

In VB.NET (as well as previous versions of VB), you know both "GetDefaults" and "GetObjInfo" would be called when this statement is hit. GetObjInfo would, of course, need to be designed to handle the possibility of a null parameter. But if VB.NET were to break this behavior and work like the C# (or C/C++/java) versions of the conditional operator, porting code would be even more challenging than it currently is since only one of those functions would be called.

Very similar concepts but implemented very differently!

Posted by PSteele | 5 comment(s)

The Bitmap class is NOT a paint program

I needed to convert a bitmap to an icon. After discovering Paint Shop Pro didn't support this (seemed odd to me), I thought I'd just quickly write up a three line .NET app to convert a bitmap to an icon.

My idea centered around the Bitmap class' Save method which accepts a filename and a format. "Perfect!", I thought. So I tapped in the code:

Bitmap bmp = new Bitmap(@"C:\folder\file.bmp");
bmp.Save(@"C:\folder\file.ico", ImageFormat.Icon);

Run it. Works! Try and use the ICO file in an application expecting a real Win32 ICON file? No go...

Can't take the shortcut on this one. You need to create an Icon from the Bitmap. Still very easy with the framework, but a few more lines of code is necessary:

Bitmap bmp = (Bitmap) Bitmap.FromFile(@"C:\folder\file.bmp");
Icon ico = Icon.FromHandle(bmp.GetHicon());
FileStream file = new FileStream(@"C:\folder\file.ico", FileMode.OpenOrCreate);
ico.Save(file);
file.Close();
ico.Dispose();
Posted by PSteele | 1 comment(s)

A "Don't Miss!" Blog

Zane Thomas from Abderaware has started a blog. As Zane comments: "I am all about challenging assumptions". This blog should be interesting.
Posted by PSteele | with no comments
More Posts Next page »