显示标签为“DateTime”的博文。显示所有博文
显示标签为“DateTime”的博文。显示所有博文

2009年3月17日星期二

March 17th:C#,Debug,HTML

C#
    This post touches on four major expression subjects:
    1) String Comparison - does a string contain a particular sub-string?
    a. finding valid HTML tags- RegEx.Matches return MactchCollection
    valid html tags: Regex HTMLTag = new Regex(@"(<\/?[^>]+>)");
    2) Splitting a string into segments(分割,部分)- we will take an IPv4 address and retrieve its dotted components
    a. splitting decimal Tcp/IP address looks like xxx.xxx.xxx.xxx with x being a decimal number
    Regex tcpIp = new Regex(@"(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})");
    3) String Replacement
    4) Substitution Patterns
    5) Stricter input validation- how to harden your expressions
    1) The ? conditional evaluation operator
    example:int max = (x > y) ? x : y;
    2) Null-Coalesce(合并,联合) operator(??)
    example:obejct e = ( c != null ) ? c : d; => object e = c ?? d;
    3) Object Initializers
    Customer c = new Customer{ Name="James",Address="204 Lime Street"};(c# 3.0)
    4) The using statement
    5) Aliases(别名) for long winded namespaces and types
    example: using Word = Microsoft.Office.Interop.Word;
                     Word.Application = new Word.Application(){ Visible = true};
    6) Nullable objects
    example: Nullable x = null;
     int? x =  null;
    7) Automatic Properties(c# 3.0)
    8) Type inference(c#3.0 var)
    note: There is no performance impact results form using type inference.The compiler does all the work figuring out the data type at compile time.
    9) Lambda Expressions
    10) string.IsNullOrEmpty
    Optional and named parameters in C# 4.0
    Example:app.Document.open(ref filename,ref missing.......);
    app.Documents.open(@"c:\Document.docx",Readonly:true);
    1) what is an anonymous type?
      One important motivation(动机)for this was to make code written with LINQ easier to read.Anonymous types simply mean that you don't specify the type- but let the complier do it instead.
    2) what is the beneficial for Anonymous type?
    a. simple definitions,simplified
    b. using anonymous types for creating arrays
    c. Saving time and code with anonymous types
    d. Combining Lambda expressions with Queries
    3) other questions?
    a. Is var typesafe? yes
    b. Is there a performance penalty(处罚,征罚) for using "var"? no
    c. On using anonymous definitions in large projects

Debugger
    1) Install the Visual Studio 2008 QFE( Quick-Fix-Engineering)
    2) Start Visual Studio 2008 and bring up Tools > Options > Debugging > General
      Turn OFF the "Enable Just My Code" setting
      Turn ON the "Enable Source Server Support" setting
    3) Next,bring up the "Symbols" page and set the symbols download URL and a cache location.
      Set the symbol file location to be:http://referencesource.microsoft.com/symbols

Sliverlight

Other

2009年3月1日星期日

March 1th Links:ASP.NET MVC,

ASP.NET MVC

C#  
    1) The Action delegate
     encapsulate a method which dosen't reutn a value,and which holds a variable number of parameters.
     a. public delegate void Action()- if the method is parameterless,use it.
     b. public delegate void Action(T arg1).
     c. public delegate void Action(T1 arg1,T2 arg2).
     d. public delegate void Action(T1 arg1,T2 arg2,T3 arg3).
     e. public delegate void Action(T1 arg1,T2 arg2,T3 arg3,T4 arg4).
    e.g: Foreach
    2) The Comparison delegate
    sorting elements within a collection
    e.g: Sort
    3) The Converter
    convert an object from on type to another type
    e.g: List toysNames = toys.ConvertAll(toy => toy.Name);
    4) The Predicate delegate
    defines a set of criteria and determines whether the specified object meets those criteria.
    e.g: Exists,Find,FindAll,FindIndex,etc..
    4. Infinite Lists With C# Yield- Justin Etheredge

CodePlex

JAVASCRIPT
    1. Time to grok Closures- Sergio Pereira
    This happens when the returned(or inner) function has a reference to anything defined in the parent(or outer) function,i.e.(换言之),the parent local scope.When this happens,we way that a closure has been created.

SQL SERVER
    1) Unidirectional(单向的) synchronization
    2) Bidirectional(双向的) synchronization

English
    1. Comfortable: 舒适的
    2. encapsulate: 装入内部,封装(encapsulate method)
    3. intention: 意图
    4. Infinite: 无限的,无穷的,极大的
    5. Closure: 闭合

2009年2月24日星期二

February 24th Links:ASP.NET,SEO,C#

ASP.NET

C#

NUint
 
LINQ-XML

SQL SERVER

WEB
    the short answer is ALWAYS! But let's rewind(绕回) a bit and provide some context...............In Summary,the compatibility(兼容) UA-X meta tag is the perfect way to ensure that your customers will enjoy your pages the way they were intended
e.g. meta equiv="x-UA-Compatible" content="IE-EmulateIE7"

CodePlex
    1. Fluent DateTime
    A set of(Ruby inspired灵感) C# Extension Methods for easier and more natural DateTime handing and operations in .NET.

English
    1. Global Summit:全球峰会
    2. Seattle and Redmond
    3. Canonical : 标准的,权威的
    4. Inspired:灵感的
    5. Campaign:战役,活动,运动