ABC分类法

ABC分类法,是一种根据帕累托最优原则设计的分类方法,多用于库存分析。

ABC分类法能够对产品进行区别和分类,并能反映出每类产品的价值对库存、销售、成本等总价值的影响。

库存管理(又称为存货管理)的实际例子:

  1. "A类"产品: 这类产品的价值占库存总价值的80%,而其数量只占库存总产品数量的20%
  2. "B类"产品: 这类产品的价值占库存总价值的15%,而其数量占库存总产品数量的30%
  3. "C类"产品: 这类产品的价值只占库存总价值的5%,而其数量占库存总产品数量的50%
posted @ 2011-12-16 13:55 AOT 阅读(10) 评论(0) 编辑
Data Quality Issue Sample Data Problem
Standard Are data elements consistently defined and understood? Gender code =M,F,U in one system and Gender code = 0, 1, 2 in another system
Complete Is all necessary data present? 20% of customers’ last name is blank, 50% of zip-codes are 99999
Accurate Does the data accurately represent reality or a verifiable source? A supplier is listed as ‘Active’ but went out of business six years ago
Valid Do data values fall within acceptable ranges Salary values should be between 60,000 – 12,000
Unique Data appears several times Both John Ryan and Jack Ryan appear in the system – are they the same person?

 

DQS…

posted @ 2011-11-23 15:51 AOT 阅读(2) 评论(0) 编辑
   1:      // strips illegal Xml characters:
   2:      static public String XmlEncode(String S)
   3:      {
   4:          if (S == null) 
   5:          {
   6:              return null; 
   7:          }
   8:      S = Regex.Replace(S, @"[^\u0009\u000A\u000D\u0020-\uD7FF\uE000-\uFFFD]", "", RegexOptions.Compiled);
   9:          return XmlEncodeAsIs(S);
  10:      }
  11:   
  12:      // leaves whatever data is there, and just XmlEncodes it:
  13:      static public String XmlEncodeAsIs(String S)
  14:      {
  15:          if (S == null) 
  16:          {
  17:              return null; 
  18:          }
  19:      StringBuilder sTmp = new StringBuilder();
  20:      using (StringWriter sw = new StringWriter())
  21:      {
  22:      using (XmlTextWriter xwr = new XmlTextWriter(sw))
  23:      {
  24:          xwr.WriteString(S);
  25:          sTmp.Append(sw.ToString());
  26:          xwr.Flush();
  27:          xwr.Close();
  28:      }
  29:      sw.Close();
  30:      }
  31:      return sTmp.ToString();
  32:  }
posted @ 2011-11-22 17:05 AOT 阅读(5) 评论(0) 编辑

XSLT is a transformation language for XML. It allows server systems to transform the source XML tree into a more suitable form for clients. XSLT uses node patterns to match against templates to perform its transformations. Though it makes complex transformations relatively simple there are some situations where we might have to use some custom classes.

Some of the situations where we might need to extend XSLT are:

1) Call custom business logic
2) Perform different actions depending on Permissions
3) Perform complex formatting for dates, strings etc
4) Or even call a webservice!!


Steps to extend XSLT

1) Create the custom object to use from within XSLT(in C#)

CustomDate custDate = new CustomDate();

 

2) Provide a custom namespace declaration for the custom class within XSLTs namespace declaration(in XSLT file)

<xsl:transform
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:myCustDate="urn:custDate">
 
3) Pass an instance of the custom object to XSLT, with the same namespace as in last step(in C#) 
xslArgs.AddExtensionObject("urn:custDate", custDate) ;

 

4) Use the object from within XSLT(in XSLT file) 

<xsl:value-of select="myCustDate:GetDateDiff(./joiningdate)"/>

Sample Code

For our example let us assume we have a XSLT sheet where we need to manipulate dates. We need to show the number of days the employee has been with the company. Since XSLT has no native date manipulation functions, let us use an extension object for our task.

   1:  using System ; 
   2:  using System.IO ; 
   3:  using System.Xml ; 
   4:  using System.Xml.Xsl ; 
   5:  using System.Xml.XPath ;
   6:   
   7:  public class XsltExtension{
   8:   
   9:      public static void Main(string[] args){         
  10:          if (args.Length == 2){            
  11:              Transform(args[0], args[1]) ;            
  12:          }else{            
  13:              PrintUsage() ;            
  14:          } 
  15:      } 
  16:      
  17:      public static void Transform(string sXmlPath, string sXslPath){         
  18:          try{             
  19:              //load the Xml doc 
  20:              XPathDocument myXPathDoc = new XPathDocument(sXmlPath) ;
  21:              XslTransform myXslTrans = new XslTransform() ; 
  22:              
  23:              //load the Xsl 
  24:              myXslTrans.Load(sXslPath) ;             
  25:              XsltArgumentList xslArgs = new XsltArgumentList() ; 
  26:              
  27:              //create custom object 
  28:              CustomDate custDate = new CustomDate() ; 
  29:              
  30:              //pass an instance of the custom object 
  31:              xslArgs.AddExtensionObject("urn:custDate", custDate) ; 
  32:                          
  33:              //create the output stream 
  34:              XmlTextWriter myWriter = new XmlTextWriter("extendXSLT.html", null) ; 
  35:              
  36:              //pass the args,do the actual transform of Xml 
  37:              myXslTrans.Transform(myXPathDoc,xslArgs, myWriter) ;        
  38:   
  39:              myWriter.Close() ;
  40:   
  41:          }catch(Exception e){
  42:   
  43:              Console.WriteLine("Exception: {0}", e.ToString()); 
  44:          } 
  45:          
  46:      } 
  47:      
  48:      public static void PrintUsage(){ 
  49:          Console.WriteLine("Usage: XsltExtension.exe <xml path> >xsl path<") ; 
  50:      }
  51:   
  52:  }
  53:   
  54:  //our custom class 
  55:  public class CustomDate{ 
  56:      
  57:      //function that gets called from XSLT 
  58:      public string GetDateDiff(string xslDate){ 
  59:      
  60:          DateTime dtDOB = DateTime.ParseExact(xslDate, "dd/MM/yyyy", null);  //DateTime.Parse(xslDate);        
  61:          DateTime dtNow = DateTime.Today ;        
  62:          TimeSpan tsAge = dtNow.Subtract(dtDOB);        
  63:          return tsAge.Days.ToString() ; 
  64:      }
  65:  } 

Compile this code and use the provided members.xml and memberdisplay.xsl to run this console application. You should see a extendXSLT.html file within the same folder. Open this file and notice that our class CustomDate has been called to calculate the number of days the employee has been in the company.
Summary :
XSLT is a powerful transformation language for XML, however using extension objects in .NET and C# should ensure that we could easily accomplish what would be impossible or hard with XSLT alone.

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

Members.xml:

<root>
  <member>
    <name>Employee1</name>
    <joiningdate>01/01/1970</joiningdate>
    <role>CTO</role>
  </member>
  <member>
    <name>Employee2</name>
    <joiningdate>24/07/1978</joiningdate>
    <role>Web Developer</role>
  </member>
  <member>
    <name>Employee3</name>
    <joiningdate>15/12/1980</joiningdate>
    <role>Tester</role>
  </member>
</root>

MemberDisplay.xslt:

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
xmlns:myCustDate="urn:custDate">

  <xsl:output method="html" omit-xml-declaration="yes" />

  <xsl:template match="/">
    <html>
      <head>
        <style>
          TABLE.tblMaster
          {
          border-style: solid;
          border-width: 1px 1px 1px 1px;
          border-style: solid;
          border-color:  #99CCCC;
          padding: 4px 6px;
          text-align: left;
          font-family:Tahoma,Arial;
          font-size:9pt;

          }
          TD.tdHeader
          {
          FONT-WEIGHT: bolder;
          FONT-FAMILY: Arial;
          BACKGROUND-COLOR: lightgrey;
          TEXT-ALIGN: center
          }
        </style>
      </head>
      <body>
        <table width="50%" class="tblMaster">
          <tr >
            <td class="tdHeader">Employee</td>
            <td class="tdHeader">Join date</td>
            <td class="tdHeader">Days in company</td>
            <td class="tdHeader">Role</td>
          </tr>
          <xsl:for-each select="/root/member">

            <tr >
              <td>
                <xsl:value-of select="./name"/>
              </td>

              <td>
                <xsl:value-of select="./joiningdate"/>
              </td>

              <td>
                <xsl:value-of select="myCustDate:GetDateDiff(./joiningdate)"/>
              </td>

              <td>
                <xsl:value-of select="./role"/>
              </td>
            </tr>

          </xsl:for-each>

        </table>
      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
posted @ 2011-11-22 15:04 AOT 阅读(14) 评论(0) 编辑

Cannot find some counter categories, just like BizTalk Message Agent

You’d make sure the host instance is started, if it is stopped, some counters would not be shown in the performance monitor.

clip_image002

posted @ 2011-09-20 10:55 AOT 阅读(11) 评论(0) 编辑

FW: http://www.microsoft.com/showcase/en/US/details/e821e9f8-e379-45b0-8879-12fe271c86be

posted @ 2011-07-21 17:28 AOT 阅读(13) 评论(0) 编辑
摘要: Visual Studio 2008 – Connecting to TFS 2010 Server0diggsdiggWe’ve recently in our group migrated to TFS 2010 Beta and in order to support this, we’ve had to make some changes to our local machines to successfully connect to projects hosted on our TFS 2010 server. In today’s blog, I wanted to do a qu阅读全文
posted @ 2011-07-12 14:36 AOT 阅读(45) 评论(0) 编辑
摘要: 避免将项目名称用作映射类型名称在 Visual Studio 中向 BizTalk 项目添加新映射时,请不要将项目名称用作类型名称。如果这样做,编译器将生成一个或多个错误,类似于“类型中不存在类型名称‘’”。若要从 BizTalk 项目内更改映射的类型名称,请在“解决方案浏览器”窗格中单击相应的映射,然后在“属性”窗格中验证类型名称属性。如果名称相同,则需要对其进行修改,以确保更改依赖于此名称的所有配置。阅读全文
posted @ 2011-05-14 15:25 AOT 阅读(15) 评论(0) 编辑
摘要: 两个作用,demotionassembleDefault Pipeline里的XmlTransmit在assemble stage里有一个XML assembler这个用来做demotion用的,相反的,assembler中做demotion所以在这种情况下,需要用XmlTransmit Send Pipeline, 或者使用自定义的send pipeline, drop an xml assembler component, 然后设置DocumentSpecNames和EnvelopeDocSpecNames, 和disassembler拆解信封相反,assemble用来组装信封阅读全文
posted @ 2011-05-13 16:14 AOT 阅读(13) 评论(0) 编辑
摘要: 目前有两个网卡, 希望虚拟机能通过网络共享上网 1. Microsoft Loopback Adapter: 10.240.0 网段, 給虚拟机用的 2. SDC Local Area Connection : 192.168.5 网段, 局域网用   1. 将局域网的网卡设为共享(Microsoft Loopback Adapter), 可能会提示会修改虚拟机网卡IP地址,不用管...阅读全文
posted @ 2011-02-22 11:01 AOT 阅读(78) 评论(0) 编辑