BizTalk solves a lot of problems, but with it comes a whole other bag of fun new ones to solve. Oh joy. All kidding aside I have been facing some real challenges working with cXML in BizTalk due to the nature of the cXML standard. Primarily the fact that cXML does not use XSD’s to describe itself and instead uses a DTD. BizTalk does not like DTD’s, as in, if you send a document to BizTalk with a DTD using the standard XML Pipeline, it will fail.
BizTalk also doesn’t work well if you try sending it messages that don’t have an XML Namespace because BizTalk uses the Namespace and the root node of the XML document to identify the message inside the system. So I have to inject something like xmlns=”http://something” into the root node as well.
Some solutions have been documented but I ran into other issues and ended up the solution a little further. Long story short, I ended up creating a custom Pipeline Component to strip out DTD’s and add Namespaces using regular expressions. At first I created a cXML cleaner component that worked specifically for my scenario. This worked fine but eventually I noticed that I was using a regular expression to find and replace the DTD which led me to think “Why can’t I use any regex I pass in and replace anything I want to?” So I did. I even made it open source so no one ever has to feel the anguish of having to develop custom BizTalk Pipeline Components, because it sucks. Bad.
Feel free to pull it down and give it whirl. If you improve it, by all means, send me a patch and I’ll include it in the trunk.
RegexReplace on Google Code
Screenshots:
1. Use Multiple RegexReplace in a single stage to process a document multiple times.
2. Simply set the Pattern and the Replacement string.
UPDATE: Turns out it was just Gallio (v3.0.5 build 546 - x86). I also tried uninstalling TestDriven.NET and the problem persisted.
This weekend I spent some time working with the release candidate of ASP.NET MVC to familiarize myself with the new features, only to find Visual Studio crashing every time I opened a View. It was pretty frustrating, especially since this was the almost ready for prime time version, and I had been working without any problems for a while using earlier versions. Obviously I started searching the interweb for an answer.
Zero point two seconds later Google found me an answer on StackOverflow. Turns out I'm not the only one who has experienced this strange behavior. When I say strange behavior, I mean “.NET Runtime version 2.0.50727.3053 - Fatal Execution Engine Error (70DC5E00) (80131506)” strange. I had started by removing the Spark View Engine add-in I have for working with Spark and MVC (which is awesome). That didn’t fix it though. A Christian Dalagar pointed out that he experienced the same problem and it appeared to be a conflict between Gallio and TestDriven.NET. Hmmm…That’s funny. I happen to have both of those installed as well!
This was the hard decision…well not really. I can’t live without my TestDriven.NET. Sorry Gallio. Maybe we’ll meet again in another life. Don’t get me wrong I like Gallio, and MBUnit is kind of growing on me, but TestDriven.NET is the best way to run tests in Visual Studio.
PROBLEM: Opening ASP.NET MVC RC Views Crashes Visual Studio when both TestDriven.NET and Gallio are installed.
SOLUTION: Un-install Gallio.
If you find that you’re out of hard drive space on your computer, or you simple hate keeping unnecessary files around, give this a try.
1. Create a batch script and put this code in it. (or download it here)
@echo off FOR /F "tokens=*" %%G IN ('DIR /B /AD /S
"C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\"')
DO RMDIR /S /Q "%%G"
*The 3 lines above should be on one line. They are broken apart here for clarity sake.
2. Create a scheduled task to run at logon and have it call the batch script you just created
Enjoy the free ~20GB.
Recently I was working on a web page that was overburdened with tabular data. The original goal was to database the information and just read/format the data with some server side code (PHP). The problem was that I had FTP access to the site but no administrative logins to setup and configure MySQL or another data store. This felt like a good time to experiment with another great extension to jQuery: $.csv() [http://plugins.jquery.com/project/csv ].
Drop the source code into an existing .js file or create a new one and make sure you link to it after you've loaded jQuery to the page. Now lets take a look at our HTML.
<h4>Select a year <select id="year"> <option>1900</option> <option>1910</option> <option>1920</option> <option>1930</option> </select> </h4> <table class="tableContent"> <tr style="background-color:#516DB6; color: #fff;"> <th>NAME</th><th>M/F</th><th>BORN</th><th>RESIDENCE AT HH</th> </tr> </table>
Now for the controls that will cause the update. You can see in the screen shot that we want to keep the update controls very simple. When a visitor changes the drop down list we want to take the new SELECT box value and search for that data.
Now that we have our HTML setup, lets start writing some javascript. We need to start by loading the CSV document on page load or once the document is ready. For this we can use the jQuery AJAX method $.get().
$.get("documents/1900_Census.csv", function(data) { array = $.csv() (data); });
Now that we have our data in an Array, lets use jQuery to loop through each row.
$.each(array, function() { var row = String(this).split(","); }
The jQuery .each() function will setup each new row for our table. The line inside of this function splits the row into an array representing each column of data. We can later use those array elements to output our data.
Now that we can load the CSV data into our table. To clean things up a bit, lets put our code into a more complete function that will cause the table to fade out, load the data, then fade back in. Removing table rows with jQuery is simple, all we need to do is find every row but the first and call the .remove() method. Below you can see how we load the data once the document is ready and bind the change event of the drop down list.
<script type="text/javascript"> $(document).ready(function() { loadCSVFile(1900); $('#year').change(function() { loadCSVFile($('#year').val()); }); }); function loadCSVFile(year) { $('.tableContent').hide(); $('#loading').fadeIn(); $('.tableContent').find("tr:gt(0)").remove(); $.get('documents/' + year + '_Census.csv', function(data) { array = $.csv() (data); $.each(array, function() { var row = String(this).split(","); if (row[0] != "") { $('.tableContent').append("" + row[0] + "," + row[1] + ""); $('.tableContent').append("" + row[2] + "" + row[3] + "" + row[4] + ""); } }); $('.tableContent tr:odd').css('background-color', '#ffc'); $('.tableContent').fadeIn(); }); </script>
You can check out the final result here.
Since the beginning of Rapidparts time, the first Friday of every month has been better known as “Cake Day”. The concept is quite simple – we celebrate and recognize the employees that have a birthday that month by having cake. Through the years, the cake has gotten quite bigger as we have grown (in some cases, literally!), but the process has always remained the same. Our world gets a bit rocked when we have to defer from the normal schedule, for instance when we close for the 4th of July that happens to fall on a Friday. Apparently, cake tastes different on Thursday?! Cake Day has become an integral part of our culture at Rapidparts!
Recently, I was strongly reminded of this. In the spirit of expense control, I decided to rank a few of our benefits and perks along with their corresponding annual cost to Rapidparts. Starting at the bottom of the list (where one could find “one cake per month for all employees”), I polled a group of colleagues and asked for their thoughts on what would happen if we potentially scaled back on a few of those little things. The response that I received was an astonishing, unanimous “there is no way you can take the cake out of Rapidparts!” I heard similar responses for the remainder of the little things on my list.
The point was well taken that little things make a huge impact! With that said, I challenge everyone to take a step back to become aware of all the little things you do in life and the corresponding impact they have on other people. The behavioral choices that you make every day have a critical impact on other people. Having this conscious awareness, the next step is challenging yourself in how to make better choices in each little thing you do.
And yes, we will continue to have our cake and eat it too!
Home
© Rapidparts, Inc 2008 | 2950 Walkent Ct. NW, Grand Rapids, MI 49544 | Phone 616.647.2500 | info@rpionline.com