Ray's playground

 
上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 56 下一页

2011年1月18日

XPath: A Syntax for Describing Needles and Haystacks(Chapter 3 of XSLT 2nd Edition)

摘要: There are seven kinds of nodes in XPath:  • The document node (one per document)  • Element nodes  • Attribute nodes  • Text nodes  • Comment nodes  • Processing instruction nodes  • Namespace nodes 阅读全文

posted @ 2011-01-18 21:03 Ray Z 阅读(146) 评论(0) 推荐(0)

2011年1月16日

Item 9: Avoid Conversion Operators in Your APIs(Effective C#)

摘要: Conversion operators introduce a form of substitutability that causes problems in your code. You’re indicating that, in all cases, users can reasonably expect that another class can be used in place of the one you created. When this substituted object is accessed, you cause clients to work with temp 阅读全文

posted @ 2011-01-16 21:01 Ray Z 阅读(213) 评论(0) 推荐(0)

2011年1月15日

Item 8: Prefer Query Syntax to Loops(Effective C#)

摘要: C# began as an imperative language. It continues to include all the featuresthat are part of that heritage. It’s natural to reach for the most familiartools at your disposal. However, those tools might not be the best tools.When you find yourself writing any form of a looping construct, ask yourself 阅读全文

posted @ 2011-01-15 10:36 Ray Z 阅读(136) 评论(0) 推荐(0)

Item 7: Understand the Pitfalls of GetHashCode()(Effective C#)

摘要: Summarizing the default behavior, Object.GetHashCode() works correctlyfor reference types, although it does not necessarily generate an efficientdistribution. (If you have overridden Object.operator==(), you can breakGetHashCode()). ValueType.GetHashCode() works only if the first field inyour struct 阅读全文

posted @ 2011-01-15 10:12 Ray Z 阅读(203) 评论(0) 推荐(0)

2011年1月13日

The Obligatory Hello World Example(Chapter 2 of XSLT 2nd Edition)

摘要: [代码][代码]java -cp saxon9he.jar net.sf.saxon.Transform -t -greeting.xml -xsl:greeting.xsl -o:output.html[代码] 阅读全文

posted @ 2011-01-13 20:13 Ray Z 阅读(186) 评论(0) 推荐(0)

2011年1月12日

Item 6: Understand the Relationships Among the Many Different Concepts of Equality(Effective C#)

摘要: C# gives you numerous ways to test equality, but you need to consider providingyour own definitions for only two of them, along with supporting theanalogous interfaces. You never override the static Object.ReferenceEquals()and static Object.Equals() because they provide the correct tests, regardless 阅读全文

posted @ 2011-01-12 21:23 Ray Z 阅读(241) 评论(0) 推荐(0)

Target/Action(Chapter 5 of Cocoa Programming for Mac OS X)

摘要: AppController.hCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#importFoundation/Foundation.h234@interfaceAppController:NSObject5{6IBOutletNSTextField*textField;7NSSpeechSynthesizer*speechSynth;8}910-(IBAction)sayIt:(id)sender;11-(IBAction)stopIt: 阅读全文

posted @ 2011-01-12 09:18 Ray Z 阅读(224) 评论(0) 推荐(0)

2011年1月11日

Item 5: Always Provide ToString()(Effective C#)

摘要: [代码] 阅读全文

posted @ 2011-01-11 22:37 Ray Z 阅读(178) 评论(0) 推荐(1)

2011年1月10日

Variables, Scope, and Memory(Chapter 4 of Professional JavaScript® for Web Developers 2nd Edition)

摘要: JavaScript ’ s lack of block - level scopes is a common source of confusion.[代码]  When a variable is declared using var , it is automatically added to the most immediate contextavailable. In a function, the most immediate one is the function ’ s local context; in a with statement, themost immediate 阅读全文

posted @ 2011-01-10 19:55 Ray Z 阅读(190) 评论(0) 推荐(0)

Language Basics(Chapter 3 of Professional JavaScript® for Web Developers 2nd Edition)

摘要: The end result was forECMAScript to provide two sets of operators: equal and not equal to perform conversion beforecomparison, and identically equal and not identically equal to perform comparison without conversion.equalityCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.C 阅读全文

posted @ 2011-01-10 18:55 Ray Z 阅读(196) 评论(0) 推荐(0)

上一页 1 ··· 17 18 19 20 21 22 23 24 25 ··· 56 下一页

导航