August 31, 2005
Update: How VSTS lets you unit test executables
As mentioned in this post, Visual Studio Team System will let you unit test executables. I was curious how it was able to call functions inside of an EXE. It turns out that you can use Assembly.LoadFile to load an EXE assembly into your process space. I guess I had assumed that Assembly.LoadFile only worked with .DLL files. In retrospect, it seems obvious that you could LoadFile an EXE (I'm guessing that Reflector does this also).
Anyways, VSTS uses reflection to load the EXE assembly, and then uses reflection to call into it and unit test the private methods.
It looks like you're trying to make a phone call
Microsoft enters the fray by acquiring Teleo, a start-up VoIP provider.
Coming soon to a desktop near you?
The slope didn't change, it just got pushed out.
Commenting on the slower than projected uptake on the Tablet PC platform, Roger Kay, president of Endpoint Technologies Associates offered the priceless quote "The revisions did not actually change the slope of the adoption curve, just pushed it out farther in time." ??!!??
While it's true that not every laptop has become a Tablet PC (not by a longshot), sales are expected to grow to about 3.5 million units per year by 2009. That's paltry compared to the 200+ million laptops that are likely to ship in 2009, but it's undeniable that Tablet sales continue to grow every year.
August 30, 2005
ADO.NET Gotcha #3 - First visible row in a DataGrid
I was working on a project recently where I needed to know what the first visible row in the DataGrid was. The DataGrid has protected field called firstVisibleRow, but I didn't want to resort to a reflection hack to get at that information. Thanks to Walt Ritscher, I didn't have to. Here's the code:
Private firstCellLocation As Point Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.SqlDataAdapter1.Fill(dsNorthwind1) firstCellLocation = Me.DataGrid1.GetCellBounds(0, 0).Location End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim hitTest As DataGrid.HitTestInfo = Me.DataGrid1.HitTest(firstCellLocation) MessageBox.Show(hitTest.Row) End Sub
Whent the grid is loaded, GetCellBounds is used to determine the location of the first cell in the grid. As the user scrolls, you can then do a hit test on that location to see what row it cooresponds to.
Note, the VS 2005 DataGridView control will expose a FirstDisplayedCell property.
August 29, 2005
How I feel...
You have to check out the animated gif on the left side of this blog (howifeel.gif). Good golly, that's funny!
The games of summer.
I'm just now reading John's Blog post about the joys of summer and the games of children. It's an old post, but I just didn't want summer to slip by without adding a few of my favorite games to the list.
One game he likes is this one:
I think the first game is called, "Aaaa." The rules are a little mysterious to me, but I'm an old man. As far as I can tell, the rules are to run around screaming at the top of your lungs, "AAAAAAAAAAAAAAAaaaaaaaaaaaaaaaaaa! AAAAAAAAAAaaaaaaaaaaaaaaaaa!" It sounds like such a fun game
It's been a long time since I've played that one, but I too live in a neighborhood with kids, so I get to hear it a lot myself. I like living in a neighborhood with kids, so it doesn't bother me nearly as much as the game: One Leaf Landed on My Parking Strip So I'm Going to Run and Grab My God Given Right To Own Leaf Blower And Run It For An Hour Because I'm Too Lazy To Use a Goddamn Rake. It's a grown up game, so the kids don't play it. The kids on my block actually use rakes and (I'm not making this up) red Radio Flyer wagons. But I guess each generation will play their own noisy games.
The other game seems to be called, "Mommymommy." This one has simple rules: while your mother is running her 22" gas lawn mower over the 200 square feet of lawn you have, you stand behind her and shout, "Mommymommymommymommymommymommy!" until she stops and turns off the mower. Then you ask a question. When she starts the mower again, you start shouting, "Mommymommymommymommymommymommy!" again. That really seems like a fun game to me.
This game actually isn't called Mommymommymommymommymommymommy, it's called My Grass Didn't Stop Growing Just Because I Had Kids, And I Desperately Need To Get It Mowed Somehow, And They're Kids, Not Computers, So I Can't Just Shut Them Off When I Need To Do Something Else, And Even Though I'm Not Yelling At My Kid, I DON'T LIKE THIS GAME EITHER!!!
For anyone who doesn't enjoy this game (and I also don't enjoy being conscripted to play it against my will), Microsoft invented Windows Media Player. It works great for opting out of both mommymommy and God Given Right To a Leaf Blower.
Getting back to the lawn mower game, it reminds me of a game we play in our neighborhood once in a while. It's called Hey, I Can See My Neighbor Is Struggling, So I'll Get Off My Ass And Help Them Out. I was really glad my neighbor decided to play it when I was wondering how to get the 500lb treadmill into my basement without ending up looking like the proverbial flattened-by-steam-roller cartoon character. We also play it when we call up Laurie and say, "Hey, it's 10:00 pm and your garage door is open. You probably didn't know you left it open, so we just thought we'd give you a call before someone walks off with all your stuff." We play that one all the time.
If someone really wanted to have a blast, they could dress up like Clippy, pop their head over the fence and say "It looks like you have a young child and you're desperately trying to get your lawn mowed. I bet if I helped you out, we could knock it out in less time than it would take me to write a complaining blog post."
Of course, it helps that our neighbors have names. I suppose it's a lot easier to play games with Taylor, Laurie, and Kevin, than it would be with The Lady, or Those Kids.
I'm disappointed in you Smithers. You assured me he was dead.
Tom Rizzo says that Beta 1 of WinFS has been posted to MSDN Subscriber Downloads.
August 26, 2005
Where do I download the Lamborghini emulator?
Windows Automotive v5.0 is designed to let car manufacturers deliver "cutting-edge in-vehicle solutions that will improve the lives of drivers and passengers."
Sounds cool, but I'd hate to think of what a "slammer" virus could do in this environment. In all seriousness, how do you install SP2 into your Taurus?
Off Topic: We're Going to Need a Bigger Saw
In Thailand, the locals have caught the largest fresh water fish ever: a monster catfish weighing 646 pounds. They then proceeded to "carve" it into some nice steaks.
Listening to: Another One Bites the Dust
.NET Language Integrated Query Framework?
From the PDC Session abstracts:
...These advances enable developers to express queries and updates in terms of their local programming language without sacrificing the server-side execution model of today's high-performance SQL-based approaches. Using these advances, database queries that previously were stored as opaque strings now benefit from static type checking, CLR metadata, design-time type inference, and of course IntelliSense.
And then you have Paul Vick asking "What if everything could be queried with SQL?"
And then, there's this post from YAG.