注冊 | 登錄讀書好,好讀書,讀好書!
讀書網(wǎng)-DuShu.com
當(dāng)前位置: 首頁出版圖書科學(xué)技術(shù)計(jì)算機(jī)/網(wǎng)絡(luò)軟件與程序設(shè)計(jì)程序設(shè)計(jì)綜合Ruby Cookbook(影印版)

Ruby Cookbook(影印版)

Ruby Cookbook(影印版)

定 價(jià):¥98.00

作 者: (美)卡爾森、理查德森
出版社: 東南大學(xué)出版社
叢編項(xiàng): 東南大學(xué)出版社O'Reilly圖書系列
標(biāo) 簽: 暫缺

ISBN: 9787564105969 出版時(shí)間: 2006-11-01 包裝: 平裝
開本: 16 頁數(shù): 873 字?jǐn)?shù):  

內(nèi)容簡介

  你想探究Ruby的極致嗎?Ruby Cookbook就是關(guān)于這一當(dāng)今最熱門編程語言的最全面的問題求解指南。本書使用清晰的闡述和數(shù)千行可以在你的項(xiàng)目中使用的源代碼,來為在實(shí)際應(yīng)用中可能碰到的數(shù)百個(gè)問題提供解決方法。從數(shù)據(jù)結(jié)構(gòu)到集成前沿技術(shù)的算法,Ruby Cookbook為每一位編程人員都準(zhǔn)備了一些專題。初學(xué)者和資深的Ruby專家都可以從本書學(xué)習(xí)到下列專題中有關(guān)Ruby編程的知識和技巧:*字符串和數(shù)字*數(shù)據(jù)庫*數(shù)組和哈希表*圖像*類、模塊和命名空間*互聯(lián)網(wǎng)服務(wù),如電子郵件、SSH和BitTorrent*反射機(jī)制和元編程(metaprogramming)*XML和HTML文件處理*多任務(wù) *Ruby on Rails (包括Ajax 集成) *圖形界面和終端界面如果你需要一個(gè)網(wǎng)絡(luò)應(yīng)用程序,本書將向你展示如何使用Rails來開始進(jìn)行開發(fā)。假設(shè)你需要重命名數(shù)以千計(jì)的文件,你將會看到如何使用Ruby來完成諸如此類的日常任務(wù)。你還可以學(xué)習(xí)如何使用Ruby讀寫微軟Excel表格文件,如何使用貝葉斯(Bayesian)過濾器進(jìn)行文本歸類以及如何創(chuàng)建PDF文件。甚至本書還將介紹一些冒傻氣的把戲,比如如何讓你的鍵盤燈閃爍不停。 總而言之,在目前已寫成的關(guān)于Ruby的書中,Ruby Cookbook是最有用的一本。如果你需要解決一個(gè)Ruby問題,大可不必進(jìn)行重復(fù)勞動(dòng),就直接在本書中尋找現(xiàn)成答案吧。 “程序員并不是僅僅靠語法知識就可以生存的,而是要靠他們所編寫的每一行實(shí)際的代碼。本書充滿了實(shí)用的方法、技巧、知識和智慧。我希望它將讀者的Ruby編程帶入更高境界?!?:Yukihiro(Matz) Matsumoto?, Ruby的作者 “你認(rèn)為書中各個(gè)主題不過是些傳統(tǒng)的日常菜譜,錯(cuò),其實(shí)它們?nèi)际潜煌可狭苏吵淼暮商m奶酪醬的美味。哦,伙計(jì),這就是實(shí)例:雜湊的版本系統(tǒng),幾個(gè)BitTorrent的客戶端以及你走失的恐龍的尋物啟事。有關(guān)各種協(xié)議的這一章好有趣。好像大快朵頤后濃稠香甜的醬汁將從你的嘴邊流下來!對了,還有些大塊的咸肉?!?:why the lucky stiff

作者簡介

  本書提供作譯者介紹Lucas Carlson是一位專注于使用Rails進(jìn)行網(wǎng)絡(luò)開發(fā)的專業(yè)Ruby程序員。他是6個(gè)Ruby庫程序的作者,也對其他很多庫程序有所貢獻(xiàn),其中包括Rails以及RedCloth。Leonard Richardson負(fù)責(zé)為多種編程語言開發(fā)和維護(hù)庫程序,其中包括Rubyful Soup。

圖書目錄

1.1 Building a String from Parts  
1.2 Substituting Variables into Strings  
1.3 Substituting Variables into an Existing String  
1.4 Reversing a String by Words or Characters  
1.5 Representing Unprintable Characters  
1.6 Converting Between Characters and Values  
1.7 Converting Between Strings and Symbols  
1.8 Processing a String One Character at a Time  
1.9 Processing a String One Word at a Time  
1.10 Changing the Case of a String  
1.11 Managing Whitespace  
1.12 Testing Whether an Object Is String-Like  
1.13 Getting the Parts of a String You Want  
1.14 Handling International Encodings  
1.15 Word-Wrapping Lines of Text  
1.16 Generating a Sucession of Strings  
1.17 Mat hing Strings with Regular Expressions  
1.18 Replacing Multiple Patterns in a Single Pass  
1.19 Validating an Email Address  
1.20 Classifying Text with a Bayesian Analyzer  
2 Numbers  
2.1 Parsing a Number from a String  
2.2 Comparing Floating-Point Numbers  
2.3 Representing Numbers to Arbitrary Precision  
2.4 Representing Rational Numbers  
2.5 Generating Random Numbers  
2.6 Converting Between Numeri Bases  
2.7 Taking Logarithms  
2.8 Finding Mean, Median, and Mode  
2.9 Converting Between Degrees and Radians  
2.10 Multiplying Matri es  
2.11 Solving a System of Linear Equations  
2.12 Using Complex Numbers  
2.13 Simulating a Sub lass of Fixnum  
2.14 Doing Math with Roman Numbers  
2.15 Generating a Sequence of Numbers  
2.16 Generating Prime Numbers  
2.17 Che king a Credit Card Che ksum  
3 Date and Time  
3.1 Finding Today's Date  
3.2 Parsing Dates, Precisely or Fuzzily  
3.3 Printing a Date  
3.4 Iterating Over Dates  
3.5 Doing Date Arithmeti  
3.6 Counting the Days Since an Arbitrary Date  
3.7 Converting Between Time Zones  
3.8 Che king Whether Daylight Saving Time Is in Effect  
3.9 Converting Between Time and DateTime Obje ts  
3.10 Finding the Day of the Week  
3.11 Handling Commer ial Dates  
3.12 Running a Code Blo k Periodi ally  
3.13 Waiting a Certain Amount of Time  
3.14 Adding a Timeout to a Long-Running Operation  
4 Arrays  
4.1 Iterating Over an Array  
4.2 Rearranging Values Without Using Temporary Variables  
4.3 Stripping Dupli ate Elements from an Array  
4.4 Reversing an Array  
4.5 Sorting an Array  
4.6 Ignoring Case When Sorting Strings  
4.7 Making Sure a Sorted Array Stays Sorted  
4.8 Summing the Items of an Array  
4.9 Sorting an Array by Frequen y of Appearance  
4.10 Shuffling an Array  
4.11 Getting the N Smallest Items of an Array  
4.12 Building Up a Hash Using Injection  
4.13 Extra ting Portions of Arrays  
4.14 Computing Set Operations on Arrays  
4.15 Partitioning or Classifying a Set  
5 Hashes  
5.1 Using Symbols as Hash Keys  
5.2 Creating a Hash with a Default Value  
5.3 Adding Elements to a Hash  
5.4 Removing Elements from a Hash  
5.5 Using an Array or Other Modifiable Object as a Hash Key  
5.6 Keeping Multiple Values for the Same Hash Key  
5.7 Iterating Over a Hash  
5.8 Iterating Over a Hash in Insertion Order  
5.9 Printing a Hash  
5.10 Inverting a Hash  
5.11 Choosing Randomly from a Weighted List  
5.12 Building a Histogram  
5.13 Remapping the Keys and Values of a Hash  
5.14 Extra ting Portions of Hashes  
5.15 Sear hing a Hash with Regular Expressions  
6 Files and Directories  
6.1 Che king to See If a File Exists  
6.2 Che king Your Acess to a File  
6.3 Changing the Permissions on a File  
6.4 Seeing When a File Was Last Used Problem  
6.5 Listing a Dire tory  
6.6 Reading the Contents of a File  
6.7 Writing to a File  
6.8 Writing to a Temporary File  
6.9 Pi king a Random Line from a File  
6.10 Comparing Two Files  
6.11 Performing Random A ess on "Read-Once" Input Streams  
6.12 Walking a Directory Tree  
6.13 Lo king a File  
6.14 Ba king Up to Versioned Filenames  
6.15 Pretending a String Is a File  
6.16 Redire ting Standard Input or Output  
6.17 Pro essing a Binary File  
6.18 Deleting a File  
6.19 Trun ating a File  
6.20 Finding the Files You Want  
6.21 Finding and Changing the Current Working Directory  
7 Code Blocks and Iteration  
7.1 Creating and Invoking a Block  
7.2 Writing a Method That Acepts a Block  
7.3 Binding a Block Argument to a Variable  
7.4 Blocks as Closures: Using Outside Variables Within a Code Block  
7.5 Writing an Iterator Over a Data Structure  
7.6 Changing the Way an Obje t Iterates  
7.7 Writing Block Methods That Classify or Collect  
7.8 Stopping an Iteration  
7.9 Looping Through Multiple Iterables in Parallel  
7.10 Hiding Setup and Cleanup in a Blo k Method  
7.11 Coupling Systems Loosely with Callbacks  
8 Objects and Classes8  
8.1 Managing Instance Data  
8.2 Managing Class Data  
8.3 Checking Class or Module Membership  
8.4 Writing an Inherited Class  
8.5 Overloading Methods  
8.6 Validating and Modifying Attribute Values  
8.7 Defining a Virtual Attribute  
8.8 Delegating Method Calls to Another Object  
8.9 Converting and Coercing Objects to Different Types  
8.10 Getting a Human-Readable Printout of Any Object  
8.11 Acepting or Passing a Variable Number of Arguments  
8.12 Simulating Keyword Arguments  
8.13 Calling a Superclass's Method  
8.14 Creating an Abstract Method  
8.15 Freezing an Object to Prevent Changes  
8.16 Making a Copy of an Object  
8.17 Declaring Constants  
8.18 Implementing Class and Singleton Methods  
8.19 Controlling Acess by Making Methods Private  
9 Modules and Namespa es  
9.1 Simulating Multiple Inheritan e with Mixins  
9.2 Extending Spe ifi Obje ts with Modules  
9.3 Mixing in Class Methods  
9.4 Implementing Enumerable: Write One Method, Get 22 Free  
9.5 Avoiding Naming Collisions with Namespaces  
9.6 Automati ally Loading Libraries as Needed  
9.7 In luding Namespaces  
9.8 Initializing Instance Variables Defined by a Module  
9.9 Automati ally Initializing Mixed-In Modules  
10 Reflection and Metaprogramming  
10.1 Finding an Object's Class and Superclass  
10.2 Listing an Object's Methods  
10.3 Listing Methods Unique to an Object  
10.4 Getting a Reference to a Method  
10.5 Fixing Bugs in Someone Else's Class  
10.6 Listening for Changes to a Class  
10.7 Che king Whether an Object Has Necessary Attributes  
10.8 Responding to Calls to Undefined Methods  
10.9 Automati ally Initializing Instance Variables  
10.10 Avoiding Boilerplate Code with Metaprogramming  
10.11 Metaprogramming with String Evaluations  
10.12 Evaluating Code in an Earlier Context  
10.13 Undefining a Method  
10.14 Aliasing Methods  
10.15 Doing Aspe t-Oriented Programming  
10.16 Enforcing Software Contracts  
11 XML and HTML  
11.1 Che king XML Well-Formedness  
11.2 Extracting Data from a Document's Tree Structure  
11.3 Extracting Data While Parsing a Document  
11.4 Navigating a Document with XPath  
11.5 Parsing Invalid Markup ..  
11.6 Converting an XML Document intoca Hash  
11.7 Validating an XML Document  
11.8 Substituting XML Entities  
11.9 Creating and Modifying XML Documents  
11.10 Compressing Whitespace in an XML Document  
11.11 Guessing a Do ument's Encoding  
11.12 Converting from One En oding to Another  
11.13 Extracting All the URLs from an HTML Document  
11.14 Transforming Plain Text to HTML  
11.15 Converting HTML Do uments from the Web into Text  
11.16 A Simple Feed Aggregator  
12 Graphi s and Other File Formats  
12.1 Thumbnailing Images  
12.2 Adding Text to an Image  
12.3 Converting One Image Format to Another  
12.4 Graphing Data  
12.5 Adding Graphical Context with Sparklines  
12.6 Strongly En rypting Data  
12.7 Parsing Comma-Separated Data  
12.8 Parsing Not-Quite-Comma-Separated Data  
12.9 Generating and Parsing Ex el Spreadsheets  
12.10 Compressing and Archiving Files with Gzip and Tar  
12.11 Reading and Writing ZIP Files  
12.12 Reading and Writing Configuration Files  
12.13 Generating PDF Files  
12.14 Representing Data as MIDI Musi  
13 Databases and Persistence  
13.1 Serializing Data with YAML  
13.2 Serializing Data with Marshal  
13.3 Persisting Objects with Madeleine  
13.4 Indexing Unstructured Text with SimpleSear h  
13.5 Indexing Structured Text with Ferret  
13.6 Using Berkeley DB Databases  
13.7 Controlling MySQL on Unix  
13.8 Finding the Number of Rows Returned by a Query  
13.9 Talking Dire tly to a MySQL Database  
13.10 Talking Directly to a PostgreSQL Database  
13.11 Using Object Relational Mapping with A tiveRecord  
13.12 Using Object Relational Mapping with Og  
13.13 Building Queries Programmati ally  
13.14 Validating Data with A tiveRecord  
13.15 Preventing SQL Injection Attacks  
13.16 Using Transactions in A tiveRecord  
13.17 Adding Hooks to Table Events  
13.18 Adding Taggability with a Database Mixin  
14 Internet Services  
14.1 Grabbing the Contents of a Web Page  
14.2 Making an HTTPS Web Request  
14.3 Customizing HTTP Request Headers  
14.4 Performing DNS Queries  
14.5 Sending Mail  
14.6 Reading Mail with IMAP  
14.7 Reading Mail with POP3  
14.8 Being an FTP Client  
14.9 Being a Telnet Client  
14.10 Being an SSH Client  
14.11 Copying a File to Another Ma hine  
14.12 Being a BitTorrent Client  
14.13 Pinging a Ma hine  
14.14 Writing an Internet Server  
14.15 Parsing URLs  
14.16 Writing a CGI Script  
14.17 Setting Cookies and Other HTTP Response Headers  
14.18 Handling File Uploadscvia CGI  
14.19 Running Servlets with WEBri k  
14.20 A Real-World HTTP Client  
15 Web Development: Ruby on Rails  
15.1 Writing a Simple Rails Application to Show System Status  
15.2 Passing Data from the Controller to the View  
15.3 Creating a Layout for Your Header and Footer  
15.4 Redire ting to a Different Location  
15.5 Displaying Templates with Render  
15.6 Integrating a Database with Your Rails Application  
15.7 Understanding Pluralization Rules  
15.8 Creating a Login System  
15.9 Storing Hashed User Passwords in the Database  
15.10 Escaping HTML and JavaS ript for Display  
15.11 Setting and Retrieving Session Information  
15.12 Setting and Retrieving Cookies  
15.13 Extra ting Code into Helper Fun tions  
15.14 Refa toring the View into Partial Snippets of Views  
15.15 Adding DHTML Effe ts with script.aculo.us  
15.16 Generating Forms for Manipulating Model Objects  
15.17 Creating an Ajax Form  
15.18 Exposing Web Services on Your Web Site  
15.19 Sending Mail with Rails  
15.20 Automati ally Sending Error Messages to Your Email  
15.21 Do umenting Your Web Site  
15.22 Unit Testing Your Web Site  
15.23 Using breakpoint in Your Web Application  
16 Web Services and Distributed Programming  
16.1 Sear hing for Books on Amazon  
16.2 Finding Photos on Fli kr  
16.3 Writing an XML-RPC Client  
16.4 Writing a SOAP Client  
16.5 Writing a SOAP Server  
16.6 Sear hing the Web with Google's SOAP Service  
16.7 Using a WSDL File to Make SOAP Calls Easier  
16.8 Charging a Credit Card  
16.9 Finding the Cost to Ship Pa kages via UPS or FedEx  
16.10 Sharing a Hash Between Any Number of Computers  
16.11 Implementing a Distributed Queue  
16.12 Creating a Shared "Whiteboard"  
16.13 Securing DRb Services with Acess Control Lists  
16.14 Automati ally Dis overing DRb Services with Rinda  
16.15 Proxying Objects That Can't Be Distributed  
16.16 Storing Data on Distributed RAM with MemCached  
16.17 Caching Expensive Results with MemCached  
16.18 A Remote-Controlled Jukebox  
17 Testing, Debugging, Optimizing, and Documenting  
17.1 Running Code Only in Debug Mode  
17.2 Raising an Exception  
17.3 Handling an Exception  
17.4 Rerunning After an Exception  
17.5 Adding Logging to Your Appli ation  
17.6 Creating and Understanding Tracebacks  
17.7 Writing Unit Tests  
17.8 Running Unit Tests  
17.9 Testing Code That Uses External Resources  
17.10 Using breakpoint to Inspect and Change the State of Your Appli ation  
17.11 Do umenting Your Application  
17.12 Profiling Your Application  
17.13 Ben hmarking Competing Solutions  
17.14 Running Multiple Analysis Tools at Once  
17.15 Who's Calling That Method? A Call Graph Analyzer  
18 Pa kaging and Distributing Software  
18.1 Finding Libraries by Querying Gem Respositories  
18.2 Installing and Using a Gem  
18.3 Requiring a Specifi Version of a Gem  
18.4 Uninstalling a Gem  
18.5 Reading Documentation for Installed Gems  
18.6 Packaging Your Codecas a Gem  
18.7 Distributing Your Gems  
18.8 Installing and Creating Standalone Packages with setup.rb  
19 Automating Tasks with Rake  
19.1 Automati ally Running Unit Tests  
19.2 Automati ally Generating Documentation  
19.3 Cleaning Up Generated Files  
19.4 Automati ally Building a Gem  
19.5 Gathering Statistics About Your Code  
19.6 Publishing Your Documentation  
19.7 Running Multiple Tasks in Parallel  
19.8 A Generi Proje t Rakefile  
20 Multitasking and Multithreading  
20.1 Running a Daemon Pro ess on Unix  
20.2 Creating a Windows Service  
20.3 Doing Two Things at On e with Threads  
20.4 Synchronizing Acess to an Object  
20.5 Terminating a Thread  
20.6 Running a Code Block on Many Objects Simultaneously  
20.7 Limiting Multithreading with a Thread Pool  
20.8 Driving an External Process with popen  
20.9 Capturing the Output and Error Streams from a Unix Shell Command  
20.10 Controlling a Process on Another Machine  
20.11 Avoiding Deadlock  
21 User Interface  
21.1  
21.2 Getting Input One Line at a Time  
21.3 Getting Input One Character at a Time  
21.4 Parsing Command-Line Arguments  
21.5 Testing Whether a Program Is Running Intera tively  
21.6 Setting Up and Tearing Down a Curses Program  
21.7 Clearing the S reen  
21.8 Determining Terminal Size  
21.9 Changing Text Color  
21.10 Reading a Password  
21.11 Allowing Input Editing with Readline  
21.12 Making Your Keyboard Lights Blink  
21.13 Creating a GUI Appli ation with Tk  
21.14 Creating a GUI Appli ation with wxRuby  
21.15 Creating a GUI Appli ation with Ruby/GTK  
21.16 Creating a Ma OS X Appli ation with RubyCo oa  
21.17 Using AppleS ript to Get User Input  
22 Extending Ruby with Other Languages  
22.1 Writing a C Extension for Ruby  
22.2 Using a C Library from Ruby  
22.3 Calling a C Library Through SWIG  
22.4 Writing Inline C in Your Ruby Code  
22.5 Using Java Libraries with JRuby  
23 System Administration  
23.1 Scripting an External Program  
23.2 Managing Windows Services  
23.3 Running Code as Another User  
23.4 Running Periodi Tasks Without roncorcat  
23.5 Deleting Files That Match a Regular Expression  
23.6 Renaming Files in Bulk  
23.7 Finding Duplicate Files  
23.8 Automating Backups  
23.9 Normalizing Ownership and Permissions in User Directories  
23.10 Killing All Processes for a Given User  
Index ...  

本目錄推薦

掃描二維碼
Copyright ? 讀書網(wǎng) hotzeplotz.com 2005-2020, All Rights Reserved.
鄂ICP備15019699號 鄂公網(wǎng)安備 42010302001612號