Saturday, January 8, 2011

This is where I am

I was assigned to an engagement this summer that had me working a lot of hours. 60-70 was the norm. I even did 97 towards the end, so that batch-processing could be delivered on time. The net effect of all that work was that I had to drop my workouts from my weekly schedule. I didn’t workout for a good six to eight weeks.

I started back to the gym when things calmed down. I was doing the 531 workout before the craziness started so I decided to pick it back up again. Unfortunately I had to backup a couple of cycles.

I just finished another cycle, and since this is the start of a new years, I thought I would post my max lifts for the four main exercises that I do: Standing military press, Deadlift, Bench press and Squat. I’m mainly doing this so that I have an easy way to measure my results this time next year.

Lift Weight Reps Theoretical Max
Military Press 120 7 148
Deadlift 265 10 353
Bench Press 225 6 270
Squat 200 12 280

 

About the Theoretical Max

In the ebook that describes the workout, Wendler provides a formula that can be used to calculate an estimated one-rep maximum – a guess at the most amount of weight that could be moved for one repetition:

Weight x Reps x 0.0333 + Weight = Estimated 1RM

The prescribed purpose of the formula is to provide a means to compare two lifts in order to gauge progress. Which lift is better 215 for 8 or 230 for 5. I use the formula to set rep goals.

I’ll start a new cycle tomorrow. I look forward to seeing where I am in a year.

Saturday, November 27, 2010

Retrieving message counts of a remote MSMQ queue using PowerShell

My current client does work for the retail industry. This weekend is the beginning of the holiday shopping season, a very important period to the retail industry.

This is also the first time that I’ve seen the planning and operations that the Retail IT groups go through. I’m really impressed by the amount of planning and support that is in place to make sure that IT-related issues don’t interfere with holiday shoppers. There are bridge calls that begin at 2am, around the clock monitoring of servers, hourly reports, call-ins every 30 minutes and lots of people are either active or on-call.

My part in this was to spend three hours monitoring 13 remote servers. To make life a little easier, we used a PowerShell script similar to this to retrieve the queue lengths of some remote MSMQ queues.

   1: $queuesToCheck = 'Q1' , 'Q2'
   2: $servers = 'myserver1', 'myserver2'
   3:  
   4: $queues = @()
   5: $servers | ForEach-Object {
   6:     $ServerName = $_
   7:     
   8:     $machineQueuesToCheck = $queuesToCheck | ForEach-Object { "$ServerName\$_".ToLower() }
   9:     $queues += gwmi -class Win32_PerfRawData_MSMQ_MSMQQueue -computerName $ServerName  | Where-Object {
  10:         $machineQueuesToCheck -contains $_.Name.Trim() -and $_.MessagesInQueue -gt 0
  11:     } 
  12: }
  13:  
  14: $queues | Format-Table Name, MessagesInQueue

Monday, September 6, 2010

Ascendo DataVault & Blackberry Desktop Manager v6

I’ve been a Blackberry Storm 9530 owner since the device was released. I’ve been really happy with the device, especially with the application ecosystem. There are lots of apps for the device. (There are a lot of apps for Blackberry devices in general).

As a computer professional, I spend a lot of time on the Internet. I’m a member of a large number of sites and that leads to a lot of username/password combinations to keep track of. An app for tracking passwords is a necessity for me. I don’t have the memory to track them all. Single-sign-on can’t come fast enough.

So I tried a bunch of password apps and ended up with DataVault from Ascendo, mainly due to its flexibility and the fact that there is a version that runs on Windows and the Blackberry Storm. The two versions will sync between each other through the Blackberry Desktop Manager.

This worked well until about a month ago when RIM released v6.0 of the Desktop Manager. According to an FAQ on Ascendo’s site, RIM removed an API that Ascendo was using to support synchronization. Unfortunately I didn’t notice that synchronization was broken until today.

The FAQ suggest upgrading to the latest version, 4.7.1 which has a fix for the problem. Still no syncing for me.

Another FAQ suggests upgrading the device version to the latest. Still no syncing for.

On a whim, I try running the Desktop Manager as Administrator. Surprise! The sync dialog appears.

Only two hours lost.

Sunday, August 29, 2010

Register Spring.Net objects with code

Anyone that has worked with Spring.Net is probably familiar with configuring the IOC container using an XML document. A typical example would be:

   2:  
   3: <objects xmlns="http://www.springframework.net" 
   4:          xmlns:v='http://www.springframework.net/validation' 
   5:          xmlns:aop="http://www.springframework.net/aop" 
   6:          xmlns:db="http://www.springframework.net/db" 
   8:  
   1: <?xml version="1.0" encoding="utf-8"?>
   9:   <object id="ConsoleWriter" type="SimpleCalculatorWithComplexTree.Writers.ConsoleWriter" singleton="false" >
  10:     <constructor-arg name="formatter" ref="HexFormatter" />
  11:   </object>
  12:  
  13:   <object id="Calculator" type="SimpleCalculatorWithComplexTree.Calculator" singleton="false">
  14:     <constructor-arg name="writer" ref="ConsoleWriter" />
  15:   </object>
  16:  
  17:   <object id="HexFormatter" type="SimpleCalculatorWithComplexTree.Formatters.HexFormatter" singleton="false" >
  18:     
  19:   </object>
  20:   
  21: </objects>

The last couple of years has seen an anti-XML movement begin to form. In the world of IOC containers, this has materialized as a movement away from XML configuration and more towards using code constructs and “convention over configuration.” I’m not against XML. After all, almost everything has a place.


I recently did a presentation on Spring.Net for a .NET user group. I wanted to introduce the IOC container without overwhelming people with XML. A quick search found an article about XMLless configuration of the container. This approach felt like it would be a distraction from my goal of getting to the container.


Luckily I stumbled into at article from early 2008 that discussed the configuration api. From this I was able to create this method that extends the GenericApplicationContext and allows for easy registration of a type in the container:



   1: Imports System.Runtime.CompilerServices
   2: Imports Spring.Context.Support
   3: Imports Spring.Objects.Factory.Support
   4:  
   5: Public Module SpringExtension
   6:  
   7:     <Extension()>
   8:     Public Sub RegisterType(Of T)(ByVal ctx As GenericApplicationContext, ByVal builderConfig As Action(Of ObjectDefinitionBuilder))
   9:         Dim objectDefinitionFactory As IObjectDefinitionFactory = New DefaultObjectDefinitionFactory()
  10:  
  11:         Dim builder As ObjectDefinitionBuilder = ObjectDefinitionBuilder.RootObjectDefinition(objectDefinitionFactory, GetType(T))
  12:         builderConfig.Invoke(builder)
  13:  
  14:         ctx.RegisterObjectDefinition(builder.ObjectDefinition.ObjectType.Name, builder.ObjectDefinition)
  15:  
  16:     End Sub
  17:  
  18: End Module

Here’s a quick example of its use:



   1: Dim ctx = New GenericApplicationContext()
   2:  
   3: ctx.RegisterType(Of Calculator)(Sub(b As ObjectDefinitionBuilder) b _
   4:                               .SetAutowireMode(Spring.Objects.Factory.Config.AutoWiringMode.AutoDetect) _
   5:                               .SetSingleton(False))
   6:  
   7: ctx.RegisterType(Of HexFormatter)(Sub(b As ObjectDefinitionBuilder) b _
   8:                       .SetAutowireMode(Spring.Objects.Factory.Config.AutoWiringMode.AutoDetect) _
   9:                       .SetSingleton(False))
  10:  
  11: ctx.RegisterType(Of ConsoleWriter)(Sub(b As ObjectDefinitionBuilder) b _
  12:                       .SetAutowireMode(Spring.Objects.Factory.Config.AutoWiringMode.AutoDetect) _
  13:                       .SetSingleton(False))

Sunday, August 22, 2010

Disable password expiration on Windows Hyper-V server

Back in April I wrong a quick entry about not being able to use the Hyper-V Remote manager to access the Hyper-V server. I was getting the error “Cannot connect to the RPC service on computer…” because my credentials on the server had expired. Today I finally got around to changing the account security policy on the server to prevent password from expiring. The command is:

NET accounts /MAXPWAGE:UNLIMITED

Monday, August 16, 2010

Spring.Net and Common.Logging 2.0

Versions 1.2 and 1.3 of Spring.Net bind to Common.Logging 1.2. If you are using or need to use v2.0 of Common.Logging, you can use an assembly redirect to force the assembly loader to the updated version. Put the following into your application’s configuration file:

<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Common.Logging"
publicKeyToken="AF08829B84F0328E" />
<bindingRedirect oldVersion="1.2.0.0"
newVersion="2.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

Sunday, May 30, 2010

TF31002, VS2008 and TFS2010

It’s funny (but not at the time) how easily you can find the answer to a question once you’ve already answered the question.

Last Friday I spent way too much time trying to figure out why I was getting the error TF31002 when trying to connect my Visual Studio 2008 instance to Team Foundation Server 2010. I knew you could do it. I have the configuration running at home. I have multiple co-workers with successful configurations. Yet, on these two machine, nothing but TF31002.

Today I can search and find all kind of solutions as long as I don’t include TF31002 in my search. Searching with the terms ‘VS2008 TFS2010’, returns the solution as the first hit. Search on TF31002 gets nothing useful. That’s why I put TF31002 in the title of this post.

The setup:

VS2008 with SP1 already installed.

We installed TFS2010.

We then installed Team Explorer for VS2008 and the Visual Studio Team System 2008 Service Pack 1 Forward Compatibility Update for Team Foundation Server 2010 (Installer). I tried to get to the TFS2010 box and received the error TF31002. Oh. I was told that you’re supposed to include the url to the team project :

http://server:8080/tfs/collection

That got me an nice message about not allowing ‘http:’, ‘https:’ nor ‘/’ in the server name.

Sound familiar?

Sadly, the answer is in the sequence of the installs. Since I installed Team Explorer after installing VS2008 SP1, I had to reinstall SP1 and then the Forward Compatibility Update.