Ruby Cookbook
(Sprache: Englisch)
Do you want to push Ruby to its limits? The Ruby Cookbook is the most comprehensive problem-solving guide to today's hottest programming language. It gives you hundreds of solutions to real-world problems, with clear explanations and thousands of lines of...
Leider schon ausverkauft
versandkostenfrei
Buch
41.00 €
Produktdetails
Produktinformationen zu „Ruby Cookbook “
Klappentext zu „Ruby Cookbook “
Do you want to push Ruby to its limits? The Ruby Cookbook is the most comprehensive problem-solving guide to today's hottest programming language. It gives you hundreds of solutions to real-world problems, with clear explanations and thousands of lines of code you can use in your own projects.From data structures and algorithms, to integration with cutting-edge technologies, the Ruby Cookbook has something for every programmer. Beginners and advanced Rubyists alike will learn how to program with:Strings and numbersArrays and hashes
Classes, modules, and namespaces
Reflection and metaprogramming
XML and HTML processing
Ruby on Rails (including Ajax integration)
Databases
Graphics
Internet services like email, SSH, and BitTorrent
Web services
Multitasking
Graphical and terminal interfacesIf you need to write a web application, this book shows you how to get started with Rails. If you're a system administrator who needs to rename thousands of files, you'll see how to use Rubyfor this and other everyday tasks. You'll learn how to read and write Excel spreadsheets, classify text with Bayesian filters, and create PDF files. We've even included a few silly tricks that were too cool to leave out, like how to blink the lights on your keyboard.The Ruby Cookbook is the most useful book yet written about Ruby. When you need to solve a problem, don't reinvent the wheel: look it up in the Cookbook.
Do you want to push Ruby to its limits? The Ruby Cookbook is the most comprehensive problem-solving guide to today's hottest programming language. It gives you hundreds of solutions to real-world problems, with clear explanations and thousands of lines of code you can use in your own projects.
From data structures and algorithms, to integration with cutting-edge technologies, the Ruby Cookbook has something for every programmer. Beginners and advanced Rubyists alike will learn how to program with:
- Strings and numbers
- Arrays and hashes
- Classes, modules, and namespaces
- Reflection and metaprogramming
- XML and HTML processing
- Ruby on Rails (including Ajax integration)
- Databases
- Graphics
- Internet services like email, SSH, and BitTorrent
- Web services
- Multitasking
- Graphical and terminal interfaces If you need to write a web application, this book shows you how to get started with Rails. If you're a system administrator who needs to rename thousands of files, you'll see how to use Ruby for this and other everyday tasks. You'll learn how to read and write Excel spreadsheets, classify text with Bayesian filters, and create PDF files. We've even included a few silly tricks that were too cool to leave out, like how to blink the lights on your keyboard.
The Ruby Cookbook is the most useful book yet written about Ruby. When you need to solve a problem, don't reinvent the wheel: look it up inthe Cookbook.
From data structures and algorithms, to integration with cutting-edge technologies, the Ruby Cookbook has something for every programmer. Beginners and advanced Rubyists alike will learn how to program with:
- Strings and numbers
- Arrays and hashes
- Classes, modules, and namespaces
- Reflection and metaprogramming
- XML and HTML processing
- Ruby on Rails (including Ajax integration)
- Databases
- Graphics
- Internet services like email, SSH, and BitTorrent
- Web services
- Multitasking
- Graphical and terminal interfaces If you need to write a web application, this book shows you how to get started with Rails. If you're a system administrator who needs to rename thousands of files, you'll see how to use Ruby for this and other everyday tasks. You'll learn how to read and write Excel spreadsheets, classify text with Bayesian filters, and create PDF files. We've even included a few silly tricks that were too cool to leave out, like how to blink the lights on your keyboard.
The Ruby Cookbook is the most useful book yet written about Ruby. When you need to solve a problem, don't reinvent the wheel: look it up inthe Cookbook.
Inhaltsverzeichnis zu „Ruby Cookbook “
Preface1. Strings
... 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 Succession of Strings
... 1.17 Matching 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 Numeric Bases
... 2.7 Taking Logarithms
... 2.8 Finding Mean, Median, and Mode
... 2.9 Converting Between Degrees and Radians
... 2.10 Multiplying Matrices
... 2.11 Solving a System of Linear Equations
... 2.12 Using Complex Numbers
... 2.13 Simulating a Subclass of Fixnum
... 2.14 Doing Math with Roman Numbers
... 2.15 Generating a Sequence of Numbers
... 2.16 Generating Prime Numbers
... 2.17 Checking a Credit Card Checksum
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 Arithmetic
... 3.6 Counting the Days Since an Arbitrary Date
... 3.7 Converting Between Time
... mehr
Zones
... 3.8 Checking Whether Daylight Saving Time Is in Effect
... 3.9 Converting Between Time and DateTime Objects
... 3.10 Finding the Day of the Week
... 3.11 Handling Commercial Dates
... 3.12 Running a Code Block Periodically
... 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 Duplicate 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 Frequency 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 Extracting 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 Extracting Portions of Hashes
... 5.15 Searching a Hash with Regular Expressions
6. Files and Directories
... 6.1 Checking to See If a File Exists
... 6.2 Checking Your Access to a File
... 6.3 Changing the Permissions on a File
... 6.4 Seeing When a File Was Last Used
... 6.5 Listing a Directory
... 6.6 Reading the Contents of a File
... 6.7 Writing to a File
... 6.8 Writing to a Temporary File
... 6.9 Picking a Random Line from a File
... 6.10 Comparing Two Files
... 6.11 Performing Random Access on "Read-Once" Input Streams
... 6.12 Walking a Directory Tree
... 6.13 Locking a File
... 6.14 Backing Up to Versioned Filenames
... 6.15 Pretending a String Is a File
... 6.16 Redirecting Standard Input or Output
... 6.17 Processing a Binary File
... 6.18 Deleting a File
... 6.19 Truncating 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 Accepts 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 Object 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 Block Method
... 7.11 Coupling Systems Loosely with Callbacks
8. Objects and Classes
... 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 Accepting 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 Access by Making Methods Private
9. Modules and Namespaces
... 9.1 Simulating Multiple Inheritance with Mixins
... 9.2 Extending Specific Objects 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 Automatically Loading Libraries as Needed
... 9.7 Including Namespaces
... 9.8 Initializing Instance Variables Defined by a Module
... 9.9 Automatically Initializing Mixed-In Modules
10. Reflection and Metaprogramming
1... 0.1 Finding an Object's Class and Superclass
1... 0.2 Listing an Object's Methods
1... 0.3 Listing Methods Unique to an Object
1... 0.4 Getting a Reference to a Method
1... 0.5 Fixing Bugs in Someone Else's Class
1... 0.6 Listening for Changes to a Class
1... 0.7 Checking Whether an Object Has Necessary Attributes
1... 0.8 Responding to Calls to Undefined Methods
1... 0.9 Automatically Initializing Instance Variables
1... 0.10 Avoiding Boilerplate Code with Metaprogramming
1... 0.11 Metaprogramming with String Evaluations
1... 0.12 Evaluating Code in an Earlier Context
1... 0.13 Undefining a Method
1... 0.14 Aliasing Methods
1... 0.15 Doing Aspect-Oriented Programming
1... 0.16 Enforcing Software Contracts
11. XML and HTML
1... 1.1 Checking XML Well-Formedness
1... 1.2 Extracting Data from a Document's Tree Structure
1... 1.3 Extracting Data While Parsing a Document
1... 1.4 Navigating a Document with XPath
1... 1.5 Parsing Invalid Markup
1... 1.6 Converting an XML Document into a Hash
1... 1.7 Validating an XML Document
1... 1.8 Substituting XML Entities
1... 1.9 Creating and Modifying XML Documents
1... 1.10 Compressing Whitespace in an XML Document
1... 1.11 Guessing a Document's Encoding
1... 1.12 Converting from One Encoding to Another
1... 1.13 Extracting All the URLs from an HTML Document
1... 1.14 Transforming Plain Text to HTML
1... 1.15 Converting HTML Documents from the Web into Text
1... 1.16 A Simple Feed Aggregator
12. Graphics and Other File Formats
1... 2.1 Thumbnailing Images
1... 2.2 Adding Text to an Image
1... 2.3 Converting One Image Format to Another
1... 2.4 Graphing Data
1... 2.5 Adding Graphical Context with Sparklines
1... 2.6 Strongly Encrypting Data
1... 2.7 Parsing Comma-Separated Data
1... 2.8 Parsing Not-Quite-Comma-Separated Data
1... 2.9 Generating and Parsing Excel Spreadsheets
1... 2.10 Compressing and Archiving Files with Gzip and Tar
1... 2.11 Reading and Writing ZIP Files
1... 2.12 Reading and Writing Configuration Files
1... 2.13 Generating PDF Files
1... 2.14 Representing Data as MIDI Music
13. Databases and Persistence
1... 3.1 Serializing Data with YAML
1... 3.2 Serializing Data with Marshal
1... 3.3 Persisting Objects with Madeleine
1... 3.4 Indexing Unstructured Text with SimpleSearch
1... 3.5 Indexing Structured Text with Ferret
1... 3.6 Using Berkeley DB Databases
1... 3.7 Controlling MySQL on Unix
1... 3.8 Finding the Number of Rows Returned by a Query
1... 3.9 Talking Directly to a MySQL Database
1... 3.10 Talking Directly to a PostgreSQL Database
1... 3.11 Using Object Relational Mapping with ActiveRecord
1... 3.12 Using Object Relational Mapping with Og
1... 3.13 Building Queries Programmatically
1... 3.14 Validating Data with ActiveRecord
1... 3.15 Preventing SQL Injection Attacks
1... 3.16 Using Transactions in ActiveRecord
1... 3.17 Adding Hooks to Table Events
1... 3.18 Adding Taggability with a Database Mixin
14. Internet Services
1... 4.1 Grabbing the Contents of a Web Page
1... 4.2 Making an HTTPS Web Request
1... 4.3 Customizing HTTP Request Headers
1... 4.4 Performing DNS Queries
1... 4.5 Sending Mail
1... 4.6 Reading Mail with IMAP
1... 4.7 Reading Mail with POP3
1... 4.8 Being an FTP Client
1... 4.9 Being a Telnet Client
1... 4.10 Being an SSH Client
1... 4.11 Copying a File to Another Machine
1... 4.12 Being a BitTorrent Client
1... 4.13 Pinging a Machine
1... 4.14 Writing an Internet Server
1... 4.15 Parsing URLs
1... 4.16 Writing a CGI Script
1... 4.17 Setting Cookies and Other HTTP Response Headers
1... 4.18 Handling File Uploads via CGI
1... 4.19 Running Servlets with WEBrick
1... 4.20 A Real-World HTTP Client
15. Web Development: Ruby on Rails
1... 5.1 Writing a Simple Rails Application to Show System Status
1... 5.2 Passing Data from the Controller to the View
1... 5.3 Creating a Layout for Your Header and Footer
1... 5.4 Redirecting to a Different Location
1... 5.5 Displaying Templates with Render
1... 5.6 Integrating a Database with Your Rails Application
1... 5.7 Understanding Pluralization Rules
1... 5.8 Creating a Login System
1... 5.9 Storing Hashed User Passwords in the Database
1... 5.10 Escaping HTML and JavaScript for Display
1... 5.11 Setting and Retrieving Session Information
1... 5.12 Setting and Retrieving Cookies
1... 5.13 Extracting Code into Helper Functions
1... 5.14 Refactoring the View into Partial Snippets of Views
1... 5.15 Adding DHTML Effects with script.aculo.us
1... 5.16 Generating Forms for Manipulating Model Objects
1... 5.17 Creating an Ajax Form
1... 5.18 Exposing Web Services on Your Web Site
1... 5.19 Sending Mail with Rails
1... 5.20 Automatically Sending Error Messages to Your Email
1... 5.21 Documenting Your Web Site
1... 5.22 Unit Testing Your Web Site
1... 5.23 Using breakpoint in Your Web Application
16. Web Services and Distributed Programming
1... 6.1 Searching for Books on Amazon
1... 6.2 Finding Photos on Flickr
1... 6.3 Writing an XML-RPC Client
1... 6.4 Writing a SOAP Client
1... 6.5 Writing a SOAP Server
1... 6.6 Searching the Web with Google's SOAP Service
1... 6.7 Using a WSDL File to Make SOAP Calls Easier
1... 6.8 Charging a Credit Card
1... 6.9 Finding the Cost to Ship Packages via UPS or FedEx
1... 6.10 Sharing a Hash Between Any Number of Computers
1... 6.11 Implementing a Distributed Queue
1... 6.12 Creating a Shared "Whiteboard"
1... 6.13 Securing DRb Services with Access Control Lists
1... 6.14 Automatically Discovering DRb Services with Rinda
1... 6.15 Proxying Objects That Can't Be Distributed
1... 6.16 Storing Data on Distributed RAM with MemCached
1... 6.17 Caching Expensive Results with MemCached
1... 6.18 A Remote-Controlled Jukebox
17. Testing, Debugging, Optimizing, and Documenting
1... 7.1 Running Code Only in Debug Mode
1... 7.2 Raising an Exception
1... 7.3 Handling an Exception
1... 7.4 Rerunning After an Exception
1... 7.5 Adding Logging to Your Application
1... 7.6 Creating and Understanding Tracebacks
1... 7.7 Writing Unit Tests
1... 7.8 Running Unit Tests
1... 7.9 Testing Code That Uses External Resources
1... 7.10 Using breakpoint to Inspect and Change the State of Your Application
1... 7.11 Documenting Your Application
1... 7.12 Profiling Your Application
1... 7.13 Benchmarking Competing Solutions
1... 7.14 Running Multiple Analysis Tools at Once
1... 7.15 Who's Calling That Method? A Call Graph Analyzer
18. Packaging and Distributing Software
1... 8.1 Finding Libraries by Querying Gem Respositories
1... 8.2 Installing and Using a Gem
1... 8.3 Requiring a Specific Version of a Gem
1... 8.4 Uninstalling a Gem
1... 8.5 Reading Documentation for Installed Gems
1... 8.6 Packaging Your Code as a Gem
1... 8.7 Distributing Your Gems
1... 8.8 Installing and Creating Standalone Packages with setup.rb
19. Automating Tasks with Rake
1... 9.1 Automatically Running Unit Tests
1... 9.2 Automatically Generating Documentation
1... 9.3 Cleaning Up Generated Files
1... 9.4 Automatically Building a Gem
1... 9.5 Gathering Statistics About Your Code
1... 9.6 Publishing Your Documentation
1... 9.7 Running Multiple Tasks in Parallel
1... 9.8 A Generic Project Rakefile
20. Multitasking and Multithreading
2... 0.1 Running a Daemon Process on Unix
2... 0.2 Creating a Windows Service
2... 0.3 Doing Two Things at Once with Threads
2... 0.4 Synchronizing Access to an Object
2... 0.5 Terminating a Thread
2... 0.6 Running a Code Block on Many Objects Simultaneously
2... 0.7 Limiting Multithreading with a Thread Pool
2... 0.8 Driving an External Process with popen
2... 0.9 Capturing the Output and Error Streams from a Unix Shell Command
2... 0.10 Controlling a Process on Another Machine
2... 0.11 Avoiding Deadlock
21. User Interface
2... 1.1 Getting Input One Line at a Time
2... 1.2 Getting Input One Character at a Time
2... 1.3 Parsing Command-Line Arguments
2... 1.4 Testing Whether a Program Is Running Interactively
2... 1.5 Setting Up and Tearing Down a Curses Program
2... 1.6 Clearing the Screen
2... 1.7 Determining Terminal Size
2... 1.8 Changing Text Color
2... 1.9 Reading a Password
2... 1.10 Allowing Input Editing with Readline
2... 1.11 Making Your Keyboard Lights Blink
2... 1.12 Creating a GUI Application with Tk
2... 1.13 Creating a GUI Application with wxRuby
2... 1.14 Creating a GUI Application with Ruby/GTK
2... 1.15 Creating a Mac OS X Application with RubyCocoa
2... 1.16 Using AppleScript to Get User Input
22. Extending Ruby with Other Languages
2... 2.1 Writing a C Extension for Ruby
2... 2.2 Using a C Library from Ruby
2... 2.3 Calling a C Library Through SWIG
2... 2.4 Writing Inline C in Your Ruby Code
2... 2.5 Using Java Libraries with JRuby
23. System Administration
2... 3.1 Scripting an External Program
2... 3.2 Managing Windows Services
2... 3.3 Running Code as Another User
2... 3.4 Running Periodic Tasks Without cron or at
2... 3.5 Deleting Files That Match a Regular Expression
2... 3.6 Renaming Files in Bulk
2... 3.7 Finding Duplicate Files
2... 3.8 Automating Backups
2... 3.9 Normalizing Ownership and Permissions in User Directories
2... 3.10 Killing All Processes for a Given UserIndex
... 3.8 Checking Whether Daylight Saving Time Is in Effect
... 3.9 Converting Between Time and DateTime Objects
... 3.10 Finding the Day of the Week
... 3.11 Handling Commercial Dates
... 3.12 Running a Code Block Periodically
... 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 Duplicate 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 Frequency 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 Extracting 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 Extracting Portions of Hashes
... 5.15 Searching a Hash with Regular Expressions
6. Files and Directories
... 6.1 Checking to See If a File Exists
... 6.2 Checking Your Access to a File
... 6.3 Changing the Permissions on a File
... 6.4 Seeing When a File Was Last Used
... 6.5 Listing a Directory
... 6.6 Reading the Contents of a File
... 6.7 Writing to a File
... 6.8 Writing to a Temporary File
... 6.9 Picking a Random Line from a File
... 6.10 Comparing Two Files
... 6.11 Performing Random Access on "Read-Once" Input Streams
... 6.12 Walking a Directory Tree
... 6.13 Locking a File
... 6.14 Backing Up to Versioned Filenames
... 6.15 Pretending a String Is a File
... 6.16 Redirecting Standard Input or Output
... 6.17 Processing a Binary File
... 6.18 Deleting a File
... 6.19 Truncating 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 Accepts 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 Object 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 Block Method
... 7.11 Coupling Systems Loosely with Callbacks
8. Objects and Classes
... 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 Accepting 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 Access by Making Methods Private
9. Modules and Namespaces
... 9.1 Simulating Multiple Inheritance with Mixins
... 9.2 Extending Specific Objects 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 Automatically Loading Libraries as Needed
... 9.7 Including Namespaces
... 9.8 Initializing Instance Variables Defined by a Module
... 9.9 Automatically Initializing Mixed-In Modules
10. Reflection and Metaprogramming
1... 0.1 Finding an Object's Class and Superclass
1... 0.2 Listing an Object's Methods
1... 0.3 Listing Methods Unique to an Object
1... 0.4 Getting a Reference to a Method
1... 0.5 Fixing Bugs in Someone Else's Class
1... 0.6 Listening for Changes to a Class
1... 0.7 Checking Whether an Object Has Necessary Attributes
1... 0.8 Responding to Calls to Undefined Methods
1... 0.9 Automatically Initializing Instance Variables
1... 0.10 Avoiding Boilerplate Code with Metaprogramming
1... 0.11 Metaprogramming with String Evaluations
1... 0.12 Evaluating Code in an Earlier Context
1... 0.13 Undefining a Method
1... 0.14 Aliasing Methods
1... 0.15 Doing Aspect-Oriented Programming
1... 0.16 Enforcing Software Contracts
11. XML and HTML
1... 1.1 Checking XML Well-Formedness
1... 1.2 Extracting Data from a Document's Tree Structure
1... 1.3 Extracting Data While Parsing a Document
1... 1.4 Navigating a Document with XPath
1... 1.5 Parsing Invalid Markup
1... 1.6 Converting an XML Document into a Hash
1... 1.7 Validating an XML Document
1... 1.8 Substituting XML Entities
1... 1.9 Creating and Modifying XML Documents
1... 1.10 Compressing Whitespace in an XML Document
1... 1.11 Guessing a Document's Encoding
1... 1.12 Converting from One Encoding to Another
1... 1.13 Extracting All the URLs from an HTML Document
1... 1.14 Transforming Plain Text to HTML
1... 1.15 Converting HTML Documents from the Web into Text
1... 1.16 A Simple Feed Aggregator
12. Graphics and Other File Formats
1... 2.1 Thumbnailing Images
1... 2.2 Adding Text to an Image
1... 2.3 Converting One Image Format to Another
1... 2.4 Graphing Data
1... 2.5 Adding Graphical Context with Sparklines
1... 2.6 Strongly Encrypting Data
1... 2.7 Parsing Comma-Separated Data
1... 2.8 Parsing Not-Quite-Comma-Separated Data
1... 2.9 Generating and Parsing Excel Spreadsheets
1... 2.10 Compressing and Archiving Files with Gzip and Tar
1... 2.11 Reading and Writing ZIP Files
1... 2.12 Reading and Writing Configuration Files
1... 2.13 Generating PDF Files
1... 2.14 Representing Data as MIDI Music
13. Databases and Persistence
1... 3.1 Serializing Data with YAML
1... 3.2 Serializing Data with Marshal
1... 3.3 Persisting Objects with Madeleine
1... 3.4 Indexing Unstructured Text with SimpleSearch
1... 3.5 Indexing Structured Text with Ferret
1... 3.6 Using Berkeley DB Databases
1... 3.7 Controlling MySQL on Unix
1... 3.8 Finding the Number of Rows Returned by a Query
1... 3.9 Talking Directly to a MySQL Database
1... 3.10 Talking Directly to a PostgreSQL Database
1... 3.11 Using Object Relational Mapping with ActiveRecord
1... 3.12 Using Object Relational Mapping with Og
1... 3.13 Building Queries Programmatically
1... 3.14 Validating Data with ActiveRecord
1... 3.15 Preventing SQL Injection Attacks
1... 3.16 Using Transactions in ActiveRecord
1... 3.17 Adding Hooks to Table Events
1... 3.18 Adding Taggability with a Database Mixin
14. Internet Services
1... 4.1 Grabbing the Contents of a Web Page
1... 4.2 Making an HTTPS Web Request
1... 4.3 Customizing HTTP Request Headers
1... 4.4 Performing DNS Queries
1... 4.5 Sending Mail
1... 4.6 Reading Mail with IMAP
1... 4.7 Reading Mail with POP3
1... 4.8 Being an FTP Client
1... 4.9 Being a Telnet Client
1... 4.10 Being an SSH Client
1... 4.11 Copying a File to Another Machine
1... 4.12 Being a BitTorrent Client
1... 4.13 Pinging a Machine
1... 4.14 Writing an Internet Server
1... 4.15 Parsing URLs
1... 4.16 Writing a CGI Script
1... 4.17 Setting Cookies and Other HTTP Response Headers
1... 4.18 Handling File Uploads via CGI
1... 4.19 Running Servlets with WEBrick
1... 4.20 A Real-World HTTP Client
15. Web Development: Ruby on Rails
1... 5.1 Writing a Simple Rails Application to Show System Status
1... 5.2 Passing Data from the Controller to the View
1... 5.3 Creating a Layout for Your Header and Footer
1... 5.4 Redirecting to a Different Location
1... 5.5 Displaying Templates with Render
1... 5.6 Integrating a Database with Your Rails Application
1... 5.7 Understanding Pluralization Rules
1... 5.8 Creating a Login System
1... 5.9 Storing Hashed User Passwords in the Database
1... 5.10 Escaping HTML and JavaScript for Display
1... 5.11 Setting and Retrieving Session Information
1... 5.12 Setting and Retrieving Cookies
1... 5.13 Extracting Code into Helper Functions
1... 5.14 Refactoring the View into Partial Snippets of Views
1... 5.15 Adding DHTML Effects with script.aculo.us
1... 5.16 Generating Forms for Manipulating Model Objects
1... 5.17 Creating an Ajax Form
1... 5.18 Exposing Web Services on Your Web Site
1... 5.19 Sending Mail with Rails
1... 5.20 Automatically Sending Error Messages to Your Email
1... 5.21 Documenting Your Web Site
1... 5.22 Unit Testing Your Web Site
1... 5.23 Using breakpoint in Your Web Application
16. Web Services and Distributed Programming
1... 6.1 Searching for Books on Amazon
1... 6.2 Finding Photos on Flickr
1... 6.3 Writing an XML-RPC Client
1... 6.4 Writing a SOAP Client
1... 6.5 Writing a SOAP Server
1... 6.6 Searching the Web with Google's SOAP Service
1... 6.7 Using a WSDL File to Make SOAP Calls Easier
1... 6.8 Charging a Credit Card
1... 6.9 Finding the Cost to Ship Packages via UPS or FedEx
1... 6.10 Sharing a Hash Between Any Number of Computers
1... 6.11 Implementing a Distributed Queue
1... 6.12 Creating a Shared "Whiteboard"
1... 6.13 Securing DRb Services with Access Control Lists
1... 6.14 Automatically Discovering DRb Services with Rinda
1... 6.15 Proxying Objects That Can't Be Distributed
1... 6.16 Storing Data on Distributed RAM with MemCached
1... 6.17 Caching Expensive Results with MemCached
1... 6.18 A Remote-Controlled Jukebox
17. Testing, Debugging, Optimizing, and Documenting
1... 7.1 Running Code Only in Debug Mode
1... 7.2 Raising an Exception
1... 7.3 Handling an Exception
1... 7.4 Rerunning After an Exception
1... 7.5 Adding Logging to Your Application
1... 7.6 Creating and Understanding Tracebacks
1... 7.7 Writing Unit Tests
1... 7.8 Running Unit Tests
1... 7.9 Testing Code That Uses External Resources
1... 7.10 Using breakpoint to Inspect and Change the State of Your Application
1... 7.11 Documenting Your Application
1... 7.12 Profiling Your Application
1... 7.13 Benchmarking Competing Solutions
1... 7.14 Running Multiple Analysis Tools at Once
1... 7.15 Who's Calling That Method? A Call Graph Analyzer
18. Packaging and Distributing Software
1... 8.1 Finding Libraries by Querying Gem Respositories
1... 8.2 Installing and Using a Gem
1... 8.3 Requiring a Specific Version of a Gem
1... 8.4 Uninstalling a Gem
1... 8.5 Reading Documentation for Installed Gems
1... 8.6 Packaging Your Code as a Gem
1... 8.7 Distributing Your Gems
1... 8.8 Installing and Creating Standalone Packages with setup.rb
19. Automating Tasks with Rake
1... 9.1 Automatically Running Unit Tests
1... 9.2 Automatically Generating Documentation
1... 9.3 Cleaning Up Generated Files
1... 9.4 Automatically Building a Gem
1... 9.5 Gathering Statistics About Your Code
1... 9.6 Publishing Your Documentation
1... 9.7 Running Multiple Tasks in Parallel
1... 9.8 A Generic Project Rakefile
20. Multitasking and Multithreading
2... 0.1 Running a Daemon Process on Unix
2... 0.2 Creating a Windows Service
2... 0.3 Doing Two Things at Once with Threads
2... 0.4 Synchronizing Access to an Object
2... 0.5 Terminating a Thread
2... 0.6 Running a Code Block on Many Objects Simultaneously
2... 0.7 Limiting Multithreading with a Thread Pool
2... 0.8 Driving an External Process with popen
2... 0.9 Capturing the Output and Error Streams from a Unix Shell Command
2... 0.10 Controlling a Process on Another Machine
2... 0.11 Avoiding Deadlock
21. User Interface
2... 1.1 Getting Input One Line at a Time
2... 1.2 Getting Input One Character at a Time
2... 1.3 Parsing Command-Line Arguments
2... 1.4 Testing Whether a Program Is Running Interactively
2... 1.5 Setting Up and Tearing Down a Curses Program
2... 1.6 Clearing the Screen
2... 1.7 Determining Terminal Size
2... 1.8 Changing Text Color
2... 1.9 Reading a Password
2... 1.10 Allowing Input Editing with Readline
2... 1.11 Making Your Keyboard Lights Blink
2... 1.12 Creating a GUI Application with Tk
2... 1.13 Creating a GUI Application with wxRuby
2... 1.14 Creating a GUI Application with Ruby/GTK
2... 1.15 Creating a Mac OS X Application with RubyCocoa
2... 1.16 Using AppleScript to Get User Input
22. Extending Ruby with Other Languages
2... 2.1 Writing a C Extension for Ruby
2... 2.2 Using a C Library from Ruby
2... 2.3 Calling a C Library Through SWIG
2... 2.4 Writing Inline C in Your Ruby Code
2... 2.5 Using Java Libraries with JRuby
23. System Administration
2... 3.1 Scripting an External Program
2... 3.2 Managing Windows Services
2... 3.3 Running Code as Another User
2... 3.4 Running Periodic Tasks Without cron or at
2... 3.5 Deleting Files That Match a Regular Expression
2... 3.6 Renaming Files in Bulk
2... 3.7 Finding Duplicate Files
2... 3.8 Automating Backups
2... 3.9 Normalizing Ownership and Permissions in User Directories
2... 3.10 Killing All Processes for a Given UserIndex
... weniger
Autoren-Porträt von Lucas Carlson, Leonard Richardson
Doug Baldwin, born 1952, is a playwright, actor and copywriter living in Portland, Oregon. He began his stage career as an actor, with appearances in many New York theatres, including Playwrights Horizons and Manhattan Punch Line, where he acted in a well-reviewed production of Room Service[1]. He has also appeared in feature films (among them Zero Effect andMusic Within) and television shows (Leverage,Nowhere Man, Under Suspicion, etc.), as well as in a number of national TV commercials. His comedy Drawing Down Clio won the 1997 Oregon Book Award for Drama. The Xenophobe was the recipient of a 2000 Oregon Literary Fellowship and won First Place in the 2001 Writer's Digest Writing Competition. Suicide Table is his most recent script, and deals with the theme of luck and the role it plays in the lives of two New York City firefighters vacationing in Reno.
Bibliographische Angaben
- Autoren: Lucas Carlson , Leonard Richardson
- 2006, 906 Seiten, Maße: 17,9 x 23,4 cm, Kartoniert (TB), Englisch
- Verlag: O'Reilly Media
- ISBN-10: 0596523696
- ISBN-13: 9780596523695
Sprache:
Englisch
Rezension zu „Ruby Cookbook “
"Auf circa 900 Seiten bieten die Autoren 341 'Speisen', gegliedert in 23 Abschnitte [...] Titel sowie Beschreibungen sind leicht nachvollziehbar, sodass der Leser die Anwendbarkeit auf seine Aufgabe überprüfen kann. Ebenso gut nachvollziehbar sind die beschriebenen Lösungen, die Codebeispiele und die weiterführende Diskussion. So bereitet es Spaß, diese Rezeptsammlung einfach zu durchblättern und von den vielen Konzepten und Ideen zu lernen. [...] In Anbetracht der inhaltlichen Qualität ist das Ruby Cookbook eine Bereicherung für das Regal des Ruby-Entwicklers." - iX, Ausgabe 3/2007
Kommentar zu "Ruby Cookbook"
0 Gebrauchte Artikel zu „Ruby Cookbook“
Zustand | Preis | Porto | Zahlung | Verkäufer | Rating |
---|
Schreiben Sie einen Kommentar zu "Ruby Cookbook".
Kommentar verfassen