2011年6月26日

Design Pattern----10.Structural.Decorator.Pattern (Delphi Sample)

摘要: IntentAttach additional responsibilities to an object dynamically. Decorators provide a flexible alternative to subclassing for extending functionality. Client-specified embellishment of a core object by recursively wrapping it. Wrapping a gift, putting it in a box, and wrapping the box. ProblemYou 阅读全文

posted @ 2011-06-26 23:54 Tony Liu 阅读(834) 评论(0) 推荐(0) 编辑

2011年6月23日

Design Pattern----09.Structural.Compsite.Pattern (Delphi Sample)

摘要: IntentCompose objects into tree structures to represent whole-part hierarchies. Composite lets clients treat individual objects and compositions of objects uniformly. Recursive composition “Directories contain entries, each of which could be a directory.” 1-to-many “has a” up the “is a” hierarchy Pr 阅读全文

posted @ 2011-06-23 14:13 Tony Liu 阅读(603) 评论(0) 推荐(0) 编辑

Design Pattern----08.Structural.Bridge.Pattern (Delphi Sample)

摘要: IntentDecouple an abstraction from its implementation so that the two can vary independently. Publish interface in an inheritance hierarchy, and bury implementation in its own inheritance hierarchy. Beyond encapsulation, to insulation Problem“Hardening of the software arteries” has occurred by using 阅读全文

posted @ 2011-06-23 11:45 Tony Liu 阅读(716) 评论(0) 推荐(0) 编辑

2011年6月22日

Design Pattern----07.Structural.Adapter.Pattern (Delphi Sample)

摘要: IntentConvert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces. Wrap an existing class with a new interface. Impedance match an old component to a new system ProblemAn “off the shelf” compone 阅读全文

posted @ 2011-06-22 13:34 Tony Liu 阅读(4373) 评论(0) 推荐(0) 编辑

2011年6月17日

Design Pattern----06.Creational.Singleton.Pattern (Delphi Sample)

摘要: IntentEnsure a class has only one instance, and provide a global point of access to it. Encapsulated “just-in-time initialization” or “initialization on first use”. ProblemApplication needs one, and only one, instance of an object. Additionally, lazy initialization and global access are necessary.Di 阅读全文

posted @ 2011-06-17 17:19 Tony Liu 阅读(724) 评论(0) 推荐(0) 编辑

Design Pattern----05.Creational.Prototype.Pattern (CSharp Sample)

摘要: IntentSpecify the kinds of objects to create using a prototypical instance, and create new objects by copying this prototype. Co-opt one instance of a class for use as a breeder of all future instances. The new operator considered harmful. ProblemApplication “hard wires” the class of object to creat 阅读全文

posted @ 2011-06-17 16:37 Tony Liu 阅读(512) 评论(0) 推荐(0) 编辑

Design Pattern----04.Creational.Object Pool.Pattern (Java Sample)

摘要: IntentObject pooling can offer a significant performance boost; it is most effective in situations where the cost of initializing a class instance is high, the rate of instantiation of a class is high, and the number of instantiations in use at any one time is low.ProblemObject pools (otherwise know 阅读全文

posted @ 2011-06-17 14:47 Tony Liu 阅读(688) 评论(0) 推荐(0) 编辑

Design Pattern----03.Creational.FactoryMethod.Pattern (Delphi Sample)

摘要: Intent Define an interface for creating an object, but let subclasses decide which class to instantiate. Factory Method lets a class defer instantiation to subclasses. Defining a “virtual” constructor... 阅读全文

posted @ 2011-06-17 14:14 Tony Liu 阅读(922) 评论(0) 推荐(0) 编辑

Design Pattern----02.Creational.Builder.Pattern (Delphi Sample)

摘要: Intent Separate the construction of a complex object from its representation so that the same construction process can create different representations. Parse a complex representation, create one of s... 阅读全文

posted @ 2011-06-17 13:44 Tony Liu 阅读(1064) 评论(0) 推荐(0) 编辑

2011年6月16日

Design Pattern----Creational.Pattern

摘要: Creational patternsIn software engineering, creational design patterns are design patterns that deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. C 阅读全文

posted @ 2011-06-16 17:33 Tony Liu 阅读(384) 评论(0) 推荐(0) 编辑

Design Pattern----00.Summary

摘要: In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. A design pattern isn't a finished design that can be transformed directly... 阅读全文

posted @ 2011-06-16 17:33 Tony Liu 阅读(255) 评论(0) 推荐(0) 编辑

Design Pattern----01.Creational.AbstractFactory.Pattern (Delphi Sample)

摘要: Intent Provide an interface for creating families of related or dependent objects without specifying their concrete classes. A hierarchy that encapsulates: many possible “platforms”, and the construct... 阅读全文

posted @ 2011-06-16 17:33 Tony Liu 阅读(709) 评论(0) 推荐(0) 编辑

汇编指令表

摘要: 汇编指令大全一、数据传输指令 ─────────────────────────────────────── 它们在存贮器和寄存器、寄存器和输入输出端口之间传送数据. 汇编指令大全 1. 通用数据传送指令. MOV 传送字或字节. MOVSX 先符号扩展,再传送. MOVZX 先零扩展,再传送. PUSH 把字压入堆栈. POP 把字弹出堆栈. PUSHA 把AX,CX,DX,BX,SP,BP,SI,DI依次压入堆栈. POPA 把DI,SI,BP,SP,BX,DX,CX,AX依次弹出堆栈. PUSHAD 把EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI依次压入堆栈. POPA 阅读全文

posted @ 2011-06-16 15:47 Tony Liu 阅读(900) 评论(0) 推荐(0) 编辑

CSharp关键字----this

摘要: Visual Studio 2005其他版本 this 关键字引用类的当前实例。 以下是 this 的常用用途:限定被相似的名称隐藏的成员,例如:public Employee(string name, string alias) { this.name = name; this.alias = alias;} 将对象作为参数传递到其他方法,例如: CalcTax(this);声明索引器,例如: public int this [int param]{ get { return array[param]; } set { array[param] = value; }}由于静态成员函数存在于类 阅读全文

posted @ 2011-06-16 15:34 Tony Liu 阅读(2398) 评论(0) 推荐(0) 编辑

Some lesser-known truths about programming

摘要: A programmer spends about 10-20% of his time writing code, and most programmers write about 10-12 lines of code per day that goes into the final product, regardless of their skill level. Good programmers spend much of the other 90% thinking, researching, and experimenting to find the best design. Ba 阅读全文

posted @ 2011-06-16 15:34 Tony Liu 阅读(176) 评论(0) 推荐(0) 编辑

CSharp关键字----base

摘要: base 关键字用于从派生类中访问基类的成员:调用基类上已被其他方法重写的方法。指定创建派生类实例时应调用的基类构造函数。基类访问只能在构造函数、实例方法或实例属性访问器中进行。从静态方法中使用 base 关键字是错误的。示例在本例中,基类 Person 和派生类 Employee 都有一个名为 Getinfo 的方法。通过使用 base 关键字,可以从派生类中调用基类的 Getinfo 方法。// keywords_base.cs// Accessing base class membersusing System;public class Person{ protected string 阅读全文

posted @ 2011-06-16 15:34 Tony Liu 阅读(2141) 评论(0) 推荐(0) 编辑

VC-SDK路报(预备知识与概念介绍)

摘要: 第一讲:预备知识与概念介绍注:我写这个专题目的是为VC初学者提供一个思路,我本人很菜,但我认为对于VC初学者来讲,可能有点帮助,当然,对于WinSDK编程,我也是刚刚接触。如果你对WinSDK编程较熟,请与我联系,咱们共同来把这个专题做好,如果你发现了什么错误,也麻烦你给我留言指正。我写的内容也基本上是我自己的一些理解,错误是肯定有的,如果你发现我的理解偏差很大的话,麻烦你提醒一下。---小朱!什么是WinSDK:大致说来windows编程有两种方法: 1.windwos c方式(SDK), 2.c++方式:即对SDK函数进行包装,如VC的MFC,BCB的OWL等,如果要深入 下去,还是要熟悉 阅读全文

posted @ 2011-06-16 15:34 Tony Liu 阅读(346) 评论(0) 推荐(0) 编辑

Windows system ---- stack, heap

摘要: 栈:在Windows下,栈是向低地址扩展的数据结构,是一块连续的内存的区域。这句话的意思是栈顶的地址和栈的最大容量是系统预先规定好的,在WINDOWS下,栈的大小是2M(也有的说是1M,总之是一个编译时就确定的常数),如果申请的空间超过栈的剩余空间时,将提示overflow。因此,能从栈获得的空间较小。 堆:堆是向高地址扩展的数据结构,是不连续的内存区域。这是由于系统是用链表来存储的空闲内存地址的,自然是不连续的,而链表的遍历方向是由低地址向高地址。堆的大小受限于计算机系统中有效的虚拟内存。由此可见,堆获得的空间比较灵活,也比较大。 2.4申请效率的比较: 栈由系统自动分配,速度较快。但程序员 阅读全文

posted @ 2011-06-16 15:33 Tony Liu 阅读(465) 评论(0) 推荐(0) 编辑

Delphi----DELPHI常用函数集及简要范例(转载大富翁)

摘要: KeyLife富翁笔记 作者 : nakata_wang 标题 : DELPHI常用函数集及简要范例 关键字: HELP Functions 函数集 简要范例 分类 : 个人专区 密级 : 公开 (评分: , 回复: 0, 阅读: 513) »» _HELP函数集 ●●●●●●● ---------- abs(x) 绝对值 arctan(x) 反正切 cos(x) 传回馀弦函数值 exp(x) e的x次幂 frac(x) 取小数部分 int(x) 取整 ln(x) 自然对数 sin(x) 传回正弦函数值 sqr(x) x*x sqrt(x) 平方根 其它 阅读全文

posted @ 2011-06-16 15:32 Tony Liu 阅读(1259) 评论(0) 推荐(0) 编辑

Delphi 正则表达式起步

摘要: 在 Delphi 中使用正则表达式, 目前 PerlRegEx 应该是首选, 准备彻底而细致地研究它.官方网站: http://www.regular-expressions.info/delphi.html直接下载: http://www.regular-expressions.info/download/TPerlRegEx.zip安装方法:1、先把解压的 TPerlRegEx 文件夹放一个合适的地方, 我放在了 Delphi 的 Imports 目录中.2、目前最新 For Win32 的版本是对 Delphi 2006 的, 2007 也能用. 打开 PerlRegExD2006.dp 阅读全文

posted @ 2011-06-16 15:30 Tony Liu 阅读(195) 评论(0) 推荐(0) 编辑

导航