Employee Discount

by Administrator 30. June 2005 19:06

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...



by Administrator 28. June 2005 02:08

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.


Http PUT

by Administrator 23. June 2005 16:00

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;
                // 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 );
                response = req.GetResponse();
                success = true;
            catch(Exception ex)
            //do something

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

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


SafeNet Consulting Hiring

by Administrator 22. June 2005 14:55

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.


Leaky Abstractions

by Administrator 21. June 2005 16:38

I believe that every good developer should be familiar with the idea of leaky abstractions, after all we live in a time when many of our computing concepts involve higher and higher levels of abstraction in our coding model.  I might go so far as to say that Joel characterizing this notion of Leaky Abstractions is a noteworthy contribution to the field of software development.  I like to know what's going on behind the scenes of any tool that I'm using, in case the abstraction breaks and I am forced to pull out my pipe wrench and fix some plumbing.  Perhaps this makes me a "Computer Science Elitist" or a Dinosaur who still has a "close to the metal" mindset in an age of abstraction.  I like to know what's under the hood.

XML Web Services in .NET is a big abstraction.  This abstraction tells me that I don't need to worry much about XML.  This abstraction tells me that if I put [WebMethod] on a method, it will handle the plumbing of SOAP endpoints and my clients can interact with this code via discoverable types and I don't need to worry about how things are serialized.  There are many cases where these great (and they are great) XML Web Services are leaky abstractions.  Some of the more well known ones involve DateTime parsing and Serialization and such.  I'll share a new one today to illustrate Leaky Abstractions.

I return Messages from my web services.  One of the types inside my message is an enumeration, defined like so:

    public enum PullOption
        None = 0,
        PullChangesOnly = 2,
        PushChanges = 4,
        EmptyTableAfterPush = 8,
        StoredProcedure = 16

The system handles enums well enough.  Note also that I have used the [Flags] attribute.  Whenver I see [Flags] I have to do a double take to make sure I'm not writing code that is hard to read or maintain; often times, especially when dealing with the Win32 API, there are so many different options to deal with that [Flags] really is the best way to go about it.  This code works fine on the server.  Now, on my client, I notice that the results I get are not quite what I expected.  The whole abstraction of XML Web Services and WSDL.exe in .NET is broken, and I have to start looking under the hood.  My OperationDescription for this enum field looks something like:

<PullOption> None or PullChangesOnly or PushChanges or EmptyTableAfterPush or StoredProcedure</PullOption>

and the WSDL looks something like:

- <s:simpleType name="PullOption">
- <s:restriction base="s:string">
  <s:enumeration value="None" />
  <s:enumeration value="PullChangesOnly" />
  <s:enumeration value="PushChanges" />
....etc.  Clearly this abstraction leaks when you want to treat an Enum as Flags.  I did not see a special SOAP attribute that would tell the Serializer to handle my Enum as an int, but I didn't spend all day on it either.
I changed the field to an int and now I can write bitwise and/or code on my client.  The downside is that this enum must be duplicated to the client via code or assembly sharing now.
Beware leaky abstractions.  A good developer uses abstractions and tools to become more productive.  A good developer can look under the hood at the internals of an abstractiono, too.


Mobile Developer Power Toys

by Administrator 20. June 2005 21:31
I got the new Mobile Developer Power Toys today and started messing around with them.  The new ActiveSync based remote display is working well, and I think some of the other tools (RAPI_Debug, RAPI_Shell, JShell) might just help me with some of my more bizarre mobile issues.  I'm glad to see Microsoft is releasing more debugging tools because quite frankly, ActiveSync is my sworn enemy at this point.  This is not good when you are primarily doing mobile development.  ActiveSync 4.0 is actually seems quite a bit better than previous versions but there are still quirks.  I should not notice any networking quirks if my device is going through ActiveSync.  Microsoft, are you listening?


Catching up

by Administrator 16. June 2005 16:15
OK, so, I have quite a few things on the burner right now as well as some items optionsScalper would call "Off the Block".  As Murphy's Law would have it, several "Critical Must-have improvements" came up in two of my side projects.  One of them is a mobile application I support.  I have come to think of ActiveSync as my sworn enemy.  Being such a critical component it should just work but as a casual parusal of the user groups will tell you, it does not.  I have an issue where trying to FTP 50 or more files from the device eventually "locks up" making any new FTP connections until Active Sync is stopped/started again.  I was hoping Active Sync 4.0 would solve the issue, but no such luck.  If I can get ShellExecute of repllog.exe to work I should be able to detect the error situation and bounce active sync to fix whatever ActiveSync proxy/network quirk this is.  If anyone knows all the possible command line args to repllog.exe on CE.NET it would save me some time.


.NET Game Programming in C#

by Administrator 12. June 2005 18:45

 I finished this book on the plane coming back from Tech Ed.  The book is pretty well laid out and if you download the source code for all the samples to read as you go along everything makes a lot of sense.  If I had never even looked into game programming before and this was the first book I'd read, the book would be highly motivating; it leaves one with the feeling of "Holy crap, I could actually do this."

If you've never done game programming before, I'd suggest going through the motions of doing the 2D games before getting into all the Managed D3D stuff.  2D games have all the same elements: game loops, render loops, collision detection, etc and you need to learn all those things before moving on to more complicated vectors.  Reading this book also gave an introduction to DirectInput, DirectSound, and DirectPlay: the developer story for making a DirectX game is really fantastic. While there is always a performance hit for working within managed code, as Tom Miller points out Managed DirectX is a very thin wrapper and in terms of pure graphics performance the managed apps get very similar framerates to the unmanaged apps.

I'm going to re-work my current Tank simulation with DirectInput and some sound before moving back to my neural net.


TechEd Friday

by Administrator 12. June 2005 18:33

Nothing super interesting to report from Friday: I saw a few of the obligatory ASP 2 demonstrations.  I don't know why I'm not tired of these yet.  Perhaps it is because I've done more web development than anything else in my career and its nice to see the developer story finally getting close to where I think it should be.

That wraps up TechEd for me.  All in all, I give it a B.  It accomplished my goal of getting me excited about work again, but a lot of the content was not as in-depth as I would have liked.  I think I'd like to try doing one conference a year.  Next year I think I might try the PDC.

Now that I'm back I have a to-do list a mile long, including catching up on all my side work and trying to make up as much of the 40 hours I missed last week as I can.


TechEd Thursday

by Administrator 10. June 2005 13:57

I was going to post about all the architecture talks I attended Thursday, and about how I feel we need to adopt more rigorous language when describing what an Architecture is and what the attributes of an Architecture are.

But, instead, I will save that for later and talk about the attendee party.

In the 90s I managed to miss all the craz JavaOne parties and such so TechEd was a big deal to me.  For the attendee party Microsoft rented Universal Studios exclusively for TechEd attendees and their guests.  The rides were running but the park was empty except for us.  Jen and I were able to go on every ride we cared about and some of them twice, with just 10 minute waits.  How cool is that?  I would definately say Universal Studios probably isn't worth the price of admission with the two hour lines, but without the lines it was really a great time.  Not only did we have the place to ourselves but there were stands placed every 50 feet or so with free beer, wine, and chewy pretzels.  Needless to say, we had a great time and didn't get home until late and I missed my Friday morning talk concerning management and the SOA enterprise.


About the author

Damon Payne is a Microsoft MVP specializing in Smart Client solution architecture. 

INETA Community Speakers Program

Month List

Page List

flickr photostream