Ray's playground

 
上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 56 下一页

2010年12月16日

Recipe 1.2. Converting Between Characters and Numeric Codes(Python Cookbook)

摘要: [代码] 阅读全文

posted @ 2010-12-16 11:13 Ray Z 阅读(139) 评论(0) 推荐(0) 编辑

2010年12月15日

Recipe 1.1. Processing a String One Character at a Time(Python Cookbook)

摘要: setCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1importsets2magic_chars=sets.set('abracadabra')3magic_chars=sets.Set('abracadabra')4poppins_chars=sets.Set('supercalifragilisticexpialidocious')5print''.join(magic_chars&poppins_chars) 阅读全文

posted @ 2010-12-15 21:52 Ray Z 阅读(162) 评论(0) 推荐(0) 编辑

2010年12月14日

Iostreams part2(Chapter 2 of Thinking in C++ Vol 2)

摘要: EffectorCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#includeiostream2#includecstdlib3#includestring4#includeclimits5usingnamespacestd;67classFixw8{9stringstr;10public:11Fixw(conststring&s,intwidth):str(s,0,width){}12friendostream&operato 阅读全文

posted @ 2010-12-14 20:50 Ray Z 阅读(196) 评论(0) 推荐(0) 编辑

2010年12月12日

Iostreams part1(Chapter 2 of Thinking in C++ Vol 2)

摘要: codeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#includeiostream2#includefstream3usingnamespacestd;45intmain()6{7ifstreamin("IOfile.cpp");8ofstreamout("IOfile.out");9outin.rdbuf();10in.close();11out.close();1213ifstreamin2("IOfile.out",ios 阅读全文

posted @ 2010-12-12 15:54 Ray Z 阅读(170) 评论(0) 推荐(0) 编辑

2010年12月11日

Strings(Chapter 1 of Thinking in C++ Vol 2)

摘要: ichar_traits.hCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#ifndefICHAR_TRAITS_H2#defineICHAR_TRAITS_H3#includestring4#includecctype56structichar_traits:std::char_traitschar7{8staticbooleq(charc1st,charc2nd)9{10returnstd::toupper(c1st)==std 阅读全文

posted @ 2010-12-11 15:04 Ray Z 阅读(196) 评论(0) 推荐(0) 编辑

2010年12月5日

Polymorphism & Virtual Functions(Chapter 15 of Thinking in C++)

摘要: To accomplish this, the typical compiler1 creates a single table(called the VTABLE) for each class that contains virtual functions.The compiler places the addresses of the virtual functions for thatparticular class in the VTABLE. In each class with virtual functions,it secretly places a pointer, cal 阅读全文

posted @ 2010-12-05 22:17 Ray Z 阅读(195) 评论(0) 推荐(0) 编辑

2010年12月1日

Inheritance & Composition(Chapter 14 of Thinking in C++)

摘要: Inheritance and static member functionsstatic member functions act the same as non-static memberfunctions:  1. They inherit into the derived class.  2. If you redefine a static member, all the other o... 阅读全文

posted @ 2010-12-01 19:56 Ray Z 阅读(228) 评论(0) 推荐(0) 编辑

2010年11月30日

Breaking Tight Coupling by using Mock Objects(Chapter 4 of Python Testing Beginner's Guide)

摘要: mockCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1>>>frommockerimportMocker2>>>mocker=Mocker()3>>>func=mocker.mock()4>... 阅读全文

posted @ 2010-11-30 21:51 Ray Z 阅读(166) 评论(0) 推荐(0) 编辑

2010年11月29日

Dynamic Object Creation(Chapter 13 of Thinking in C++)

摘要: codeCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#include<cstdio>2#include<cstdlib>3#include<iostream>4usingnamespacestd;56void*... 阅读全文

posted @ 2010-11-29 22:33 Ray Z 阅读(182) 评论(0) 推荐(0) 编辑

2010年11月28日

Operator Overloading part 3(Chapter 12 of Thinking in C++)

摘要: reference countingCode highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--1#include<string>2#include<iostream>3usingnamespacestd;45classDog6{7stri... 阅读全文

posted @ 2010-11-28 15:26 Ray Z 阅读(209) 评论(0) 推荐(0) 编辑

上一页 1 ··· 21 22 23 24 25 26 27 28 29 ··· 56 下一页

导航