爱情[Project]==疑惑[Requirements]==关于成熟[Data&Arithmetic]

_blackwhite_ 2004-12-15 07:59:37
【题记:爱情】
各位CSDN::XDJM
最近要研发一个爱情项目
由于项目经验不足,虚心诚心像各位求教学习一些经验,望不吝赐教
-------------------------
【目的:求解决方案】
前段遇到一个很谈的来的MM
见了一次
大家感觉都不错
很想有好的发展,美的铺垫,因为内心的感觉,就是她了,她是那个我要寻找的人。
但是,现实之中,没有神,没有丘比特,光靠运气是不行的。
虽然她刚本科毕业,是个比较成熟的女孩子,不管怎么说我觉得她是个内心温柔善良的好女孩。
她需要比较成熟的男子
自觉此方面还有欠缺
故前来求良方
要注意那些行为,语言,理解力,态度等等
使自己更加成熟~
最好是比较真切一点的成熟,因为总觉得咱程序员是比较实在的。
而且随着年龄阅历的增长,总会成熟起来,只是现在像要先了解学习一下各位生活的积累与领悟


欢迎肺腑直言
={:::::::::::::::::::::::::::>
...全文
205 24 打赏 收藏 转发到动态 举报
写回复
用AI写文章
24 条回复
切换为时间正序
请发表友善的回复…
发表回复
incisive 2004-12-21
  • 打赏
  • 举报
回复
你散分我没有理由不接啊。谢谢
_blackwhite_ 2004-12-21
  • 打赏
  • 举报
回复
到圣诞再结帖吧
到时来接分吧:)~
seasunsky 2004-12-17
  • 打赏
  • 举报
回复
问下她有偶像没有
hongke212 2004-12-17
  • 打赏
  • 举报
回复
你总结的都不错
还是相信自己吧!!!!
我支持你
bigfIingpig 2004-12-17
  • 打赏
  • 举报
回复
_blackwhite_ 2004-12-17
  • 打赏
  • 举报
回复
分~多的是,随便来拿
此问题更为重要~~~朋友们继续说
洗耳恭听~~~~~~
Maxdell 2004-12-15
  • 打赏
  • 举报
回复
有钱才是硬道理
ljy524963 2004-12-15
  • 打赏
  • 举报
回复
up
zmjasmine 2004-12-15
  • 打赏
  • 举报
回复
努力追求吧
yyyjff 2004-12-15
  • 打赏
  • 举报
回复
路过、、
xzhy80 2004-12-15
  • 打赏
  • 举报
回复
en
zzj627 2004-12-15
  • 打赏
  • 举报
回复
要成熟可能需要一些伤害,楼主保住!
sharpblade 2004-12-15
  • 打赏
  • 举报
回复
別急,再慢慢了解
心急吃不到熱豆腐
omi120 2004-12-15
  • 打赏
  • 举报
回复
需要比较成熟的男子,就证明女孩本身不够成熟。成熟不是身体,穿着打扮,是内心。
DragonBill 2004-12-15
  • 打赏
  • 举报
回复
o
qingfeng5332 2004-12-15
  • 打赏
  • 举报
回复
接分···
tristsesame 2004-12-15
  • 打赏
  • 举报
回复
下面这些是某天晚上,一个人静静的想,然后第二天写的一些.
俺还是个感情白痴,也还没经历过感情.
给一个同学看过,他说写的不咋地,不过也算是自己的一点感触吧.
大家莫笑话我:)


1.自信
女孩子们都喜欢自信且有责任心的男人.所以男人一定要有自信.
当然自信要建立在一定的实际基础上,比如一个"游水好闲的人,叫嚣说几年后要年薪百万云云",
人家只会叫是搞笑.
让MM觉得你这人很有上进心,和你在一块,会有不错的前途.
男人,除了相貌没法变(其实也能办,不过觉得男人去整容,会让MM觉得你不自信),其它都能靠努力去改变的.
幸好,男人的相貌对于女人来说,不是最重要的.


2.责任
这点就不用多说了.谁喜欢不负责任的人呢.
不过很多东西都是说来容易,做起来就太难了.
要不然,就没有那么多失败者了.

3.关心
MM说的话一定要留心记住.让她觉得你很在乎她.
并且很尊重她的意见.要记住一些重要的日子.
而且你的关心,最好还要懂得反馈,
虽然你在一旁默默的关心她,她知道还好,要是她不知道.
很可能就错过了.输给了时间.

4.情趣
这点可能是程序员们比较郁闷的地方了,大家都是和code打交道的多.
加班多,不善交际的多.
这点一定要改.
女孩子都很感性,很有些虚荣心,要学会用些甜言蜜语,去讨她欢心.
谁都喜欢和能让自己开心的人在一起.

所以工作之余,应该花点时间培养一下自已,
如留意一下女孩子的工作或专业方向的东西,这样容易在她谈论到工作方面找到点共同语言.
学学去打球,唱歌,喝茶,逛街.
这样,和女孩子相处,就不至于只是吃饭,聊天什么的,这样久了,太显单调了.

5.实力
女孩子大都喜欢强势的男人.所谓强势,就是有好的经济基础或社会地位吧.
不要说MM们势利.其实男人不也这样吗.
所谓说别人容易,说自己难.
谁都有自私的一面.

所以男人一定要有事业.
如果和你竞争的另一家伙,比你更有实力.而且对待MM也不比你差.
那你只有努力了.努力变得比那家伙更强.当然这些,你要注意在MM面前表现出来

不过,这也是很痛苦的.你可能输给了时间.那只有感叹:时不待我.

6.表现
程序员们可能大都有些木讷和内向吧.
女孩子们是不放心把自己终身托付给一个自己不太了解的人的.
所以你要能让MM了解你,你就需要多表现表现自己.

而且女孩子都有虚荣心,有时喜欢比较,所以在遇到别的一对时,你就要想办法表现的比别人更好.
这点会让MM很开心的,我想.

所以.学会打扮打扮自己,学学如何言谈举止.学学如何说甜言蜜语.

7.罗嗦几句
打了这么多,觉得自己都很罗嗦,同时也觉得有些心里发虚.

只是这些日子觉得有些绝望,觉得很痛苦,想到过放弃.
但是觉得自己并没付出百分百的努力去争取,所以昨晚想了想,觉得还是要乐观面对.

你要是在MM面前,总是流露出一种很失落的情绪,或是很难过的情绪,
那会让她有心理负担,会有种逃避感,这令得她更不愿和你继续来往了.
所以要隐藏自己的不良情绪,毕竟,情绪是会传染的.而女孩子,一般更感性.
而且不良的情绪,对自己的影响很大的.

我很感谢一位同为程序员的异性朋友,在我难过的时候,她的一些话,给了我很大的帮助.
"很少有女生会喜欢喜欢把自己掩藏起来的人的。"
"如果你希望给别人带来幸福,首先你自己要感觉幸福"
"如果你自己都没有信心获得幸福,怎么会让你喜欢的人相信你能给她带来幸福"
"当你一个人你可以自由的做很多事情,如果你想做你现在所做的是为了能和将来的她在一起 ,那么你会快乐些的"
tristsesame 2004-12-15
  • 打赏
  • 举报
回复
自信,有责任,有钱,有地位,会甜言蜜语,
让别人觉得你能给她带来快乐.

做事有条理,深思熟虑.
不盲目.
能给别人有好的建议.

说话能有幽默,有时可以说说有些深度的话.
不轻易抱怨,宽容.大度.

懂得关心照顾女孩子.

随手想到一些,乱写的:)
yyjuan2004 2004-12-15
  • 打赏
  • 举报
回复
成熟决定于性格+经历,自己感受吧....不过,别太刻意了对她
xiaoya3l7 2004-12-15
  • 打赏
  • 举报
回复
接分···
加载更多回复(4)
这个数据库看性能不错,哪位能破解一下。Overview Absolute Database: Delphi database with SQL support.Absolute Database lets you forget the Borland Database Engine (BDE). This BDE replacement is the compact, high-speed, robust and easy-to-use database engine. With Absolute Database you will not need special installation and configuration, it compiles right into your EXE. Make your application faster and smaller with Absolute Database BDE alternative!An individual may use Absolute Database Personal in a project if he / she is the only user of this project. If your project is public or if you represent a company, you must order commercial edition of Absolute Database.Key Features: No BDE; no DLLs Single-file database SQL‘92 (DDL & DML) support Single-user and multi-user mode (file-server) Unmatched ease-of-use 100% compatibility with standard DB-aware controls Strong encryption BLOB compression Free for personal use Full source code available Royalty-free Specification Ease of Deployment No BDE, no DLLs No special installation or configuration required Database engine compiles right into EXE Single-file database format Database file could be merged with the application EXE file High Speed Advanced cache management and buffering architecture Sophisticated SQL query and filter optimizer Special optimized database engine for temporary results of SQL queries Fast B*-Tree indexes with high-speed on thousands and on millions of records Buffered transactions for batch inserts, updates and deletes In-memory tables for fast operations with data loaded into memory Optimization for read-only databases, such as databases on CD High-concurrency design for multi-threaded applications Multi-User Zero-admin file-server Automatic record and table locking Automatic detection of changes made by other users Configurable limit of concurrent connections Easy switching between single-user and multi-user mode Full transactions support with ReadCommited isolation level SQL Support SELECT with DISTINCT, INNER LEFT, RIGTH, FULL and OUTER JOIN, GROUP BY and ORDER BY clauses CREATE TABLE, DROP TABLE, ALTER TABLE statements CREATE INDEX, DROP INDEX statements INSERT, UPDATE, DELETE statements BETWEEN, IN, LIKE, IS NULL, EXISTS operators Aggregate functions COUNT,SUM,MIN,MAX,AVG Most of all SQL‘92 arithmetic, logical, date-time and string functions and operators Data types conversion by function CAST SQL scripts (multiple commands separated by ‘;‘) Parameters in queries SELECT from several databases in one query Correlated and non-correlated subqueries Compactness Small size of code added into the application by the database engine units Small database file size achieved by customizable page size, compression of table metadata and other special means Automatic free space recycling for data records, index pages, and BLOB blocks Fast BLOB data compression Short indexes for string fields Low memory consumption Compatibility Support of most of TTable field data types, including BLOB fields Full compatibility with standard DB-aware visual controls such as QuickReport, DBGrid, DBNavigator, DBImage, DBMemo, DBRichEdit and others Calculated and lookup fields Most of TTable functions including Key and Range methods Support for the IProvider interface (TClientDataSet) Functionality Unicode support in String and Memo fields Multiple-fields indexes with descending, ascending, case-sensitive and insensitive options Shareable tables Default values support Min, max and not null constraints on field values Export to SQL script (reverse engineering) Security Strong encryption of database file Variety of supported encryption algorithms: Rijndael, the Advanced Encryption Standard (AES) winner 128 bit key, Rijndael 256 bit key, Blowfish 448 bit key, Twofish 128 bit key, Twofish 256 bit key, Square, Single DES and Triple DES Reliability Repair database in case of hardware failure or operating system error caused by another application Auto-detect of database corruption and automatic repair of database file Convenience Table restructuring being performed in the easiest way keeping all the existing data Data importing from and exporting to any dataset Internationalization / localization support by use of current system locale Displaying progress during potentially slow operations with the tables and databases Utilities DBImportExport utility to transfer your existing tables from database systems with BDE driver, such as Paradox, Interbase, Access, Oracle, SQL Server to Absolute Database format and vice versa. Absolute Database Manager to manage a database easily and to perform all supported operations with tables and database file Absolute Database Manager also provides you an easy way of executing SQL queries All utilities come with full source code and can be used as an advanced examples Ease of Development Full compatibility with TTable, TQuery, TSession and TDatabase components Extensive documentation: Developer‘s Guide and Reference covering every development issue. Large number of demos illustrating wide range of use cases Prompt and responsive technical support Cost-Effectiveness 100% royalty-free, i.e. there is no additional licensing fees no matter how many times you deploy the application Flexible licensing: source code and no source code versions, multi-developers licenses Comparison with other Databases You can see here Comparision with other databases Maximum Capacity SpecificationsObject Maximum sizes / numbers Multi-User Edition Single-User Edition Bytes per string field 64,000 (also limited by page size) 64,000 (also limited by page size) Bytes per BLOB field 2GB 2GB Bytes per index 64,000 (also limited by page size) 64,000 (also limited by page size) Bytes per row 65,400 (also limited by page size) 65,400 (also limited by page size) Columns per index 10,000 10,000 Columns per table 65,000 65,000 UNIQUE indexes or constraints per table 30,000 30,000 Database size 32 TB (also limited by file system and OS) 32 TB (also limited by file system and OS) Identifier length (in characters) 255 255 Locks per connection 2,147,483,647 N/A Rows per table 2,147,483,647 2,147,483,647 Tables per database 2,147,483,647 2,147,483,647 Bytes per page 65,536 65,536 Pages per database file 2,147,483,647 2,147,483,647 Connections per database Maximum value of configured connections before creating database file (up to 2,147,483,647) 1 Records in transaction 2,147,483,647 (also limited by available RAM) 2,147,483,647 (also limited by available RAM) In-memory table size 2,147,483,647 (also limited by available RAM) 2,147,483,647 (also limited by available RAM) Requirements Target Development Environment:Delphi 4, Delphi 5, Delphi 6, Delphi 7 and C++ Builder 4, C++ Builder 5, C++ Builder 6. Trial and Personal editions of Delphi are not supported.Target OS:Windows 95/98/ME, Windows NT, 2000, XP
go程序设计语言 Contents Preface................................................................................................................................. xix PART 1—WHY LEARN GO—GETTING STARTED Chapter 1—Origins, Context and Popularity of Go...............................................................1 1.1 Origins and evolution................................................................................................1 1.2 Main characteristics, context and reasons for developing a new language....................4 1.2.1 Languages that influenced Go.........................................................................4 1.2.2 Why a new language?......................................................................................5 1.2.3 Targets of the language....................................................................................5 1.2.4 Guiding design principles...............................................................................7 1.2.5 Characteristics of the language........................................................................7 1.2.6 Uses of the language........................................................................................8 1.2.7 Missing features?.............................................................................................9 1.2.8 Programming in Go......................................................................................10 1.2.9 Summary......................................................................................................10 Chapter 2—Installation and Runtime Environment............................................................11 2.1 Platforms and architectures.....................................................................................11 (1) The gc Go-compilers:..................................................................................11 (2) The gccgo-compiler:....................................................................................13 (3) File extensions and packages:.......................................................................14 2.2 Go Environment variables........................................................................................14 2.3 Installing Go on a Linux system...............................................................................16 2.4 Installing Go on an OS X system.............................................................................21 2.5 Installing Go on a Windows system.........................................................................21 2.6 What is installed on your machine? .........................................................................26 2.7 The Go runtime.......................................................................................................27 2.8 A Go interpreter ......................................................................................................27 Chapter 3—Editors, IDE’s and Other tools.........................................................................28 3.1 Basic requirements for a decent Go development environment.................................28 3.2 Editors and Integrated Development Environments.................................................29 3.2.1. Golang LiteIDE ..........................................................................................32 3.2.2. GoClipse......................................................................................................33 3.3 Debuggers................................................................................................................34 3.4 Building and running go-programs with command- and Makefiles..........................35 3.5 Formatting code: go fmt or gofmt............................................................................39 3.6 Documenting code: go doc or godoc........................................................................40 3.7 Other tools...............................................................................................................41 3.8 Go’s performance.....................................................................................................41 3.9 Interaction with other languages...............................................................................43 3.9.1. Interacting with C .......................................................................................43 3.9.2. Interacting with C++....................................................................................45 PART 2—CORE CONSTRUCTS AND TECHNIQUES OF THE LANGUAGE Chapter 4—Basic constructs and elementary data types.......................................................49 4.1. Filenames—Keywords—Identifiers..........................................................................49 4.2. Basic structure and components of a Go-program...................................................50 4.2.1 Packages, import and visibility......................................................................51 4.2.3 Comments....................................................................................................56 4.2.4 Types............................................................................................................57 4.2.5 General structure of a Go-program...............................................................58 4.2.6 Conversions..................................................................................................60 4.2.7 About naming things in Go..........................................................................60 4.3. Constants................................................................................................................60 4.4. Variables..................................................................................................................63 4.4.1 Introduction.................................................................................................63 4.4.2 Value types and reference types.....................................................................66 4.4.3 Printing........................................................................................................68 4.4.4 Short form with the := assignment operator..................................................69 4.4.5 Init-functions................................................................................................70 4.5. Elementary types and operators...............................................................................73 4.5.1. Boolean type bool........................................................................................73 4.5.2. Numerical types...........................................................................................75 4.5.2.1 ints and floats.............................................................................................75 4.5.2.2 Complex numbers.....................................................................................79 4.5.2.3 Bit operators..............................................................................................79 4.5.2.4 Logical operators........................................................................................81 4.5.2.5 Arithmetic operators.................................................................................82 4.5.2.6 Random numbers......................................................................................82 4.5.3. Operators and precedence............................................................................84 4.5.4. Aliasing types...............................................................................................84 4.5.5. Character type.............................................................................................85 4.6. Strings.....................................................................................................................86 4.7. The strings and strconv package..............................................................................88 4.7.1—Prefixes and suffixes:...................................................................................88 4.7.2—Testing whether a string contains a substring:.............................................89 4.7.3—Indicating at which position (index) a substring or character occurs in a string:...................................................................................................89 4.7.4—Replacing a substring:................................................................................90 4.7.5—Counting occurrences of a substring:..........................................................90 4.7.6—Repeating a string:.....................................................................................90 4.7.7—Changing the case of a string:....................................................................91 4.7.8—Trimming a string:.....................................................................................92 4.7.9—Splitting a string:........................................................................................92 4.7.10—Joining over a slice:..................................................................................92 4.7.11—Reading from a string:..............................................................................93 4.8. Times and dates.......................................................................................................95 4.9. Pointers...................................................................................................................96 Chapter 5—Control structures...........................................................................................101 5.1—The if else construct............................................................................................101 5.2—Testing for errors on functions with multiple return values..................................106 5.3—The switch keyword............................................................................................110 5.4—The for construct................................................................................................114 5.4.1 Counter-controlled iteration.......................................................................114 Character on position 2 is:...........................................................................................116 5.4.2 Condition-controlled iteration ...................................................................117 5.4.3 Infinite loops .............................................................................................118 5.4.4 The for range construct...............................................................................119 5.5—Break / continue..................................................................................................121 5.6—Use of labels with break and continue—goto.......................................................123 Chapter 6—Functions.......................................................................................................126 6.1 Introduction...........................................................................................................126 6.2 Parameters and return values..................................................................................129 6.2.1 Call by value / Call by reference..................................................................129 6.2.2 Named return variables...............................................................................131 6.2.3 Blank identifier...........................................................................................133 6.2.4 Changing an outside variable......................................................................134 6.3 Passing a variable number of parameters.................................................................135 6.4 Defer and tracing...................................................................................................137 6.5 Built-in functions...................................................................................................142 6.6 Recursive functions................................................................................................143 6.8 Closures (function literals).....................................................................................147 6.9 Applying closures: a function returning another function ......................................150 6.10 Debugging with closures......................................................................................153 6.11 Timing a function ...............................................................................................154 6.12 Using memoization for performance....................................................................154 Chapter 7—Arrays and Slices.............................................................................................157 7.1 Declaration and initialization.................................................................................157 7.1.1 Concept......................................................................................................157 7.1.2 Array literals................................................................................................161 7.1.3 Multidimensional arrays..............................................................................162 7.1.4 Passing an array to a function......................................................................163 7.2 Slices......................................................................................................................164 7.2.1 Concept......................................................................................................164 7.2.2 Passing a slice to a function.........................................................................168 7.2.3 Creating a slice with make()........................................................................168 7.2.4 Difference between new() and make().........................................................170 7.2.5 Multidimensional slices...............................................................................171 7.2.6 The bytes package.......................................................................................171 7.3 For range construct................................................................................................172 7.4 Reslicing.................................................................................................................175 7.5 Copying and appending slices................................................................................176 7.6 Applying strings, arrays and slices...........................................................................178 7.6.1 Making a slice of bytes from a string...........................................................178 7.6.2 Making a substring of a string.....................................................................179 7.6.3 Memory representation of a string and a slice..............................................179 7.6.4 Changing a character in a string..................................................................180 7.6.5 Comparison function for byte arrays...........................................................180 7.6.6 Searching and sorting slices and arrays.......................................................181 7.6.7 Simulating operations with append.............................................................182 7.6.8 Slices and garbage collection.......................................................................182 Chapter 8—Maps..............................................................................................................185 8.1 Declaration, initialization and make.......................................................................185 8.1.1 Concept......................................................................................................185 8.1.2 Map capacity..............................................................................................188 8.1.3 Slices as map values.....................................................................................188 8.2 Testing if a key-value item exists in a map—Deleting an element...........................188 8.3 The for range construct..........................................................................................190 8.4 A slice of maps......................................................................................................191 8.5 Sorting a map.........................................................................................................192 8.6 Inverting a map......................................................................................................194 Chapter 9—Packages.........................................................................................................196 A The standard library..................................................................................................196 9.1 Overview of the standard library.............................................................................196 9.2 The regexp package................................................................................................199 9.3 Locking and the sync package................................................................................200 9.4 Accurate computations and the big package...........................................................202 B Custom and external packages: use, build, test, document, install.............................203 9.5 Custom packages and visibility...............................................................................203 9.6 Using godoc for your custom packages...................................................................208 9.7 Using go install for installing custom packages.......................................................210 9.8 Custom packages: map structure, go install and go test..........................................212 9.8.1 Map-structure for custom packages.............................................................212 9.8.2 Locally installing the package......................................................................215 9.8.3 OS dependent code.....................................................................................216 9.9 Using git for distribution and installation...............................................................216 9.9.1 Installing to github.....................................................................................216 9.9.2 Installing from github.................................................................................217 9.10 Go external packages and projects. ......................................................................218 9.11 Using an external library in a Go program............................................................219 Chapter 10—Structs and Methods.....................................................................................224 10.1 Definition of a struct............................................................................................224 10.2 Creating a struct variable with a Factory method..................................................232 10.2.1 A factory for structs..................................................................................232 10.2.2 new() and make() revisited for maps and structs:.......................................234 10.3 Custom package using structs...............................................................................235 10.4 Structs with tags...................................................................................................236 10.5 Anonymous fields and embedded structs..............................................................237 10.5.1 Definition.................................................................................................237 10.5.2 Embedded structs.....................................................................................238 10.5.3 Conflicting names.....................................................................................239 10.6 Methods...............................................................................................................240 10.6.1 What is a method?....................................................................................240 10.6.2 Difference between a function and a method............................................244 10.6.3 Pointer or value as receiver........................................................................245 10.6.4 Methods and not-exported fields..............................................................247 10.6.5 Methods on embedded types and inheritance............................................248 10.6.6 How to embed functionality in a type.......................................................251 10.6.7 Multiple inheritance..................................................................................253 10.6.8 Universal methods and method naming....................................................256 10.6.9 Comparison between Go types and methods and other object-oriented languages...........................................................................256 10.7 The String()-method and format specifiers for a type...........................................258 10.8 Garbage collection and SetFinalizer......................................................................261 Chapter 11—Interfaces and reflection................................................................................263 11.1 What is an interface?............................................................................................263 11.2 Interface embedding interface(s)...........................................................................270 11.3 How to detect and convert the type of an interface variable: type assertions.........270 11.4 The type switch....................................................................................................273 11.5 Testing if a value implements an interface.............................................................274 11.6 Using method sets with interfaces.........................................................................275 11.7 1st example: sorting with the Sorter interface........................................................277 11.8 2nd example: Reading and Writing......................................................................282 11.9 Empty Interface...................................................................................................284 11.9.1 Concept....................................................................................................284 11.9.2 Constructing an array of a general type or with variables of different types............................................................................................286 11.9.3 Copying a data-slice in a slice of interface{}...............................................287 11.9.4 Node structures of general or different types.............................................288 11.9.5 Interface to interface.................................................................................289 11.10 The reflect package.............................................................................................290 11.10.1 Methods and types in reflect...................................................................290 11.10.2 Modifying (setting) a value through reflection........................................293 11.10.3 Reflection on structs...............................................................................294 11.11 Printf and reflection...........................................................................................296 11.12 Interfaces and dynamic typing............................................................................298 11.12.1 Dynamic typing in Go............................................................................298 11.12.2 Dynamic method invocation...................................................................300 11.12.3 Extraction of an interface........................................................................301 11.12.4 Explicitly indicating that a type implements an interface........................303 11.12.5 Empty interface and function overloading..............................................304 11.12.6 Inheritance of interfaces..........................................................................304 11.13 Summary: the object-orientedness of Go............................................................306 11.14 Structs, collections and higher order functions...................................................306 PART 3—ADVANCED GO Chapter 12—Reading and writing.....................................................................................313 12.1 Reading input from the user.................................................................................313 12.2 Reading from and writing to a file........................................................................317 12.2.1 Reading from a file....................................................................................317 12.2.2 The package compress: reading from a zipped file.....................................321 12.2.3 Writing to a file.........................................................................................322 12.3 Copying files........................................................................................................324 12.4 Reading arguments from the command-line.........................................................325 12.4.1 With the os-package..................................................................................325 12.4.2 With the flag-package...............................................................................326 12.5 Reading files with a buffer....................................................................................328 12.6 Reading and writing files with slices.....................................................................330 12.7 Using defer to close a file.....................................................................................332 12.8 A practical example of the use of interfaces: fmt.Fprintf......................................332 12.9 The json dataformat.............................................................................................334 12.10 The xml dataformat............................................................................................340 12.11 Datatransport through gob.................................................................................342 12.12 Cryptography with go........................................................................................345 Chapter 13—Error-handling and Testing...........................................................................348 13.1 Error-handling.....................................................................................................349 13.1.1 Defining errors..........................................................................................349 13.1.2 Making an error-object with fmt..............................................................353 13.2 Run-time exceptions and panic............................................................................353 13.4 Error-handling and panicking in a custom package..............................................357 13.5 An error-handling scheme with closures...............................................................360 13.6 Starting an external command or program...........................................................363 13.7 Testing and benchmarking in Go.........................................................................364 13.8 Testing: a concrete example..................................................................................367 13.9 Using table-driven tests........................................................................................369 13.10 Investigating performance: tuning and profiling Go programs............................371 13.10.1 Time and memory consumption.............................................................371 13.10.2 Tuning with go test.................................................................................371 13.10.3 Tuning with pprof...................................................................................371 Chapter 14—Goroutines and Channels.............................................................................375 14.1 Concurrency, parallelism and goroutines..............................................................375 14.1.1 What are goroutines?................................................................................375 14.1.2 The difference between concurrency and parallelism.................................377 14.1.3 Using GOMAXPROCS............................................................................378 14.1.4 How to specify the number of cores to be used on the command-line?.....379 14.1.5 Goroutines and coroutines........................................................................381 14.2 Channels for communication between goroutines................................................381 14.2.1 Concept....................................................................................................381 14.2.2 Communication operator <-.....................................................................383 14.2.3 Blocking of channels.................................................................................385 14.2.4 Goroutines synchronize through the exchange of data on one (or more) channel(s)........................................................................................387 14.2.5 Asynchronous channels—making a channel with a buffer.........................387 14.2.6 Goroutine using a channel for outputting result(s)....................................388 14.2.7 Semaphore pattern....................................................................................389 14.2.8 Implementing a parallel for-loop...............................................................391 14.2.9 Implementing a semaphore using a buffered channel................................391 14.2.10 For—range applied to channels...............................................................394 14.2.11 Channel directionality............................................................................396 14.3 Synchronization of goroutines: closing a channel—testing for blocked channels..400 14.4 Switching between goroutines with select.............................................................403 14.5 Channels, Timeouts and Tickers...........................................................................408 14.6 Using recover with goroutines..............................................................................412 14.7 Comparing the old and the new model: Tasks and Worker processes....................413 14.8 Implementing a lazy generator..............................................................................416 14.9 Implementing Futures..........................................................................................420 14.10 Multiplexing......................................................................................................421 14.10.1 A typical client-server pattern..................................................................421 14.10.2 Teardown: shutdown the server by signaling a channel............................424 14.11 Limiting the number of requests processed concurrently....................................427 14.12 Chaining goroutines...........................................................................................428 14.13 Parallelizing a computation over a number of cores............................................429 14.14 Parallelizing a computation over a large amount of data.....................................430 14.15 The leaky bucket algorithm................................................................................431 14.16 Benchmarking goroutines...................................................................................433 14.17 Concurrent acces to objects by using a channel..................................................434 Chapter 15—Networking, templating and web-applications..............................................436 15.1 A tcp-server .........................................................................................................436 15.2 A simple webserver...............................................................................................445 15.3 Polling websites and reading in a web page...........................................................448 15.4 Writing a simple web application.........................................................................452 15.5 Making a web application robust..........................................................................454 15.6 Writing a web application with templates.............................................................456 15.7 Exploring the template package............................................................................461 15.7.1. Field substitution: {{.FieldName}}............................................................462 15.7.2. Validation of the templates.......................................................................463 15.7.3 If-else........................................................................................................464 15.7.4 Dot and with-end.....................................................................................465 15.7.5 Template variables $..................................................................................466 15.7.6 Range-end.................................................................................................467 15.7.7 Predefined template functions...................................................................467 15.8 An elaborated webserver with different functions.................................................468 (works only on Unix because calls /bin/date)........................................................474 15.9 Remote procedure calls with rpc...........................................................................474 15.10 Channels over a network with netchan...............................................................477 15.11 Communication with websocket........................................................................478 15.12 Sending mails with smtp....................................................................................480 PART 4—APPLYING GO Chapter 16—Common Go Pitfalls or Mistakes..................................................................485 16.1 Hiding (shadowing) a variable by misusing short declaration...............................486 16.2 Misusing strings...................................................................................................486 16.3 Using defer for closing a file in the wrong scope...................................................487 16.4 Confusing new() and make()................................................................................488 16.5 No need to pass a pointer to a slice to a function..................................................488 16.6 Using pointers to interface types...........................................................................488 16.7 Misusing pointers with value types.......................................................................489 16.8 Misusing goroutines and channels........................................................................489 16.9 Using closures with goroutines.............................................................................490 16.10 Bad error handling.............................................................................................491 16.10.1 Don’t use booleans:.................................................................................491 16.10.2 Don’t clutter your code with error-checking:...........................................492 Chapter 17—Go Language Patterns...................................................................................494 17.1 The comma, ok pattern........................................................................................494 17.2 The defer pattern..................................................................................................495 17.3 The visibility pattern............................................................................................497 17.4 The operator pattern and interface.......................................................................497 17.4.1 Implement the operators as functions.......................................................497 17.4.2 Implement the operators as methods.........................................................498 17.4.3 Using an interface.....................................................................................499 Chapter 18—Useful Code Snippets—Performance Advice.................................................500 18.1 Strings..................................................................................................................500 18.2 Arrays and slices...................................................................................................501 18.3 Maps....................................................................................................................502 18.4 Structs..................................................................................................................502 18.5 Interfaces..............................................................................................................503 18.6 Functions.............................................................................................................503 18.7 Files......................................................................................................................504 18.8 Goroutines and channels......................................................................................505 18.9 Networking and web applications.........................................................................507 18.9.1. Templating:......................................................................................................507 18.10 General..............................................................................................................508 18.11 Performance best practices and advice................................................................508 Chapter 19—Building a complete application....................................................................509 19.1 Introduction.........................................................................................................509 19.2 Introducing Project UrlShortener.........................................................................509 19.3 Data structure......................................................................................................510 19.4 Our user interface: a web server frontend.............................................................515 19.5 Persistent storage: gob..........................................................................................519 19.6 Using goroutines for performance........................................................................524 19.7 Using json for storage...........................................................................................527 19.8 Multiprocessing on many machines......................................................................528 19.9 Using a ProxyStore...............................................................................................532 19.10 Summary and enhancements..............................................................................536 Chapter 20—Go in Google App Engine............................................................................538 20.1 What is Google App Engine ?...............................................................................538 20.2 Go in the cloud ...................................................................................................540 20.3 Installation of the Go App Engine SDK: the development environment for Go...540 20.3.1. Installation...............................................................................................540 20.3.2. Checking and testing...............................................................................542 20.4 Building your own Hello world app ....................................................................543 20.4.1 Map structure—Creating a simple http-handler........................................543 20.4.2 Creating the configuration file app.yaml...................................................544 20.4.3 Iterative development................................................................................548 20.4.4. Integrating with the GoClipse IDE..........................................................548 20.5 Using the Users service and exploring its API.......................................................549 20.6 Handling forms....................................................................................................551 20.7 Using the datastore...............................................................................................552 20.8 Uploading to the cloud.......................................................................................556 Chapter 21—Real World Uses of Go.................................................................................559 21.1 Heroku—a highly available consistent data store in Go. ......................................559 21.2 MROffice—a VOIP system for call centers in Go................................................561 21.3 Atlassian—a virtual machine cluster management system.....................................562 21.4 Camlistore—a content addressable storage system................................................563 21.5 Other usages of the Go language..........................................................................563 APPENDICES...................................................................................................................567 (A) CODE REFERENCE...........................................................................................567 (B)CUTE GO QUOTES.............................................................................................571 GO QUOTES: TRUE BUT NOT SO CUTE....................................................572 (C) LIST OF CODE EXAMPLES (Listings)...............................................................572 (E) References in the text to Go—packages..................................................................583 (F) References in the text to Go—tools........................................................................586 (G) Answers to Questions............................................................................................586 (H) ANSWERS TO EXERCISES................................................................................590 (I) BIBLIOGRAPHY (Resources and References)........................................................593 Index..............................................................................................................................597 List of Illustrations Chapter 1—Origins, Context and Popularity of Go...............................................................1 Fig 1.1: The designers of Go: Griesemer, Thompson and Pike..........................................1 Fig 1.2: The logo’s of Go..................................................................................................3 Fig 1.3: Influences on Go.................................................................................................5 Chapter 3—Editors, IDE’s and Other tools.........................................................................28 Fig 3.1: LiteIDE and its AST-view..................................................................................33 Fig 3.2: GoClipse and its outline code-view...................................................................34 Chapter 4—Basic constructs and elementary data types.......................................................49 Fig 4.1: Value type..........................................................................................................67 Fig 4.2: Assignment of value types..................................................................................67 Fig 4.3: Reference types and assignment.........................................................................67 Fig 4.4: Pointers and memory usage...............................................................................98 Fig 4.5: Pointers and memory usage, 2...........................................................................99 Chapter 7—Arrays and Slices.............................................................................................157 Fig 7.1: Array in memory.............................................................................................158 Fig 7.2: Slice in memory..............................................................................................166 Chapter 9—Packages.........................................................................................................196 Fig 9.1: Package documentation with godoc.................................................................210 Chapter 10—Structs and Methods.....................................................................................224 Fig 10.1: Memory layout of a struct.............................................................................227 Fig 10.2: Memory layout of a struct of structs..............................................................229 Fig. 10.3: Linked list as recursive struct........................................................................230 Fig 10.4: Binary tree as recursive struct.........................................................................230 Chapter 11—Interfaces and reflection................................................................................263 Fig 11.1: Interface value in memory.............................................................................264 Chapter 14—Goroutines and Channels.............................................................................375 Fig 14.1: Channels and goroutines...............................................................................382 Fig 14.2: The sieve prime-algorithm.............................................................................397 Chapter 15—Networking, templating and web-applications..............................................436 Fig 15.1—Screen of exercise 15.6.................................................................................454 Chapter 19—Building a complete application....................................................................509 Fig 19.1: Handler functions in goto.............................................................................515 Fig 19.2: The Add handler...........................................................................................518 Fig 19.3: The response of the Add handler...................................................................519 Fig 19.4: The response of the Redirect handler.............................................................519 Fig 19.5: Distributing the work load over master- and slave computers........................529 Chapter 20—Go in Google App Engine............................................................................538 Fig 20.1: The Application Control Panel......................................................................558
The Way to Go,: A Thorough Introduction to the Go Programming Language 英文书籍,已Cross the wall,从Google获得书中源代码,分享一下。喜欢请购买正版。 目录如下: Contents Preface................................................................................................................................. xix PART 1—WHY LEARN GO—GETTING STARTED Chapter 1—Origins, Context and Popularity of Go...............................................................1 1.1 Origins and evolution................................................................................................1 1.2 Main characteristics, context and reasons for developing a new language....................4 1.2.1 Languages that influenced Go.........................................................................4 1.2.2 Why a new language?......................................................................................5 1.2.3 Targets of the language....................................................................................5 1.2.4 Guiding design principles...............................................................................7 1.2.5 Characteristics of the language........................................................................7 1.2.6 Uses of the language........................................................................................8 1.2.7 Missing features?.............................................................................................9 1.2.8 Programming in Go......................................................................................10 1.2.9 Summary......................................................................................................10 Chapter 2—Installation and Runtime Environment............................................................11 2.1 Platforms and architectures.....................................................................................11 (1) The gc Go-compilers:...........................................................

590

社区成员

发帖
与我相关
我的任务
社区描述
提出问题
其他 技术论坛(原bbs)
社区管理员
  • community_281
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧