Monday, July 18, 2005

Well, this is what, four non-code posts in a row?  I'm slipping.

I spent some time going over some client work this weekend and it seems that I am catching up.  It seems that I might be getting close to the Period of Rest I've been looking for, this is less satisfying that it would be if my new home was anywhere near completion.  I still have a couple of bigger things that I could work on but these hold the danger of me getting too far ahead of client requirements, the old "Go ahead and work on it but I won't have time to tell you if its right" hurry-up-and-wait.  In light of this, I turned back to something that had been shelved for a while: something I call Project Cesium.  I have alluded to Cesium a couple of times on this blog and to friends, hinting that this may be a press-release-worthy item at some point.  I started working on a re design and some code Saturday afternoon.  Stay tuned for an early 2006 release of something that will hopefully be a big deal.

Monday, July 18, 2005 8:52:49 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Friday, July 15, 2005

Like a lot of people, I tend to define goals for a year at the beginning of each year.  Many of them are typical: get in shape, pay off debt, etc.  Once I went a whole year without consuming alcohol.  Since you're curious, this year's item (I assume you are curious or you would stop reading) was to make a great deal of $$ so that next year I can relax more.  At any rate, I'm adding one UberGoal™ right in the middle of the year.  Yes, I know its not a best practice to change the deliverables in the middle of a project but management says this is important.

My goal is to Be Progressive.  There are a lot of ways that we should just Do The Right Thing that we don't, some of them vitally important to our position in the world and our continued prosperity as a species.  I have some specific things in mind:

  1. Use the metric system as much as humanly possible.  The current NASA fiasco reminds me of just how silly it is that we are not using the metric system.  Being an obnoxious elitist, imagine the fun I'll have telling people how many Kilometers it is to my house, how many liters of beer I drank at the Nerd Dinner, or how good the 700 gram steaks I ate were, or how many kilowatts of power and newton-meters of torque my WRX has.  This will be kilograms of fun!
    1. Action Item: SmartPhone program with conversion rates for everything.
    2. Action Item: Refactor common sayings such as "Kilograms of fun", "A kilogram of cure is worth a gram of prevention", "Go the extra kilometer", "A journey of a thousand kilometers is begun with a single step", "This weighs a Metric Ton", "I'll bet you can't drink 1.83 liters of milk in under an hour", "The whole 8.73 meters", "Give them a centimeter, they take a decimeter"
  2. I cannot type as fast as I used to, due to the Carpal Tunnel/tendonitis brought on by me working way too much.  Contemplating this, I recalled the bit of trivia that the Qwerty keyboard layout was specifically designed to make typing as slow and uncomfortable as possible back in the Golden Age of Typewriters.  Considering the amount of work that is done on PCs these days, my bean counters estimate that this costs us approximately Eleventy-gazillion (0xff∞E^eleventy) in productivity losses each year, mostly in email and MSN messenger related time loss and overly verbose VB.NET code.
    1. Action Item: Obtain, learn, and evangelize an alternate keyboard
  3. Look into renewable energy as much as one man can.  Am I the only person who can see the upward curve in gas price is going to have us paying over $1.20 per liter as soon as next year?  This does not mean I'm buying a hybrid car: I hate to be the one to say that hybrid cars are a joke.  The amount of energy a hybrid car will save you in gas over its lifetime is not as much energy as it took to create the battery in the first place.  How did the power plant make the energy to make your battery in your hybrid car?  Why, burning fossil fuels of course.  On top of that, due to the principles of Entropy, a lot of energy is being wasted in this transformation as well.  That's right, Hybrid Vehicles are driving gas prices up.
    1. Action Item: Laugh at people who drive hybrid cars
    2. Action Item: Look into solar panels on my house, assuming they do not suffer the same drawback as hybrid cars.

That's enough for one year.

Friday, July 15, 2005 11:54:40 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Tuesday, July 12, 2005

So we are going to have ".mobi" domains soon, the idea being that these are meant for mobile devices.  One one hand, I'm all about mobile.  On another, sounds like a way for registrars to make more money.  On another hand, is it so hard to detect the user agent on your server and direct them to a mobile version of your site?  Haven't we had tools to do this for a while?

Next up, ".moz" sites for the anti-IE "look at our CSS implementation" crowd...

Tuesday, July 12, 2005 9:14:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Monday, July 11, 2005

Two weeks without an update seems like a very long time.  I assure you I am still alive.  As I have indicated in the past I am building a new home, and we have been in the process of selling the existing home and moving into an apartment while the new home is built.  About the only non-essential activity I have done in the past two weeks is convert my personal site over to DotNetNuke 3.  Overall I'm pretty happy with DNN but I do have a couple of minor issues.  For each module, there seems to be 8 different Settings links such as "Configuration", "Settings", "Manage".  I installed the forum/blog with no issue but "Gallery" blows up, to be fair these are listed as Beta.  Maybe my photos will just be an iframe containing Flickr anyway.

Until at least this week Friday (7/15/2005) I have to continue to focus only on essential activities.  Explosions, crypto, CompactFramework 2, and other promised goodies have to wait.

Monday, July 11, 2005 9:21:30 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, June 30, 2005

Milwaukee MVP Sean McCormack posted an article regarding GM's employee discount plan on their cars right now.  He makes the point that if they can make a profit, they've really been "sucking us dry for years"; I agree with him, but let me go further and add my 2 cents.

Worse than "sucking us dry for years" is Sucking us Dry for Years and Still being in financial trouble. If they are able to keep the lights on at these prices, it makes it look (to me anyway) as though they could have ran a lean ship all along and not be where they are now.  In many ways, I blame this on the "Executive Caste" that has evolved in this country.  Executive compensation in many of our largest companies has never been more decoupled from their companies' performance.  (At least someone is achieving a high degree of decoupling...) Money magazine has a regular special on this unexplainable and purely American phenomenon.  My favorite example from Money is a couple of years old: In a year when the company's revenues plunged 40%, the CEO of Home Depot was awarded a coupe of hundred million dollars in bonus options and cash.  Huh?  What exactly did this individual do that year to deserve more than their normal salary?  The current Ford and GM CEOs are trying to correct many years of their predecessors' carelessness.

Like many issues, I attribute this to "The Population" being uninformed and not caring anyway.  C-level (not sea level) executives have been the subject of Hero-Worship ever since Lee Iacocca "saved" Chysler.  Did people fail to see that this deliverance came in the form of a gift from Uncle Sam of Billions of taxpayer's money?  Can this be in GM's future?  I hope not.  As much as GM is an American icon, I'd rather not pay for it.  Companies need to realize that we may not come to their rescue if they are this careless.  The jobs are important, sure, but then again I'm not a big fan of the UAW either.  I'd better withhold my union comments and stop it here.

Maybe I'll go buy a Saab...

Thursday, June 30, 2005 1:06:15 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [4]  |  Trackback
 Monday, June 27, 2005

My friend Brian Tinkler, acknowledged Sales Ninja and all around good guy introduced me to Stephen Covey, John Maxwell, Brian Tracy,  and other authors who write on the subjects of leadership, effectiveness, productivity, and various other Good Things ™.  One principle many of these people tease out but do not always call by name is the idea of Excellence.  Excellence and commitment to improvement are the notions that keep many people from "getting" things like the 7 Habits.  They try something for a while, its hard, they give up.  The next day at the water cooler: "That self-improvement stuff is crap."

Of all the principles espoused by these authors and others, the notion of Excellence is very much on my mind these days.  Let me explain, starting with a note of humility: I have always thought of myself as "one of the elite" and to be fair I do pretty well.  My increased participation in the the local .NET user group in all of its various forms has put me in front of more and more people.  One thing I've heard many times is "Hey that was a good post/idea/bit of code Damon but you broke XYZ best practice in this part."  The vast majority of the time,  the best practice is something I am aware of.  Be it Lazy coding practice, "I just want to get this post out so people can look at it", or "I just want to make this deadline", one's work is a reflection of one's self and one's values.  Wanting to do well and being able to do well are not the same as doing excellent work consistently and conciously.

This simply won't do.  No one is perfect.  A programmer who always designes the right patterns, with adequate comments, with the proper unit tests, who looked for a tool first, who takes the time to refactor properly, who thinks about something before they start writing it, who creates UML artifacts to represent a complex interaction, who follows every best practice they can think of, who is a "good citizen", this person is a rare individual indeed, but that doesn't mean you should stop working towards it.  I would argue that in all but the most extreme circumstances one's core Habits and even core mindset can be changed.  It takes concious and constant effort, and the ability to face the ugliest parts of yourself and beat it, disallow it from ruling you.  For example: I hate litter.  There are people in the world who throw their McDonald's bag out the window with no concious thought.  Most people have a momentary flash of a Devil on one shoulder and Angel on the other and they allow the dude with the red suit and 6-pack of Ham's to win.   They don't face and defeat the ugly part.

I argue that the fundamental paradox surrounding these bag-tossers is not that they are breaking the rules someone else has laid in front of them, but that they are acting contrary to a value set that they themselves believe in.  Living up to one's own notion of the human experience is, strangely, an Herculean endeavor for most of us.  A commitment to excellence requires one to face down one's bad habits with every single action and to know that a defeat here and there is unavoidable but to let that defeat push you back down the hill, or back to tossing bags, or back to just putting in that one little hack, is the worst sin of all.  It is a terrible burden to know that you are truly capable of living up to your ideals, but it is also liberating and motivating.

Today I did the Right Thing and refactored a complex design rather than add an "if (name.Equals("SkipMe")) " type of line of code.  I came home and played with my daughter for a very long time despite the pile of work waiting for me, I came home and wrote a Bugzilla report rather than send an IM to the programmer, I did the tedious testing that was necessary because only I could do it.  I did not publish a library I've been working on "as is" becaue I have decided the Right Thing is to refactor it to fit an appropriate Provider model Microsoft allows for this type of code in the .NET framework.  I'm taking those shortcuts less and less, improving my research methods, getting more work done, and producing designs I really want to share with people.  No one will believe you can do great things if they've only seen your mediocre work.  You will not believe you can do great work if you keep letting  yourself do mediocre work.  My thanks to the many Excellent people I know, being around you is a benevolent push that reminds me to strive every day for more Excellence in my life.

Monday, June 27, 2005 8:08:29 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  |  Trackback
 Thursday, June 23, 2005

Suppose for some reason you need to use the HTTP PUT verb from the compact framework.  Depending on whether you zig before zagging for vice versa, you may expience some unexpected behavior.  I'm posting this here in case anyone else has this issue, Google should lead you here and help you out.  You may get an uncatchable InvalidOperationException from HttpWebRequest when setting the ContentLength of your request, not on every request just once in a while.  The exception is uncatchable because it happens on a worker thread you do not have access to.  You can "continue" through it in the debugger but it will otherwise crash your application.  The error is as follows:

System.dll!System.Net.HttpWebR­equest.set_ContentLength(long value = 108863) + 0xe bytes
System.dll!BufferConnectStream­.WritingSucceeds() + 0x12 bytes
System.dll!System.Net.HttpWrit­eStream.doClose() + 0x4b bytes
System.dll!System.Net.HttpWrit­eStream.Finalize() + 0x6 bytes

My working Http PUT code:

public bool HttpPut(string path)
        {
            bool success = false;


            string fileName = Image.ImageNameHelper.GetLastPathPart(path);
            Uri uri = new Uri("http://bigfatlaptop/put/" + fileName            ;

HttpWebRequest req = (HttpWebRequest)HttpWebRequest.Create( uri );
            req.AllowWriteStreamBuffering = true;
            req.Method = "PUT";
            req.KeepAlive = true;
            BinaryReader binaryReader = null;
            FileStream localFile = null;
            Stream reqStream = null;
            WebResponse response = null;
            try
            {
                // Allocate buffer for the data, which will be written in blocks.
                int     bufsize = 4096;
                byte[] buf = new byte[ bufsize ];
                int     xcount;
                localFile = File.Open(path, FileMode.Open);
                binaryReader = new BinaryReader(localFile);                
                reqStream = req.GetRequestStream();        
                
                req.Expect = string.Empty;
                while ( ( xcount = binaryReader.Read( buf, 0, bufsize ) ) > 0 )
                {
                    reqStream.Write( buf, 0, xcount );
                }                
                reqStream.Close();
                response = req.GetResponse();
                success = true;
            }
            catch(Exception ex)
            {
            //do something

            }
            finally
            {
                if (null != binaryReader) {binaryReader.Close();}
                if (null != response) { response.Close(); }
            }
            return success;
        }

Yes, my development laptop is called "BigFatLaptop". Happy coding.

Thursday, June 23, 2005 10:00:01 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [1]  |  Trackback
 Wednesday, June 22, 2005

We are hiring at SafeNet consulting.  Specifically, I need a senior .NET person or three.  I can't think of anyone I know who's looking for a job right now so I'm going to throw this out to the public and see if anyone can help me out.

Why would you want to work at SafeNet?  Well, here is my take on it:

I worked for two other consulting companies before coming here.  Each one started out good but I ultimately became disgruntled. This is not an attack on anyone, just pointing out some of the things I don't like about traditional consulting models.

Salary: Its fairly complicated to come up with a fixed salary to fairly compensate a consultant.  Expected utilization, expected billrate, and various other value-add activities you perform have to be taken into account.  If you do convince your boss you are worth keeping on staff even if you are not profitable, chances are you're at the top of the list to be let go when things go downhill.

Sales & Extras: Consulting companies consider their staff to be a second sales force, and why not?  A consultant's relationship with clients and potential clients (places their friends work, etc) are usually of a different and very useful quality than a salesperson's relationships (Sales-Ninjas excluded).  Despite the fact that everyone admits how valuable this under the radar sales activity is, companies are loathe to offer compensation even when a sale is made that couldn't have been made without the consultant.  The most common answers are "That's part of your job" or "This benefits everyone/Grows the company so we're all doing better/etc".  Unless you have equity in the company beware the "Growing the firm" argument, and unless you live under a rock you probably know that you can make the same (or very close to it) salary at a non-consulting firm without the unpaid sales guy part of your job.

Non Competes and Freedom: This is the biggest one.  I'd rather not give too many examples but I had one manager go so far as to tell me they wouldn't let me write a book I was working on unless I let people at the company review it.  Doing small billable side work, large billable side work, creating products on the side, or making an HTML page for your friend at the barber shop can all be squashed by the non compete you signed when you took a job.  Wisconsin happens to be a Right-To-Work state which means most non competes would not stand up in court.  Chances are your employer can afford the legal battle better than you can though, so even if your agreement is ridiculous your bound by default.

Companies do not own you, so how is SafeNet supposedly better?

Salary: Let's get this out of the way.  You don't get paid when you're not working.  You get an hourly rate which is quite a bit higher than your effective salary would be at a normal firm, and you put some money in the piggy bank for the times when you're not working.  A good rule of thumb is to plan for around 2 months of downtime.  I'm confident I'll be working most of the time, and after doing the math I'll make a lot more here than most other places would be willing to pay me.  Obviously this puts part of the onus on you to "Be Placeable". 

Sales & Extras: SafeNet gives you a business development credit when you bring them work and leads.  This credit takes the form of a per-person, per-hour commission to you.  The same goes for referrals: if you get someone to come work @ SafeNet you get a per-hour bonus for as long as you both work there.  While these amounts do not quite measure up to what a full-time sales person or recruiter's commission would be, I am not a full time sales person or recruiter so it seems fair to me.  These conditions and dollar amounts are written into your employment contract, so its not a "wink-wink we'll give you a Best Buy gift certificate if you bring us a $750,000 project" type of deal.  To me this seems fair and reasonable for all parties involved.  Sure, there is a little risk, but I'd rather make more when I'm billing and make less when I'm not billing in exchange for some other freedoms...

Non Competes and Freedom: This is the best part.  If you are not billing for a month, you do not have to come into the office and work on some inane pet project of the management.  You can come into the office and maybe get paid for the inane project, or study, or sleep in and watch Soaps all day, or study for a certification or play Doom3.  This is a huge draw to me, since I have so many nerd side projects that I don't have time for.  I can't wait to be on the bench (sorta) so I can keep my daughter home from daycare and finally catch up on my DirectX projects and such.  Also, have you ever been put on a ludicrous project copying CSV files into a FoxPro database or upgrading Windows98 to Windows 2000 because that's the only billable work the firm could find you?  You're in the driver's seat: you don't have to do it if you don't want to.  SafeNet's non compete is very simple and very side-work friendly.  Unless you are doing side work for a big client they are trying to break into,  and your side work doesn't affect your 9-5 gig you're fine.

After reading all of this you may wonder "Why not just go independent?"  I thought the same thing, and who knows, I still may someday.  The single biggest benefit is that I don't really need to spend any time selling myself.  There is a full time sales staff pounding the pavement to place me and get a good rate for me.  SafeNet also manages benefits for me so I don't need to worry about the cost of singe-party health insurance, 401k administration fees or anything like that.  SafeNet has the formula about right: the $10-$20k per year more I could make being independent isn't worth the headaches and added risk of being my own sales guy.

So yeah, if you've got the skills,  send me your resume if you're interested in getting a big pay raise and having complete freedom over your career.

Wednesday, June 22, 2005 8:55:45 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [3]  |  Trackback