Jared

Sights of the City – Break Dancing on a Moving Subway

Three guys walked into the subway car at a stop somewhere between Brooklyn and Manhattan. When the doors closed and the car began to move a small stereo that began to play a background hip-hop song. The music was barely audible over the noisy car clacking and screeching along the tracks.When one of the guys began to speak I thought to myself, “This is going to be annoying”. Then he began to break dance in a small open area. It wasn’t all that spectacular and by the time the second guy started his routine I was busy fiddling with my camera phone which was only irritating me further because it wasn’t loading the camera software correctly.

At the moment I gave up on the camera and looked up the dancer did a complete 360deg flip in the air – head over heals. I didn’t see anyone else react but it was an amazing feat because of the physical constraints and the moving car. That daring move made the whole performance amazingly memorable.

Oddly enough I believe this is the same line where the subway violinist made an appearance.

2010 Washington D.C. Cherry Blossom Festival Panorama Pictures

The 2010 Cherry Blossom Festival in Washington D.C. was amazing. The trees were prime and the weather was beautiful. Sporadic breezes would send a cascade of white petals falling through the air. The crowd under the trees made it impossible to take any close multi-picture panorama images. All of the images were taken free hand from a distance and then stitched.

Below are several stitched panorama images. Click on the image to view it full size in a new window.

Wide panorama picture of cherry blossoms looking north from Kutz Bridge.

Wide panorama of cherry blossoms looking north from Kutz Bridge.

West view of tidal basin with cherry blossoms at either edge of panorama.

JFK Grave in Arlington Cemetery During 2010 Cherry Blossom Festival.

There are a couple more pictures to stitch and post, check back later in the week to see them.

Life In Carcassonne (The Board Game)

Carcassonne reminds me of Transport Tycoon Deluxe, I can’t say exactly why but I think it has to do with the geometry of the pieces and how everything fits together. Maybe I should introduce my friends to OpenTTD… hmmm…

Getting back to the game, it is a cross between The Settlers of Catan and Drakon. The board unfolds with each players turn to generate scoring opportunities. You have a chance to subtly coerce your fellow players and interact with them to make the game more interesting.

We played at the T’s place, RT, CT, and AM where there.

It is a fun game that I’d like to bring home during the holidays to play with my family. Not as intense as Risk or Monopoly but yet has a fun edge so even if you don’t try to over analyze each move you still feel like something was accomplished after each rotation.

Loading Specific Versions of .NET Assemblies From the GAC Based on the Assembly Information in a .NET DLL – Visual Basic Example Code

By default the latest version of an assembly is loaded from the GAC (Global Assembly Cache) when the assembly is instantiated. While working on a side project the need arose to load older versions of the assembly without hard coding the assembly versions. The answer, load the existing assembly library from the assembly DLL and interrogate it to find the assembly information. Then ask the GAC to provide a handle to the specific object. The result allows multiple versions of the same assembly to be loaded loaded at the same time.

The Visual Basic .NET example code below loads SampleAppV1\DotNetLibrary.DLL and AnotherSampleAppV2\DotNetLibrary.DLL which are different versions of the same assembly.

'Load assembly using reflection from the file specified so we can get information about it
Dim DLLAssemblyInfo As System.Reflection.Assembly
DLLAssemblyInfo = System.Reflection.Assembly.LoadFrom("\\\\appserver.company.int\\SampleAppV1\\DotNetLibrary.DLL")

'Now load the assembly from the GAC using the information in the file. 
Dim GACDLL As System.Reflection.Assembly
GACDLL = System.Reflection.Assembly.Load(AssemblyInfo.FullName, DLLAssemblyInfo.Evidence)
'Load the second version of the same assembly from the newer application
Dim DLLAssemblyInfoV2 As System.Reflection.Assembly
DLLAssemblyInfoV2 = System.Reflection.Assembly.LoadFrom("\\\\appserver.company.int\\AnotherSampleAppV2\\DotNetLibrary.DLL")
'Again, use the DLL information from the assembly file to load the assembly from the GAC
Dim GACDLLv2 As System.Reflection.Assembly
GACDLLv2 = System.Reflection.Assembly.Load(AssemblyInfoV2.FullName, DLLAssemblyInfoV2.Evidence)
'At this point in the code we have references to both assemblies loaded from the GAC. The next step is to instantiate an object from each of the references.
'Get an MyAssembly.Library from the old version and run the version method
Dim GACDLLType As Type = GACDLL.GetType("MyAssembly.Library")
Dim MyLibV1 As Object = Activator.CreateInstance(GACDLLType)
Dim v1 As String
v1 = MyLibV1.Version
'Finally, do the same and get the new MyAssembly.Library
Dim GACDLLTypeV2 As Type = GACDLLV2.GetType("MyAssembly.Library")
Dim MyLibV2 As Object = Activator.CreateInstance(GACDLLTypeV2)
Dim v2 As String
v2 = MyLibV2.Version

The variables v1 and v2 were both retrieved from the MyAssembly.Library.Version() method but the variables will not contain the same value because different versions of the assembly were loaded from the GAC during the System.Reflection.Assembly.Load() call.

Why not just load the assembly from each of the DLL files instead of the GAC? Security restrictions prevented untrusted assemblies from being loaded over the network. A possible work around would be to trust the network location or sign the assemblies and trust the signer but that remains for another posting.