Friday, August 23, 2013

biztalk mapper bug

In Visual Studio 2010, I used the script functoid to write some C# method. Then I write the code in an assembly and changed the functoid to get the assembly code. Then I generate the xslt. The code is still in the xslt and the xsl is calling the script code, not the method in the assembly. You have to delete the code from the textbox to make the code go away.

Friday, May 18, 2012

A big gotcha

I installed the "Microsoft Biztalk 2010 Accelerator for SWIFT" (A4SWIFT) and the "Microsoft Biztalk Accelerator for SWIFT 2010 Message Pack" on my computer. In my work I need to research the SWIFT schemas and such. I was trying to open up the SWIFT header schema that is inside the Microsoft.Solutions.FinancialServices.SWIFT.RuntimeSchemas assembly. However I keep getting this error: Could not load type 'Microsoft.Solutions.FinancialServices.SWIFT.RuntimeSchemas.HeaderSchema' from assembly 'Microsoft.Solutions.FinancialServices.SWIFT.RuntimeSchemas, Version=3.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The problem is that there are two assemblies with the same file name and version number! The one creating the error is from A4SWIFT. The correct one is in the message pack directory. Note that the namespace name has different: A4SWIFT: Microsoft.Solutions.FinancialServices.SWIFT.RuntimeSchemas.HeaderSchema A4SWIFT Message Pack: SWIFTSchemas.SWIFTHeader Confusing as hell. No idea why they left an obsolete assembly around.

Monday, August 08, 2011

using Biztalk script functoid

I have been trying to use Biztalk maps to create xsl transforms. The biggest challenge seems to be finding resources that talk about its capabilities and limitations. Here is my little contribution.

My transform involves a lot of repeating structures. In particiular a bunch of addresses attached to different entities that needs to be mapped to another address structure.





xxx
yyy
www
...



...

...
...



...


In some cases the address entries are blanks but the destination does not allow blanks so the nodes have to be skipped.

Most of these tasks can be done with various functoids. But if you have to repeat a good few times the biztalk map gets hairy.

So my solution is to use the scripting functoid and write an xslt template. Luckily every has an id so I can use that as a parameter. The other parameter would be the node (a, b, c, or d) so that I can construct the xpath inside my template. Then it's normal xsl stuff and you can control your output.

I can construct an example if there is interest.

Friday, January 21, 2011

Questions and issues with Home systems using RAID

I bought a new home computer a few months ago. For the past few weeks I was trying to set up a RAID-1 array at home and ran into a bunch of issues and questions. The Motherboard is an ASUS M4A88TD-V which has a RAID support on the motherboard via a SB850 chipset.


  • There is no way to create a RAID volume from an existing disk. You have to create a new volume from scratch and re-image.

  • There seem to be a need to special drivers. When I boot up Linux with the RAID volume defined it still shows 2 disks!

  • Does the controller (or controlling software) verifies the write? If it doesn't and an error is discovered at read time it is too late.

  • If you have a corrupted file due to a software glitch for example you still need a backup. Otherwise you have a mirror of corrupted files.

  • If the motherboard dies can we take the disks and boot up from another computer with potentially a different chipset - RAID or regular?



Due to the above questions and issues I ended up using the secondary disk for backups.

Tuesday, October 19, 2010

kernel panic - unable to mount root fs

I have a Ubuntu 10.04 desktop and one day it just refuses booting up. Here are my steps to get it going again. Please drop a comment if it helped you.

- press escape when grub is load. Choose "recovery mode" to see where in the boot process it failed. In this case it is trying to mount root and failed.
- rebooted the computer from the bootable CDrom. Chose "fix a harddisk"
- once the initial setup is completed, try to mount the harddisk as root. For me it worked.

At this point I have 3 suspects:
- grub is corrupt. I tried reinstalling grub from the CDrom and that didn't help. Moreover I have been able to change options, tried older kernels, so not likely.
- blkid or device id somehow changed. I double checked the blkid values and devices with both the grub menu and /etc/fstab and they haven't changed.
- it took a while for me but I finally did a ls -l on /boot. All the files except one was dated one day before the failure. It was also odd that there was no backup (.bak) of the file. The file was initrd-xxx. I couldn't find the documentation on how to roll back the file, so I grabbed the same file from another Ubuntu box, copied it over. Rebooted and it started working again.

I googled a lot during this process and there was nothing really helpful. My suspicion is that there was a kernel update and somewhere in the middle of the process it failed.

Thursday, October 14, 2010

Powershell set-ClusterParameter

Powershell is wonderful. That being said there are still dark corners you have to traverse through.

I need to create a Powershell script to create a MSMQ resource on a failover cluster. One of the things I need is to set the IP address using DHCP. Using the UI interface is simple, select the network, click DHCP enabled, click apply. You would think you can do the same thing in Powershell, but it has to work like this:


$clusterGroup = Add-ClusterGroup -InputObject $cluster -Name "MsmqCluster"

# create cluster IP address
$IPClusterResource = add-ClusterResource -InputObject $ClusterGroup -Name "${clusterGroup}-IP" -ResourceType "IP Address"

# find the network name
$ClusterParam = get-ClusterResource "Cluster IP Address"|get-ClusterParameter Network
$NetworkName = new-object Microsoft.FailoverClusters.Powershell.ClusterParameter $IPClusterResource,Network,$ClusterParam.Value
# have to fake an ipaddress and subnet mask
$address = new-object Microsoft.FailoverClusters.Powershell.ClusterParameter $IPClusterResource,address,"10.16.12.101"
$subnetmask = new-object Microsoft.FailoverClusters.Powershell.ClusterParameter $IPClusterResource,subnetmask,"255.255.255.0"

# have to bundle the parameters together and set the parameters in one shot
$setParams = $NetworkName,$address,$subnetmask
$setParams|set-clusterParameter

# now you have to enable NetBIOS before you can Enable Dhcp
set-ClusterParameter -inputObject $IPClusterResource -Name EnableNetBIOS -Value 1
set-ClusterParameter -inputObject $IPClusterResource -Name EnableDhcp -Value 1

Tuesday, September 21, 2010

longest run up

My friend is doing this crazy thing. Please support him.

Monday, September 13, 2010

Nokia 5800 settings

I called Fido and they gave all these info. I have to figure out how to put the information properly in the phone because I did not buy the phone from them.

Add a new access point under Network destinations. Do this twice (one for internet and one for wap)

Connection Name: fido wap (it can be anything I think)
Data bearer: packet data
Access Point Name (APN): wap.fido.ca
user name: fido
promopt password: no
password: fido
authentication: normal
homepage: http://fido.mobi (i need it because I use prepaid)
use access point: after confirmation (again because I use prepaid)

now go to options|advance settings

network type: ipv4
phone ip address: automatic
DNS addresses: automatic
Proxy server address: 205.151.11.11
proxy port number: 0 (8080 for internet settings)

I also find it curious that nobody talks about their $1 a day nor their $3 for a week (unlimited) data plans.

Tuesday, August 17, 2010

Hong Kong - sports part 1

I went back to Hong Kong for a few weeks. Here is a recap of the activities I have participated in.

Wakeboarding
I remembered trying water skiing when I was a teenager but do not recall any success in it. It is fashionable to do wakeboarding and we were fortunate enough to book a boat. When you have a couple of noobs trying to learn this it is truly an expensive exercise. Everything from wearing the boots that are attached to the board, setting the boarder and the boat in position, resetting after the boarder has fallen in the water. Every round takes a good few minutes for the noob to try to hang up to a few seconds of board time. Throw in a couple of noobs and the time flies by pretty quickly without any interesting action.

To make things more interesting the guy who has the most experience was not on the boat when I was. I was left with little instructions and pure speculation based on how I've seen noob snowboarders do. And I have to share my thoughts with my daughter too.

I got 4 tries on the board. I was happy to stand up on the first try. By the third try I can turn the board so I was kind of surfing. On the fourth try I was able to hang on for about 10-15 seconds which seems like an eternity.

One odd thing about this boat trip is that the water inside the harbour is rougher. We got on the boat in Central and it was a rough 30 minute ride to get out of the harbour. Once we were able to turn the corner towards Pokfulam the waves die down. I haven't been on a cruise for many years and the busy traffic inside the harbour is to blame.

Monday, June 21, 2010

Tuesday, June 08, 2010

Did you notice?

That the hockey statisticians credited the loss to Brian Boucher for game 5?

If they used baseball rules it should have been Michael Leighton.

Friday, June 04, 2010

Network Load Balancing in Windows

I am using NLB on a prototype I am working on. I have a custom process that listens to custom port and I have two Windows 2008 boxes to act like a web farm. The quick gotcha is that if my process is down but the network on the machine is still up NLB will try to distribute the network load around the two nodes. I was hoping for something a little bit smarter (like figuring out the port has not listener) but that is not the case.

Monday, April 26, 2010

TSS and CTL

For the definitions of TSS, TSB and CTL read here.

This is my second year training with a powermeter. Last year it was mostly about getting the field experience of using it, matching up the perceived effort with the real power, managing efforts so the training is effective. This year the focus drifts into looking into TSS and CTL and how it relates to racing.

Firstly instead of using number of hours as a gauge of training effort, I am trying to use weekly total TSS as a gauge. So a big week needs to have say 600-700 TSS.

A rest week would be used to reset TSB to zero without losing CTL. The point is to keep building up CTL without going overboard. Last year I got sick right around Easter time trying to do too many big training rides and took more than one month to fully recover.

CTL is used as measure for race-readiness. If I were going into a 1.5 hour road race I need roughly 130 TSS. If my CTL were below 65 chances are I would crack before the end of the race. In comparison the one-day classic races the guys are racking up 300+ TSS in a day. Not only do you have to have the Watts per kilogram to stay with the guys, you need the CTL/TSS to stay with them for the duration of the race.

Lastly I counted the number of times a ride exceeds 150TSS last year and it is less than 10. So in terms of training regime 150 is a big ride. So if my "A" race is a 2 hour race worth about 180TSS, I will have to ride a couple of big rides to get use to that level. Either that or just stick to 30 minutes criteriums. :-(

Friday, April 09, 2010

how things have changed

Back in the days when I was learning piano, I often hear my teacher play the song once or twice in the beginning, rely on your memory and your reading skills and try to play the song. I was one of the luckier guys when I was in University and can use the record (vinyl) collection in the music library to hear the music while reading the score.
Last night my son told me that we were tasked to pick a new song (list C) for him to play and the recommended composer is Rachmaninov. So I opened up imslp and search what they have. We then look for the corresponding pieces on youtube and have these great pianists playing for us. We picked prelude op 23 no 5 - something I haven't played myself.

Monday, March 29, 2010

invalid license data. reinstall is required

I have Vista 64 SP2 and Visual Studio 2008 SP1. Monday morning I got this error message when I try to start Visual Studio. MSDN recommends reinstalling Visual Studio.

Luckily the technical support guy reminded to reboot the computer first. The problem goes away.

Monday, March 01, 2010

withdrawal

What did I do after watching the closing ceremonies? I re-read all the emails that were sent to me from the volunteer program manager. I baffles me that 7 years or planning and executed the plan in 2 weeks. Think designing, coding and testing a system for 7 years and run it for 2 weeks and throwing it away. Imagine hot-fixing it within the 2 week period as well. Amazing.

Next thing I would do: re-read the training manual. :-)

Tuesday, January 05, 2010

GroupBy with XElement

I am working on a new project and experimenting with Linq. It is very powerful and useful however it is a paradigm change for us old geezers.

The problem at hand was an XML string that needs to be sorted by a the value of an inner node:

<a>
  <b>
    <c>value1</c>
  </b>
  <b>
    <c>value2</c>
  </b>
  <b>
    <c>value1</c>
  </b>
</a>

I want to grab a list of "b" sorted by "c".

So I tried:
var xmldoc = XElement.Load("file.xml");
var grouplist1 = xmldoc.Elements("b").GroupBy(x => x.Elements("c").Select(y => y.Value);

When I do that the key is not the value1 but some sort of IEnumerable.
Then I tried:

var grouplist1 = xmldoc.Elements("b").GroupBy(x => x.Elements("c").Select(y => y.Value);

Then the compiler complained that I cannot cast an IEnumerable to string.

The issue is that within XElement you can have multiple "c"s although we know it could not. So this finally works:

var grouplist1 = xmldoc.Elements("b").GroupBy(x => x.Elements("c").Select(y => y.Value).ElementAt(0);

Of course it assumes there is at leaat one "c" node inside or else it would not work.

Lesson learned:
(1) types are still your friend. Declaring them make things easier.
(2) Break up Linq queries into smaller function calls. You will get the right result faster. At least it works for me.

Saturday, November 28, 2009

reflections on the Olympics part 1

Just a little background: I signed up to volunteer for the 2010 Olympics and recently I have been officially offered a position as an NOC (National Olympic Committee) assistant.

I have been attending the training sessions since April. I did run into a cycling friend in one training session but other than that these are all strangers to me. Being the anti-social self I have not been interacting with my fellow volunteers. All that changed today as I have my driver training. Three of us were assigned to a car and our job is to go through a couple of the Vancouver venues to locate the entry roads, dedicated parking, loading zones, etc. And for a few hours the three of us have to interact, make conversation and discover the solution for the problems posed to us.

Here is my reflection: as diverse are the people coming to compete in the games, the volunteers are similarly as diverse. We don't have to be friends, we don't have to have the same political views, we don't have any similar interests. We are all there just to make the games work. And as long as that objective is achieved that is the bottom line.

Friday, November 13, 2009

busy

I am volunteering for this, this and this. It's going to be busy for a while.

Wednesday, October 21, 2009

bike fit

I went for a bike fit at this bike shop. Here is what I have learned from the session.

1. Most of us have feet that are not parallel to the ground. I have known since a teenager that the outside of my shoes wears out first. Yet most pedals and cleats assume we are parallel and we are locked in while riding. I sometimes get soreness on the outside of my feet possibly because of this. The guys at the store installed some cleat wedges to rectify that problem.

2. In an ideal world the world the knee should be perfectly above the pedal and moving up-and-down only. Sideways movements just causes inefficiencies in the power transfer. The guys figured that my knee was moving outwards and rectified it by moving the pedals out by 20mm. At first it feels drastic but after a few rides it seems natural now. My only worry now is how peddling through a corner in a crit will be affected.

Before I went into the fit session I thought it was mainly about adjustment saddle and handlebar positions. They spend way more time on cleat and knee position than saddle/handlebar. I now have results to prove that I am more effective and would recommend this bike fit session to any serious cyclist.
 
Listed on BlogShares