# Tuesday, December 27, 2005

We had a pretty mellow Christmas this year, visiting family up in Seattle and then finishing the festivities yesterday at our place.  In years past we’ve had some pretty crazed holiday seasons, so it was nice to chill for the weekend.  Got a chance to hang out with my sister and her new baby, my first nephew. 

We managed to work in some gadgets, as is traditional.  I got a new Highgear Axis watch, with compass, altimeter and barometer.  Very cool for geocaching.  Also got some extra software for my GPSr, so now I have topo maps that I can load onto it.  I have yet to try it out for caching, but I’m thinking the maps will be a big help. 

I got my son his very own Garmin GPS 60, which was a huge hit.  We went out Christmas morning so he could find his first geocache by himself, which he did quite quickly.  A chip off the old nerd block. :-)

For those of you who might happen to read this blog for the technical content that once was here, hopefully there’ll be a bit more in the weeks to come.  I’m starting to work with Indigo, WWF, and Enterprise Library 2.0, so I should have some interested tidbits to report soon.

Tuesday, December 27, 2005 11:15:50 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
# Friday, December 02, 2005

I haven’t tried doing any WCF (formerly and still known as Indigo) development in probably 6 months or so, and some things have changed since then.  Also, this is the first time I’ve tried implementing a duplex contract.  I made some mistakes along the way, due in part to the fact that the sample code in the November CTP doesn’t match the docs (no surprise there).  Over all, though, it was way easier than I thought it might be.  Certainly easier then .NET Remoting, and the fact that there’s a built-in notion of a duplex contract solves tons of problems.

Anyway, I was trying to get my client to work, and for the life of me couldn’t figure out the errors I was getting, until it finally dawned on me.  Here’s what I had:

        static void Main(string[] args)

        {

            InstanceContext site = new InstanceContext(new CallbackHandler());

 

            // Create a proxy with the given client endpoint configuration.

            using (MyDuplexProxy proxy = new MyDuplexProxy(site))

            {

                proxy.Send("Joe");   

            }

            Console.ReadLine();

        }

    }

It’s probably obvious to everyone who isn’t me why this won’t work.  You can’t dispose of the proxy and still expect a callback.  Now that I say that it makes sense, but it didn’t occur to me for a while, since the callback itself isn’t on the proxy class. So, I changed one line to this:

        static void Main(string[] args)

        {

            InstanceContext site = new InstanceContext(new CallbackHandler());

 

            // Create a proxy with the given client endpoint configuration.

            using (MyDuplexProxy proxy = new MyDuplexProxy(site))

            {

                proxy.Send("Joe");   

                Console.ReadLine();

            }

        }

and everything worked out swimmingly.  I continue to be impressed with how well thought out Indigo is.  While many people like to point out how many mistakes MS has made over the years, you certainly can’t fault them for not learning from them. 

Friday, December 02, 2005 2:31:53 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, November 29, 2005

Geocaching is the bomb!  I’m totally hooked.  Even in the crummy weather we’re having today, Vikki and I managed to find two caches at lunch.  We’ve been geocaching in Sisters, out to Cannon Beach, and up on the Columbia outside of Vancouver.  There are a couple we haven’t been able to find, but for the most part it’s been pretty successful.  Even if we don’t find it, it’s a great excuse to get outside and go hiking with the kids and the dog.  And the thrill of the hunt really keeps me going.  I’m hoping when the weather improves (April? July?) I can plan some longer hikes to caches in the backcountry.  We’re also planning to hide a few of our own come Spring. 

It’s also been an excuse to finally learn map & compass navigation.  I’ve been wanting to try orienteering for a long time now, and now that I’m getting practice navigating it’ll be that much easier.  I’ve found some really good books on navigation and geocaching, and I’ll try to get around to posting a list some time. 

 

Profile for SafetyGeek
Tuesday, November 29, 2005 1:47:08 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 

Over the weekend I finally got a chance to go down to the Evergreen Aviation Museum in McMinnville.  The Spruce Goose is one big plane!  When I’d read that it was the biggest plane ever built, that still didn’t prepare me for the actual scale of the thing.  The whole museum is essentially in one big room, and the goose makes the other planes (like the “little” B-17) look like kid’s toys in comparison.  Not too surprising that it couldn’t actually fly.

The museum is very well done, with good, informative graphics, and a very nice building.  A clean, well lighted place for planes. One of the coolest parts of the visit was that we got to go inside the B-17 (for $10 extra for a family) and talk with some of the volunteers about the plane.  My grandfather flew B-17s and B-25s in WWII, so it was pretty cool to get a look inside and get a sense of what it would have been like to ride in one.  It would have been crowded, cold (30° below) and pretty scary, considering there’s not that much aluminum between you and the bullets. 

On the way down I managed to hunt up a couple of geocaches in Newburg, which made the trip that much more fun.  We also got a chance to check out the Hotel Oregon, McMennemin’s hotel in McMinnville.  Typical McMennemin’s food, nice atmosphere.  It’d be a nice place to stay.

Tuesday, November 29, 2005 1:38:06 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [1]  | 
# Monday, November 07, 2005

I got in some more geocaching this weekend.  I had a bunch of free time on Saturday, but unfortunately it started to rain really hard just as I found the first cache of the day, so I decided to call it quits.  So instead I went home and started reading up on navigation, which inspired me to get a snazzy new compass and start boning up on my wilderness navigation and mapreading skills.  I’ve wanted to try orienteering for ever, so this might get me towards that goal too. 

I had better luck yesterday since the weather was way better, although caching with both kids and the dog is an additional challenge.  They all hung in like troopers though, and we found 3 caches in Lacamas Park, up in Camas, WA.  It’s a lovely park, even this time of year.  It’s even better in the early spring when the camas lillies are in bloom. 

Monday, November 07, 2005 9:53:25 AM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 
# Tuesday, November 01, 2005

I found 4 geocaches around Sisters this weekend, and had a blast doing it.  I’m totally down with this sport!  Of course, I need another hobby like the proverbial whole in the head, but at least it’s an outdoor activity. 

The part that was the most fun was looking for caches that were in places I otherwise never would have visited.  We saw the remains of the first ski area in Central Oregon, the view from 4–Mile Butte, and some other great sights in the high desert.  I’m hoping the rain lets up a bit this weekend so I can go after some of the local caches in Hillsboro.

Tuesday, November 01, 2005 4:36:14 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [0]  | 

I’ve been working on a project that required me to turn some CLR types into a set of XML Schema element definitions so that they can be included in another file.  It stumped me for a while, and I envisioned having to reflect over all my types and build schema myself, which would be a total drag. 

Then I remembered that this is exactly what xsd.exe does.  Thank the heavens for Reflector!  It turns out to be really simple, just undocumented…

            XmlReflectionImporter importer1 = new XmlReflectionImporter();

            XmlSchemas schemas = new XmlSchemas();

            XmlSchemaExporter exporter1 = new XmlSchemaExporter(schemas);

            Type type = typeof(MyTypeToConvert);

            XmlTypeMapping map = importer1.ImportTypeMapping(type);

            exporter1.ExportTypeMapping(map);

It’s that easy!  The XmlSchemaExporter will do all the right things, and you can do this with a bunch of types in a loop, then check your XmlSchemas collection.  It will contain one XmlSchema per namespace, with all the right types, just as if you’d run xsd.exe over your assembly.

Even better, if there’s stuff in your CLR types that isn’t quite right, you can use XmlAttributeOverrides just like you can with the XmlSerializer.  So if you want to exclude a property called “IgnoreMe” from your MyTypeToConvert type…

            // Create the XmlAttributeOverrides and XmlAttributes objects.

            XmlAttributeOverrides xOver = new XmlAttributeOverrides();

            XmlAttributes attrs = new XmlAttributes();

 

            /* Use the XmlIgnore to instruct the XmlSerializer to ignore

               the IgnoreMe prop  */

            attrs = new XmlAttributes();

            attrs.XmlIgnore = true;

            xOver.Add(typeof(MyTypeToConvert), "IgnoreMe", attrs);

 

            XmlReflectionImporter importer1 = new XmlReflectionImporter(xOver);

            XmlSchemas schemas = new XmlSchemas();

            XmlSchemaExporter exporter1 = new XmlSchemaExporter(schemas);

            Type type = typeof(MyTypeToConvert);

            XmlTypeMapping map = importer1.ImportTypeMapping(type);

            exporter1.ExportTypeMapping(map);

That’ll get rid of the IgnoreMe element in the final schema.  It took a bit of Reflectoring, but this saves me a ton of time.

Work | XML
Tuesday, November 01, 2005 4:32:41 PM (Pacific Standard Time, UTC-08:00)  #    Disclaimer  |  Comments [2]  | 
# Friday, October 28, 2005
I found my first geocache at lunch yesterday.  Vikki and Carter (my wife, and our dog) came over to help.  Pretty fun stuff.  It was actually a “multi-cache” meaning that the initial coordinates get you a piece in a puzzle, which leads to the next set of coordinates, etc.  Bascially it’s a treasure hunt for technologically enabled grown ups.  I can see it getting to be a habit forming kind of hobby.  From looking at the maps, there are plenty more caches near both work and my house to keep my busy for a good while.
Friday, October 28, 2005 9:48:03 AM (Pacific Daylight Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  | 
# Wednesday, October 26, 2005

I did a little geocaching with some friends this summer, and really want to do some more.  To that end, I just got my first GPS, a Garmin GPSMAP 60C.  So far I’m totally digging it.  It gets great reception, even in the car, and the color screen is super easy to read.  It’s even got some nice built-in geocaching features, like the ability to mark a cache as found, and recording when you found it. 

The USB interface is super easy, and I was able to upload/download waypoints in no time.  I have yet to try downloading a route, but that will be next.  I haven’t shelled out for the mapping software yet, so I have to content myself with the basemap, which isn’t much to go on, but should be enough for highways at least.

I’m hoping to get in some ‘caching this weekend, so we’ll see how well it works in the field.

Wednesday, October 26, 2005 10:07:12 AM (Pacific Daylight Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  | 

While I’d consider this more of a “survival kit” than a “72–hour kit”, it’s still a neat idea.  I really like the way the saw blade is mounted on the tin.  Plus it’s always fun to see what people make out of Altoids tins…

Wednesday, October 26, 2005 9:59:55 AM (Pacific Daylight Time, UTC-07:00)  #    Disclaimer  |  Comments [0]  |