comments edit

Last night I attended the Microsoft Office System party at the Hard Rock Cafe. The “Unauthorized Rolling Stones” were playing and the crowd was into it. I was primarily there for the food at first, but after a few free drinks, I was having a jolly good time talking to people. Even met a techie from Juneau, Alaska. Though I live in L.A., I still claim Anchorage since my family still lives there. So it was nice to bond with another Alaskan. Especially as I didn’t figure the Alaskan government would be using .NET.

In any case, I stuck out the party till the end and was rightly rewarded for it. I won the grand prize of the raffle which was a 3GHZ HP Media Center PC. It’s one of them TIVO like systems with 160 GB hard-drive, ATI Radeon 9200 (I think), TV and Radio Tuner, etc… I hear the next version of the Media Center operating system will support HDTV.

The funny part is that at the time, I was bummed I didn’t win second place which was a Tablet PC. I even went up to the guy who won it and offerred a trade, but he wasn’t having it. Especially considering I had to carry this big honking box to my car. ;)

Thanks Microsoft!

comments edit

The best part of Tech-Ed 2004 is how Microsoft puts us developers in touch with the people who are creating the languages and tools we use. They’ve accomplished this in two ways.

First, with the Rio system (nothing to do with Duran Duran). This system allows you to search for attendees (who’ve registered in the system) by name or interests and request a meeting with them. This is the debut of the system and I don’t believe it’s being well utilized by attendees. This is great for me as most everyone I’ve wanted to talk to has been available and I’ve had a chance to meet members of the C# team such as Eric Gunnerson (PM for the C# compiler) and Anders Hejlsberg (a Distinguished Engineer at Microsoft and chief designer of Delphi and the C# language). Unfortunately Steve Ballmer was not in the system.

Second, by having Microsoft employees hang around the cabana areas (replete with comfortable couches), it’s easy to walk up to the devs who are building the next generation of tools I use (such as Anson Horton and Cyrus Najmabadi) and ask, “So whatcha got?”

If there’s one thing I’ve taken away from my various discussions about language design is that language design is hard. This may be obvious to you, but it’s not obvious to everyone. Look in any unmoderated newsgroup about programming language and you’ll hear plenty of “Java sucks!” or “C# stinks” (perhaps even more colorful than that). A lot of people carry a one language fits all mentality when in reality, each language has a purpose and target in mind.

There are three reasons that come to mind to explain the difficulty of language design:

  • Language changes shouldn’t break existing code…too much.
  • Total language purity is unattainable, but we try anyway.
  • Language design must take into consideration human behavior.

Language changes shouldn’t break existing code…too much\ This is one of the more difficult issues when designing a language. How do you update the language without breaking thousands if not millions of lines of code out in the wild. Even small changes that seemingly should cause no problems can break code. Well hopefully you have legions and legions of regression tests, but they can only go so far. This remains a difficult challenge.

Total language purity is unattainable, but we try anyway \ Let’s face it, if we’re not seeking the ideal pure perfect design, why are we in the business. It’s a natural tendency. However, a good designer realizes that total purity is unattainable. It’s a simple fact: real world pressures are factors in language design. These guys have to ship and deadlines will affect which features they keep or don’t keep. More subtly, sometimes the order in which a feature is designed affects the language design.

I asked Eric Gunnerson whether they’ve considered adding a timeout syntax to the lock statement ala Ian Griffiths’ TimedLock structure. He in turn asked me, would creating this new syntax have any more clarity than using the TimedLock structure? Ummm… I guess not since we can already do this in a clean and concise manner. Right. So why add syntax. Not only that, the TimedLock demonstrates what the C# team had in mind with the using statement. It wasn’t intended just for cleanup, but for situations just like this.

Naturally, if this were the case, why even have the lock statement, as the using statement makes it unnecessary. It turns out, the lock statement was introduced long before they introduced the using statement when creating the language. At that point it wouldn’t make sense to refactor the lock statement out of the language as it was likely used all over the place and would introduce a major breaking change (see the first reason why language design is hard). Wow, you mean real world issues such as timing will affect the purity of language design? Indeed, total purity is an illusion.

Language design must take into consideration human behavior\ Another reason language design is hard is that it must take into account human behavior. Just as we have usability testing for GUI applications, usability testing for APIs and languages are also important.

Take the “throws” statement in Java when declaring a method. This statement is followed by the type of exception (or exceptions) that the method may throw. When calling this method, the developer must catch and handle every exception declared by the throws clause. From a purity standpoint, this is beautiful. If a method could throw this exception, certainly the developer should be forced to do something about it. But now let’s examine the behavior of real developers in the field. They just want to call this method to get the work done and handle the exceptional cases later (or in a method up the call stack). However, the code won’t compile until they catch each exception. So what do they typically do? They catch(Exception e) and forget about it. No more compiler errors, but if they never return, they’ve lost a lot of valuable information about the exception.

Some will argue that we shouldn’t pander to developers with bad habits like this and teach them to do the right thing. But this isn’t necessarily a case of developer ignorance. The physics of software development states that developers naturally take the path of least resistance i.e. we’re lazy. We have to ship software. We don’t have time to do everything in the most pure fashion. The language has to work for us, not against us. We absolutely have to pander (to a degree) to lazy programmers because they’re creating the software that’s running our cars, flight control, etc… Figure out why developers don’t perform a best practice and learn how to make the best practice the path of least resistance. That should be a focus of language design. It’s not always possible. Sometimes we just have to admit that software development is hard. I certainly don’t want developers to be lazy about security. But whenever possible, I want to make writing secure code, the path of least resistance.

comments edit

My good buddy makes the following comment on my last post:

I have a suspicion that TechEd might just be a massive re-education project, sponsored by Gates, attempting to grow an army for the violent overthrow of the domestic government.

Now that you’ve spoken the truth, you must be punished. You are hereby forced to use Windows ME for the rest of your life!

Sorry, nothing that insidious is happening here. Ballmer’s keynote focused on Microsoft’s mission for IT which is to help IT “Do More With Less”. Sadly, IT is already doing more with less. Less people. Less resources. Less moral. More hours.

For me, the most interesting announcement made was about Visual Studio.NET Team edition which will attempt to improve the software development lifecycle. This product integrates unit testing, deployment configuration (via Whitehorse), collaboration and workflow management, improved source control with the IDE. Yes, they are improving sourcesafe.

As for overthrowing the government, Ballmer did mention that Oracle is now a VSIP (Visual Studio Integration Partner). Larry Ellison partnering with Microsoft on any level? Either they’ve tied Larry up and locked him away, or there’s something brewing here…

comments edit

It’s probably too early to tell, but Don Box and Doug Purdy gave what I bet will be the most interesting talk I will hear at Tech-Ed. This was the opening talk for the Connected Systems track which focuses on that hot TLA, SOA (Service Oriented Architecture).

The implications of The Program is that we are constantly adding code to it while it still runs, but we can’t reboot it. We can take parts of it offline and replace parts, but there are parts (and decisions) within The Program that we may have to live with forever.

One of the big revelations they had was that “There is only one program and it is still being written.” This has pretty profound implications when you think of it. I can attest to this statement as I recently worked on porting Fortran code running on a microcomputer to Fortran 90 code (big upgrade!) that was to run on a modern Intel server. The front end was being replaced by an ASP.NET site that emulated the console currently in use. The ASP.NET site communicates with the Fortran via memory mapped files.

“Choice is an Illusion” Darwin is the system admin for The Program. You can’t change the program, you only have control over a small sliver of it. Your goal is to make your neighborhood better. This addresses the initiatives in the industry to create grand unification architectures. The physicists are still looking for a Grand Unifying Theory, but for software architects, it’s time to give that up. We’re not all going to run on a JVM. There will be no language to rule them all. We’ve tried DCOM, CORBA, etc…

In any case, this keyboard is not ergo so I’m going to have to stop typing and let you research this one on your own. Till next time, over and out.

comments edit

I have a new personal record time for the drive from Los Angeles to San Diego.  I believe I made it in 1.5 hours.  It was a harrowing drive, but I made it safely and already received some free code generation software.  Now to find some food and watch the Alias finale.

comments edit

DubyaAccording to a new report, the Bush Administration has taken its strong support for outsourcing further than previously thought – opting to move key political operations offshore. India’s Hindustan Times reports that, during a 14 month period from 2002 to 2003 when the Republican Party was playing up patriotism, its fund-raising and vote-seeking campaign was performed in part by two call centers located in India….

http://www.misleader.org/daily_mislead/Read.asp?fn=df05212004.html

comments edit

I may be the last geek to have posted this, but it’s interesting nonetheless.

REDMOND, Wash. (Reuters) - Microsoft Corp. Chairman Bill Gates often takes the stage to talk about the future of software technology, but on Thursday he also told top corporate executives that Weblogs and the way they are distributed can be used as business communication tools.

[Via Reuters: Technology]

comments edit

Knew it had to be too good to be true. Ignore my previous post.

Google is not offering users of its Gmail service 1 terabyte of storage, the company says. It’s all the fault of some buggy software. By Amit Asaravala.

[Via Wired News]

comments edit

When I first heard of this, I thought it was a glitch in gMail. But hot damn! A whole Terabyte. I don’t even have a terabyte at home.

The search giant may have just escalated the e-mail storage arms race by a factor of 1,000, by quietly raising storage limits to 1 terabyte for some users.

[Via CNET News.com]

comments edit

graffitti.TEXT has a neat page in the Admin section that displays all the comments made in your blog. I hadn’t been monitoring this page so when I finally got around to it, I was quite surprised at some of the comments made therein. Most of the comments are from my very nice and intelligent friends, but there are the occasional entries made by people with a one letter vocabulary (literally). My wife and I had a good laugh at many of them, but some of them were a bit disturbing or just plain nonsensical. I ended up deleting a lot of them.

Examples of comments include this gem printed in its entirety by someone named “d”. “d”:

See, one letter vocabulary.

In another post about how my wife spent time clicking on my AdSense ads, “slut” commented “lmao u idiots its tracked by ips NOT cookies”. Thanks Slut! That was soooo kewl of you to reply. However, I imagine that Google uses some combination of both since each request coming from America Online might come from a different IP.

This post which is just a link to Rory’s guide to Hollywood Aliens received this comment “this is gay about aliens because i know what we are like ???????????????”.

Fortunately, these comments are in the minority. It’s too bad. I would expect better than this. If you’re going to comment graffitti my blog, at least write something witty and intelligent. That’s a challenge! I remember the old days when graffitti was an artform. At least that’s what I tried to tell the officer who caught me with the can of spray paint.

comments edit

Last Thursday I was lucky enough to attend the E3 Gaming Conference. It’s basically a candy store for adolescent boys (or adults who cater to the inner adolescent). Two words characterize the expo, sex and videogames. Booth babes were plentiful (in number and cup size), but I was more interested in the games, games, games!

Unfortunately, I borrowed a coworker’s camera and I didn’t realize that none of my pics were in focus! Doh!

The game that most caught my attention was Star Wars Battleground. This game just looked fantastic. The part I played is set on Endor (remember them furry little half Wookies called Ewoks? Their home town) and it looks lush. Every plant and tree looks great close-up and you really feel like your in this densely wooded area fighting in an intense battle.

Doom3 on the X-Box also caught my attention. It has a dark atmosphere and a very cool beginning stage. You walk into a dark room and basically need to use your flashlight. As the light falls on some sort of zombie creature, he wakes up and starts staggering towards you. So you put down your flashlight to grab your gun and start firing in the dark trying to hit him till he gets close enough to see. Very cool.

In the “It’s a Small World” category, I ran into an old friend from Alaska, Gavin (pictured on the left). He’s a director of marketing with Motorola and showed me a sweet cell-phone with a touch screen interface and a 3-D J2ME engine. It’ll be coming out in December in the U.S.

\ Those Are Cockroaches.

asp.net, code comments edit

Apparently I’m not the only one to run into this annoying problem. When using the HttpWebRequest to POST form data using HTTP 1.1, it ALWAYS adds the following HTTP header “Expect: 100-Continue”. Fixing the problem has proved to be quite elusive.

According to the HTTP 1.1 protocol, when this header is sent, the form data is not sent with the initial request. Instead, this header is sent to the web server which responds with 100 (Continue) if implemented correctly. However, not all web servers handle this correctly, including the server to which I am attempting to post data. I sniffed the headers that Internet Explorer sends and noticed that it does not send this header, but my code does.

Looking through the newsgroups, several people have had problems with this, but nobody with a solution (apart from going back to HTTP 1.0 which doesn’t work for me).

At this point, I thought I would fire up Lutz Roeder’s Reflector 4.0 and look through the source code for the System.Net.HttpWebRequest class. Aha! There it is. Within a private method named MakeRequest() are the following lines of code:

if (this._ExpectContinue && ((this._HttpWriteMode == HttpWriteMode.Chunked) || (this._ContentLength > ((long) 0))))
{
    this._HttpRequestHeaders.AddInternal("Expect", "100-continue");
}

So even if you try to remove the Expect header from the _HttpRequestHeaders collection, the header will get added back when the request is actually made.

Unfortunately, fixing this is not easy since MakeRequest is a private method. Walking up the callee graph, I found that the method I would have to override is BeginGetRequestStream (there are other ancestors aside from this one). Unfortunately this method relies on several internal and private objects to which I do not have access. I hoped to re-use the existing code base and only make a slight tweak.

I even started down the path of building my own HttpWebRequest class using the Rotor source code but ran into several problems there as well.

In any case, I think the easiest way to get this fixed is to find the right person at Microsoft and ask them very nicely to try to get this in SP2. Pretty Please?

UPDATE: Lance Olson points me to the solution in my comments section. The System.Net.ServicePointManager class has a static property named Expect100Continue. Setting this to false will stop the header “Expect: 100-Continue” from being sent.

Thanks Lance!!!

comments edit

C64 miniThis press release announced a joystick that has a C64 mini console in a Joystick with 30 games including California Games. I absolutely loved California Games! Especially hacky-sack and surfing.

Man, I need to dust off my Amiga and get that guy up and running again.

code comments edit

Wow! After posting my update to the TimedLock class entitled TimedLock Yet Again Revisited…, Ian Griffiths posts this gem which outlines a solution to one of the problem’s with my approach to keeping a stack trace.

The problem is that my code acquires a stack trace every time it acquires a lock just in case another thread fails to acquire a lock. The purpose of this action is so that we can examine the stack trace of the blocking thread to find out why we couldn’t acquire a lock. This can be a big performance cost in some situations.

Ian received the solution via an email from Marek Malowidzki. Marek, if you’re out there. I’d love to see the proof of concept code you wrote. I won’t rehash the explanation of the solution, but will mention that it avoids creating and storing a StackTrace every time a lock is acquired, and rather, finds a way to obtain the blocking thread’s stack trace if and only if another thread fails to acquire a lock. How? You have to read the Ian’s post to find out.

comments edit

fightThis weekend I nearly got into a fight while playing soccer. To give you perspective, this is a friendly co-ed game with a group of people I’ve played with for six years. Player ages range from the early twenties up to fifty something.

After a tough play, the other player (I’ll call him Bob to protect the guilty) and I got into a verbal argument. I’ve been in these shouting matches before. You yell at each other a bit making sure to look real angry. Eventually, someone else will yell “C’mon. Just play soccer!” and we’ll both agree to quit yelling and continue with the game.

But Oh No! Not this time. Bob had to go and change the rules on me. As the shouting match was in a normal bell-curve progression, he stepped toward me and shoved me hard. This shocked me. My thought process in that moment went something like this.

That a-hole just pushed me!\ Oh no he didn’t!\ No. Wait. He did.\ Now why would that moron do that? Doesn’t he realize this is a shouting not a shoving match?\ Damn, he’s pissed. He needs an anger management class.\ Come to think of it. I’m pissed too!\ He’s a good 4 to 5 inches taller than me.\ I don’t care, I should kick his ass.\ Hmmm… Then again, if I retaliate, I may not be allowed to continue playing.\ Hmmm… I’d rather play soccer than whoop Bob’s ass.

I’m a slow thinker, and by the time I reached this conclusion, there were five people between the two of us, and I hadn’t made any reaction except the look of shock on my face. He is definitely in need of an anger management class or two, but it also gave me pause to consider if I’ve been an angrier person lately. Certainly if you get me started talking about the Bush administration (and calling it an “administration” is being too kind. It’s more of a nitwit circus) I get in a furor. I certainly could have let Bob wag his finger at me without responding in an angry manner. But lately, I’ve lost all patience for fools. I do not suffer fools lightly. I’m becoming Huey from the Boondocks.