• AW.OpenGL.SUPERBIBLE.5th.Edition.Comprehensive.Tutorial.and.Reference.2011.pdf

    Contents at a Glance Preface to the Fifth Edition. ........xxi Preface to the Fourth Edition ............xxiii Preface to the Third Edition...............xxvi Introduction . ..................1 PART I Basic Concepts ...............7 1 Introduction to 3D Graphics and OpenGL.............9 2 Getting Started . ...........33 3 Basic Rendering . ..........79 4 Basic Transformations: A Vector/Matrix Primer . .....125 5 Basic Texturing. ..........179 6 Thinking Outside the Box: Nonstock Shaders . ........229 7 More Advanced Texture Topics . ........289 PART II Intermediate to Advanced Ideas ........321 8 Buffer Objects: Storage Is Now in Your Hands . .......323 9 Advanced Buffers: Beyond the Basics . .............359 10 Fragment Operations: The End of the Pipeline . .......391 11 Advanced Shader Usage . ...........411 12 Advanced Geometry Management . ..........471 PART III Platform-Specific Notes .............539 13 OpenGL on Windows . ...............541 14 OpenGL on OS X . .............569 15 OpenGL on Linux . .............597 16 OpenGL ES on Mobile Devices . .........619 Appendix A Further Reading ................653 Appendix B Glossary . ............655 Appendix C OpenGL Man Pages for (Core) OpenGL 3.3 ......661 Index............939

    0
    120
    20.05MB
    2012-02-02
    35
  • Springer.Python.Programming.Fundamentals.2011

    1 Introduction . . . . . . . . . . 1 1.1 The Python Programming Language . . . . . . . 2 1.2 Installing Python and Wing IDE 101 . . . . . . . 3 1.3 Writing Your First Program . . . . . . . . 7 1.4 What is aComputer? . . . . . . . 8 1.5 Binary Number Representation . . . . . . 10 1.6 What is a Programming Language? . . . . . . . 13 1.7 Hexadecimal and Octal Representation . . . . . . 15 1.8 Writing Your Second Program . . . . . . 16 1.9 SyntaxErrors . . . . . . . 18 1.10 Types of Values . . . . . . 19 1.11 The Reference Type and Assignment Statements . . . . 20 1.12 Integers and Real Numbers . . . . . . . . 21 1.13 Strings . . . . . . . 24 1.14 Integer to String Conversion and Back Again . . . . . . 25 1.15 Getting Input . . . . . . . 26 1.16 Formatting Output . . . . . . . . 27 1.17 When Things Go Wrong . . . . . 30 1.18 Review Questions . . . . . . . . . 33 1.19 Exercises . . . . . . . . . 34 1.20 Solutions to Practice Problems . . . . . . 36 2 Decision Making . . . . . . . . 41 2.1 FindingtheMaxofThree Integers . . . . 45 2.2 The Guess and Check Pattern . . . . . . . 47 2.3 Choosing from a List of Alternatives . . . . . . . 48 2.4 The Boolean Type . . . . . . . . . 50 2.5 ShortCircuitLogic . . . . . . . . 53 2.6 Comparing Floats for Equality . . . . . . 54 2.7 ExceptionHandling . . . . . . . . 55 2.8 ReviewQuestions . . . . . . . . . 57 2.9 Exercises . . . . . . . . . 58 2.10 Solutions to Practice Problems . . . . . . 61 3 Repetitive Tasks . . . . . . . . 65 3.1 Operators . . . . . . . . . 67 3.2 Iterating Over a Sequence . . . . . 69 3.3 Lists . . . . . . . . 71 3.4 The Guess and Check Pattern for Lists . . . . . . 74 3.5 Mutability of Lists . . . . . . . . 75 3.6 The Accumulator Pattern . . . . . 79 3.7 Reading from and Writing to a File . . . . 80 3.8 ReadingRecords fromaFile . . . . . . . 82 3.9 ReviewQuestions . . . . . . . . . 85 3.10 Exercises . . . . . . . . . 86 3.11 Solutions to Practice Problems . . . . . . 88 4 Using Objects . . . . . . . . . . 93 4.1 Constructors . . . . . . . . 96 4.2 Accessor Methods . . . . . . . . 98 4.3 Mutator Methods . . . . . . . . . 98 4.4 ImmutableClasses . . . . . . . . 99 4.5 Object-Oriented Programming . . . . . . 100 4.6 Working with XML Files . . . . . 100 4.7 Extracting Elements from an XML File . . . . . 103 4.8 Dictionaries . . . . . . . . 104 4.9 Getting at the Data in an XML File . . . . 105 4.10 Working with Time . . . . . . . . 107 4.11 Parallel Lists . . . . . . . 107 4.12 Visualizing a Workout . . . . . . 108 4.13 Review Questions . . . . . . . . . 110 4.14 Exercises . . . . . . . . . 110 4.15 Solutions to Practice Problems . . . . . . 113 5 Defining Functions . . . . . . . 119 5.1 WhyWriteFunctions? . . . . . . 120 5.2 PassingArguments andReturning aValue . . . . 121 5.3 ScopeofVariables . . . . . . . . 122 5.4 The Run-time Stack . . . . . . . . 126 5.5 MutableData andFunctions . . . . . . . 129 5.6 Predicate Functions . . . . . . . . 131 5.7 Top-DownDesign . . . . . . . . . 133 5.8 Bottom-UpDesign . . . . . . . . 134 5.9 RecursiveFunctions . . . . . . . . 134 5.10 The Main Function . . . . . . . . 136 5.11 Keyword Arguments . . . . . . . 139 5.12 Default Values . . . . . . . 140 5.13 Functions with Variable Number of Parameters . . . . . 140 5.14 Dictionary Parameter Passing . . . . . . . 141 5.15 Review Questions . . . . . . . . . 142 5.16 Exercises . . . . . . . . . 142 5.17 Solutions to Practice Problems . . . . . . 145 6 Event-Driven Programming . . . . . . 149 6.1 TheRootWindow. . . . . . . . . 150 6.2 Menus . . . . . . . 151 6.3 Frames . . . . . . . . . . 152 6.4 TheTextWidget . . . . . . . . . 152 6.5 TheButtonWidget . . . . . . . . 153 6.6 Creating a Reminder! . . . . . . . 154 6.7 Finishing up the Reminder! Application . . . . . 156 6.8 Label andEntryWidgets . . . . . 157 6.9 Layout Management . . . . . . . 158 6.10 Message Boxes . . . . . . 159 6.11 Review Questions . . . . . . . . . 160 6.12 Exercises . . . . . . . . . 161 6.13 Solutions to Practice Problems . . . . . . 164 7 Defining Classes . . . . . . . . 167 7.1 Creating an Object . . . . . . . . 168 7.2 Inheritance . . . . . . . . 172 7.3 ABouncingBallExample . . . . . . . . 178 7.4 Polymorphism. . . . . . . 180 7.5 Getting Hooked on Python . . . . . . . . 181 7.6 ReviewQuestions . . . . . . . . . 184 7.7 Exercises . . . . . . . . . 184 7.8 Solutions to Practice Problems . . . . . . 190 Appendix A Integer Operators . . . . . . . 193 Appendix B Float Operators . . . . . . . . 195 Appendix C String Operators and Methods . . . . . . . 197 Appendix D List Operators and Methods . . . . . 201 Appendix E Dictionary Operators and Methods . . . . . 203 Appendix F Turtle Methods . . . . . . . . 205 Appendix G TurtleScreen Methods . . . . . . . . 217 Appendix H The Reminder! Program . . . . . . . 225 Appendix I The Bouncing Ball Program . . . . . 227 Glossary . . . . . . . . . . . 231 References . . . . . . . . . . 237 Index . . . . . . . . . 239

    0
    48
    4.05MB
    2012-02-02
    0
  • O’Reilly.Head.First.Python.2011.pdf

    经典python入门书 Table of Contents (Summary) 1 Meet Python: Everyone Loves Lists 1 2 Sharing Your Code: Modules of Functions 33 3 Files and Exceptions: Dealing with Errors 73 4 Persistence: Saving Data to Files 105 5 Comprehending Data: Work That Data! 139 6 Custom Data Objects: Bundling Code with Data 173 7 Web Development: Putting It All Together 213 8 Mobile App Development: Small Devices 255 9 Manage Your Data: Handling Input 293 10 Scaling Your Webapp: Getting Real 351 11 Dealing with Complexity: Data Wrangling 397 i Leftovers: The Top Ten Things (We Didn’t Cover) 435

    0
    36
    28.2MB
    2012-02-02
    0
  • Pragmatic.Programmers.Programming.Concurrency.on.the.JVM.2011.pdf

    ontents Preface . . . . . . . . . . . . . xi 1. The Power and Perils of Concurrency . . . . . . 1 1.1 Threads: The Flow of Execution 1 1.2 The Power of Concurrency 2 1.3 The Perils of Concurrency 5 1.4 Recap 10 Part I — Strategies for Concurrency 2. Division of Labor . . . . . . . . . . . 15 2.1 From Sequential to Concurrent 15 2.2 Concurrency in IO-Intensive Apps 18 2.3 Speedup for the IO-Intensive App 25 2.4 Concurrency in Computationally Intensive Apps 25 2.5 Speedup for the Computationally Intensive App 31 2.6 Strategies for Effective Concurrency 33 2.7 Recap 34 3. Design Approaches . . . . . . . . . . 35 3.1 Dealing with State 35 3.2 Exploring Design Options 36 3.3 Shared Mutable Design 37 3.4 Isolated Mutable Design 37 3.5 Purely Immutable Design 38 3.6 Persistent/Immutable Data Structures 39 3.7 Selecting a Design Approach 42 3.8 Recap 43 Part II — Modern Java/JDK Concurrency 4. Scalability and Thread Safety . . . . . . . . 47 4.1 Managing Threads with ExecutorService 48 4.2 Coordinating Threads 49 4.3 Exchanging Data 58 4.4 Java 7 Fork-Join API 61 4.5 Scalable Collections 63 4.6 Lock vs. Synchronized 66 4.7 Recap 71 5. Taming Shared Mutability . . . . . . . . . 73 5.1 Shared Mutability != public 73 5.2 Spotting Concurrency Issues 74 5.3 Preserve Invariant 75 5.4 Mind Your Resources 76 5.5 Ensure Visibility 79 5.6 Enhance Concurrency 80 5.7 Ensure Atomicity 82 5.8 Recap 85 Part III — Software Transactional Memory 6. Introduction to Software Transactional Memory . . . 89 6.1 Synchronization Damns Concurrency 89 6.2 The Deficiency of the Object Model 90 6.3 Separation of Identity and State 91 6.4 Software Transactional Memory 92 6.5 Transactions in STM 96 6.6 Concurrency Using STM 97 6.7 Concurrency Using Akka/Multiverse STM 102 6.8 Creating Transactions 104 6.9 Creating Nested Transactions 111 6. 10 Configuring Akka Transactions 120 6. 11 Blocking Transactions—Sensible Wait 122 6. 12 Commit and Rollback Events 126 6. 13 Collections and Transactions 129 6. 14 Dealing with the Write Skew Anomaly 133 6. 15 Limitations of STM 136 6. 16 Recap 140 ? viii 7. STM in Clojure, Groovy, Java, JRuby, and Scala . . . 141 7.1 Clojure STM 142 7.2 Groovy Integration 142 7.3 Java Integration 146 7.4 JRuby Integration 149 7.5 Choices in Scala 156 7.6 Recap 158 Part IV — Actor-Based Concurrency 8. Favoring Isolated Mutability . . . . . . . . 163 8.1 Isolating Mutability Using Actors 164 8.2 Actor Qualities 165 8.3 Creating Actors 166 8.4 Sending and Receiving Messages 173 8.5 Working with Multiple Actors 178 8.6 Coordinating Actors 182 8.7 Using Typed Actors 190 8.8 Typed Actors and Murmurs 195 8.9 Mixing Actors and STM 201 8. 10 Using Transactors 202 8. 11 Coordinating Typed Actors 210 8. 12 Remote Actors 216 8. 13 Limitations of the Actor-Based Model 218 8. 14 Recap 219 9. Actors in Groovy, Java, JRuby, and Scala . . . . . 221 9.1 Actors in Groovy with GPars 221 9.2 Java Integration 235 9.3 JRuby Akka Integration 235 9.4 Choices in Scala 239 9.5 Recap 239 Part V — Epilogue 10. Zen of Programming Concurrency . . . . . . 243 10. 1 Exercise Your Options 243 10. 2 Concurrency: Programmer’s Guide 244 10. 3 Concurrency: Architect’s Guide 245 10. 4 Choose Wisely 246 ? ix A1. Clojure Agents . . . . . . . . . . . 249 A2. Web Resources . . . . . . . . . . . 255 A3. Bibliography . . . . . . . . . . . . 259 Index . . . . . . . . . . . . . 261

    5
    76
    3.91MB
    2012-02-02
    11
  • John.Wiley.&.Sons.Data.Structures.and.Algorithms.Using.Python.2011.pdf

    Contents Preface xiii Chapter 1: Abstract Data Types 1 1.1 Introduction...... . 1 1.1.1 Abstractions..... . 2 1.1.2 Abstract Data Types.... . . 3 1.1.3 Data Structures..... 5 1.1.4 General Definitions.... . . . 6 1.2 The Date Abstract Data Type.... . 7 1.2.1 Defining the ADT.... . . . . 7 1.2.2 Using the ADT..... 8 1.2.3 Preconditions and Postconditions... 9 1.2.4 Implementing the ADT.... . 10 1.3 Bags...... . . . . 14 1.3.1 The Bag Abstract Data Type... . . 15 1.3.2 Selecting a Data Structure... . . . 17 1.3.3 List-Based Implementation... . . . 19 1.4 Iterators...... . . . 20 1.4.1 Designing an Iterator.... . 21 1.4.2 Using Iterators..... 22 1.5 Application: Student Records.... . 23 1.5.1 Designing a Solution.... . . 23 1.5.2 Implementation..... 26 Exercises....... 28 Programming Projects..... . . . 29 Chapter 2: Arrays 33 2.1 The Array Structure..... . 33 2.1.1 Why Study Arrays?.... . . . 34 2.1.2 The Array Abstract Data Type... . . 34 2.1.3 Implementing the Array.... 36 2.2 The Python List..... . . . . 41 2.2.1 Creating a Python List.... . 41 2.2.2 Appending Items.... . . . . 42 2.2.3 Extending A List.... . . . . 44 2.2.4 Inserting Items..... 44 2.2.5 List Slice..... . . . 45 2.3 Two-Dimensional Arrays.... . . . . 47 2.3.1 The Array2D Abstract Data Type... 47 2.3.2 Implementing the 2-D Array... . . . 49 2.4 The Matrix Abstract Data Type.... 52 2.4.1 Matrix Operations.... . . . 53 2.4.2 Implementing the Matrix.... 55 2.5 Application: The Game of Life.... . 57 2.5.1 Rules of the Game.... . . . 57 2.5.2 Designing a Solution.... . . 59 2.5.3 Implementation..... 61 Exercises....... 64 Programming Projects..... . . . 65 Chapter 3: Sets and Maps 69 3.1 Sets....... 69 3.1.1 The Set Abstract Data Type... . . . 70 3.1.2 Selecting a Data Structure... . . . 72 3.1.3 List-Based Implementation... . . . 72 3.2 Maps...... . . . . 75 3.2.1 The Map Abstract Data Type... . . 76 3.2.2 List-Based Implementation... . . . 77 3.3 Multi-Dimensional Arrays.... . . . 80 3.3.1 The MultiArray Abstract Data Type.. . . . . 81 3.3.2 Data Organization.... . . . 81 3.3.3 Variable-Length Arguments... . . . 85 3.3.4 Implementing the MultiArray... . . . 86 3.4 Application: Sales Reports.... . . 89 Exercises....... 95 Programming Projects..... . . . 96 Chapter 4: Algorithm Analysis 97 4.1 Complexity Analysis..... . 97 4.1.1 Big-O Notation..... 99 4.1.2 Evaluating Python Code.... 104 4.2 Evaluating the Python List.... . . . 108 4.3 Amortized Cost..... . . . . 111 4.4 Evaluating the Set ADT.... . . . . 113 4.5 Application: The Sparse Matrix.... 115 4.5.1 List-Based Implementation... . . . 115 4.5.2 Efficiency Analysis.... . . . 120 Exercises....... 121 Programming Projects..... . . . 122 Chapter 5: Searching and Sorting 125 5.1 Searching...... . . 125 5.1.1 The Linear Search.... . . . 126 5.1.2 The Binary Search.... . . . 128 5.2 Sorting...... . . . 131 5.2.1 Bubble Sort..... . . 132 5.2.2 Selection Sort..... 136 5.2.3 Insertion Sort..... . 138 5.3 Working with Sorted Lists.... . . . 142 5.3.1 Maintaining a Sorted List... . . . . 142 5.3.2 Merging Sorted Lists.... . . 143 5.4 The Set ADT Revisited..... 147 5.4.1 A Sorted List Implementation... . . 147 5.4.2 Comparing the Implementations... 152 Exercises....... 152 Programming Projects..... . . . 153 Chapter 6: Linked Structures 155 6.1 Introduction...... . 156 6.2 The Singly Linked List..... 159 6.2.1 Traversing the Nodes.... . 159 6.2.2 Searching for a Node.... . 161 6.2.3 Prepending Nodes.... . . . 162 6.2.4 Removing Nodes.... . . . . 163 6.3 The Bag ADT Revisited.... . . . . 165 6.3.1 A Linked List Implementation... . . 165 6.3.2 Comparing Implementations... . . 167 6.3.3 Linked List Iterators.... . . 168 6.4 More Ways to Build a Linked List... . . . . 169 6.4.1 Using a Tail Reference.... . 169 6.4.2 The Sorted Linked List.... . 171 6.5 The Sparse Matrix Revisited.... . 174 6.5.1 An Array of Linked Lists Implementation.. . 175 6.5.2 Comparing the Implementations... 178 6.6 Application: Polynomials.... . . . . 179 6.6.1 Polynomial Operations.... . 179 6.6.2 The Polynomial ADT.... . . 181 6.6.3 Implementation..... 181 Exercises....... 189 Programming Projects..... . . . 190 Chapter 7: Stacks 193 7.1 The Stack ADT..... . . . . 193 7.2 Implementing the Stack.... . . . . 195 7.2.1 Using a Python List.... . . 195 7.2.2 Using a Linked List.... . . . 196 7.3 Stack Applications..... . . 198 7.3.1 Balanced Delimiters.... . . 199 7.3.2 Evaluating Postfix Expressions... . 202 7.4 Application: Solving a Maze.... . . 206 7.4.1 Backtracking..... . 207 7.4.2 Designing a Solution.... . . 208 7.4.3 The Maze ADT..... 211 7.4.4 Implementation..... 214 Exercises....... 218 Programming Projects..... . . . 219 Chapter 8: Queues 221 8.1 The Queue ADT..... . . . 221 8.2 Implementing the Queue.... . . . . 222 8.2.1 Using a Python List.... . . 222 8.2.2 Using a Circular Array.... . 224 8.2.3 Using a Linked List.... . . . 228 8.3 Priority Queues..... . . . . 230 8.3.1 The Priority Queue ADT.... 230 8.3.2 Implementation: Unbounded Priority Queue. . . . . 232 8.3.3 Implementation: Bounded Priority Queue.. 235 8.4 Application: Computer Simulations... . . . 237 8.4.1 Airline Ticket Counter.... . 237 8.4.2 Implementation..... 239 Exercises....... 244 Programming Projects..... . . . 246 Chapter 9: Advanced Linked Lists 247 9.1 The Doubly Linked List..... 247 9.1.1 Organization..... . 247 9.1.2 List Operations..... 248 9.2 The Circular Linked List.... . . . . 253 9.2.1 Organization..... . 253 9.2.2 List Operations..... 254 9.3 Multi-Linked Lists..... . . . 259 9.3.1 Multiple Chains..... 259 9.3.2 The Sparse Matrix.... . . . 260 9.4 Complex Iterators..... . . . 262 9.5 Application: Text Editor..... 263 9.5.1 Typical Editor Operations... . . . . 263 9.5.2 The Edit Buffer ADT.... . . 266 9.5.3 Implementation..... 268 Exercises....... 275 Programming Projects..... . . . 275 Chapter 10: Recursion 277 10.1 Recursive Functions..... . 277 10.2 Properties of Recursion.... . . . . 279 10.2.1 Factorials..... . . . 280 10.2.2 Recursive Call Trees.... . . 281 10.2.3 The Fibonacci Sequence... . . . . 283 10.3 How Recursion Works..... 283 10.3.1 The Run Time Stack.... . . 284 10.3.2 Using a Software Stack.... 286 10.3.3 Tail Recursion..... 289 10.4 Recursive Applications..... 290 10.4.1 Recursive Binary Search... . . . . 290 10.4.2 Towers of Hanoi.... . . . . 292 10.4.3 Exponential Operation.... . 296 10.4.4 Playing Tic-Tac-Toe.... . . 297 10.5 Application: The Eight-Queens Problem... 299 10.5.1 Solving for Four-Queens.... 301 10.5.2 Designing a Solution.... . . 303 Exercises....... 307 Programming Projects..... . . . 308 Chapter 11: Hash Tables 309 11.1 Introduction...... . 309 11.2 Hashing...... . . . 311 11.2.1 Linear Probing..... 312 11.2.2 Clustering..... . . . 315 11.2.3 Rehashing..... . . 318 11.2.4 Efficiency Analysis.... . . . 320 11.3 Separate Chaining..... . . 321 11.4 Hash Functions..... . . . . 323 11.5 The HashMap Abstract Data Type... . . . 325 11.6 Application: Histograms.... . . . . 330 11.6.1 The Histogram Abstract Data Type.. . . . . 330 11.6.2 The Color Histogram.... . . 334 Exercises....... 337 Programming Projects..... . . . 338 Chapter 12: Advanced Sorting 339 12.1 Merge Sort...... . 339 12.1.1 Algorithm Description.... . 340 12.1.2 Basic Implementation.... . 340 12.1.3 Improved Implementation... . . . . 342 12.1.4 Efficiency Analysis.... . . . 345 12.2 Quick Sort...... . . 347 12.2.1 Algorithm Description.... . 348 12.2.2 Implementation..... 349 12.2.3 Efficiency Analysis.... . . . 353 12.3 How Fast Can We Sort?.... . . . . 353 12.4 Radix Sort...... . . 354 12.4.1 Algorithm Description.... . 354 12.4.2 Basic Implementation.... . 356 12.4.3 Efficiency Analysis.... . . . 358 12.5 Sorting Linked Lists..... . 358 12.5.1 Insertion Sort..... . 359 12.5.2 Merge Sort..... . . 362 Exercises....... 367 Programming Projects..... . . . 368 Chapter 13: Binary Trees 369 13.1 The Tree Structure..... . . 369 13.2 The Binary Tree..... . . . . 373 13.2.1 Properties..... . . . 373 13.2.2 Implementation..... 375 13.2.3 Tree Traversals..... 376 13.3 Expression Trees..... . . . 380 13.3.1 Expression Tree Abstract Data Type.. . . . 382 13.3.2 String Representation.... . 383 13.3.3 Tree Evaluation..... 384 13.3.4 Tree Construction.... . . . 386 13.4 Heaps...... . . . . 390 13.4.1 Definition..... . . . 391 13.4.2 Implementation..... 395 13.4.3 The Priority Queue Revisited... . . 398 13.5 Heapsort...... . . 400 13.5.1 Simple Implementation.... 400 13.5.2 Sorting In Place.... . . . . 400 13.6 Application: Morse Code.... . . . . 404 13.6.1 Decision Trees..... 405 13.6.2 The ADT Definition.... . . . 406 Exercises....... 407 Programming Projects..... . . . 410 Chapter 14: Search Trees 411 14.1 The Binary Search Tree.... . . . . 412 14.1.1 Searching..... . . . 413 14.1.2 Min and Max Values.... . . 415 14.1.3 Insertions..... . . . 417 14.1.4 Deletions..... . . . 420 14.1.5 Efficiency of Binary Search Trees... 425 14.2 Search Tree Iterators..... . 427 14.3 AVL Trees...... . . 428 14.3.1 Insertions..... . . . 430 14.3.2 Deletions..... . . . 433 14.3.3 Implementation..... 435 14.4 The 2-3 Tree...... 440 14.4.1 Searching..... . . . 442 14.4.2 Insertions..... . . . 443 14.4.3 Efficiency of the 2-3 Tree... . . . . 449 Exercises....... 451 Programming Projects..... . . . 452 Appendix A: Python Review 453 A.1 The Python Interpreter..... 453 A.2 The Basics of Python..... 454 A.2.1 Primitive Types..... 455 A.2.2 Statements..... . . 456 A.2.3 Variables..... . . . 457 A.2.4 Arithmetic Operators.... . . 458 A.2.5 Logical Expressions.... . . 459 A.2.6 Using Functions and Methods... . 461 A.2.7 Standard Library.... . . . . 462 A.3 User Interaction..... . . . . 463 A.3.1 Standard Input..... 463 A.3.2 Standard Output.... . . . . 464 A.4 Control Structures..... . . 467 A.4.1 Selection Constructs.... . . 467 A.4.2 Repetition Constructs.... . 469 A.5 Collections...... . 472 A.5.1 Strings..... . . . . 472 A.5.2 Lists...... . 473 A.5.3 Tuples...... 475 A.5.4 Dictionaries..... . . 475 A.6 Text Files...... . . 477 A.6.1 File Access..... . . 477 A.6.2 Writing to Files..... 478 A.6.3 Reading from Files.... . . . 479 A.7 User-Defined Functions.... . . . . 480 A.7.1 The Function Definition.... 480 A.7.2 Variable Scope..... 483 A.7.3 Main Routine..... . 483 Appendix B: User-Defined Modules 485 B.1 Structured Programs..... . 485 B.2 Namespaces...... 486 Appendix C: Exceptions 489 C.1 Catching Exceptions..... . 489 C.2 Raising Exceptions..... . . 490 C.3 Standard Exceptions..... . 491 C.4 Assertions...... . . 491 Appendix D: Classes 493 D.1 The Class Definition..... . 493 D.1.1 Constructors..... . 494 D.1.2 Operations..... . . 495 D.1.3 Using Modules..... 497 D.1.4 Hiding Attributes.... . . . . 498 D.2 Overloading Operators..... 500 D.3 Inheritance...... . 502 D.3.1 Deriving Child Classes.... . 503 D.3.2 Creating Class Instances... . . . . 504 D.3.3 Invoking Methods.... . . . 505 D.4 Polymorphism..... . . . . 507

    5
    45
    10.19MB
    2012-02-02
    10
  • Addision.Wesley.The.Android.Developer’s.Cookbook.2011.pdf

    Addision.Wesley.The.Android.Developer’s.Cookbook.Building.Applications.with.the.Android.SDK.2011.pdf Contents at a Glance 1 Overview of Android 1 2 Application Basics: Activities and Intents 23 3 Threads, Services, Receivers, and Alerts 51 4 User Interface Layout 79 5 User Interface Events 117 6 Multimedia Techniques 147 7 Hardware Interface 169 8 Networking 195 9 Data Storage Methods 221 10 Location-Based Services 251 11 Advanced Android Development 277 12 Debugging 303 Index 317

    0
    64
    3.68MB
    2012-02-02
    12
  • Addision.Wesley.Android.Wireless.Application.Development.2nd.Edition.2011.pdf

    Contents at a Glance Introduction 1 I: An Overview of Android 1 Introducing Android 7 2 Setting Up Your Android Development Environment 29 3 Writing Your First Android Application 43 II: Android Application Design Essentials 4 Understanding the Anatomy of an Android Application 69 5 Defining Your Application Using the Android Manifest File 81 6 Managing Application Resources 97 III: Android User Interface Design Essentials 7 Exploring User Interface Screen Elements 133 8 Designing User Interfaces with Layouts 173 9 Drawing and Working with Animation 205 IV: Using Common Android APIs 10 Using Android Data and Storage APIs 231 11 Sharing Data Between Applications with Content Providers 259 12 Using Android Networking APIs 287 13 Using Android Web APIs 301 14 Using Location-Based Services (LBS) APIs 315 15 Using Android Multimedia APIs 335 16 Using Android Telephony APIs 353 17 Using Android 3D Graphics with OpenGL ES 367 18 Using the Android NDK 397 19 Using Android’s Optional Hardware APIs 407 V: More Android Application Design Principles 20 Working with Notifications 423 21 Working with Services 437 22 Extending Android Application Reach 451 23 Managing User Accounts and Synchronizing User Data 489 24 Handling Advanced User Input 499 25 Targeting Different Device Configurations and Languages 523 VI: Deploying Your Android Application to the World 26 The Mobile Software Development Process 551 27 Designing and Developing Bulletproof Android Applications 571 28 Testing Android Applications 585 29 Selling Your Android Application 597 VII: Appendixes A The Android Emulator Quick-Start Guide 613 B The Android DDMS Quick-Start Guide 635 C The Android Debug Bridge Quick-Start Guide 647 D Eclipse IDE Tips and Tricks 661 E The SQLite Quick-Start Guide 669 Index 683

    5
    71
    13.46MB
    2012-02-02
    10
  • Addision.Wesley.Algorithms.4th.Edition.2011.pdf

    A great algorithms book writen in JAVA. Preface . . . . . . . . . . . . . . . . . . . . . . . . .viii 1 Fundamentals . . . . . . . . . . . . . . . . . . . . . .3 1.1 Basic Programming Model 8 1.2 Data Abstraction 64 1.3 Bags, Queues, and Stacks 120 1.4 Analysis of Algorithms 172 1.5 Case Study: Union-Find 216 2 Sorting . . . . . . . . . . . . . . . . . . . . . . . 243 2.1 Elementary Sorts 244 2.2 Mergesort 270 2.3 Quicksort 288 2.4 Priority Queues 308 2.5 Applications 336 3 Searching . . . . . . . . . . . . . . . . . . . . . . 361 3.1 Symbol Tables 362 3.2 Binary Search Trees 396 3.3 Balanced Search Trees 424 3.4 Hash Tables 458 3.5 Applications 486 4 Graphs . . . . . . . . . . . . . . . . . . . . . . . 515 4.1 Undirected Graphs 518 4.2 Directed Graphs 566 4.3 Minimum Spanning Trees 604 4.4 Shortest Paths 638 5 Strings . . . . . . . . . . . . . . . . . . . . . . . 695 5.1 String Sorts 702 5.2 Tries 730 5.3 Substring Search 758 5.4 Regular Expressions 788 5.5 Data Compression 810 6 Context . . . . . . . . . . . . . . . . . . . . . . . 853 Index . . . . . . . . . . . . . . . . . . . . . . . . . 933 Algorithms . . . . . . . . . . . . . . . . . . . . . . 954 Clients . . . . . . . . . . . . . . . . . . . . . . . . 955

    5
    61
    23.94MB
    2012-02-02
    10
  • Wiley.Publishing.Professional.Android.2.Application.Development.2010.pdf

    INTRODUCTION................ xxvii CHAPTER 1 Hello, Android............. . 1 CHAPTER 2 Getting Started ............17 CHAPTER 3 Creating Applications and Activities ........ 49 CHAPTER 4 Creating User Interfaces .......... . . 85 CHAPTER 5 Intents, Broadcast Receivers, Adapters, and the Internet ............ 137 CHAPTER 6 Files, Saving State, and Preferences .......187 CHAPTER 7 Databases and Content Providers ........ . 209 CHAPTER 8 Maps, Geocoding, and Location-Based Services ..... 245 CHAPTER 9 Working in the Background ......... . . 285 CHAPTER 10 Invading the Phone-Top .......... . 327 CHAPTER 11 Audio, Video, and Using the Camera ....... . . 363 CHAPTER 12 Telephony and SMS........... . 389 CHAPTER 13 Bluetooth, Networks, andWi-Fi ........425 CHAPTER 14 Sensors .............457 CHAPTER 15 Advanced Android Development ........ . 477 INDEX.................. . . 529

    5
    85
    17.37MB
    2010-05-21
    10
  • Apress.Beginning.Android.2.2010.pdf

    ■Contents at a Glance .................... iv ■Contents...................... v ■About the Author........................ xiii ■Acknowledgments ......................xiv ■Preface.......................xv ■Chapter 1: The Big Picture ................... 1 ■Chapter 2: Projects and Targets ................ 5 ■Chapter 3: Creating a Skeleton Application ............... 17 ■Chapter 4: Using XML-Based Layouts.................. 23 ■Chapter 5: Employing Basic Widgets ................... 29 ■Chapter 6: Working with Containers.................... 39 ■Chapter 7: Using Selection Widgets............... 59 ■Chapter 8: Getting Fancy with Lists............... 75 ■Chapter 9: Employing Fancy Widgets and Containers ........... 95 ■Chapter 10: The Input Method Framework .............. 117 ■Chapter 11: Applying Menus.................. 125 ■Chapter 12: Fonts...................... 137 ■Chapter 13: Embedding the WebKit Browser................. 141 ■Chapter 14: Showing Pop-Up Messages.................. 149 ■Chapter 15: Dealing with Threads ............... 155 ■Chapter 16: Handling Activity Life Cycle Events ............ 167 ■Chapter 17: Creating Intent Filters .................... 171 ■Chapter 18: Launching Activities and Subactivities ............ 177 ■Chapter 19: Handling Rotation..................... 185 ■Chapter 20: Working with Resources ................ 197 ■Chapter 21: Using Preferences .................... 213 ■Chapter 22: Managing and Accessing Local Databases ............ 225 ■Chapter 23: Accessing Files................... 237 ■Chapter 24: Leveraging Java Libraries.............. 245 ■Chapter 25: Communicating via the Internet................. 253 ■Chapter 26: Using a Content Provider................ 259 ■Chapter 27: Building a Content Provider ................. 265 ■Chapter 28: Requesting and Requiring Permissions ........... 275 ■Chapter 29: Creating a Service .................... 279 ■Chapter 30: Invoking a Service.................... 285 ■Chapter 31: Alerting Users via Notifications.................. 289 ■Chapter 32: Accessing Location-Based Services................. 295 ■Chapter 33: Mapping with MapView and MapActivity............... 301 ■Chapter 34: Handling Telephone Calls ............... 311 ■Chapter 35: Development Tools ................... 315 ■Chapter 36: Handling Multiple Screen Sizes.................. 331 ■Chapter 37: Dealing with Devices................ 353 ■Chapter 38: Handling Platform Changes.................. 359 ■Chapter 39: Where Do We Go from Here? ................ 367 ■Index ....................... 369

    0
    126
    10.01MB
    2010-05-21
    0
关注 私信
上传资源赚积分or赚钱