Links
Activity
<July 2008>
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789
Blogroll
Archive
Categories
Search
Admin Login
Sign In

Once a month whether I have something to say or not!

Oh damn.  I'm breaking one of Scott Hanselman's rules that he lists out in Blog Interesting - 32 Ways to Keep Your Blog from Sucking.  I may have passed suck a few posts ago already.  Oh well.

I'm finally settled in Indiana.  Well as settled as you can be without owning a house.  That's what is taking up all of my time lately.  Just to get a bunch of stuff off my chest, here's a dump of links that I've either consumed or am waiting to fully consume sometime shortly:

Swear Jar. (wmv)  Awesome Bud Lite commercial.

So you want to be a tracer?!  Here's your chance.  Re-inking Thor.

I haven't had a chance to play with it yet, but I really want to spend some time with the latest Microsoft Robotics Studio.  It looks like they have some Sumo Robot simulator happening.  It looks like it's kind of a big brother to the SumoBots.

I really wish that I could be at TechEd this year.  But between the move and everything else, that just didn't happen.  I can still keep up with some of the goings on thanks to Virtual TechEd.  I thought it was really cool that you could watch the keynote online.  Be sure to check out the video covering Embedded programming.  NOTE: You will need Silverlight installed on your system to watch any of those videos.

If Virtual TechEd doesn't give you enough info, my buddy James is blogging from TechEd as well.

Thursday, June 07, 2007 2:37:59 AM (Pacific Daylight Time, UTC-07:00) | Comments [0] |  |  |  | #

A week late, but Microsoft has finally come out with the first contest in Dream Build Play.  The Challenge is to create a game based on the Spacewar Starter Kit.  Use the codebase, content or both.  They also mention that you can use the Torque X tools.  Very nice....  I already have my ideas, do you?

Games must be submitted between February 21st - 28th.

Go read at Dream Build Play to find out more.

Thursday, February 15, 2007 3:46:34 PM (Pacific Standard Time, UTC-08:00) | Comments [0] |  |  | #

Microsoft released the .NET Micro Framework 2.0 the other day.  This is pretty cool technology with a lot of possibilities.  I find it hard to play around with it too much though because I don't really have any hardware that will let me deploy applications to it.  It would be neat if there was a way to write stuff that could run on my watch and load it up on there.

One really cool application that I've seen (in this video) is somebody setting the temp in their house via their cell phone while on their way home.  It would be sweet to set up that kind of automation and remote control, as far as lights and thermostat and other things in your house.  Leviton has a lot of home automation technology.  It looks like some of it is .NET Micro related too.  Haven't followed up any more as of yet to see how pricey or hackable the products are though.

Thursday, February 15, 2007 2:15:24 PM (Pacific Standard Time, UTC-08:00) | Comments [0] |  | #

Every year around this time I write a post talking about how much I like my watch.  Guess what?  I still like it.  I’m usually reminded of it this time of year because I have to decide if I want to pay the $50 to keep using the MSN Direct service.  I chose to renew it this year.  I’ll still read the news on it every now and then when I ride the bus to work.  I still use it to check football scores when my wife has drug me out shopping on a Saturday afternoon.  I don’t really use it too much for the IM features anymore.  But the one area where it is still indispensable is reminding me when I have a meeting.  That one feature (synching up with Outlook) is worth its weight in gold.

 

One of the things that first intrigued me about the technology was the hopes that I would be able to write code for it.  Unfortunately at the time when I got the watch you had to buy a development kit that included a chip to test your code on.  In the end I wasn’t interested enough to buy the development kit.

 

But now you can develop for the SPOT platform in Visual Studio using the .NET Micro Framework and SPOT emulator. It seems pretty cool when you first use it.  That is until you realize that there doesn’t seem to be a way to get that to an actual device.  Right now I can’t write some code that does something, and push that down to a device like a watch.  Plus, even if you could, there isn’t a whole lot of useful stuff that can be done without being able to access the radio spectrum and get some real-time communication.  One application that I can think of off the top of my head that doesn’t need the real time communication would be to load and have the ability to read certain bus schedules so that I don’t have to look online or have a paper copy handy.

 

Actually, I guess that bus thing would be more “useful” than “cool”.  You actually do have the ability to do something cool, and that something is called Sumobot.  The SDK comes with a Sumobot emulator and startup code.  You can even buy a Sumobot kit that you can build and push your code out to!  Another thing you can also do with the Sumobot is enter a Sumobot Contest.  I’ve already submitted mine.  Anybody else up for some Sumobot?

Tuesday, November 07, 2006 2:24:49 PM (Pacific Standard Time, UTC-08:00) | Comments [0] |  |  | #

The architects of the .NET framework made a specific decision not to use multiple inheritance.  There are arguments on “they should have” and “they did the right thing”, and there are some work-arounds where you can kind of get the feeling of multiple inheritance.  But I’m not going to specifically focus on that right now.  Today I’m talking about interfaces, and a problem that I ran into converting some code from .NET 1.1 to 2.0.

 

When you start talking about the need for multiple inheritance, the answer that inevitably comes up is interfaces.  That’s all well and good, but it still leaves you with having to implement all of those interfaces in each class where they are used.  Not quite as fancy as just straight inheritance.  The ability to implement these multiple interfaces still leaves you with one of the problems of multiple inheritance as well.  I’m talking about method overloading.

 

Let’s say in your code you have two interfaces, Ione and Itwo.  Let’s also say that you have a bunch of classes that implement Ione and Itwo.

 

public interface Ione{}

 

public interface Itwo{}

 

public class UsesInterfaceOne : Ione {}

 

public class UsesInterfaceTwo : Itwo {}

 

This allows you two write code like this

 

public class Runner

{

     public static string Run(Ione one)

     {

           return "Ran ONE";

     }

     public static string Run(Itwo two)

     {

           return "Ran TWO";

     }

}

 

But suppose someone comes along and decides to introduce a class that looks something along the lines of this (can you guess what’s coming next?)

 

public class UsesBothInterfaces : Ione, Itwo {}

 

Oh damn.  What happens when you run Runner.Run() ? 

Well now…..that all depends.  How are you calling the method and what framework are you using?  If you are just running the code directly like so|
 

UsesBothInterfaces both = new UsesBothInterfaces();

Runner.Run(both);

 

Then that code won’t even compile.  It tells you that the call is ambiguous.

But what if you think that you’re being slick, and you have an XML file that drives your navigation, and you are calling your methods via reflection and Type.InvokeMember().  Say your code looks something like this

 

Type.GetType("MultipleInterfaces.Runner").InvokeMember("Run", BindingFlags.Public | BindingFlags.Static | BindingFlags.FlattenHierarchy | BindingFlags.InvokeMethod, null, null, new object[] {o})

 

Yeah.  So in the .NET framework 1.1, that runs fine.  Well, sort of fine.  What it seems to be doing is calling the last method that is listed in your class.  Now I haven’t analyzed it further than stepping through the code, and trying to flip the methods around to see which one is being called.  So it may be doing something a bit more fancy than calling the last one.  But that seems to be what my tests are showing.

 

NOW, take your code and port everything over to .NET 2.0.  Either convert it in the IDE or just go into IIS Manager and switch it over to 2.0. Note: depending on what version of IIS you are using, you’ll probably have to reset IIS or move your app to a new app pool.  Now run that bit of reflection code and you should be seeing an exception.  Specifically it is throwing a System.Reflection.AmbiguousMatchException. 

 

So they tightened up reflection a little bit.  I would say for the better.  Even though it looks like there is now a possible breaking change during runtime in your app.  But if you are using reflection to poke around and call methods, you should probably be writing your code to be able to handle these kinds of exceptions and error out or continue on gracefully.

 

If you want to the sample code that I created when testing this, you can get it here:  MultipleInheritance.zip

Tuesday, October 24, 2006 2:21:40 PM (Pacific Daylight Time, UTC-07:00) | Comments [0] | #
www. flickr .com