BizTalk Blog by Chris Han

BizTalk, ASP.NET, C#, SQL server, Visual studio

  Home  |   Contact  |   Syndication    |   Login
  60 Posts | 8 Stories | 80 Comments | 82 Trackbacks

News

Article Categories

Archives

Post Categories

Image Galleries

BizTalk Bloggers

BizTalk on MSDN

Patterns & Architecture

SharePoint

Friday, July 18, 2008 #

I was working a project schedule with MS project. I started by estimate the duration in 'months' using PERT, and later I decided to switch to 'days'. The I run into the duration format convertion trouble. I fund the set the 'Duration is entered in' drop down list in option menu didn't really do the job. See the full solution:

geekswithblogs.net/chrishan/archive/2008/07/18/123879.aspx


Wednesday, February 06, 2008 #

I guess we all had a 'aha' moment when fund out what our friends talking about was just something you'd call it differently which made you totally missed out the first half of the conversation.
I sure had one - when my friend pronounced SOA as sooooa like in Noah. But that’s just the different of pronunciation. We can still communicate by writing SOA down.
What makes it more difficult to communicate is the definition of taxonomy, which is supposed to be a map. Here is an example we are facing in BPM today. I map the two sets of taxonomy hoping it’ll help in understanding and communicating BPM idea and development.

Academia
Industry
Used-to-be Product
Collaboration-Centric Process Automation
Document processes
Portal
People-Centric Process Automation
Human-centric BPM
Workflow
System-Centric Process Automation
Integration-centric BPM
EAI

Tuesday, February 05, 2008 #

This is part of my school work at Steven Institute of Technology. The assignment is to come up with a definition of a system architecture by my own words. Here it is: 

A system architecture is the organization of a set of components forming up a system. It provides a plan that arranges the responsibilities of each internal component in the system and their interactions to each other as well as the interactions between the system and the external environment it resides and/or being operated in.

A system architecture also refers to a set of artifacts by which the plan of the system can be communicated to each other among stakeholders.
 
A complete system architecture includes a methodology guiding the instantiation activities of the system which also rendering a consistent style among system instances.

The last point about methodology is what I learned from my work experience, and inspired by the architecuture from civile engineering.


Monday, January 14, 2008 #

 

 

I haven't written any thing for a while. Part of the reason is because I'm now back to school - Stevens Institute of Technology.

As my career advancing, I'm more and more focusing on Enterprise Architecture and Business Process Management. Of course, as an EA, you'll never hand off on technologies. So as a Microsoft guy, I'm always curious about what Microsoft will offer to BPM.

I'm a little suprised when I talk to my professor Dr. Michael zur Muehlen (his blog: bpm-research.com). He sees Microsoft as just a vender of System Integration Solution. And it seems Gartner is agreeing with him. Check out this gartner BPM Magic Quadrant 2007(free with registered user). I also find that Sandy Kemsley had a chance to closely examine Microsoft's tech stack, and shared with on her blog column2.com.  

But I still remain curious on what are the commonly agreed criteria of a qualified BPM solution. I agree that BizTalk is not a complete business architecting to automatic execution solution, but can we at least say it's a workflow system than a simply EAI/ESB? I mean, it got BPEL engine, rule engine, BAM....

Is that because the lack of 'human-centric' features that BizTalk is not recognized as a BPM player? I'll find out, later.


Tuesday, October 23, 2007 #

Here is how you should play it:
1. Make sure your have both a SQL 2000 with latest sp and a SQL 2005 database
2. guess the result of the two 'print' command in the script below, write down the last character in the string on your mind
3. Run the script below in SQL 2000
4. Change the 3999 to 3998 and run it again on SQL 2000
5. Change the 3998 back to 3999 and run it on SQL 2005

 ---------------------------------------

declare @n varchar(4000)

set @n = replicate(N'z',3999)+N'i'

print @n

set @n=replace(@n, N'i', N'B')

print @n

-----------------------------------------

have fun


Thursday, October 04, 2007 #

It used to be a joke when there was some software design flaws caught at the test phase. It is amazing to see that the joke presents a truth by reading this new from MSNBC http://www.msnbc.msn.com/id/21112810/

If you put the hybrid car as an architect, one of the most important questions you should have asked yourself as an architect is 'how it will interact with the environment it resides?'

You thought the noise of the gasoline car is something unwanted? Think again. It is really depends on which stakeholder you are talking about. Blind people are in deed participating in the traffic - the architectural environment your system interacts with. To them, the noise indeed is a feature!

Now ask yourself, do you think vibration is a feature of the car or rather a technical constraint?


Saturday, September 15, 2007 #

I'm running 64 bit Visa and trying to install my new phone toos software 4.5.1c. After get this error, I have to exchange the 4.5.1.c with a 4.5.  After install v4.5 and let it update itself to 4.5.1.c online, everything works.

Hope this will help ohters Moto owners.


Friday, September 14, 2007 #

I remember when the title 'architect' in IT became a buzz word around 2005, a fellow blogger comments that it is just a new way to say ‘I'm senior enough not to code any more’. It is a joke, a good one, if you don’t really understand what architecture is supposed to do with the system, and how you are supposed to make that happen.

Today, an even bigger title flowing around the job market – ‘Enterprise Architect’. What is that supposed to mean? A more senior-er position that you don’t have to code plus a c-level bonus?

Before you can call yourself an ‘Enterprise Architect’, you have to understand what an Enterprise Architecture is. The ‘architecture’ in system engineering perspective is a structure that defines its internal components and the relationship between the components, as well as the relationship to environment it resides. The ‘Enterprise Architecture’ comes from the theory that an organization (enterprise) is a system. Therefore it can be viewed as a structure that defines its internal components (functional departments or regional divisions) and the relationship between them (power and resource sharing, command chains), as well as relationship to its environment – political, environmental, competitive…

An ‘Enterprise Architect’ is a role who comes from engineering or science discipline with a good understanding of businesses and industries; who is responsible for over seeing the business as a system and design and govern it as such a system that can only gain its competitive edge by generating the output effectively and efficiently from its limited resources. It’s not a MBA, not an EMBA. It’s a system engineer at a larger, human-centered system.

Chris
http://www.stevens.edu/sse/


I read a piece of news online says Plymouth police officers in England make more arrests  and reduce violent crime by wearing a helmet mounted camera. (http://news.cnet.co.uk/camcorders/0,39029660,49287477,00.htm) By reading the news, it seems the idea of having cams attach to police officer’s helmets is another silver bullet to solve the serious crimes. Interestingly, the other night when I watch CNN tech news, a police officer being interviewed concludes at the end of the video footage with a big smile on his face “it saves us a lots of paper works”. It is amazing how system being viewed and used by different stakeholders. To the public or tax payers, it’s all about the purples of having police department; to the executives in department, it’s the numbers that make them valuable; to the first line officers, what makes it worth is the convenience of concluding his or her day by simply changing hat and enjoy more time with family.

Wednesday, July 18, 2007 #

I've been through almost all sorts of Timeout related issues with Asp.net web service development. I’d like put a check list here to remind myself and hopefully save some headache of yours.
 
  1. If use database, you may get ‘System.Data.SqlClient.SqlException: Timeout expired’:
          a: Check your connection string setting for ‘Connect Timeout’:  I.e.
    connectionString="Data Source=SNYC14D11511;Initial Catalog=d_dbivt003;Persist Security Info=True;User ID= user;Password= Password;Connect Timeout=4200

          b:Check your command object  SqlCommand.CommandTimeout Property, it’s by default 30s 
  2. Check you Web.config setting when you get error like ‘Client found response content type of 'text/html; charset=utf-8', but expected 'text/xml'.’:
    <system.web>….
    <compilation debug="false"/>
    <httpRuntime executionTimeout="1200"/>
    </system.web>
    make sure your set 'compilation debug="false" as well to let timeout setting take effect. Check MSDN for details.
  3. Set your proxy class Timeout property (derived from WebClientProtocol.Timeout Property) at client if you get error like this ‘The operation has timed out’: I.e.
    proxy.Timeout = System.Threading.Timeout.Infinite;
  4. If you are like me, use VistualStudio unit test tool and you get a blue icon and error ‘Timeout’ in your test result pane, you need to check your test config file localtestrun.testrunconfig. The last item ‘Test Timeouts’ is the key. It’s 5 min by default. 
  5. Last one and every web developer should know is the IIS server setting such as Keep Alive and Connection Timeout

Thursday, June 28, 2007 #

I got this error when testing my web service POC which is runing on .netFx 2.0:

System.Data.SqlClient.SqlException: Timeout expired.  The timeout period elapsed prior to completion of the operation or the server is not responding.

I find Angel's article gives the most accurate diagnosis. Check it out here:
http://blogs.msdn.com/angelsb/archive/2004/08/25/220333.aspx

But the solution he gives out doesn't solve the problem:
      public void DoesNotLeakConnections()

      {          

                  Using (SqlConnection sqlconnection1 = new SqlConnection("Server=.\\SQLEXPRESS ;Integrated security=sspi;connection timeout=5")) {

                              sqlconnection1.Open();

                              SqlCommand sqlcommand1 = sqlconnection1.CreateCommand();

                              sqlcommand1.CommandText = "raiserror ('This is a fake exception', 17,1)";

                              sqlcommand1.ExecuteNonQuery();  //this throws a SqlException every time it is called.

                              sqlconnection1.Close(); //Still never gets called.

                  } // Here sqlconnection1.Dispose is _guaranteed_

      }


What you should do which is the best practice for any resource related job is to close the resource in a Final block like this:

 

      public void DoesNotLeakConnections()  

      {          

                  Using (SqlConnection sqlconnection1 = new SqlConnection("Server=.\\SQLEXPRESS ;Integrated security=sspi;connection timeout=5")) {

try

{

                              sqlconnection1.Open();

                              SqlCommand sqlcommand1 = sqlconnection1.CreateCommand();

                              sqlcommand1.CommandText = "raiserror ('This is a fake exception', 17,1)";

                              sqlcommand1.ExecuteNonQuery();  //this throws a SqlException every time it is called.

}

catch  (Exception ex)

{

  //do something

}

finally

 

 

{

          sqlconnection1.Close(); //Always gets called.

}

                  } // Here sqlconnection1.Dispose is _guaranteed_

      }


 


Monday, June 25, 2007 #

My friend told me this morning, he's little confused with his UPS shipment tracking result.

We all know that UPS' using 18 bits tracking number to 'uniquely' identify a shipment. But after I just saw my friend's tracking result page, I'm not sure about the 'unique' part any more.

On the 'Package Progress' pane, UPS lists all the history of the shipment associated with the number:

Package Progress
Location Date Local Time Description
BROOKLYN,
NY,  US
06/25/2007 9:47 A.M. DELIVERY
  06/25/2007 7:19 A.M. OUT FOR DELIVERY
BROOKLYN,
NY,  US
06/22/2007 11:38 P.M. ARRIVAL SCAN
FARMINGDALE,
NY,  US
06/22/2007 10:29 P.M. DEPARTURE SCAN
  06/22/2007 8:11 P.M. ORIGIN SCAN
CHARLOTTE,
NC,  US
11/06/2006 4:53 P.M. DELIVERY

See the two high-lighted lines? Apparently, the tracking number is reused by UPS! I don't what's the policy for reusing a tracking number at UPS. But the common sense would be unless you have used all other possible numbers, right? That means all 18 bits of numbers have been used in roughly half year (11/06/2006~06/25/2007)! That's 10^17*26= 2,600,000,000,000,000,000 shipments! Man, 2.6 trillion, what a business!

I guess it's a good news for sales department at UPS but headache for DBAs. Most our SQL server database are still using 'int' type as the unique id, which only supports 2^31-1 (2,147,483,647), even 'bigint' type which supporting up to 2^63-1 (9,223,372,036,854,775,807) - about 3.5 times of what UPS has used out in 6 months. It's about 1.7 yeas of OLTP data. After that, you have to move the data to a data warehouse! DBAs or database designer probably never think of such a big number in such a short time. Similar problem as Y2K, but this comes much quicker than any of us can ever imagine. Even Mr. Moore needs to adjust his law.

What a great time for all geeks like you who’s reading my blog. But be prepared! Love yo’ll.


Wednesday, June 13, 2007 #

I have to admit that I never read any manual or document for Visual Studio. Part of blame should go to MS engineers who design such a consistent UI that I can pick it up without any learning curve with past experience.
 
But this also creates a problem when there is a new element introduced in the newer version without a proper warning on the consequence. That is what happened to me.
 
If you right click an Aspx file in Solution Explorer, you will see an item called “Browse With” in the context menu.
I added Altova’s XML Spy to display the XHTML generated by Server side. But I forgot to set the “Default” back to IE after that. The consequence is that every time I try to F5 debug or View in Browser, Visual Studio will load the XmlSpy to display the XHTML generated by Server side instead of load it IE.

Monday, May 14, 2007 #

I have a Dell Latitute D820. And I run VPC for all the development I'm doing now.
I drove me crazy that the Hardware Virtualization check box was grayed out with this DUO Core2 baby. After some research and upgrading, I finally got it work! Here is some advise in case you have same laptop and run VPC2007 too.

There are four things you need to check and do something about it if you haven't:

  1. Download and install the latest BISO from DELL it's revision A6 as of today. My D820 came with A5.
  2. After upgrade your BIOS, you will see a new line in your BIOS configuration when you hold F2 key when boot. You know what to do with it, don't you?
  3. This is the trick one.  Before you can enable the Hardware Virtualization check box in the 'Setting' for your specific VPC machine, you have to enable it at your 'Virtual PC Options'!
    • Go to Virtual PC Console
    • Under 'File' menu, and then 'Options'
    • The 3rd line from top!
  4. Now you can enable it in your VPC machine's 'Setting'

Enjoy it!

 


Monday, April 02, 2007 #

First of all, I'm using IE 6.0.2900.2180, Haven't test on other browsers.

I was using ListSearch control to decorate my drop down lists to provide the incremental-search ability. See the online demo here:

http://ajax.asp.net/ajaxtoolkit/ListSearch/ListSearch.aspx

It all looks smooth and neat untill after I put more ajax controls to make the page more "dynamic".  

The problem I was experiencing is that the promp text will not be alway located right above or under the DropDown control I specified. (By default, the position is PositioningMode.TopLeft) The vertical location apear variously every time after I scroll the page!
I looked into the tool kit source code. It seems that the ListSearch extension internally uses the PopupExtender to create the promp text. And by default (PositioningMode.TopLeft), PopupExtender calculate the Y position as the PrompDiv's offsetHeight plus diff.y which is calculated by this code block:
///////////////////////////////////////////////////////////////////////////////////////////////////////

// offsetParent (doc element if absolutely positioned or no offsetparent available)
var offsetParent = elt.offsetParent || document.documentElement;
//alert(offsetParent.tagName); //IE is BODY if no DIV with relative postion around

// diff = difference in position between element's offsetParent and the element we will attach popup to.
// this is basically so we can position the popup in the right spot even though it may not be absolutely positioned
var diff;
var parentBounds;
if(this._parentElement) {
// we will be positioning the element against the assigned parent
parentBounds = CommonToolkitScripts.getBounds(this._parentElement);
var offsetParentLocation = CommonToolkitScripts.getLocation(offsetParent);
diff = {x: parentBounds.x - offsetParentLocation.x, y:parentBounds.y - offsetParentLocation.y};
}
else {
// we will be positioning the element against the offset parent by default, since no parent element given
parentBounds = CommonToolkitScripts.getBounds(offsetParent);
diff = {x:0, y:0};
}

///////////////////////////////////////////////////////////////////////////////////////////////////////

Notice that the first line  is to find the relative parent element in the document in order to calculate the postion of the promp?

Realize that the offsetParent will be the "BODY" element in IE instead of the object which is the closest (nearest in the containment hierarchy) positioned containing element in Mozzila, I find that the way to solve this problem in IE is to: 

1. Have a panel control wrap around the drop down list and your SearchList control.
2. Create a stylesheet class like this:
.DDLPanelListSearchExtender
{
    position: relative;
}

3. Specify the CssClass property of the panel control you added at the first step to this new stylesheet class DDLPanelListSearchExtender

You can feather use the theme to simplify this task by adding a Panel.skin which looks like this:
<asp:Panel runat="server" BorderWidth="0px" CssClass="DDLPanelListSearchExtender"/>

Happy coding!  

P.s. theoritically, this postion problem will also apear on any control that depends on PopupExtender, such as PopupControl.