Thursday, February 26, 2009

BLOG MOVED

I have moved my blog to here...

Bye bye Blogger!

Thursday, February 19, 2009

C# String.Format for Double/Decimal Values

The following examples show how to format float numbers to string in C#. You can use static method String.Format or instance methods double.ToString and float.ToString.
Digits after decimal point

This example formats double to string with fixed number of decimal places. For two decimal places use pattern "0.00". If a float number has less decimal places, the rest digits on the right will be zeroes. If it has more decimal places, the number will be rounded.
[C#]

// just two decimal places
String.Format("{0:0.00}", 123.4567);      // "123.46"
String.Format("{0:0.00}", 123.4);         // "123.40"
String.Format("{0:0.00}", 123.0);         // "123.00

More examples are in the original article here...

Wednesday, February 18, 2009

Architect Competencies

A couple of good articles were shared with me today about the competencies of a software architect and some training resources for them.

Microsoft Certified Architect Program Competencies
Learn Architecture

Tuesday, January 27, 2009

PowerShell Script for Find In Files

A co-worker gave me this Windows PowerShell script that I used to find files that contained a certain value...because the Windows Search Companion stinks!

gci -include *.txt *.* |? { $n = $_.FullName; $t = $false; gc $_ |% {$t = $t -or $_.Contains("stringtofind")}; if($t) {$n} }

Seems to do the trick!

Thanks Jason Turnage!!! :)

Tuesday, January 13, 2009

Failed to create a CLSID_BizTalkPropertyBagFactory

Was getting this message, "Failed to create a CLSID_BizTalkPropertyBagFactory" when trying to refresh the Group Overview screen in the BizTalk 2006 Administration Console.

What was the answer? Restart the Windows Management Instrumentation service.

Thanks to Michael Stephenson's blog for the answer...

http://geekswithblogs.net/michaelstephenson/archive/2007/09/01/115103.aspx


Wednesday, August 06, 2008

Sharepoint Crashing My Browser

I was having a heck of a time with Sharepoint. Every time I would click on a document, my browser would crash. The only way I was able to get a document to open was to right-click on it and open it in a new window. Needless to say, this was really annoying!

I found a Microsoft KB article that solved the problem.

http://support.microsoft.com/kb/929360

Just in case someone searches the interweb with the error code I was getting, it was: 0xc06d007f.

John

Thursday, July 03, 2008

ScribeFire - Worth It?

I'm taking a look at the ScribeFire extension for FireFox to see how I like it. It would be nice to have a tool integrated with the browser to write blog posts quickly and easily.

The coolest feature is that I can drag-and-drop content from web pages into a blog post. That is pretty darn compelling.

We will see how it goes!

John

Monday, March 17, 2008

How to Install Pavers

We have had a project lined up to extend the patio in our backyard. We were thinking of just having it done with concrete, which is what our existing patio is made of.

After looking at different contractors for the job, it was way more expensive than we had hoped. Now, we are thinking of a do-it-yourself project using pavers. I installed a natural stone flower bed border around the front and side of our house and it turned out really well.

This project would be a little more involved in some ways, but easier in others.

How to Install Pavers - wikiHow

Maybe I'll get some before and after pictures out here. :)

Sunday, March 16, 2008

Nail Pops

We have a few places in our house where drywall nails are beginning to rear their ugly heads. I've never done this kind of work before, but it looks like it's a pretty easy fix.

How to Fix Nail Pops in Drywall - wikiHow

We also have one area where the drywall tape is beginning to separate from the wall. I may need to undertake that project too.

How to Repair Drywall Tape That Is Separating from Your Walls - wikiHow

I actually know a great guy who does small drywall repair. I just know I can save a good bit of money if I do it myself. The materials themselves are really cheap.

Thursday, December 06, 2007

Failed to create a CLSID_BizTalkPropertyBagFactory

Failed to create a CLSID_BizTalkPropertyBagFactory

We periodically will start getting this exception in the BizTalk Admin Console and it's annoying to say the least. Previously, we would do a reboot not really knowing what was causing the problem. Well, the solution from this article worked for us. All we had to do was restart the Windows Management Instrumentation service and it started working again.

Still not sure what creates this condition, but this fix is easier than taking a production server down to reboot!

Yay!

John

Thursday, August 16, 2007

SQL Server. Create a data insert script from a table

SQL Server. Create a data insert script from a table - Author Nigel Rivett

This useful stored proc will generate insert statements for an entire table. Definitely a time saver!

John

Friday, June 22, 2007

Dynamically Set BizTalk 2006 Pipeline Properties

Matt Meleski's .Net Blog - The ABC's of .NET : Dynamically Configuring Pipeline Component Properties in a BizTalk Orchestration

I am so very glad that BTS 2006 is capable of this!

Basically, you set properties on the message you are about to send through a pipeline and those properties will get set dynamically within the pipeline. This works both for stock and customer pipeline component properties.

John

Thursday, February 01, 2007

Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

Calling A Receive Pipeline Inside an Orchestration in BizTalk 2006

This is a quick example of how to call a receive pipeline from within a BizTalk 2006 orchestration.

Here's the gist of it:

InputPipeline = Microsoft.XLANGs.Pipeline.

XLANGPipelineManager.ExecuteReceivePipeline

(typeof(CallReceivePipeline.ReceivePipeline),msgFullMessage);

InputPipeline.MoveNext()

msgSingle = new System.Xml.XmlDocument();
InputPipeline.GetCurrent(msgSingle);

Wednesday, January 31, 2007

JkDefrag v3.6

JkDefrag v3.6

Here's a handy little defrag utility.

Tuesday, January 23, 2007

BizTalk - Make the Port Operation Unique

Kevin Lam's WebLog : An orchestration pattern that can hog the master message box CPU

This is a compelling article on why the operation property of an orchestration port should be uniquely named.

Monday, January 22, 2007

How to Debug a BizTalk Rules Policy in Code

Rule engine - Another way to debug the rule engine

I was experiencing an unreported error when I was trying to dynamically call a BizTalk 2006 rules policy in C# code. The policy ran and gave me no exception information and was annoying me to no end!

It turns out the issue had to do with facts and namespaces. I didn't discover this, however, until I learned from the link above how to put a debug trace into the policy so it would tell me what was going on.

Here's a snippet:

TypedXmlDocument typedResult = new TypedXmlDocument("ValidationResult", validationResult);
TypedXmlDocument typedTransaction = new TypedXmlDocument("Transaction", transaction);

System.Collections.ArrayList FactList = new System.Collections.ArrayList();
FactList.Add(typedResult);
FactList.Add(typedTransaction);

DebugTrackingInterceptor debug = new DebugTrackingInterceptor(@"D:\trace.txt");
Policy rulePolicy = new Policy("ValidateTransaction");
rulePolicy.Execute(FactList.ToArray());
rulePolicy.Dispose();

Wednesday, January 17, 2007

Passing an Array of Facts into the Rules Engine

Passing an Array of Facts into the Rules Engine (BizTalk 2004)

The last piece of the puzzle for me in working with generic messages to do away with a TON of duplication is to dynamically call a rules policy to validate outbound EDI messages.

This is some sample code I found on the blog mentioned above:

//System.Collections.ArrayList List;
sCon = "Initial Catalog=Northwind;Data Source=(local);Integrated Security=SSPI;";
con = new System.Data.SqlClient.SqlConnection(sCon);
dcNorthwind = new Microsoft.RuleEngine.DataConnection("Northwind", "ShipperCountry", con);
List.Add(dcNorthwind);


xmlDocument = msgShippingRequest;
typedXmlDocument = new Microsoft.RuleEngine.TypedXmlDocument("RoleLinkSample.ShippingRequest",xmlDocument);
policy = new Microsoft.RuleEngine.Policy("ShippingPolicy");
List.Add(typedXmlDocument);


policy.Execute(List.ToArray());
msgOutgoingShippingRequest = typedXmlDocument.Document;
policy.Dispose();
typedXmlDocument = null;
dcNorthwind = null;


This sample is based on Biztalk 2004, but should not differ in this instance for Biztalk 2006.

Tuesday, January 16, 2007

Dynamic Mapping (Transforms) in Biztalk Orchestrations

TopXML : Dynamic Mapping (Transforms) in Biztalk Orchestrations, in XmlDocument

This is how we call maps dynamically in Biztalk 2006.

tMapType = System.Type.GetType("DynamicMaps.Map_A, DynamicMaps, Version=1.0.0.0, Culture=neutral, PublicKeyToken=faed587cb93de4ea");

construct Out_Xml

{

transform (Out_Xml) = tMapType(In_Xml);

}

BizTalk Correlation of Untyped Messages

Richard Seroter - SoCal BizTalk Musings : BizTalk Correlation of Untyped Messages

This is VERY cool...

I had two choices: created fifty separate orchestrations to handle all of the types and scenarios I needed to cover, or find a way to correlate untyped (XmlDocument) messages. I searched for the latter and found this article.

public IBaseMessage Execute(IPipelineContext pc, IBaseMessage inmsg)
{
string trackCode = Convert.ToString(System.Guid.NewGuid());
inmsg.Context.Promote("TrackingID", "http://Microsoft.Demo.Customer.CustomerPropertySchema", trackCode);
return inmsg;
}

Sweet!

Wednesday, January 10, 2007

MSDN TV: Introduction to Analysis Services 2005

I watched this demo and it is really impressive how quicky analysis cubes can be created and consumed in SQL Server 2005. I haven't had the opportunity to use analysis services with SQL Server 2000, so I can't appreciate how much easier it is in 2005. However, the benefits of cubed data become apparent pretty quickly while watching this short demo.

MSDN TV: Introduction to Analysis Services 2005