My reading list
The Jeeves Omnibus Volume 4 - P. G. Wodehouse Everyone this Christmas has a Secret - Benjamin Stevenson A Handful of Ash - Marsali Taylor A Second Chance - Jodi Taylor A Gentleman in Moscow - Amor Towles
In full
Welcome to the Submarine Network. This is the new home of carbon14.

海底ネットワークへの歓迎。 これはcarbon14の新しい家である。

Terms and Conditions of Use
what's up doc!

Last updated: 28/08/12

28/08/12  06:36:58 pm,

Raspberry Pi

I bought a Raspberry Pi.

Partly to have a look at it and get to grips with it.

And partly to use to further my research.

I have a new research project (also documented on the forums) and I hope that the two will feed into one another.

09/08/10  12:13:38 pm,

Yamaha OPL project

I've started a research project to investigate the behaviour of the Yamaha OPL3 chipset.

rather than documenting this through a blog, I thought I would use my forum

01/07/08  03:50:11 pm,

Hosting new site

I'm hosting a site for my colleague Alastair. He is part of a small crew sailing right around the UK mainland over the next 5 weeks.

You can check on their progress here

14/03/08  02:15:39 pm,

Terms and conditions

I have added some terms of use, these are linked from the front page.

04/04/07  10:36:50 am,

New artwork - poster in the makings

I am working on a nice poster design.

Mexican Wave

I've posted some wallpaper based on this, in the art section

In full
Digital philosophy

Last updated: 16/06/17

16/06/17  09:38:52 am, Technology, Rant

Bug in BizTalk LogicalAnd functoid

While unit testing my own functoids, I came across an odd scenario where my map was working with inline C#, but if I switched to testing the external assembly version, the results were completely different. Obviously I started with the assumption that my functoid was broken, but in fact it appears that it's Microsoft's LogicalAnd functoid which is broken, and has been since BizTalk 2006.

I must stress, that the failure only occurs when you are using the external assembly version of the functoid, which would occur only when you have set the script type preference on your map to give higher priority to the external assembly script type than the inline C# script type. And frankly I still don't know why you would ever want to do that. But if you do, the LogicalAnd functoid is broken.

In BizTalk 2004, the functoid used this code which works:


// Microsoft.BizTalk.BaseFunctoids.FunctoidScripts
public bool LogicalAnd(string val1, string val2)
{
	bool flag = false;
	try
	{
		flag = bool.Parse(val1);
	}
	catch (Exception)
	{
		if (BaseFunctoid.IsNumeric(val1))
		{
			int num = Convert.ToInt32(val1, CultureInfo.get_InvariantCulture());
			flag = (0 < num);
		}
		else
		{
			flag = false;
		}
	}
	if (flag)
	{
		try
		{
			bool flag2 = bool.Parse(val2);
			flag = (flag && flag2);
		}
		catch (Exception)
		{
			if (BaseFunctoid.IsNumeric(val2))
			{
				int num2 = Convert.ToInt32(val2, CultureInfo.get_InvariantCulture());
				bool flag3 = true;
				if (0 >= num2)
				{
					flag3 = false;
				}
				flag = (flag && flag3);
			}
			else
			{
				flag = false;
			}
		}
	}
	return flag;
}

but at some point, either in BizTalk 2006 or in 2006r2 they changed to this code:

// Microsoft.BizTalk.BaseFunctoids.FunctoidScripts
public bool LogicalAnd(string val1, string val2)
{
	bool flag = false;
	if (!bool.TryParse(val1, out flag))
	{
		if (BaseFunctoid.IsNumeric(val1))
		{
			int num = Convert.ToInt32(val1, CultureInfo.InvariantCulture);
			flag = (0 < num);
		}
		else
		{
			flag = false;
		}
	}
	if (flag)
	{
		bool flag2 = false;
		if (!bool.TryParse(val2, out flag2))
		{
			flag = (flag && flag2);
		}
		else if (BaseFunctoid.IsNumeric(val2))
		{
			int num2 = Convert.ToInt32(val2, CultureInfo.InvariantCulture);
			flag2 = true;
			if (0 >= num2)
			{
				flag2 = false;
			}
			flag = (flag && flag2);
		}
		else
		{
			flag = false;
		}
	}
	return flag;
}

The new code is cleaner, and uses the TryParse method of the Boolean, presumably to avoid the overhead of the try..catch block. But the sense of the second parse test is the wrong way round; that second exclamation mark shouldn't be there; and as a result this function will almost always return false.

The fact that this bug appears to have survived for a decade suggests that no-one ever chooses to prioritise external assemblies in their maps, but you never know.

A Boolean and function should be the easiest thing to get right, and it certainly shouldn't be difficult to have unit testing this function.

28/11/16  04:26:34 pm, Technology

Unexpected Execution Order of Pipeline Components in BizTalk

Recently I ran into an unexpected problem with a custom pipeline component which I thought had been working fine. Suddenly it stopped working, but with an unexpected workaround. Today I worked out what the problem is, and although it makes perfect sense it caught me by surprise. I can't find any mention of this gotcha elsewhere on the internet, so I thought I'd write about it here.

Last year I wrote a custom pipeline component (Message Dump component) which optionally dumps the message body and/or the context of the message, and I use it regularly in my pipelines. Because the dumping is optional, and can be quickly controlled at runtime, I place the component in pretty much all of the pipelines that I use. When turned off, the overhead is minimal, but when you want to check what's going through any given stage of a pipeline you can quickly turn it on and get what you need.

This year we decided that one of our pipelines should always dump a copy of the message body and so I created another cut down version of this component (Archive component) that didn't have the optional switch. It has just 1 configuration option which is the path to the file that should be written, and that file path can contain various macros which can be expanded from the message context.

Everything seemed to work in the development and test environments; we went live with it and it was great. After a period of live commissioning I turned off the Message Dump components in the pipeline, and that's when it all went wrong.

=> Read more!

15/09/15  04:34:04 pm, Technology

If..Then..Else mapping in BizTalk

Starting some serious development in Microsoft BizTalk 2013 and I was looking for a way to streamline some of our maps. One common place where we have clutter is in the if..then..else design pattern. Typically you want to map one element if something is true, and if it's not true, you want to map something else instead.

BizTalk doesn't provide functoids that do that neatly, and over the years several people have commented on this; it's a problem that goes right back to at least BizTalk 2006.

In this post I'm going to show you the custom functoids that I created to try to streamline my maps.

=> Read more!

09/11/07  01:09:18 pm, Technology, Rant

ISP Muppetry

I've just had to help a friend with here broadband email service. It was working on Monday, but at some point during the week it stopped.

It was complaining that it couldn't get a response from the POP3 server. So I double checked all the documentation and rechecked the password. No good.

I had a look through her existing emails and discovered that she'd been sent details of a new email service that she was being moved onto. So I checked through the settings for that.
There were quite a few settings changes and I thought that would sort it, but no.

So then I went to the ISPs extremely slow, and badly organised AJAX enabled website, where eventually I managed to get the help pages to open for me. There I double checked all the settings, still OK and then looked for more help.

"Perhaps your password has become desynchronised in the move to the new service. Go to this page and change your password." It suggested.

I eventually had to find a different computer to get through the website without the AJAX choking and then I changed the password.

It still wasn't working.

I logged into the provider's site again, to be sure the password was right.
I logged into the provider's webmail service, which I discover is now a GMail solution.

There I find, in my friend's inbox, sent after the changeover, a new, and subtly different set of instructions on what to do to get POP3 working. Now you have to log into the webmail service and ENABLE POP3 apparently.

IF you move someone to a new email service.
AND some changes are necessary for them to continue to use it as before
sending them instructions AFTER the changeover is NOT GOOD ENOUGH!!!

05/07/07  07:51:53 pm, Food, Recipe

Fishcakes

I made some fishcakes yesterday, very easy and extremely tasty.

This should make 4 fishcakes. Enough for 2 people as a main meal with a salad or a handful of chips.

Boil some potatoes, around 250g, until tender. I used new potatoes and then peeled them, but you can use any floury potatoes and peel them first if they have thicker skins. While they were boiling, I was able to steam 180g of fish fillet above the boiling water. You can use any firm fish, cod, haddock or salmon for example. I went for coley because I had some in. It's a little darker in colour than cod, but with a similar flavour, a little less delicate.

Take 2 handfuls of fresh parsley and blend with 15g of cold butter. Then mix with the hot potatoes and mash them with a fork until smooth. Flake the steamed fish into the mash, add two handfuls of fine breadcrumbs and combine thoroughly.

Form the mixture into patties and then chill in the fridge for at least half an hour. They will become a good deal less sticky as the breadcrumbs absorb some of the moisture, and the cooling potato congeals.

When you are ready to cook the fishcakes, beat an egg into a shallow bowl, dip the patties into the egg, coating both sides, and then cover them with a mixture of breadcrumbs and polenta grains. Shallow fry for a few minutes on each side until they are golden brown and the coating has become crispy.

Serve immediately.

In full