May 2004 Blog Posts
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. ;)
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.
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.
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...
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.
According 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....
A coworker sent me this really neat car commercial. It makes really good use of soothing subtle sound effects as the car drives around the scerene landscape. You may need to turn up your speakers a bit to hear it.
Watch it here [3.38 mb MPEG]
A German couple who went to a fertility clinic after eight years of marriage have found out why they are still childless - they weren't having sex.
In the old days, the Shaolin monks demonstrated the strength of their kung-fu with feats of amazing dexterity. The modern monk has replaced kung-fu with this: http://eul0000562.eu.verio.net/bmuk_movies/asianarcade.wmv
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]
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]
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]
.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.
Reuters - Various reports indicate that
young people who use cannabis tend to experience psychological
and social problems. However, there is no evidence that
marijuana use is directly linked with such problems, according
to the results of a study published in The Lancet.
[Via Yahoo! News - Most Emailed]
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.
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))))
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!!!
And I thought he was talking about my site...
Interesting Technet article: Help, I got hacked, now what do I do?[Via Scobleizer: Microsoft Geek Blogger]
This 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.
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.
This 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.
In an earlier post, I updated the TimedLock class (first introduced in this post) to allow the user to examine the stack trace of the thread that is holding the lock to an object when the TimedLock fails to obtain a lock on that object. This assumes that the blocking lock was obtained using the TimedLock. Ian Griffiths pointed out a few flaws in my implementation and I promised I would incorporate his feedback and revise the code.
Since that time, Ian revisited the TimedLock based on comments he recevied and changed it to be a struct in both Debug and Release versions. He adds a new Sentinel class in the debug version. The finalizer in the Sentinal is used to detect whether or not the user of the TimedLock remembered to call Dispose. I've incorporated his new changes as well as his comments and have released my newest TimedLock struct.
Get the code here. I have yet to update the NUnit tests (I know, bad programmer! Bad!).
As Ian points out, there are non-trivial costs involved in keeping track of the stack trace of every lock just in case we wish to examine it later. When I have some non-trivial free time, I'd like to examine other possibilities.
This interesting piece on Slate presents the idea that perhaps Bush chose "stupidity" early on as an act of rebellion and has stuck with it even after beginning to get his act together. An excerpt:
Why would someone capable of being smart choose to be stupid? To understand, you have to look at W.'s relationship with father. This filial bond involves more tension than meets the eye. Dad was away for much of his oldest son's childhood. Little George grew up closer to his acid-tongued mother and acted out against the absent parent—through adolescent misbehavior, academic failure, dissipation, and basically not accomplishing anything at all until well into his 40s.
The other day while at the gym, I started regaling my friend with a story about my weekend trip to San Jose. Just as my storytelling juices started to flow, he interrupts and says,
“Yeah, I know. I read it in your blog.”
“Well did I tell you that...”
“How about...” I sputtered/p>
“Yep. That too.”
“Ok then. How many reps?”
Conversation over, we exercised in complete silence. I call this the “Blogging Syndrome”. It’s the increasingly common situation I find myself in where I cannot carry a conversation because the conversation is already published on my blog for the world to see. I have nothing to say that my friends haven't already read.
Perhaps it is time to purposely disseminate misinformation on my blog both as conversation starters, and to reserve a few interesting stories for me to tell via the old fashioned oral tradiion.
No matter what happens, I know I'll end up telling my friend.
“Hey, I just realized that we have nothing to talk about because of my blog.”
Yep, I read that.
One day at kindergarten a teacher said to the class of 5-year- olds, I'll give $2 to the child who can tell me who was the most famous man who ever lived."
An Irish boy put his hand up and said, "It was St. Patrick." The teacher said, "Sorry Sean, that's not correct."
Then a Scottish boy put his hand up and said, "It was St. Andrew." The teacher replied, "I'm sorry, Hamish, that's not right either."
Finally, a Jewish boy raised his hand and said, "It was Jesus Christ." The teacher said, "That's absolutely right, Marvin, come up here and I'll give you the $2."
As the teacher was giving Marvin his money, she said, "You know Marvin, since you're Jewish; I was very surprised you said Jesus Christ."
Marvin replied, "Yeah. In my heart I knew it was Moses, but business is business..."
I finally received an ergonomic chair at work through Workman's comp. It's a nice Neutral Posture brand chair with a tempurpedic seat cushion. Hopefully my back will start to calm down.
Found this on Slate. It's a funny little anecdote written from the perspective of the wife who decides to take a 48 hr vow of silence.
Have you ever wished your wife would just shut up? Here's what happens when she does.
[Via Slate Magazine]
Saw a post on the RSS Bandit newsgroup about AmphetaRate, a recommendation engine for blogs.
Having worked on a recommendation and personalization engine on a large music community site (now owned by a company with a name you would exclaim if you were to find a huge stash of gold), I think the idea of a blogging recommendation server is compelling and if done right, very useful for finding new and interesting content.
The basic premise is this, you subscribe to a Recommendations feed from the recommendation server. Then, by rating blog items via your RSS Aggregator, the recommendations get personalized to your tastes. Currently, only one aggregator supports this service (RSSOwl).
I wonder if others will think this is worthwhile to implement in RSS Bandit.
NPR Reports that Disney is blocking its Miramax division from distributing a Michael Moore film that is critical of the Bush administration. Disney is known for its tight control over the cheery image its theme parks present to world. Unfortunately the real world is not so sanguine.
AP - A middle school basketball coach who presented a "Crybaby Award" trophy to a 13-year-old player has been fired from his coaching job, and the board of education wants him out entirely, officials said Wednesday.
[Via Yahoo! News - Oddly Enough]
The latest version of RSS Bandit (v220.127.116.11) now includes rich support for synchronizing the state of RSS Bandit across multiple computers (such as you computers at work and home). Find out how by reading the online docs here. Click on the item "Using RSS Bandit from Multiple Computers".
The physics geek and marshmallow lover in me thinks this is awesome.
How to measure the speed of light with a marshmallow.
I love this quip from Joel Spolsky’s foreward to Mike Gunderloy’s Coder to Developer.
There’s something weird about software development, some mystical quality, that makes all kinds of people think they know how to do it. I’ve worked at dotcom-type companies full of liberal arts majors with no software experience or training who nevertheless were convinced that they knew how to manage software teams and design user interfaces. This is weird, because nobody thinks they know how to remove a burst appendix, or rebuild a car engine, unless they actually know how to do it, but for some reason there are all these people floating around who think they know everything there is to know about software development.
Spot on Joel! I need to print this out and hand it to everyone on the business side of my company.
Sorry, but it's been a slow news day for me and I'm really tired from this weekend. Unfortunately, I will not be posting anything on my blog today. Tune in again tomorrow.
This weekend I drove up to San Jose to hang out with Mr. Oba and his woman Cara. You can't toss a rock there without breaking a window of some high-tech company (whoops! Sorry E-Bay). Driving to his apartment, I passed Canon, Hitachi, E-Bay, Bea, Sun, etc....
This was my first time at their apartment which is in a really nice, clean, new building. We took the dog (named "Dubya" for a walk). He was much better behaved than his namesake.
Later that night, Kyle and I drove up to San Francisco and on the way passed a slew of companies with names starting with "Net" or "Inter". Talk about some uncreative names that violate the principle of timelessness. Sun at least does a decent job with naming. "Sun", it'll be a few billion years before that name is out-dated.
Our target in SF was 1015 Fulsom to see Paul Van Dyk spin. Promoters are a funny lot. They bill the event as a "Rock The Vote" benefit where a whole 1 DOLLAR! of the ticket price is donated. So how much do they charge for pre-sale tickets? $31.00 of course (where normally this would be a $30 event). They're really giving back to the community. At least we bought pre-sales: the door cost was $50.
When PVD spins, he always has his trusty IBook (or is it a G5) macintosh handy. I got close enough to see the warm glow of the white apple on the translucent white background while he queued up an album on the decks.
Nonetheless, we had a great time despite the huge crowd and heat. After partying like rock stars till 5AM, we drove back to San Jose to crash.
I managed to swing a deal where I pay for it now and get reimbursed later. It solves the budget and politics issue. Woohoo!!! Hope to see you all there. Be sure to say hello.
Google's IPO is valued at $2,718,281,828. This is the value of the mathematical constant e (2.718281828...). Apparently they forgot to tack on 45 cents.
For the less mathematically inclined e is the base for the natural logarithm. It was chosen to honor Euler, one of the greatest mathematicians ever. It has the unique property such that the area of the region under the hyperbola y = 1/x from x = 1 to x = e is exactly 1.
Here's a mnemonic to memorize the first 40 digits of e...
"We present a mnemonic to memorize a constant so exciting that Euler exclaimed: '!' when first it was found, yes, loudly '!'. My students perhaps will compute e, use power or Taylor series, an easy summation formula, obvious, clear, elegant!"
Found this on Wired News...
Sure, news aggregators are handy tools, making Web surfing a breeze. But the programs are greedy little buggers that swamp websites with unwanted traffic. Something has to change, and soon. By Ryan Singel.
[Via Wired News]
There's a corresponding essay in the latest Wired magazine about RSS too which I wrote about here. Dave Winer points out the same point I made which is propely written RSS Aggregators should not cause a large increase in network traffic.