08 2013 档案
摘要:http://www.phpinternalsbook.com/classes_objects/magic_interfaces_comparable.html
阅读全文
摘要:http://www.ecmascript.org/docs.phphttp://coolshell.cn/articles/9749.htmlhttp://coolshell.cn/tag/javascripthttp://www.cnblogs.com/hema/archive/2010/01/27/1657587.htmlhttp://www.cnblogs.com/lhb25/category/146074.html
阅读全文
摘要:Native Service and Android Service Native Service:In every main() method of NativeService, which is called by init process through parseing init.rc, t
阅读全文
摘要:Native Service and Android ServiceNative Service:In every main() method of NativeService, which is called by init process through parseing init.rc, the globale object of ProcessState will be createdby calling ProcessState::self(),and then startThreadPool and created main thread by calling IPCThreadP
阅读全文
摘要:MediaService.Main 1 #include 2 #include 3 #include 4 5 #include 6 #include 7 #include 8 #include 9 10 #include 11 #include 12 #include 13 #include 14 #include 15 16 using namespace android;17 18 int main(int argc, char** argv)19 {20 sp proc(ProcessState::self());21 sp sm = defaultSer...
阅读全文
摘要:ParcelWords with same meaning: package,bunch,bundle,pack,packet, make into a wrapped container,a wrapped container, a collection of things wrapped or boxed togetherThe implementation of Parcel, write or read data from data memoryParcel.cppThe header of Parcel 1 #ifndef ANDROID_PARCEL_H 2 #define A..
阅读全文
摘要:Message Class 1 package android.os; 2 import android.os.Bundle; 3 import android.os.Parcel; 4 import android.os.Parcelable; 5 import android.util.Time
阅读全文
摘要:Programming for thread in JavaOverride Annotation 1 package java.lang; 2 import java.lang.annotation.ElementType; 3 import java.lang.annotation.Retention; 4 import java.lang.annotation.RetentionPolicy; 5 import java.lang.annotation.Target; 6 7 /** 8 * Annotation type used to mark methods that over..
阅读全文
摘要:Exception 1 Try 2 { 3 ... ... 4 } 5 catch (Exception ex) 6 { 7 …; 8 throw new Throwable(ex); 9 }10 catch (Throwable ex)11 {12 …;13 }14 finally15 {16 17 } 1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one or more 3 * contributor license agreements. See the...
阅读全文
摘要:Implementation with JavaFrom:http://jcsc.sourceforge.netIn general, follow the Sun coding conventions.These are available at java.sun.com/docs/codeconv/index.html (the code in this book follows these conventions as much as I was able). These are used for what constitutes arguably the largest body of
阅读全文
摘要:Effective Java: Programming Language GuideItem 1: Consider providing static factory methods instead of constructor.Advantage: have a name, no new operator everytime, return any subtype of iteself. Consider pattern: Singleton and Factory method (with many different ways to implement: Creator by inher
阅读全文
摘要:From:http://my.safaribooksonline.com/book/programming/cplusplus/9780321545190IntroductionThe C++ in More Effective C++Conventions and TerminologyReporting Bugs, Making Suggestions, Getting Book UpdatesBasicsItem 1: Distinguish between pointers and referencesItem 2: Prefer C++-style castsItem 3: Neve
阅读全文
摘要:From:http://my.safaribooksonline.com/book/programming/cplusplus/0321334876?bookview=overviewhttp://www.kuqin.com/effectivec2e/Chapter 1.Accustoming Yourself to C++Item 1: View C++ as a federation of languagesItem 2: Prefer consts, enums, and inlines to #definesItem 3: Use const whenever possibleItem
阅读全文
摘要:Layering & Contract Philosophy With additional indirection 1 class CComponent 2 { 3 public: virtual void Operation() = 0; 4 public: virtual void AddComponent(Component* p)= 0; 5 public: virtual void RemoveComponent(Component* p)= 0; 6 public: virtual Component* GetChild...
阅读全文
摘要:Layering & Contract Philosophy With additional indirection. 1 class CWindowImp 2 { 3 public: virtual void DrawLine(){}; 4 public: virtual void DrawText(){}; 5 } 6 class CWindow 7 { 8 public: virtual void DrawLine(){}; 9 virtual void DrawText(){};10 protect:...
阅读全文
摘要:Layering & Contract Philosophy With additional indirectionAdaptee object just is as a member. Adaptee object just relies on Adapter object.class CAdaptee{ public: void theExistingAndIncompatibleMethod(){ … } ;}class CTarget{ public: virtual void theNewMethod() = 0;}class CAdapter: public CT...
阅读全文
摘要:Layering & Contract Philosophy With additional indirectionclass CSingleton{ Protect: CSingleton(); Protect: CSingleton(const CSingleton&); Protect: CSingleton& operator=(const CSingleton& rhs); Private: ~CSingleton(); Private: static CSingleton *pInstance; Public: static CSin...
阅读全文
摘要:Hyperpolyglot.orgFrom Hyperpolyglot.orgC++ Style Languages: C++, Objective-C, Java, C#a side-by-side reference sheetgrammar and invocation | variables and expressions | arithmetic and logic | strings | regexes | dates and timearrays | dictionaries | user-defined types | functions | execution control
阅读全文
posted @ 2013-08-16 17:39
iDragon
摘要:FunctionFunction is composed of name, parameter (operand, type of operand), return value, body with another adornment like: inline, virtual, static, const, throw().我们必须在调用函数之前,就声明该函数否则会引起编译错误.函数声明由函数返回类型,函数名和参数表构成. 这三个元素被称为函数声明function declaration 或函数原型function prototype, 一个函数可在一个文件中被声明多次. 函数生命不需要指定
阅读全文
posted @ 2013-08-16 14:29
iDragon
摘要:Many thanks to the people who devote themselft to the common libs. STL four components Global Constructor and Destructor STL Allocator STL Vector STL
阅读全文
摘要:InheritanceThe pointer or reference to base class can address/be assigned with any of the classes derived from base class with virtual functions through mechanism of dynamic binding.There are three ways to support polymorphism:through implicit conversion (from a pointer or reference to derived class
阅读全文
摘要:Normal COM.cpp 1 #include "resource.h" // 主符号 2 #include "ATLCOM_i.h" 3 #include "_IDragonComEvents_CP.h" 4 #if defined(_WIN32_WCE) && !defined(_CE_DCOM) && !defined(_CE_ALLOW_SINGLE_THREADED_OBJECTS_IN_MTA) 5 #error "Windows CE 平台(如不提供完全 DCOM 支持的 W
阅读全文
摘要:All we did must depend on compiler, and then What we did can run on machine.What does compiler do behind our programm?Reference to :http://gcc.gnu.org/http://www.cnblogs.com/lingqing/archive/2012/08/04/2623241.html 1 1: -c GCC 把给它的文件编译成目标文件,用源文件的文件名命名 2 e.g 3 gcc -c Zhanglong.c longzhang.c 4 ...
阅读全文
摘要:Everything has its properties and has relation with each other.All in world can be related to each other by a kind of special router.More videos onhttps://class.coursera.org/datasci-001/lecture/previewMachine Learning Videos on:http://blog.videolectures.net/100-most-popular-machine-learning-talks-at
阅读全文
摘要:Everything has its own regulation by defining its grammar.ECMAScript regular expressions pattern syntaxThe following syntax is used to construct regex objects (or assign) that have selected ECMAScript as its grammar.A regular expression pattern is formed by a sequence of characters.Regular expressio
阅读全文
摘要:Everything has its lifecycle, from being created to disappearing.Pass by reference instead of pass by value尽量用“传引用”pass reference 而不用“传值” pass valuec语言中,什么都是通过传值来实现的,c++继承了这一传统并将它作为默认方式。除非明确指定,函数的形参parameter总是通过“实参argument的拷贝”来初始化的,函数的调用者得到的也是函数返回值的拷贝. Pointer also is copied to pass as parameter. If
阅读全文
摘要:More numbers, More power.We waste much more every day.Everything can be connectible through special router mechanism.Google Cloud Computinghttp://www.cs.rutgers.edu/~pxk/417/notes/16-dfs.htmlApache HadoopHadoop ClusterFacebookEMCGlobal File System in red hathttp://www.redhat.com/magazine/006apr05/fe
阅读全文
摘要:Thank to the pepole who devote theirself to the common libs. STL(http://www.cplusplus.com/reference/)旧的C++头文件名如将会继续被支持,尽管它们不在官方标准official standard中。这些头文件的内容不在名字空间std中。No _STDBEGIN (namespaces std {}and _STDEND。新的C++头文件如包含的基本功能和对应的旧头文件相同,但头文件的内容在名字空间std中。(在标准化的过程中,库library中有些部分的细节被修改了,所以旧头文件和新头文件中的实体
阅读全文
摘要:Pepole who make a greate contribution on common libaraies deserve our respect.Component(Widget) / STL / Container(Collection)合成不会强迫我们的程序设计进入继承的分级结构中has-a relationship。同时,合成显得更加灵活,因为可以动态选择一种类型(以及行为),而继承要求在编译期间准确地知道一种类型。Java的工具(实用程序)库提供了一些“集合类”(亦称作“容器类”,但该术语已由AWT使用,所以这里仍采用“集合”这一称呼)。利用这些集合类,我们可以容纳乃至操纵自
阅读全文
摘要:MachineCode->Assembly->CIL(.Net) or SpecialMachineCode(JVM)->Pogramming codeCIL Instruction SetOpcodeInstructionDescription0x58addAdd two values, returning a new value.0xD6add.ovfAdd signed integer values with overflow check.0xD7add.ovf.unAdd unsigned integer values with overflow check.0x5F
阅读全文
摘要:Anything can be programmable with defined syntax and common lib. 1 ALTER PROCEDURE [dbo].[sp_GetLaborHourPerDayEmployee](@au_Date DATETIME, @au_employeeID VARCHAR(30)) 2 -- Add the parameters for the stored procedure here 3 AS 4 BEGIN 5 -- SET NOCOUNT ON added to prevent extra result sets fr...
阅读全文
摘要:Framework knows how to do and leave what to do to user with interface programming and dynamic configuration.What is Struts?Struts is a kind of MVC framework for developing web application, which has finished the flow of controller,knowing how to do when request come in,at same time left the what to
阅读全文
摘要:Interface from user, not from implementor.(DIP)Interface-Oriented Programming.Interface or Abstract function or Abstract classJava专门提供了一种机制,名为“抽象方法”(same as abstraction)。它属于一种不完整的方法,只含有一个声明declaration,没有方法主体 body of definition。下面是抽象方法声明时采用的语法:abstract void X();包含了抽象方法的一个类叫作“抽象类”abstract class with o
阅读全文
摘要:OS puts emphases on how to provide interfaces to user's APPs for using hardware device in the convenient and efficient way.Everything has its own logic of running and must be done step by step,no shortcut. Take a look at Android OS FrameworkNow, how to make the above OS run and every component o
阅读全文
摘要:JVM & BytecodeHas-a or Is-a relationship(inheritance or composition)如果想利用新类内部一个现有类的特性,而不想使用它的接口,通常应选择合成。也就是说,我们可嵌入一个对象,使自己能用它实现新类的特性。但新类的用户会看到我们已定义的接口,而不是来自嵌入对象的接口。考虑到这种效果,我们需在新类里嵌入现有类的private对象。有些时候,我们想让类用户直接访问新类的合成。也就是说,需要将成员对象的属性变为public。成员对象会将自身隐藏起来,所以这是一种安全的做法。如选择继承,就需要取得一个现成的类,并制作它的一个特殊版本。
阅读全文
摘要:Make changes on existing code for subsequent and constant changes of requirement. Reference:http://www.refactoring.com/catalog/index.htmlWays of RefactoringsAdd ParameterChange Bidirectional Association to UnidirectionalChange Reference to ValueChange Unidirectional Association to BidirectionalChang
阅读全文
摘要:SQL1. SELECT id, name, FROM Products; //Retrieving Multiple or Individual Columns from the specific DB-table2. SELECT * FROM Products; //Retrieving All Columns (* stand for / means all columns)3. SELECT id, name, price FROM Products order by price, name; //Sorting By Multiple Columns name//Order by
阅读全文
摘要:JVM & BytecodeAbstract & ObjectObject in Java(1) 所有东西都是对象object。可将对象想象成一种新型变量;它保存着数据,但可要求它对自身进行操作self-operation(this pointer is always as parameter pssing to function called on object)。理论上讲,可从要解决的问题身上提出所有概念性的组件,然后在程序中将其表达为一个对象。(2) 程序是一大堆对象的组合combination;通过消息传递,各对象知道自己该做些什么。为了向对象发出请求,需向那个对象“发
阅读全文
摘要:Reference to: http://agilemanifesto.org/iso/en/Individuals and interactions over processes and toolsWorking software over comprehensive documentationCustomer collaboration over contract negotiationResponding to change over following a planTwelve Principles of Agile Software We follow these principle
阅读全文
摘要:JVMAnalysis & DesignThe object-oriented paradigm is a new and different way of thingking about programming.Most of the analysis and design methodologies are intended to sovle the largest of problems. Remember that most projects don’t fit intot hat category, so you can usually have successful ana
阅读全文
摘要:Programming has its own methodology.Layering is everywhere in real life,this why the pruchase and sale exist. Layering, Insert additional indirection通过分层layering/add indirection来体现 "有一个" 或 "用...来实现’ composition /composite 使某个类的对象成为另一个类的数据成员,从而实现将一个类构筑在另一个类之上,这一过程称为 "分层"(Laye
阅读全文
摘要:What does the compiler behind our programming?Overloading in C++Override all of overloaded functions defined in base class.The following rules from Bjarne Stroustrup:Begin:Allowing overloading based on const was part of a general tightening up of the rules for const and a trend towards enforcing tho
阅读全文
摘要:Programming language evolves always along with Compiler's evolvementOn the Cusp of the Object ModelTemplatesTemplate are now the foundation for generic programming ( the Standard Template Library).Template are used in memory allocation strategies, mutual exclusion mechanism for synchronizing thr
阅读全文
摘要:Anything is programmable with defined syntax and common lib.Bash Shell is created to programme to Linux command in defined grammarLinux 中的bash shell 拥有自己的一些语法,通过语法我们可以对命令进行编程,也就是脚本编写。脚本就是用一些特定的语法把要执行的命令联合起来自动执行。参考:http://wenku.baidu.com/view/e034565bbe23482fb4da4ce8.html & http://www.cnblogs.com
阅读全文
摘要:Programming language evolves always along with Compiler's evolvementThe Semantics of FunctionC++ supports three flavors of member functions: static, nonstatic, and virtual. Each is invoked differently; those differences are the topic of the next section. (A short quiz: Although we cannot say wit
阅读全文

浙公网安备 33010602011771号