Monday, February 27, 2006

What would happen if Microsoft had branded the iPod instead of Apple?

Something like this...

According to Mary Jo Foley from Microsoft Watch, the video was produced by Microsoft, which makes it even funnier!

Check it out!

UPDATE: Corrected URL to point to Google Video.

posted on Monday, February 27, 2006 5:33:17 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Friday, February 24, 2006
Larry O'Brien talks about the myth of better programming languages and how "there is not a shared psychology of computer programming." Seriously, it really does have to do with how you think about things. I work with people who can type all day and then compile and run their program without any errors... in COBOL. Does that mean that it is a better programming language? Maybe for them. Most definitely not for me.

As a side note, Kona and the Big Island of Hawaii rule.

(found via the Daily Grind)
posted on Friday, February 24, 2006 7:46:19 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
If you've never seen some of the posts from Kevin Moore regarding WPF (commonly pronounced Avalon), you should definitely check them out. In particular, some of the things you can do with ListViews and XAML are incredible! He points to this post to show some of the XAML that is required and, really, it doesn't look that bad. To get something like that out of the built-in ListView in .NET 1.1 or .NET 2.0, you would have to do some owner-drawn madness... or do the entire thing yourself.

I don't know about you, but I'm looking forward to WPF!
posted on Friday, February 24, 2006 7:26:44 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Thursday, February 23, 2006
Jeff Atwood posted a very interesting article today detailing the effects of icons, text, and combinations of the two in toolbars. I particularly liked his comparison of using different icon sets for toolbars. The image of Word with all possible toolbars displayed was particularly horrifying, though.

There is something to be said for having both icons and text. I think of Outlook a few years ago versus Outlook today. I believe Outlook 97 defaulted to just displaying icons. It was also one of the most complicated email programs out there. Today, Outlook is my preferred email client, and it has a nice combination of displaying ToolStrip items with icons and text both. The text tells us exactly what it does, but the icons do have meaning. I keep thinking back to all of the comments to posts on the IEBlog. There was a lot of positive response to the standardization of the RSS icon. There have been a lot of negative responses to some of the changes to the other IE icons, though, in particularly the combination of refresh and stop that they had prior to the Beta 2 Preview. (that might have more to do with having one button do multiple things, though).

Anyway, as I said, an interesting post, so check it out!
posted on Thursday, February 23, 2006 7:33:39 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Monday, February 20, 2006
I just installed the Performancing Add-in today and it is pretty snazzy. It seems to work fine with dasBlog, which is exactly what I need. It supports categories and will also pull in previous posts and allow you to edit them. It also has some pretty good formatting capabilities. If you can read this post, then I can highly recommend Performancing!

UPDATE: It worked fine... I like it a lot! A very quick and easy way to blog, and from within your browser, too! Sweet!
posted on Monday, February 20, 2006 7:53:09 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

Okay, I couldn't resist this. How often is it that you see CNN.com post something about Tiger Poo?!?

Sorry, I'm easily entertained.

posted on Monday, February 20, 2006 7:54:46 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Saturday, February 18, 2006

I'd like to talk a little bit about what I did to get my personal site up and running.

First off, I wanted it to support blogging for my wife and I. I tried a lot of different ASP.NET blogging engines like CommunityServer and SUB (Single User Blog). CommunityServer is great, but it had way too much for my needs. I really liked SUB, particularly version 2 because it was in ASP.NET 2.0 and Master pages rule. My only problems with it were probably more my fault, but I had some weird issues with the ASP.NET Development Server (aka Cassini). Something about files existing in two different places. I imagine if I had installed the Web Application Project things might have worked better. Still, I would suggest checking out SUB if you can.

I ended up going with dasBlog. I was already somewhat familiar with it and it is extremely easy to set up. It allows multiple logins by adding multiple users to the siteConfig.config file. My only obstacle was encorporating my own pages (Photos) and creating my own theme. I'd like to say thanks to James Snape for the Project84 theme (the default here), because I based my new theme off of it. If you're going to create your own dasBlog theme, I recommend starting with one you already like. Copy it to a new directory under the themes folder and then started changing things. See what happens. That's really all I did. Since dasBlog is written under ASP.NET 1.1, we can't use Master pages, but we get something pretty close. dasBlog uses template files that are very easy to change and that give you almost complete control over the way your blog will look. If you're interested in using my theme, let me know and I'll zip it up and post it.

The other primary addition to the standard dasBlog setup is that I added a Photos page written in ASP.NET 2.0. It is proof that you can run ASP.NET 1.1 and 2.0 side by side for relatively simple applications. My photos page relies primarily on Picasa, which is a great photo album application. I'm relying primarily on the "Make a webpage..." ability, which will export a selected album into a directory with appropriately sized images, thumbnails, and an index file. The best part is that you can choose to export to an XML file. The XML file is very simple, but it provides a simple way to provide image galleries in a format other than the Picasa defaults. My page basically has a Galleries subdirectory with exported albums. It grabs all of the albums in the gallery and parses the XML file to display the images. All my wife has to do to add albums is export from Picasa and drop the folder into the Galleries directory. How easy is that?

I'll be the first one to admit that there are issues with my Photos page (the exported albums' name are exactly the safest for the web), but it works. At some point, I'd like to clean up the names and add the ability to display our comments as well as to take comments from visitors to the site.

That pretty much sums up what I've done with the site. If you'd like to know more, let me know!

posted on Saturday, February 18, 2006 8:24:05 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

When I registered www.mohundro.com, it was always my intention to have a technical blog (what you're reading) and a personal site where my wife and I could post pictures and news. I wanted the primary site to be for family, etc, so I made that the root directory. My technical blog (which likely will get more visitors) would live in a subfolder.

Well, I've finally put a site out there for my wife and I and it is at http://www.mohundro.com. Easy enough to remember if you can get to this page. I've also added a link under my navigation to get there. I plan on blogging about some of the techniques I used with it soon so, if you're interested, check back soon.

posted on Saturday, February 18, 2006 8:02:23 PM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Thursday, February 16, 2006

Benjamin Wulfe wrote an article for the April issue of MSDN magazine about a utility called ManagedSpy, which is basically the managed version of Spy++. If you're unfamiliar with Spy++, it will let you look at running Windows processes and see messages, classes, and other WinAPI-related information. As the article notes, from a managed Windows Forms perspective, that isn't exactly where we typically work. ManagedSpy uses a TreeView and a Properties window to display controls and layout in a managed form. It can also listen and log events raised from the form and its controls.

One of the particularly interesting things to me is the ControlProxy, which is exposed from a managed C++ library called ManagedSpyLib. There is discussion about how to use Windows hooks to get to other windows currently running and even a section on using ManagedSpyLib for unit testing, because it has the ability to send Windows messages to other processes.

Check it out!

(via jfo's coding)

UPDATE: As an aside, be careful with this tool. I tried running it while RssBandit was running (which is a managed Windows application... and it blew up. Hard. As in, let's take them BOTH down. Luckily, it does come with code, so you can have fun with it. After all, I would like to learn some Managed C++ ;-).

posted on Thursday, February 16, 2006 7:20:43 AM (Central Standard Time, UTC-06:00)  #    Comments [0]
 Wednesday, February 15, 2006

Let's say you have the following class:

   51 Public Class Person

   52     Private _name As String

   53 

   54     Public Event NameChanged As EventHandler

   55 

   56     Public Property Name() As String

   57         Get

   58             Return _name

   59         End Get

   60         Set(ByVal value As String)

   61             _name = value

   62             OnNameChanged(EventArgs.Empty)

   63         End Set

   64     End Property

   65 

   66     Protected Sub OnNameChanged(ByValAs EventArgs)

   67         RaiseEvent NameChanged(Me, e)

   68     End Sub

   69 End Class

We've set up the [Property]Changed events so that DataBinding will work correctly. Now, let's assume you want to bind the name property over to the text property of your TextBox control. We'll go the simple data binding route here for simplicity.

    3 Public Class Form1

    4     Private txtName As New TextBox

    5     Private _person As New Person

    6 

    7     Public Sub New()

    8         ' This call is required by the Windows Form Designer.

    9         InitializeComponent()

   10 

   11         ' Add any initialization after the InitializeComponent() call.

   12         Me.Controls.Add(txtName)

   13 

   14         _person.Name = "cool"

   15         txtName.DataBindings.Add("Text", _person, "Name")

   16     End Sub

   17 

   18     Private Sub Form_Click(ByVal sender As ObjectByValAs EventArgs) _

   19         Handles Me.Click

   20         _person.Name = "clicked"

   21     End Sub

   22 End Class

There! Now the txtName will display "clicked" whenever you click on the form. Magic! Now, let's change that Click event like so to see what happens:

   18     Private Sub Form_Click(ByVal sender As ObjectByValAs EventArgs) _

   19         Handles Me.Click

   20 

   21         Dim newPerson As New Person

   22         newPerson.Name = "new person"

   23         _person = newPerson

   24     End Sub

Why would I ever want to do is this way? Well, let's say you're remoting somewhere to get your data and your background thread returns a fully populated object. The easiest thing to do is to just point to the new object... except that it doesn't work.

All we did was change our instance over, but the textbox never changed. Why not? Because of REFERENCES, POINTERS, and MEMORY ADDRESSES! That's why! Check this out:

   18     Private Sub Form_Click(ByVal sender As ObjectByValAs EventArgs) _

   19         Handles Me.Click

   20 

   21         Dim newPerson As New Person

   22         newPerson.Name = "new person"

   23 

   24         Debug.WriteLine("Are references equal? "Object.ReferenceEquals(txtName.DataBindings("Text").DataSource, _person))

   25         _person = newPerson

   26         Debug.WriteLine("Are references equal? "Object.ReferenceEquals(txtName.DataBindings("Text").DataSource, _person))

   27     End Sub

Whoa! The first Debug.Writeline will give you TRUE, but the second will give you FALSE. You see, understanding how references and pointers work is important. The textbox's DataSource is holding onto a reference of the old Person instance. You now have two different instances in memory, whether you like it or not.

What do you do about it? Well, as far as I can tell, you can either update your DataSource reference (it did change after all) or you can move your properties over manually so that your references don't change. I'm open to suggestions on other methods here.

posted on Wednesday, February 15, 2006 1:05:04 PM (Central Standard Time, UTC-06:00)  #    Comments [0]

For those two or three who missed it, Yahoo! released two libraries yesterday: the Yahoo! Design Patterns Library and the Yahoo! User Interface Library. I particularly like the UI library. First of all, it was released under as open source, so as long as you include the copyright at the top, it looks like you can use it. I checked out their JavaScript code and it looks pretty good. It seems that the whole object { name : value }* notation of declaring objects is becoming more popular. It is also becoming much more common to see entire frameworks being developed (I'm thinking of the JavaScript libraries that come with Atlas). Anyway, interesting stuff. It will be a lot easier to add some nice, production quality JavaScript to pages now.

* Instead of:

var newObject = new function () {
   this.name = value;
}

It is:

var newObject = {
   name: value;
}

posted on Wednesday, February 15, 2006 7:53:14 AM (Central Standard Time, UTC-06:00)  #    Comments [0]