Monday, November 24, 2008
#
Drew is my amazing nephew, and is the inspiration for this amazing project.
Please take a look and let me know if you want to contribute in any way!
I recently got the new MacBook Pro, and I am smitten. The form factor of the MacBook Air was what initially caught my attention after spending the last 16 years Mac-free. After seriously looking at the Macintosh line up I found several justifications for why I simply could not and should not spend another day without one. (The final tipping point was 18 months no interest from Best Buy - and this was after the credit crunch! I rationalized that by the time I had to actually pay for the thing I would have added at least that much value to my skill set.)
This is actually my first blog post from the MBP (as I fondly call it) using ecto.
After opening the (very cool) box and oohing and ahhhing over the ambient-light driven screen and keyboard lighting (you haven't lived until you've turned the lights off and on in a room with a MBP) I set about the task of becoming familiar with a very foreign environment.
I downloaded the following in very short order:
QuickSilver, Adium, Jing, Skype, Dropbox, TextMate, and VMWare Fusion.
Within days I had accomplished the "Windows on a Mac" experience. I did it the simple way for my first foray in the bi-platform lifestyle. I started with a Windows XP VPC created on my Dell. I will blog about the details later since that is not really the topic of this post.
My next project was XCode - the Mac development environment. To my great surprise and delight, Apple has relaxed the whole iPhone Development rigamarole ridiculousness and the entire process was easy (so far). I simply had to "Register" as an Apple Developer, and immediately in my inbox appeared an email with a link to validate my registration. I was then able to download the latest iPhone sdk with the iPhone emulator. The Apple Dev site contains tons of resources and before the day's end I had a small app up and running in the iPhone emulator.
With only 20 hours on it, the MBP had become my main laptop and I use it everywhere now - even for work at times. (Don't tell my boss... I think that may be a fireable offense!)
With that, I will end my first post from the MBP. (Actually, this is not the first post... I posted from livewriter running inside my Windows XP VM on my my MBP).
Saturday, November 22, 2008
#
Last weekend I spoke at Iowa Code Camp in Des Moines Iowa. It was a fantastic time, those guys put on a great event. After a quick dinner and iced tea (no post-event beer for those driving home!) at the after party, I headed out on my four hour drive back to the Twin Cities. The weather and road conditions were good. Until just south of Clear Lake. Suddenly the highway became one big ice sheet and cars were going into the ditch right and left. People were spinning out even when we were crawling along at 20 mph. Long story short - at one point I had to call 911 from my cell phone. (A Treo 800w from Sprint.) Many people, including myself, pulled off at the rest stop just south of Clear Lake to wait for the salt trucks. It was here that I started making calls to friends and family to let them know I was delayed. After I had make a few calls, my phone presented me with the following: "No more non-emergency calls while in emergency mode." Apparently my call to 911 had flipped something in my phone and I was now blocked from using it as a normal cell phone. I took a guess and dialed *2 - the number for Sprint customer service. As I suspected, I was able to complete this call. When I was finally in touch with a customer representative, I was told that she couldn't "access anybody's records" because they were "updating" their system." I explained that this was not an acceptable answer because I was driving alone in an ice storm at night in the middle of no where, and absolutely had to have a cell phone for safety reasons. Not to mention that my brother was driving south to escort me back because, well, I guess that's what brothers do, and if I didn't have a cell phone, we would drive right past each other - me going north and him going south. She continued to say that she couldn't help me and that I needed to "call back in the morning." Then we were suddenly cut off. When I redialed customer service, I was greeted with a "Please call back during business hours" message. (From a 24 hour service). By this time, the salt trucks had finally passed by and people were leaving the rest stop, so just staying put and waiting for my brother was not an option. (I had borrowed someone's cell phone to let him know that mine was out of service.)
I was left with two choices: stay at a rest stop in rural Minnesota at night, alone, or hit the road and drive in an ice storm with no cell phone. Then I happened to overhear that the rest stop had wifi. I flipped the switch on my phone and sure, enough, was able to connect to the internet. After that, it was merely a matter of googling to find the registry hack that would unlock my phone. After downloading a free WinMobile registry editor and deleting the specified entries from the phone registry, I was on my way again with a fully functional cell phone. (Although, ever since then I cannot synch to my computer - Active Sync doesn't even detect the device. Wireless Active Synch still works, though.)
There were so many FAILs in this scenario that I don't even know where to begin. The locking of a phone after a 911 call. (Don't you think that someone making a 911 call might have a pretty pressing need for communication capability?) The failure of Sprint to even explain, much less address the issue (The rep I was talking to had no idea what I was talking about when I was trying to explain the problem with my phone.) The Sprint system "update" that took out their entire support network including the customer service number.
All ended well - after reinstalling Active Synch on my laptop I was even able to sync my phone again. But this never should have turned into such a saga.
Monday, November 03, 2008
#
Here is a video of Drew using his SmartNav and special switch to play on the computer!
*Note: SFW, But there is sound with this video.
Monday, October 27, 2008
#
Now that I had my Amazing Qwerty KeyBoard, I had to hook it up. BabySmash uses the OnKeyUp event in the MainScreen as its hook to the business logic:
public partial class MainWindow : Window
{
private readonly Controller controller;
public Controller Controller { get { return controller; } }
public MainWindow(Controller c)
{
this.controller = c;
this.DataContext = controller;
InitializeComponent();
}
....
protected override void OnKeyUp(KeyEventArgs e)
{
base.OnKeyUp(e);
e.Handled = true;
controller.ProcessKey(this, e);
}
...
}
Since I wanted to mimic the existing behavior as closely as possible, I had to create a corresponding event for my on-screen key board, and then have the MainWindow handle it in the same manner.
My keys are <Button/>s, so I used the "Click" event on all of my keys:
<Button Name="Q" Grid.Column="0" Grid.Row="0" Click="HandleKeyBoardClick" >
<Button Name="W" Grid.Column="1" Grid.Row="0" Click="HandleKeyBoardClick" >
...
<Button Name="M" Grid.Column="2" Grid.Row="6" Click="HandleKeyBoardClick" >
I then implemented the "HandleKeyBoardClick" class in the code behind:
protected void HandleKeyBoardClick(object sender, RoutedEventArgs e)
{
Button b = (Button) sender;
NewKeyBoardClick(b.Name);
}
I abstracted the actual logic of the event raising in case I ever wanted to raise the event in a different way. My NewKeyBoardClick method takes the desired key as a plain-text string (ie: "Q"). I chose not to convert back and forth from ascii codes because I really didn't see any value in doing so.
public void NewKeyBoardClick(string keyName)
{
//Raise a key click event for the specified key
}
Now I needed a KeyClick event. After much googling and pain (It was during this activity that my KeyBoard user control briefly became a custom control before it was reincarnated back in it's present form.) I not only needed a custom event, I needed a custom event argument (which key was clicked).
Here is what I came up with:
First, I created my custom argument:
public class KeyBoardClickArgs : EventArgs
{
public string KeyName { get; set; }
}
Then I created the delegate for my event:
public delegate void KeyboardClickHandler(Object sender, KeyBoardClickArgs args);
Then I created my event:
public event KeyboardClickHandler KeyBoardClick;
Now, I needed to raise the event with the proper argument in my NewKeyBoardClick class. First I instantiated my KeyClickArgs and set the keyName property. Then I check for any subscribers to my event, and if I find any, I raise my event:
public void NewKeyBoardClick(string keyName)
{
KeyBoardClickArgs e = new KeyBoardClickArgs();
e.KeyName = keyName;
if (KeyBoardClick != null)
{
KeyBoardClick(this, e);
}
}
Now my control is ready to go! (I know, I haven't implemented the size property yet - that came later.)
I added the KeyBoard control the the MainPage window:
xmlns:local="clr-namespace:BabySmash"
<Canvas Name="figuresCanvas"><local:Keyboard3 x:Name="KeyBoardC" Visibility="Hidden"/></Canvas>
I set it to "Hidden" because I only want to display it if we are in "drewbie mode".
Now I just needed to hook up the new event:
First I added it to the MainWindow constructor:
KeyBoardC.KeyBoardClick += new Keyboard3.KeyboardClickHandler(KeyBoardC_KeyBoardClick);
Then I used the event in the same way that MainScreen uses its OnKeyUp event:
void KeyBoardC_KeyBoardClick(object sender, KeyBoardClickArgs e)
{
controller.ProcessKey(this, e.KeyName);
}
Success!! The MainWindow is responding to keyboard clicks from either the real keyboard or my on-screen keyboard control in exactly the same way! Now I can go ahead with modifying BabySmash and implementing new "DrewbieSmash" features without thinking about the input mechanism.
I'll work on getting the source code available. Until then, email me.
The first thing I did after downloading BabySmash was to begin building an on-screen keyboard. I installed Microsoft Expressions, but quickly became frustrated. That was a surprise to me because I am a Photoshop pro!! (On portraits anyway). Despite the admonishing of many, I switched over to Visual Studio and began coding my keyboard by hand. Now I was on much more familiar territory! I do plan to return someday to Expressions when I have a more open mind. But for now, I want to build DrewbieSmash!
The following are my requirements for my keyboard:
1. Appears in the bottom right corner of the BabySmash main window when BabySmash is in "drewbie mode".
2. Is resizable.
3. Sends a key-click event to the main window when a key is clicked on. I wanted to reuse as much code as possible, and hook the on-screen keyboard right into where the real keyboard is hooked in.
I tried many things... first I made my keyboard a <Window />. Mainly because the sample xaml files I was working with were all <window /> s, and I was just trying to do some cut-and-paste development to get my feet wet with WPF. Getting my window to render inside the main window as I wanted it to appear was problematic - probably because I didn't know what I was doing. And probably because putting a window inside another window is probably a dumb idea.
Then there was this challenge... BabySmash is architected so that all logic is executed by a controller class. The controller class requires a FrameworkElement argument and uses this for where it performs the animation. The original BabySmash main window was both the input and the action window, so it just used "this". Since my events were coming from the KeyBoard window, I had to get a reference to the Main window before I could execute the animations in the MainWindow via the controller class. Furthermore, it was apparent to me that BabySmash was really architected around having a single main window, and by continuing down this path I would likely run into additional challenges when trying to work with a second window.
So I took a step back and realized that in a .NET application, I would make the keyboard a <usercontrol />, and give it a "KeyClicked" event.
Since the keyboard object doesn't know anything about the size and real-estate concerns of the containing object, the keyboard was coded to size itself relative to the parent window. There were no pixel values coded into the Keyboard xaml. So originally I thought that the Keyboard size could be entirely controlled by the parent window. However, I soon realized that I have to change the font size as the key board is resized. So I added a "size" property to the KeyBoard control. I didn't want to use explicit pixel values because we still don't know what is going on with the parent. So I made the KeyBoard accept 4 sizes: Large, Medium, Small, Standard. (Standard being the smallest and the size of the on-screen keyboard that ships with the Windows OS. If someone has a better name for that one, please let me know!!!!)
Now, even though I don't know what the actual size of the KeyBoard will be, I can make a guess as to the size the font should be. And this works very well.
Here is a screen shot of my Amazing BabySmash keyboard. You can see by the name of the control that this is my third attempt at creating a keyboard. The next blog post will be about how I coded the KeyClicked event and how I modified the BabySmash application to use it.

Saturday, October 25, 2008
#
A long, long time ago in a galaxy far far away, a developer at Microsoft named Scott Hanselman decided to learn WPF. And so he set out upon the Great BabySmash Experiment.
Meanwhile, in another galaxy, a developer at Magenic named Kirstin decided to learn WPF. By this time, the Great BabySmash Experiment had achieved fame far and wide, and so Kirstin downloaded the source code and created DrewbieSmash.
Who is Drewbie?
Drew is my five-year-old nephew and is very special in many ways. When he was about one year old we learned that he has SMA. Spinal Muscular Atrophy is a form of Muscular Dystrophy. SMA is the reason he can’t walk or sit unsupported. However, please don’t worry about him. He has a scooter that he can drive like a pro. Besides, he's really smart. Best of all, he's one of the happiest five year olds you’ll ever meet! As you can see in his picture, he gives his life a double thumbs-up!
Few things will be more important for Drew than access to computers. Using a mouse is too difficult for him. When we were struggling with a way for Drew to access the computer I found a wonderful piece of equipment called the SmartNav. Drew puts a small ring on his finger to mouse and uses a switch to click. Drew will use an on-screen keyboard with his SmartNav for keyboard input.
DrewbieSmash
Ideally Drew will be able to use the on-screen keyboard that ships with the OS, so as to minimize the adaptations that need to be made to any PC he wants to use. (The SmartNav and the switch use a USB port and the SmartNav software must be installed.) However, the on-screen keyboards are quite small and require precise control of the mouse, something that Drew is working to master with his SmartNav.
When I saw BabySmash, I had an idea for a modification that could transform it into a platform for Drew (or any other toddler) to master the keyboard as well as learn letters and words. Instead of displaying whatever letter the user happens to "smash", why not have a word displayed that the child would then key in? If the correct letter was pressed, the letter would come dancing out and settle into place into its proper spot below the word. For Drew, I would create an on-screen keyboard as part of DrewbieSmash that could start out large with big keys and gradually be made smaller and smaller as his skill at clicking on the correct letter improves. Eventually he will be able to use the regular on-screen keyboard.
Learning WPF
And so here begins my adventure in learning WPF. Never having had any exposure whatsoever to WPF, yet eager to get going, I eschewed all preliminary research on the topic and decided to go the old-fashioned route: reverse engineering BabySmash and coding by Google. I will blog about my progress and what I learn along the way. If anyone has any helpful comments, PLEASE add your two cents. Scott has graciously offered to make whatever I come up with available as part of the BabySmash repository. Thanks for riding along with me!
Thursday, August 21, 2008
#
Last I attended a TFS User Group meeting in Minneapolis. Bill Maurer explained how Microsoft used Team Foundation Server to build the next release of Visual Studio.
It was really interesting to hear how the development team used TFS to track their own work. The most interesting thing to me was to hear about how TFS is being used to manage Java projects (Not at Microsoft of course!) Previously it had not occurred to me to consider TFS as anything other than a .NET development tool. But, of, course, data is data, and it makes perfect sense now that TFS would be used to track any type of project.
Bill mentioned that quite frequently, the software development team doesn't want management to have this detailed kind of visibility into the process. "If they knew how bad things really were, we would get fired!" Ten years ago I started putting Manufacturing Execution Systems into factories in my previous life as a Chemical Engineer. The operators nearly staged a mutiny over the fact that their actions would be tracked down to every operation they performed on every item. One plant was a union plant and the union was looking into whether or not the contract even allowed this type of data to be tracked! Management was also unsure... they were spending millions to dollars to implement systems that had no direct affect on the product.
Now, of course, you cannot imagine a manufacturing plant that does not have traceability down through the process for each unit produced. The operators work in an environment of reasonable expectations and an optimized process. No one thinks twice about logging into a system and then scanning each unit as it comes down the line.
Similarly, I think that one day no one will believe that we actually tried to build software without tracking this kind of data. The value of the data will be many times the cost of purchasing and implementing the system that supports it. Bill's comment to the teams that are concerned about giving management an actual picture of what is going on is that management will finally understand what can actually be accomplished, and remove bottlenecks if performance is unsatisfactory. "The working environment for the software team will actually improve", Bill says.
I do believe in the promised of optimized performance through Defining metrics, measuring what matters, analyzing the data, and improving and controlling the process. I have lived it in my years as a manufacturing engineer. TFS promises to be a huge asset to the teams that choose to use it for this purpose. I am anxious for Microsoft to give us a hint as to what Rosario will do. Perhaps at the upcoming PDC. I guess we will just have to wait.
Blogging so that I can find these again when I have time to watch them...:)
Ø Introduction to Microsoft Dynamics CRM, Susan Sauls
Ø Intro to SQL Server Data Services, Soumitra Sengupta
Ø The Spy Who Hacked Me! , Alex Smolen, Rudolph Araujo
Ø How Microsoft SQL Server Helps You to Lower Your Cost of Storage, Torsten Grabs
Ø Microsoft System Centre Virtual Machine Manager 2008: Overview, Edwin Yeun
Ø A Hackers Diary: How I Can Hack Your Vulnerable Services and How You Can Stop Me, Marcus Murray
Ø Advances Microsoft SQL Server PowerShell Tips and Tricks, Dan Jones
Ø Technical Introduction to Microsoft System Center Data Protection Manager 2007, Jason Buffington
Ø Introduction to Microsoft Forefront Code Name "Stirling", Brad Wright
Ø Hyper-V Architecture, Scenarios and Networking, Jeff Woolsey, Mike Sterling
Ø Windows, PowerShell, and Windows Management Instrumentation: Unveiling Microsoft's Best Kept Secret, Ben Pearce
Ø Windows Logins Revealed, Mark Minasi
Ø Virtualization and Security: What Does it Mean For Me? Steve Riley
Ø Windows Security Boundaries Mark Russinovich
Ø How to Build Your next Generation IT Infrastructure Using Windows Server 2008, Corey Hynes
Ø Deploying Windows Server 2008 Hyper V and System Centre Virtual Machine Manager 2008 Best Practices Edwin Yeun, Alan Stewart
Ø Deploying Microsoft Dynamics CRM, Ryan Casey
Ø Microsoft System Centre Service Manager Paul Ross, Travis Wright
Ø Windows Server 2008 Hyper-V: Scripting & Programmatic Management for Fun & Profit (VBS & PowerShell), John Kelbley, Alexander Lash
Saturday, August 02, 2008
#
A colleague of mine is organizing a community event to benefit Children's Hospitals and Clinics of Minnesota.
The Charity Fragathon will be held September 24, 2008 at the Microsoft office in Bloomington.
This is an amazing hospital, not only due to the world-class health care, but for the family experience they provide.
So come on out, have some fun, and benefit this great cause!
I'll be there, and I don't even game!