get-myprocess

Link. October 5, 2008. Comments [1]. Posted in: PowerShell

Silly little helper PowerShell function that I’ve been finding useful lately when doing some debugging:

# get our own process information
function get-myprocess {
   [diagnostics.process]::GetCurrentProcess()
}

Update to /dev/null R2 Adapter

Link. October 4, 2008. Comments [0]. Posted in: BizTalk

Antti Somersalo brought to my attention that there was a bug in my R2 version of the /dev/null adapter. The bug manifested itself when you tried to export the bindings of any BizTalk Application that used the adapter in one of its send ports, failing with an ArgumentNullException.

The problem was simple: The adapter management class was returning null from the GetConfigSchema() call. Fixing it was just as simple: Just change the implementation so that it returns an empty Xml schema:

public string GetConfigSchema(ConfigType configType) {
   return @"<schema xmlns='http://www.w3.org/2001/XMLSchema'/>";
}

I’ve updated the ZIP file with the code snapshot.

/dev/null Adapter on GitHub

Link. September 28, 2008. Comments [0]. Posted in: BizTalk

I’ve just uploaded the source code for my old /dev/null BizTalk Adapter sample on GitHub, which is where I’m posting all my utilities, libraries and tools now.

The repository contains both the original version of the adapter, as well as the special BizTalk 2006 R2 version I did that showed how to use create custom configuration dialogs for adapters in R2.

The original version is in the ‘master’ branch, while the R2 version is in the ‘R2’ branch. Enjoy.

PipelineTesting Acknowledgements

Link. September 24, 2008. Comments [0]. Posted in: BizTalk

This morning I announced the release of PipelineTesting v1.2.0.0.

Now I need to mention that for this release, I need to give a huge ¡Thank You! to the people who contributed to it by reporting bugs and potential problems, providing some great feature suggestions and even some code!

These are:

  1. Bram Veldhoen
  2. Frédéric Hautecoeur
  3. Mark Coleman
  4. GokulRaja Dhamodaran
  5. Gregory Van de Wiele, as always :-)

Bram has also been working on some really cool stuff to integrate PipelineTesting features with BizUnit!

A huge thanks to each and everyone of you. And please keep the suggestions and bug reports coming :-)

PipelineTesting v1.2.0.0 Released

Link. September 24, 2008. Comments [0]. Posted in: BizTalk

I’m happy to announce a new release of my PipelineTesting library!

PipelineTesting is used alongside your favorite Unit Testing tool to make it easier to create and test custom pipeline components, pipelines and schemas for BizTalk Server 2006 using Test-Driven Development, or simply to have a set of regression tests to detect bugs arising from code changes.

These are the most important new features introduced in this version:

  1. Per-Instance Pipeline Configuration: You can now load an XML file with modified settings into a pipeline instance. This relies on the same XML format used by the BizTalk 2006 Administration Console.
  2. Accessible Components: A new GetComponent() method gives you access to the individual components within the pipeline. This makes it easy to load an existing compiled pipeline and then manually tweak the component options through code before executing it.
  3. Loading Saved Messages: Allows you to recreate an entire IBaseMessage object from the set of files exported by the BizTalk Admin Console or HAT by calling MessageHelper.LoadMessage() and providing the path to the exported <msg>_context.xml file.

The best news, however, is that I’ve been working on putting together existing PipelineTesting documentation I had previously written in different blog posts, along with documentation on this new features into a single, consolidated location. I give you the PipelineTesting Wiki!

This should make it easier for people to get started using the library.

Yu will find a snapshot of the code and a pre-built binary in the usual location, and always current source code in the GitHub repo.

Console2 and x64

Link. September 18, 2008. Comments [3]. Posted in: C++ | Tools

I recently mentioned that version 2.00b140 of the great Console utility had come out. Eddie Velasquez commented on that post that, unfortunately, Console didn't work correctly on Windows x64.

I had the opportunity to verify this during the last week. Console2 runs, but all text drawn on the console is invisible, which makes it a bit hard to read :-). I looked around the web, and although a few people mentioned seeing the same problem, no one offered any solutions. So I decided to take a look.

I installed Visual C++ 2008 on my x64 machine, downloaded the Console2 source code package and went hunting around for all dependencies needed to actually build it, which took a couple of hours. Off the top of my head, you need:

After a bit of tweaking the project files, I was able to build an x86 version of the code and started looking around the code to see where the problem might be. I checked a few things, like:

  • Was it possible that it was interacting incorrectly with the underlying system console and not picking up the text colors? Nope. Debugger showed me it was indeed picking up the right color for each character drawn.
  • Was it possible that it was mapping colors incorrectly? nope, not that either.
  • Was it possible it was drawing the text in the wrong locations? Didn't seem to be that either, as you could even copy paste the text from Console correctly, and the caret seemed to be at the right location either.
  • Could the off-screen surfaces be somehow invalid? Nope, a few calls to GetDeviceCaps() showed it had all the correct number of planes and bits per pixel that you'd expect.

After a few hours of tinkering, I was able to narrow it down to one issue: the use of the AlphaBlend() function when blitting between the off-screen and on-screen surfaces. In fact, I'm fairly confident that the issue Console2 is running into is the same one described on this newsgroup post. Unfortunately, that didn't seem to point to a good workaround for the issue.

Now, my GDI programming isn't very fresh on my mind, and frankly, I didn't want to sit around for a long time trying to get this fixed. However, I was able to make a quick change to the code that would make it work. The changes are setting up the BlendFunction for AlphaBlend slightly different.

The change I did was around line 1979, changing the setup before AlphaBlend like this:

blendFn.BlendOp               = AC_SRC_OVER;
blendFn.BlendFlags            = 0;
blendFn.SourceConstantAlpha   = 255;
blendFn.AlphaFormat           = AC_SRC_OVER;

Now, to be honest, this is just a hack, but it does the trick for now, using ClearType for font rendering and even alpha transparency on the entire window. I was not able (at least not in my quick look at the code) to fix the code path that gets executed when you're using an image as the console background, since that actually does require full alpha-blending to render the right output.

So it's not a great fix, but it means I can use Console2 on my x64 box now, which is good enough for me at this point. YMMV.

Updating Old Posts

Link. September 10, 2008. Comments [0]. Posted in: Blogging

I was recently looking for an old post I had written on some topic and discovered, much to my dismay, that a substantial number of old entries in my weblog were simply unreadable!

Some have code that is very hard to read or poorly formatted, while others force the font color on the main text, overriding the site's CSS styles. A lot of this is stuff that dates before I started using darkish background colors on my weblog theme, and is simply stuff that just wasn't written to be easy to style. Big mistake.

Some other stuff are just entries that I wrote in Microsoft Word and then posted through Windows Live Writer. It seemed like a good idea at the time, but no clue why I ever thought so!

Anyway, I'm slowly going over the old entries and fixing the formatting and making sure everything is readable. If you run into any post with really crappy formatting, let me know and I'll fix it.

AutoClose

Link. September 9, 2008. Comments [0]. Posted in: Vim

There's a Vim plugin I've had my eyes on for a while: AutoClose, by Thiago Alves. It's a rather nifty plugin that will complete open-close character pairs, such as quotes, parenthesis and braces, when typing in insert mode.

That is, if you type a (, AutoClose will insert the matching ) right away, though it is smart enough to not insert it if it was already there and things like that.

This is a rather nice feature that I missed from editors like Eclipse and Netbeans when working in Vim. The reason I wasn't using AutoClose sooner was that it had one annoying issue: Sometimes, when inserting an open character as the first character in a line, it would de-indent that line all the way to column 0.

This seemed to be somehow related to my use of a US-International keyboard layout, so I didn't pay much attention to it and decided to just wait it out and keep an eye on it.

Thiago recently updated his plugin and I'm happy to say that this problem seems to have gone away completely. I'm now keeping AutoClose enabled and seems to be working pretty well for me. Sweet!

FixEncoding on GitHub

Link. September 3, 2008. Comments [0]. Posted in: BizTalk

I just published the source code for my FixEncoding pipeline components for BizTalk Server 2006 to GitHub as well. FixEncoding provides two custom components that can help you resolve issues when resolving charset/encoding issues when receiving or sending messages.

I haven't touched FixEncoding in a while, but I still find it very helpful on a lot of projects. You can find the new repository here: http://github.com/tomasr/fixencoding/

Syndicate

About

Tomas Restrepo is a software developer located in Colombia, South America. His interests include .NET, Connected Systems, PowerShell and lately dynamic programming languages. More...

tomasrestrepo @ twitter My Flickr photostream My saved links on delicious My Technorati Profile

email: tomas@winterdom.com
msn: tomasr@passport.com

View my profile on LinkedIn

MVP logo

Ads


Links

Categories

Statistics

Total Posts: 1032
This Year: 102
This Month: 1
This Week: 1
Comments: 801

Blogroll

Archive

Other

Copyright © 2002-2008, Tomas Restrepo.

Powered by: newtelligence dasBlog 2.1.8139.823

Sign In