Jump to content

Nytro

Administrators
  • Posts

    18725
  • Joined

  • Last visited

  • Days Won

    706

Everything posted by Nytro

  1. Ethiopian multiplication A method of multiplying integers using only addition, doubling, and halving. Method: Take two numbers to be multiplied and write them down at the top of two columns. In the left-hand column repeatedly halve the last number, discarding any remainders, and write the result below the last in the same column, until you write a value of 1. In the right-hand column repeatedly double the last number and write the result below. stop when you add a result in the same row as where the left hand column shows 1. Examine the table produced and discard any row where the value in the right column is even. Sum the values in the right-hand column that remain to produce the result of multiplying the original two numbers together In fine, nu asta e ideea. Ideea e ca acest algoritm e scris intr-o gramada de limbaje. Asa puteti vedea cum arata un cod scris intr-o multitudine de limbaje si poate o sa va placa unul si o sa il invatati. Link: http://rosettacode.org/wiki/Ethiopian_Multiplication
  2. Version Control with Subversion The Standard in Open Source Version Control Version Control with Subversion Introduction This is the online home of Version Control with Subversion, a free book about Subversion, a new version control system designed to supplant CVS. As you may have guessed from the layout of this page, this book is published by O'Reilly Media. This is a place to read HTML and PDF versions of the book (although you can certainly buy a copy if you'd like to). We'll do our best to keep the site up-to-date. As Subversion development continues, the product will continue to grow new features, and we plan to continue documenting those changes. 2ND EDITION RELEASED: The second edition of Version Control with Subversion is now available for purchase! Order your physical copy today, or add the book to your virtual library using the Safari Books Online service. Download: http://svnbook.red-bean.com/en/1.5/svn-book.pdf Sursa: Version Control with Subversion
  3. The Scheme Programming Language Fourth Edition R. Kent Dybvig Illustrations by Jean-Pierre Hébert Table of Contents * Preface * Chapter 1. Introduction o Section 1.1. Scheme Syntax o Section 1.2. Scheme Naming Conventions o Section 1.3. Typographical and Notational Conventions * Chapter 2. Getting Started o Section 2.1. Interacting with Scheme o Section 2.2. Simple Expressions o Section 2.3. Evaluating Scheme Expressions o Section 2.4. Variables and Let Expressions o Section 2.5. Lambda Expressions o Section 2.6. Top-Level Definitions o Section 2.7. Conditional Expressions o Section 2.8. Simple Recursion o Section 2.9. Assignment * Chapter 3. Going Further o Section 3.1. Syntactic Extension o Section 3.2. More Recursion o Section 3.3. Continuations o Section 3.4. Continuation Passing Style o Section 3.5. Internal Definitions o Section 3.6. Libraries * Chapter 4. Procedures and Variable Bindings o Section 4.1. Variable References o Section 4.2. Lambda o Section 4.3. Case-Lambda o Section 4.4. Local Binding o Section 4.5. Multiple Values o Section 4.6. Variable Definitions o Section 4.7. Assignment * Chapter 5. Control Operations o Section 5.1. Procedure Application o Section 5.2. Sequencing o Section 5.3. Conditionals o Section 5.4. Recursion and Iteration o Section 5.5. Mapping and Folding o Section 5.6. Continuations o Section 5.7. Delayed Evaluation o Section 5.8. Multiple Values o Section 5.9. Eval * Chapter 6. Operations on Objects o Section 6.1. Constants and Quotation o Section 6.2. Generic Equivalence and Type Predicates o Section 6.3. Lists and Pairs o Section 6.4. Numbers o Section 6.5. Fixnums o Section 6.6. Flonums o Section 6.7. Characters o Section 6.8. Strings o Section 6.9. Vectors o Section 6.10. Bytevectors o Section 6.11. Symbols o Section 6.12. Booleans o Section 6.13. Hashtables o Section 6.14. Enumerations * Chapter 7. Input and Output o Section 7.1. Transcoders o Section 7.2. Opening Files o Section 7.3. Standard Ports o Section 7.4. String and Bytevector Ports o Section 7.5. Opening Custom Ports o Section 7.6. Port Operations o Section 7.7. Input Operations o Section 7.8. Output Operations o Section 7.9. Convenience I/O o Section 7.10. Filesystem Operations o Section 7.11. Bytevector/String Conversions * Chapter 8. Syntactic Extension o Section 8.1. Keyword Bindings o Section 8.2. Syntax-Rules Transformers o Section 8.3. Syntax-Case Transformers o Section 8.4. Examples * Chapter 9. Records o Section 9.1. Defining Records o Section 9.2. Procedural Interface o Section 9.3. Inspection * Chapter 10. Libraries and Top-Level Programs o Section 10.1. Standard Libraries o Section 10.2. Defining New Libraries o Section 10.3. Top-Level Programs o Section 10.4. Examples * Chapter 11. Exceptions and Conditions o Section 11.1. Raising and Handling Exceptions o Section 11.2. Defining Condition Types o Section 11.3. Standard Condition Types * Chapter 12. Extended Examples o Section 12.1. Matrix and Vector Multiplication o Section 12.2. Sorting o Section 12.3. A Set Constructor o Section 12.4. Word Frequency Counting o Section 12.5. Scheme Printer o Section 12.6. Formatted Output o Section 12.7. A Meta-Circular Interpreter for Scheme o Section 12.8. Defining Abstract Objects o Section 12.9. Fast Fourier Transform o Section 12.10. A Unification Algorithm o Section 12.11. Multitasking with Engines * References * Answers to Selected Exercises * Formal Syntax * Summary of Forms * Index Online: http://www.scheme.com/tspl4/
  4. Programming Scala Dean Wampler Object Mentor, Inc. <dean@deanwampler.com> Alex Payne Twitter, Inc. <alex@al3x.net> Copyright © 2008 O’Reilly Media This work has been released under the Creative Commons Attribution-Noncommercial. Abstract Programming Scala introduces an exciting new language that offers all the benefits of a modern object model, functional programming, and an advanced type system. Packed with code examples, this comprehensive book teaches you how to be productive with Scala quickly, and explains what makes this language ideal for today's highly scalable, component-based applications that support concurrency and distribution. You'll also learn the advantages that Scala offers as a language for the Java Virtual Machine. Learn more at programmingscala.com or at the book's catalog page. Preface Welcome to Programming Scala Conventions Used in This Book Using Code Examples Getting the Code Examples Safari® Books Online How to Contact Us Acknowledgements 1. Zero to Sixty: Introducing Scala Why Scala? If You Are a Java Programmer… If You Are a Ruby, Python, etc. Programmer… Introducing Scala The Seductions of Scala Installing Scala For More Information A Taste of Scala A Taste of Concurrency Recap and What’s Next 2. Type Less, Do More In This Chapter Semicolons Variable Declarations Method Declarations Method Default and Named Arguments (Scala Version 2.8) Nesting Method Definitions Inferring Type Information Literals Integer Literals Floating Point Literals Boolean Literals Character Literals String Literals Symbol Literals Tuples Option, Some, and None: Avoiding nulls Organizing Code in Files and Namespaces Importing Types and Their Members Imports are Relative Abstract Types And Parameterized Types Reserved Words Recap and What’s Next 3. Rounding Out the Essentials Operator? Operator? Syntactic Sugar Methods Without Parentheses and Dots Precedence Rules Domain-Specific Languages Scala if Statements Scala for Comprehensions A Dog-Simple Example Filtering Yielding Expanded Scope Other Looping Constructs Scala while Loops Scala do-while Loops Generator Expressions Conditional Operators Pattern Matching A Simple Match Variables in Matches Matching on Type Matching on Sequences Matching on Tuples (and Guards) Matching on Case Classes Matching on Regular Expressions Binding Nested Variables in Case Clauses Using try, catch, and finally Clauses Concluding Remarks on Pattern Matching Enumerations Recap and What’s Next 4. Traits Introducing Traits Traits as Mixins Stackable Traits Constructing Traits Class or Trait? Recap and What’s Next 5. Basic Object-Oriented Programming in Scala Class and Object Basics Parent Classes Constructors in Scala Calling Parent Class Constructors Nested Classes Visibility Rules Public Visibility Protected Visibility Private Visibility Scoped Private and Protected Visibility Final Thoughts on Visibility Recap and What’s Next 6. Advanced Object-Oriented Programming In Scala Overriding Members of Classes and Traits Attempting to Override final Declarations Overriding Abstract and Concrete Methods Overriding Abstract and Concrete Fields Overriding Abstract and Concrete Fields in Traits Overriding Abstract and Concrete Fields in Classes Overriding Abstract Types When Accessor Methods and Fields Are Indistinguishable: The Uniform Access Principle Companion Objects Apply Unapply Apply and UnapplySeq for Collections Companion Objects and Java Static Methods Case Classes Syntactic Sugar for Binary Operations The copy Method in Scala Version 2.8 Case Class Inheritance Equality of Objects The equals Method The == and != Methods The ne and eq Methods Array Equality and the sameElements Method Recap and What’s Next 7. The Scala Object System The Predef Object Classes and Objects: Where Are the Statics? Package Objects Sealed Class Hierarchies The Scala Type Hierarchy Linearization of an Object’s Hierarchy Recap and What’s Next 8. Functional Programming in Scala What Is Functional Programming? Functions in Mathematics Variables that Aren’t Functional Programming in Scala Function Literals and Closures Purity Inside vs. Outside Recursion Tail Calls and Tail-Call Optimization Trampoline for Tail Calls Functional Data Structures Lists in Functional Programming Maps in Functional Programming Sets in Functional Programming Other Data Structures in Functional Programming Traversing, Mapping, Filtering, Folding, and Reducing Traversal Mapping Filtering Folding and Reducing Functional Options Pattern Matching Partial Functions Currying Implicits Implicit Conversions Implicit Function Parameters Final Thoughts on Implicits Call by Name, Call by Value Lazy Vals Recap: Functional Component Abstractions 9. Robust, Scalable Concurrency with Actors The Problems of Shared, Synchronized State Actors Actors in Abstract Actors in Scala Sending Messages to Actors The Mailbox Actors in Depth Effective Actors Traditional Concurrency in Scala: Threading and Events One-Off Threads Using java.util.concurrent Events Recap and What’s Next 10. Herding XML in Scala Reading XML Exploring XML Looping & Matching XML Writing XML A Real-World Example Recap and What’s Next 11. Domain-Specific Languages in Scala Internal DSLs A Payroll Internal DSL Infix Operator Notation Implicit Conversions and User Defined Types Apply Methods Payroll Rules DSL Implementation Internal DSLs: Final Thoughts External DSLs with Parser Combinators About Parser Combinators A Payroll External DSL A Scala Implementation of the External DSL Grammar Generating Paychecks with the External DSL Internal vs. External DSLs: Final Thoughts Recap and What’s Next 12. The Scala Type System Reflecting on Types Understanding Parameterized Types Manifests Parameterized Methods Variance Under Inheritance Variance of Mutable Types Variance In Scala vs. Java Implementation Notes Type Bounds Upper Type Bounds Lower Type Bounds A Closer Look at Lists Views and View Bounds Nothing and Null Understanding Abstract Types Parameterized Types vs. Abstract Types Path-Dependent Types C.this C.super path.x Value Types Type Designators Tuples Parameterized Types Annotated Types Compound Types Infix Types Function Types Type Projections Singleton Types Self Type Annotations Structural Types Existential Types Infinite Data Structures and Laziness Recap and What’s Next 13. Application Design Annotations Enumerations vs. Pattern Matching Thoughts On Annotations and Enumerations Enumerations vs. Case Classes and Pattern Matching Using Nulls vs. Options Options and For Comprehensions Exceptions and the Alternatives Scalable Abstractions Fine-Grained Visibility Rules Mixin Composition Self-Type Annotations and Abstract Type Members Effective Design of Traits Design Patterns The Visitor Pattern: A Better Alternative Dependency Injection in Scala: The Cake Pattern Better Design with Design By Contract Recap and What’s Next 14. Scala Tools, Libraries and IDE Support Command Line Tools scalac Command Line Tool The scala Command Line Tool The scalap, javap, and jad Command Line Tools The scaladoc Command Line Tool The sbaz Command Line Tool The fsc Command Line Tool Build Tools Integration with IDEs Eclipse IntelliJ NetBeans Text Editors Test-Driven Development in Scala ScalaTest Specs ScalaCheck Other Notable Scala Libraries and Tools Lift Scalaz Scalax MetaScala JavaRebel Miscellaneous Smaller Libraries Java Interoperability Java and Scala Generics Using Scala Functions in Java JavaBean Properties AnyVal Types and Java Primitives Scala Names in Java Code Java Library Interoperability AspectJ The Spring Framework Terracotta Hadoop Recap and What’s Next Glossary A. References Index Online: http://programming-scala.labs.oreilly.com/index.html
  5. Ruby Best Practices We can all write better Ruby code Though we don't like to admit it, all hackers churn out bad code from time to time. But most coders worth their salt also have it in them to produce software that is truly elegant without sacrificing practicality. Because we value our craft, its important to know the difference between code that is agile, and code that is fragile. Ruby Best Practices aims to help Ruby developers from a wide range of skill levels improve their fundamental understanding of the language via exposure to the common practices and idioms that many seasoned Rubyists take for granted. With a strong emphasis on exploring real codebases, and an understanding that beautiful solutions depend heavily on context, this book lays out a clear road map to Ruby mastery for those who wish to pursue it. Download: http://sandal.github.com/rbp-book/pdfs/rbp_1-0.pdf Sursa: Ruby Best Practices - Book
  6. Programming Ruby The Pragmatic Programmer's Guide Preface This book is a tutorial and reference for the Ruby programming language. Use Ruby, and you'll write better code, be more productive, and enjoy programming more. These are bold claims, but we think that after reading this book you'll agree with them. And we have the experience to back up this belief. As Pragmatic Programmers we've tried many, many languages in our search for tools to make our lives easier, for tools to help us do our jobs better. Until now, though, we'd always been frustrated by the languages we were using. Our job is to solve problems, not spoonfeed compilers, so we like dynamic languages that adapt to us, without arbitrary, rigid rules. We need clarity so we can communicate using our code. We value conciseness and the ability to express a requirement in code accurately and efficiently. The less code we write, the less that can go wrong. (And our wrists and fingers are thankful, too.) We want to be as productive as possible, so we want our code to run the first time; time spent in the debugger is time stolen from the development clock. It also helps if we can try out code as we edit it; if you have to wait for a 2-hour make cycle, you may as well be using punch cards and submitting your work for batch compilation. We want a language that works at a high level of abstraction. The higher level the language, the less time we spend translating our requirements into code. When we discovered Ruby, we realized that we'd found what we'd been looking for. More than any other language with which we have worked, Ruby stays out of your way. You can concentrate on solving the problem at hand, instead of struggling with compiler and language issues. That's how it can help you become a better programmer: by giving you the chance to spend your time creating solutions for your users, not for the compiler. Online: http://www.ruby-doc.org/docs/ProgrammingRuby/
  7. Learn Python The Hard Way This is the site for the book "Learn Python The Hard Way". The book is a very beginner book for people who want to learn to code. If you can already code then the book will probably drive you insane. It's intended for people who have no coding chops to build up their skills before starting a more detailed book. About The Book The book is very simple: * 52 exercises in all. * 26 cover just input/output, variables, and functions. * 26 cover logic (boolean algebra, if-statements, while-loops, etc.) Each exercise is one or two pages and follows the exact same format. You type each one in (no copy-paste!), make it run, do the extra credit, and then move on. If you get stuck, at least type it in and skip the extra credit for later. Download: http://learnpythonthehardway.org/static/LearnPythonTheHardWay.pdf
  8. Python for Fun Purpose of this Collection This collection is a presentation of several small Python programs. They are aimed at intermediate programmers; people who have studied Python and are fairly comfortable with basic recursion and object oriented techniques. Each program is very short, never more than a couple of pages and accompanied with a write-up. I have found Python to be an excellent language to express algorithms clearly. Some of the ideas here originated in other programs in other languages. But in most cases I developed code from scratch from just an outline of an idea. However "Lisp in Python" was almost a translation exercise from John McCarthy's original "Evalquote in Lisp". From many years of programming these are some of my favorite programs. I hope you enjoy them as much as I do. I look forward to hearing from readers, especially folks with suggestions for improvements, ideas for new projects, or people who are doing similar things. You can email me at mailme.html Many thanks to Paul Carduner and Jeff Elkner for their work on this page, especially for Paul's graphic of "Psyltherin" (apologies to Harry Potter) and to the Twisted developement team for their Lore documentation generator to which all the other web pages in this collection have been recently adapted. Chris Meyers The Collection Items with a "*" have been recently added or updated * A Simple Video Game * Queues, Trees and Water Buckets * Towers of Hanoi * Animal Trees * Building a GUI with Tkinter * Using SQL with the GUI * Building a GUI with wxPython * Erlang for Python Programmers * * Erlang Concurrency: Logic Circuits revisted * * Forth in Python * * Lisp in Python * Prolog in Python (Introduction) * * Prolog in Python (Part 1) * * Prolog in Python (Part 2) * * Prolog in Python (Part 3) * * Squeezing Bits. Huffman Data Compression * * Natural Language Processing * Classic AI. Semantic Information Retrival * Unicode support in Python * Logic Circuits * Logic Circuits (more) * Simulator for Toy Computer * Assembler for Toy Computer * Compiler for Toy Computer * Using SQL with Python * Waves and Harmonics * Online: http://www.openbookproject.net/py4fun/
  9. Nytro

    Think Python

    Think Python How to Think Like a Computer Scientist Version 1.1.24 Allen Downey Green Tea Press Needham, Massachusetts Download: http://www.greenteapress.com/thinkpython/thinkpython.pdf
  10. Practical PostgreSQL John Worsley Command Prompt, Inc. Joshua Drake Command Prompt, Inc. Edited by Andrew Brookins Michael Holloway Copyright © 2001-2002 by Commandprompt, Inc Copyright © 2001 by Command Prompt, Inc. This material may be distributed only subject to the terms and conditions set forth in the Open Publication License, v1.0 or later (the latest version is presently available at http://www.opencontent.org/openpub/). 'Distribution of substantively modified versions of this document is prohibited without the explicit permission of the copyright holder.' to the license reference or copy. 'Distribution of the work or derivative of the work in any standard (paper) book form is prohibited unless prior permission is obtained from the copyright holder.' to the license reference or copy. Although every reasonable effort has been made to incorporate accurate and useful information into this book, the copyright holders make no representation about the suitability of this book or the information therein for any purpose. It is provided "as is" without expressed or implied warranty. Table of Contents Preface Who Is the Intended Audience? Structure of This Book Platform and Version Used What Is Included on the CD? Conventions Used in This Book Acknowledgments Comments and Questions I. Introduction and Installation 1. What is PostgreSQL? Open Source Free Version PostgreSQL Feature Set Where to Proceed from Here 2. Installing PostgreSQL Preparing for Installation 10 Steps to Installing PostgreSQL II. Using PostgreSQL 3. Understanding SQL Introduction to SQL Introduction to Relational Databases SQL Statements Data Types Tables in PostgreSQL 4. Using SQL with PostgreSQL Introduction to psql Using Tables Adding Data with INSERT and COPY Retrieving Rows with SELECT Modifying Rows with UPDATE Removing Rows with DELETE Using Sub-Queries Using Views Further SQL Application 5. Operators and Functions Operators Functions 6. PostgreSQL Clients The psql Client: Advanced Topics PgAccess: A Graphical Client 7. Advanced Features Indices Advanced Table Techniques Arrays Automating Common Routines Transactions and Cursors Extending PostgreSQL III. Administrating PostgreSQL 8. Authentication and Encryption Client Authentication Encrypting sessions 9. Database Management Starting and Stopping PostgreSQL Initializing the Filesystem Creating and Removing a Database Maintaining a Database Backing Up and Restoring Data 10. User and Group Management Managing Users Managing Groups Granting Privileges IV. Programming with PostgreSQL 11. PL/pgSQL Adding PL/pgSQL to your Database Language Structure Using Variables Controlling Program Flow PL/pgSQL and Triggers 12. JDBC Building the PostgreSQL JDBC Driver Using the PostgreSQL Driver Using JDBC Issues Specific to PostgreSQL and JDBC 13. LXP Why Use LXP? Core Features Installing and Configuring LXP Understanding LXP Mark-Up LXP Variables and Objects Using Cookies with LXP Tag Parsing Branching Logic Loop Iteration Content Inclusion Displaying Foreign Tags with <xtag> V. PostgreSQL Command Reference 14. PostgreSQL Command Reference ABORT -- Rolls back changes made during a transaction block. ALTER GROUP -- Modifies the structure of a user group. ALTER TABLE -- Modifies table and column attributes. ALTER USER -- Modifies user properties and permissions. BEGIN -- Starts a chained-mode transaction block. CLOSE -- Closes a previously defined cursor object. CLUSTER -- Provides the backend server with clustering information about a table. COMMENT -- Adds a comment to an object within the database. COMMIT -- Ends the current transaction block and finalizes changes made within it. COPY -- Copies data between files and tables. CREATE AGGREGATE -- Defines a new aggregate function within the database. CREATE DATABASE -- Creates a new database in PostgreSQL. CREATE FUNCTION -- Defines a new function within the database. CREATE GROUP -- Creates a new PostgreSQL group within the database. CREATE INDEX -- Places an index on a table. CREATE LANGUAGE -- Defines a new language to be used by functions. CREATE OPERATOR -- Defines a new operator within the database. CREATE RULE -- Defines a new rule on a table. CREATE SEQUENCE -- Creates a new sequence number generator. CREATE TABLE -- Creates a new table. CREATE TABLE AS -- Creates a new table built from data retrieved by a SELECT. CREATE TRIGGER -- Creates a new trigger. CREATE TYPE -- Defines a new data type for use in the database. CREATE USER -- Creates a new PostgreSQL database user. CREATE VIEW -- Creates a view on a table. CURRENT_DATE -- Returns the current date. CURRENT_TIME -- Returns the current time. CURRENT_TIMESTAMP -- Returns the current date and time. CURRENT_USER -- Returns the current database username. DECLARE -- Defines a new cursor. DELETE -- Removes rows from a table. DROP AGGREGATE -- Removes an aggregate function from a database. DROP DATABASE -- Removes a database from the system. DROP FUNCTION -- Removes a user-defined function. DROP GROUP -- Removes a user group from the database. DROP INDEX -- Removes an index from a database. DROP LANGUAGE -- Removes a procedural language from a database. DROP OPERATOR -- Removes an operator from the database. DROP RULE -- Removes a rule from a database. DROP SEQUENCE -- Removes a sequence from a database. DROP TABLE -- Removes a table from a database. DROP TRIGGER -- Removes a trigger definition from a database. DROP TYPE -- Removes a type from the system catalogs. DROP USER -- Removes a PostgreSQL user. DROP VIEW -- Removes an existing view from a database. END -- Ends the current transaction block and finalizes its modifications. EXPLAIN -- Shows the statement execution plan for a supplied query. FETCH -- Retrieves rows from a cursor. GRANT -- Grants access privileges to a user, a group, or to all users in the database. INSERT -- Inserts new rows into a table. LISTEN -- Listen for a notification event. LOAD -- Dynamically loads object files into a database. LOCK -- Locks a table within a transaction. MOVE -- Repositions a cursor to another row. NOTIFY -- Signals all backends that are listening for the specified notify event. REINDEX -- Rebuilds indices on tables. RESET -- Restores runtime variables to their default settings. REVOKE -- Revokes access privileges from a user, a group, or all users. ROLLBACK -- Aborts the current transaction block and abandons any modifications it would have made. SELECT -- Retrieves rows from a table or view. SELECT INTO -- Construct a new table from the results of a SELECT. SET -- Set runtime variables. SET CONSTRAINTS -- Sets the constraint mode for the current transaction block. SET TRANSACTION -- Sets the transaction isolation level for the current transaction block. SHOW -- Displays the values of runtime variables. TRUNCATE -- Empties the contents of a table. UNLISTEN -- Stops the backend process from listening for a notification event. UPDATE -- Modifies the values of column data within a table. VACUUM -- Cleans and analyzes a database. VI. Appendixes A. Multibyte Encoding Types B. Backend Options for postgres C. Binary COPY Format The Header Tuples Trailer D. Internal psql Variables Online: http://www.commandprompt.com/ppbook/
  11. Learn Prolog Now Learn Prolog Now! is an introductory course to programming in Prolog. The online version has been available since 2001, and now there is also a throughly revised version available in book form. We wanted to do two things with this course. First, we wanted to provide a text that was relatively self contained, a text that would permit someone with little or no knowledge of computing to pick up the basics of Prolog with the minimum of fuss. We also wanted the text to be clear enough to make it useful for self study. We believe that if you read the text, and do the associated exercises, you will gain a useful partial entry to the world of Prolog. But only a partial entry, and this brings us to our second point. We want to emphasize the practical aspects of Prolog. Prolog is something you do. You can't learn a programming language simply by reading about it, and if you really want to get the most out of this course, we strongly advise you to get hold of a Prolog interpreter (you'll find pointers to some nice ones on this website) and work through all the Practical Sessions that we provide. And of course, don't stop with what we provide. The more you program, the better you'll get.... We hope you enjoy the course. And whether you're using this book to teach yourself Prolog, or you're using it as the basis for teaching others, we would like to hear from you. Please send us any comments/corrections you have so that we can take them into account in later versions. Patrick Blackburn, Johan Bos and Kristina Striegnitz * Table of Contents * 1 Facts, Rules, and Queries * 2 Matching and Proof Search * 3 Recursion * 4 Lists * 5 Arithmetic * 6 More Lists * 7 Definite Clause Grammars * 8 More Definite Clause Grammars * 9 A Closer Look at Terms * 10 Cuts and Negation * 11 Database Manipulation and Collecting Solutions * 12 Working With Files Online: http://www.learnprolognow.org/
  12. Master-PowerShell With Dr. Tobias Weltner # Chapter 1. The PowerShell Console Welcome to PowerShell! This chapter will introduce you to the PowerShell console and show you how to configure it, including font colors and sizes, editing and display options. # Chapter 2. Interactive PowerShell PowerShell has two faces: interactivity and script automation. In this chapter, you will first learn how to work with PowerShell interactively. Then, we will take a look at PowerShell scripts. # Chapter 3. Variables It is time to combine commands whenever a single PowerShell command can't solve your problem. One way of doing this is by using variables. PowerShell can store results of one command in a variable and then pass the variable to another command. In addition, variables are rich 'objects' and can do much more than simply store data. In this chapter, we'll explain what variables are and how you can use them to solve complex problems. # Chapter 4. Arrays and Hashtables No matter how many results a command returns, you can always store the results in a variable because of a clever trick. PowerShell automatically wraps results into an array when there is more than one result. In this chapter, you'll learn how arrays work. You'll also discover a special type of array, a hash table. While normal arrays use a numeric index to access their elements, hash tables use key-value-pairs. # Chapter 5. The PowerShell Pipeline The PowerShell pipeline chains together a number of commands similar to a production assembly. So, one command hands over its result to the next, and at the end, you receive the result. # Chapter 6. Using Objects PowerShell always works with objects. Whenever you output objects into the PowerShell console, PowerShell automatically converts the rich objects into readable text. In this chapter, you will learn what objects are and how to get your hands on PowerShell objects before they get converted to simple text. # Chapter 7. Conditions You'll need a condition first to compose intelligent PowerShell code capable of making decisions. That's why you'll learn in the first part of this Chapter how to formulate questions as conditions. In the second part, you'll employ conditions to execute PowerShell instructions only if a particular condition is actually met. # Chapter 8. Loops Loops are a good example that iterations do not have to be boring. They repeat particular PowerShell statements with the pipeline being one of the areas where you can benefit from loops. Most PowerShell commands wrap their results in arrays, and you'll need a loop when you want to examine single elements in an array more closely. # Chapter 9. Functions PowerShell has the purpose of solving problems, and the smallest tool it comes equipped with for this is commands. By now you should be able to appreciate the great diversity of the PowerShell command repertoire: in the first two chapters, you already learned how to use the built-in PowerShell commands called cmdlets, as well as innumerable external commands, such as ping or ipconfig. In Chapter 6, the objects of the .NET framework, API calls, and COM component statements were added, providing you with a powerful arsenal of commands. In Chapters 3-5, command chains forged out of these countless single commands combined statements either by using variables or the PowerShell pipeline. The next highest level of automation is functions, which are self-defined commands that internally use all of the PowerShell mechanisms you already know, including the loops and conditions covered in the last two chapters. You can also use functions to get the better of the more complex problems that consist of many separate instructions and sequences. # Chapter 10. Scripts PowerShell scripts function like batch files in the traditional console: scripts are text files that can include any PowerShell code. If you run a PowerShell script, PowerShell will read the instructions in it, and then execute them. As a result, scripts are ideal for complex automation tasks. In this chapter, you'll learn how to create and execute scripts. PowerShell makes certain requirements mandatory for their execution because scripts can contain potentially dangerous statements. Depending on the security setting and storage location, scripts must have a digital signature or be specified with their absolute or relative path names. These security aspects will also be covered in this chapter. # Chapter 11. Finding and Avoiding Errors The more complex your commands, pipelines, functions, or scripts become, the more often that errors can creep in. PowerShell has its own remedies for finding and correcting errors at various levels of complexity. In simple cases, use "what-if" scenarios to check whether a command or a pipeline is really doing what you expect it to do. With the help of such scenarios, you can simulate the result of commands without actually executing the commands. You can permit commands to do their work only after you're convinced that the commands will function flawlessly. If you've written your own functions or scripts, PowerShell can also step through the code and halt its execution at locations called breakpoints, which allow you to examine functions or scripts more closely at these locations. You can verify whether variables actually do contain an expected result. Moreover, PowerShell offers you the option of integrating debugging messages into functions or scripts. This enables your code to output progress reports to you at key locations when your code is in the development stage. # Chapter 12. Command Discovery and Scriptblocks In previous chapters you learned step by step how to use various PowerShell command types and mechanisms. After 11 chapters, we have reached the end of the list. You'll now put together everything you've seen. All of it can actually be reduced to just two PowerShell basic principles: command discovery and scriptblocks. The purpose of this chapter is to tie up the many loose ends of previous chapters and to weave them into a larger whole: the basics are complete and the remaining chapters will put the knowledge gained to the test of daily tasks. # Chapter 13. Text and Regular Expressions PowerShell distinguishes sharply between text in single quotation marks and text in double quotation marks. PowerShell won't modify text wrapped in single quotation marks but it does inspect text in single quotation marks and may modify it by inserting variable contents automatically. Enclosing text in double quotation marks is the foremost and easiest way to couple results and descriptions. The formatting operator -f, one of many specialized string operators, offers more options. For example, you can use -f to output text column-by-column and to set it flush. Other string commands are also important. They can replace selected text, change case, and much more. Pattern recognition adds a layer of complexity because it uses wildcard characters to match patterns. In simple cases, you can use the same wildcards that you use in the file system. Substantially more powerful, but also more complex, are regular expressions. # Chapter 14. XML Raw information used to be stored in comma-separated lists or .ini files, but for some years the XML standard has prevailed. XML is an acronym for Extensible Markup Language and is a descriptive language for any structured information. In the past, handling XML was difficult, but PowerShell now has excellent XML support. With its help, you can comfortably wrap data in XML as well as read existing XML files. # Chapter 15. The File System The file system has special importance within the PowerShell console. One obvious reason is that administrators perform many tasks that involve the file system. Another is that the file system is the prototype of a hierarchically structured information system. In coming chapters, you'll see that PowerShell controls other hierarchical information systems on this basis. You can easily apply what you have learned about drives, directories, and files in PowerShell to other areas, including the registry or Microsoft Exchange. # Chapter 16. The Registry You can navigate the Windows registry just as you would the file system because PowerShell treats the file system concept discussed in Chapter 15 as a prototype for all hierarchical information systems. # Chapter 17. Processes, Services, Event Logs In your daily work as an administrator, you often have to deal with programs (processes), services, and innumerable entries in event logs so this is a good opportunity to put into practice the basic knowledge you gained from the first 12 chapters. The examples and topics covered in this chapter are meant to give you an idea of the full range of options. In the course of your reading, you will no doubt rack your brains occasionally and find yourself flipping back pages to the introductory chapters. What's really astonishing are the many and diverse options you have in using the PowerShell pipeline (as discussed in Chapter 5) and associated formatting cmdlets to wring out every last bit of data from pipeline objects. What was just dry theory in Chapter 5 will now become very interesting in the following. # Chapter 18. WMI: Windows Management Instrumentation It might have escaped your attention, but the Windows Management Instrumentation (WMI) service introduced with Windows 2000 has been part of every Windows version since then. The WMI service is important because it can retrieve information about nearly every aspect of your system and can even make some modifications. However, it would be beyond the scope of this book to go into WMI in greater depth because that alone could fill another volume. For this reason, we will focus on how the WMI service basically works and how PowerShell handles it. # Chapter 19. User Management For many administrators, managing users is an important part of their work. PowerShell v1 does not contain any cmdlets to manage users. However, you can add them from third-party vendors. But if you do not want any dependencies on third-party tools and snap-ins, you will learn in this chapter how to use native .NET framework methods for user management. # Chapter 20. Your Own Cmdlets and Extensions Since PowerShell is layered on the .NET framework, you already know from Chapter 6 how you can use .NET code in PowerShell to make up for missing functions. In this chapter, we'll take up this idea once again. You'll learn about the options PowerShell has for creating command extensions on the basis of the .NET framework. You should be able to even create your own cmdlets at the end of this chapter. # Administrator's Guide to Powershell Remoting This paper explains how to set up and run Windows PowerShell Remoting which is a new feature in Windows PowerShell 2.0 and allows you to run Windows PowerShell commands and scripts remotely. So, before moving on, make sure you have Windows PowerShell 2.0 RTM on your machines. Download: http://powershell.com/Mastering-PowerShell.pdf Sursa: Master-PowerShell | With Dr. Tobias Weltner - Powershell.com
  13. In mare pe stumbleupon, postez si aici ce gasesc interesant. Acum am gasit o lista de carti online gratuite, dar nu are rost sa le postez pe toate, fac o selectie cu ce mi se pare mai interesant.
  14. Survive The Deep End: Zend Framework Welcome to Surviving The Deep End, a free book about Zend Framework for the PHP programming language. The book was written to guide readers through the metaphorical "Deep End". It's the place you find yourself in when you complete a few tutorials and scan through the Reference Guide, where you are buried in knowledge up to your neck but without a clue about how to bind it all together effectively into an application. This take on the Zend Framework offers a survival guide, boosting your understanding of the framework and how it all fits together by following the development of a single application from start to finish. I'll even throw in a few bad jokes for free. The book is a work in progress and will soon be available to read online or download and print as PDF. In fact, every individual chapter can be downloaded individually or read online as soon as it's published. There will be no final version of the book - it's not like Zend will cease releasing new Zend Framework versions tomorrow! There will be a print edition in the near future when I figure out how that should work. Surviving The Deep End is a free book. I rely on guilt, extortion, bad jokes, and teary eyed pleas for assistance to raise donations. That and Google ads on every page. Donations will be used to pay for the server (we're hosted on Slicehost) and the next Macbook Pro I intend purchasing later this year. To keep up to date on the book's progress please visit or subscribe to my blog or follow TheDeepEnd on Twitter. Table of Contents 1. Introduction 1.1. The Zend Framework 1.2. About This Book 1.2.1. Obtaining The Source Code For Chapters 1.3. Me, Me, Me! 1.4. You, You, You! 2. The Architecture of Zend Framework Applications 2.1. Introduction 2.2. The Model-View-Controller 2.2.1. The View 2.2.2. The Controller 2.2.3. The Model 2.3. In Review 2.4. Conclusion 3. The Model 3.1. Introduction 3.2. Clarifying The Model 3.3. In Programming, Fat Models Are Preferable To Size Zero Models 3.4. The Fat Stupid Ugly Controller 3.5. Controllers Are Not The Data Police 3.6. Conclusion 4. Installing The Zend Framework 4.1. Introduction 4.2. Before You Install The Framework 4.3. Getting The Zend Framework 4.3.1. Download As Compressed Archive File 4.3.2. Checkout From Subversion 4.3.3. Download As A Linux Distribution Package 4.3.4. Nightly Build Download 4.4. Post Installation 5. A Not So Simple Hello World Tutorial 5.1. Introduction 5.2. Step 1: Creating A New Local Domain 5.3. Step 2: Creating A Project Directory Structure 5.4. Step 3: Implement Application Bootstrapping 5.5. Step 4: The Only Way In, The Index File 5.6. Step 5: Adding A Default Controller and View 5.7. Conclusion 6. Standardise The Bootstrap Class With Zend_Application 6.1. Introduction 6.2. Step 1: Editing the ZFExt_Bootstrap Class 6.3. Step 2: Editing The Index and htaccess Files 6.4. Step 3: Adding The Application Configuration File 6.5. Step 4: Handling Setting Of Standard Component Defaults 6.6. Step 5: Fixing ZFExt_Bootstrap 6.7. Step 6: Integrating Application Configuration Into Resource Methods 6.8. Step 7: Optimising Autoloading Code 6.9. Allowing Zend_Loader_Autoload Load Namespaced Classes 6.10. Conclusion 7. Handling Application Errors Gracefully 7.1. Introduction 7.2. The ErrorController and Error View 7.3. Well, That Didn't Work... 7.4. Not All Errors Are Equal 7.5. Conclusion 8. Developing A Blogging Application 8.1. Introduction 8.2. Planning 8.3. Incremental Development and YAGNI 8.4. Checking Our Toolbox 8.5. This Is Not The Reference Guide 9. Implementing The Domain Model: Entries and Authors 9.1. Introduction 9.2. The Domain Model and Database Access Patterns 9.3. Exploring The Domain Objects 9.4. Exploring The Entry Data Mapper 9.5. Assessing Implementation Tools 9.5.1. Domain Objects 9.5.2. Validation And Filtering Rules 9.5.3. Database Access 9.6. Implementation 9.6.1. Adding Unit Tests For Execution 9.6.2. The Domain Objects 9.6.3. The Data Mappers 9.6.4. Lazy Loading Domain Objects 9.6.5. Preventing Duplicate Entities With An Identity Map 9.7. Conclusion 10. Setting The Design With Zend_View, Zend_Layout, HTML 5 and Yahoo! User Interface Library 10.1. Introduction 10.2. Zend_View: Object Oriented Templating 10.2.1. Layouts 10.2.2. Partials 10.2.3. View Helpers 10.2.4. Placeholders 10.2.5. Short Tags vs Full Tags 10.3. The ZFBlog Application Setup 10.4. Creating An Index Page With HTML 5 10.5. Extracting Static Markup Into A Layout 10.6. Replacing Changeable Elements With Placeholders 10.7. Improving HTML 5 Support With Custom View Helpers 10.8. Adding A Link To A Custom Stylesheet 10.9. Customising The Style 10.10. Conclusion A. Creating A Local Domain Using Apache Virtual Hosts A.1. Introduction A.2. Configuring Apache With Virtual Hosts A.3. Configuring Local HOSTS File A.4. Conclusion B. Performance Optimisation For Zend Framework Applications B.1. Introduction B.2. Avoid Premature Optimisation B.3. Measuring Performance B.3.1. Memory and CPU Measurement B.3.2. Requests Per Second B.4. Pinpointing The Cause Of Poor Performance B.4.1. Code Profiling B.4.2. Database Operations Analysis B.5. General PHP Optimisation B.5.1. Opcode Caching B.5.2. Realpath Cache B.6. General Zend Framework Optimisation B.6.1. Class Loading Optimisation B.6.2. Configuring Default Caches B.6.3. Cache At The Right Level B.6.4. Minimising Include Paths B.7. HTTP Server Optimisation B.7.1. Optimising Apache's Configuration B.7.2. Avoiding Apache Completely B.8. Conclusion C. Copyright Information C.1. Copyright C.2. Licensing Online: http://www.survivethedeepend.com/zendframeworkbook/en/1.0
  15. Practical PHP Programming Table of Contents Practical_PHP_Programming:Preface 1. Practical_PHP_Programming:Introducing PHP 2. Practical_PHP_Programming:Simple variables and operators 3. Practical_PHP_Programming:Functions 4. Practical_PHP_Programming:Arrays 5. Practical_PHP_Programming:Object-oriented programming 6. Practical_PHP_Programming:HTML forms 7. Practical_PHP_Programming:Working with files 8. Practical_PHP_Programming:Databases 9. Practical_PHP_Programming:Cookies and sessions 10. Practical_PHP_Programming:Multimedia 11. Practical_PHP_Programming:XML and XSLT 12. Practical_PHP_Programming:Output buffering 13. Practical_PHP_Programming:Java and COM 14. Practical_PHP_Programming:Networks 15. Practical_PHP_Programming:Miscellaneous topics 16. Practical_PHP_Programming:Security concerns 17. Practical_PHP_Programming:Performance 18. Practical_PHP_Programming:Writing PHP 19. Practical_PHP_Programming:Writing extensions 20. Practical_PHP_Programming:Alternative PHP uses 21. Practical_PHP_Programming:Practical PHP 22. Practical_PHP_Programming:Bringing it to a close 23. Practical_PHP_Programming:The future of PHP 24. Practical_PHP_Programming:Choosing an ISP 25. Practical_PHP_Programming:Glossary 26. flash designer programmer Online: http://www.ipbwiki.com/Practical_PHP_Programming%3aTable_Of_Contents
  16. Nytro

    Perl & LWP

    Perl & LWP by Sean M. Burke "Fetching web pages, Parsing HTML, Writing Spiders, & More" Table of Contents Click to enlarge the blesboks. CLICK THEM! * Introduction to the 2007 online edition of Perl & LWP * Foreword * Preface * Search! * Chapter 1: Introduction to Web Automation * Chapter 2: Web Basics * Chapter 3: The LWP Class Model * Chapter 4: URLs * Chapter 5: Forms * Chapter 6: Simple HTML Processing with Regular Expressions * Chapter 7: HTML Processing with Tokens * Chapter 8: Tokenizing Walkthrough * Chapter 9: HTML Processing with Trees * Chapter 10: Modifying HTML with Trees * Chapter 11: Cookies, Authentication, and Advanced Requests * Chapter 12: Spiders * Appendix A: LWP Modules * Appendix B: HTTP Status Codes * Appendix C: Common MIME Types * Appendix D: Language Tags * Appendix E: Common Content Encodings * Appendix F: ASCII Table * Appendix G: User's View of Object-Oriented Modules * Index * Colophon * Copyright Page Online: http://lwp.interglacial.com/index.html
  17. Learning Perl the Hard Way by Allen B. Downey Do we really need another Perl book? Well obviously I think so, and here's why: * I want a book for people who already know how to program in another language, but don't know Perl. * I want a book that gets through the basics as quickly as possible. I'm sick of reading about the precedence of operators; I want to know how to do the fun stuff. * I want a book that emphasizes good programming style in Perl. Many of the Perl programs I have seen are written in a quick-and-dirty style; I wanted to see if the style I have developed in other languages can translate. * In many Perl books, object-oriented programming is treated as an optional feature for advanced programming. I wanted to bring it closer to the center of focus (although I am anything but an object-oriented bigot). In presenting Perl features, I tried to find examples that are interesting in their own right, and that encourage the reader to explore Perl's features. This book is a work in progress. I have some ideas about what will go into the next few chapters, but I am open to suggestions. I am looking for interesting programming projects that highlight some of the moderately advances features of Perl, like inter-process communication, the Perl/tk interface, or one of the infinite number of modules on CPAN. Learning Perl the Hard Way is a free book available under the GNU Free Documentation License. Readers are free to copy and distribute the text; they are also free to modify it, which allows them to adapt the book to different needs, and to help develop new material. Printable versions of the book are available in PDF and gzipped Postscript. The LaTeX source code (with figures and a Makefile) will be available soon. Download: http://www.greenteapress.com/perl/perl.pdf Sursa: Learning Perl the Hard Way
  18. Nytro

    Extreme Perl

    Extreme Perl Extreme Perl is a book about Extreme Programming using the programming language Perl. This site contains the entire book. Please send me your suggestions, questions, etc. to comments at extremeperl.org. You may also want to join the Extreme Perl Group at Yahoo! Groups to discuss Extreme Programming with Perl. The book is available in HTML, PDF, or A4 PDF. Contents: Preface The Problem Extreme Programming Perl Release Planning Iteration Planning Pair Programming Tracking Acceptance Testing Coding Style Logistics Test Driven Design Continuous Design Unit Testing Refactoring It's a SMOP Praise: There is a part of Extreme Programming which celebrates excellence in programming in service to a customer, someone who needs computation but doesn't have the skill/patience/mania necessary to program. I'm always looking for win-wins. Gratuitous virtuosity is a win for the programmer, but a lose for the customer, because they end up with a program that no one (sometimes not even the original author) can touch without causing damage. What I like most about your book is that it presents some pretty pointy hat programming techniques, but uses them to create power for a customer, XP-style. -- Kent Beck Great book - very useful information and examples. It inspired me to review our processes yet again. -- Chris Hutchinson It is one of the best resources I have struck to introduce Extreme Programming to newbies. I have found that most references to Extreme Programming are not overly helpful when you are trying to get started down the XP path. -- Lance Wicks I rarely recommend techie books, but this is one you really have to read. I've been programming for something like 35 years, and I learned a lot from this book. If you write software, you should read this book. One thing that is compelling is that I've known the author for perhaps 20 years. He is one of the most thoughtful and intelligent technologists I know, and I respect whatever he says out of reflex. If there is one thing about the book that I must caution you about, it is that it is terrifying. Rob is doing things (not discussing theoretical concepts, but actually doing them) that I fear I can never achieve. I wish I could take the next step, and try to adopt some of his practices, but it may never happen. That said, I learned a LOT just reading the book. I expect that you will, too. Give it a try, even if you know nothing about extreme programming or Perl. I didn't! -- Jon Bondy Download: http://www.extremeperl.org/f/extremeperl.pdf Sursa: Extreme Perl - Home
  19. The Objective-C Programming Language Introduction The Objective-C language is a simple computer language designed to enable sophisticated object-oriented programming. Objective-C is defined as a small but powerful set of extensions to the standard ANSI C language. Its additions to C are mostly based on Smalltalk, one of the first object-oriented programming languages. Objective-C is designed to give C full object-oriented programming capabilities, and to do so in a simple and straightforward way. Most object-oriented development environments consist of several parts: * An object-oriented programming language * A library of objects * A suite of development tools * A runtime environment This document is about the first component of the development environment—the programming language. It fully describes the version of the Objective-C language released in Mac OS X v10.6 and iOS 4.0. This document also provides a foundation for learning about the second component, the Objective-C application frameworks—collectively known as Cocoa. The runtime environment is described in a separate document, Objective-C Runtime Programming Guide. Who Should Read This Document The document is intended for readers who might be interested in: * Programming in Objective-C * Finding out about the basis for the Cocoa application frameworks This document both introduces the object-oriented model that Objective-C is based upon and fully documents the language. It concentrates on the Objective-C extensions to C, not on the C language itself. Because this isn’t a document about C, it assumes some prior acquaintance with that language. Object-oriented programming in Objective-C is, however, sufficiently different from procedural programming in ANSI C that you won’t be hampered if you’re not an experienced C programmer. Organization of This Document The following chapters cover all the features Objective-C adds to standard C. * “Objects, Classes, and Messaging” * “Defining a Class” * “Allocating and Initializing Objects” * “Protocols” * “Declared Properties” * “Categories and Extensions” * “Associative References” * “Fast Enumeration” * “Enabling Static Behavior” * “Selectors” * “Exception Handling” * “Threading” A glossary at the end of this document provides definitions of terms specific to Objective-C and object-oriented programming. Online: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Introduction/introObjectiveC.html
  20. Nytro

    C# Essentials

    C# Essentials The C# Essentials online book contains 28 chapters of detailed information intended to provide everything necessary to gain Table of Contents 1. About C# Essentials 2. The C# Language and Environment * A Brief History of Computer Programming Languages * What exactly is C#? * The Common Language Infrastructure (CLI) * Common Intermediate Language (CIL) * Virtual Execution System (VES) * Common Type System (CTS) & Common Language Specification (CLS) * The Framework (Base Class and Framework Class Libraries) * Non Microsoft Implementations of the CLI 3. A Simple C# Console Application * Options for Installing a C# Environment * C# Source File Naming Conventions * Creating a Sample C# Program * Compiling C# Code From the Command Line * Executing a Compiled C# Program 4. Creating a Simple C# GUI Application with Visual Studio * Installing Visual Studio with C# Support * Creating a new Visual Studio C# Project * Adding Components to the Windows Form * Changing Component Names * Changing Component Properties * Adding Behavior to a Visual Studio C# Application 5. C# Variables and Constants * What is a C# Variable? * What is a C# Constant? * C# Integer Variable Types * C# Floating Point Variables * The C# Decimal Variable Type * C# Boolean Variable Type * C# Character Variable Type * C# String Variables * Casting Variable Types in C# 6. C# Operators and Expressions * What is an Expression? * The Basic Assignment Operator * C# Arithmetic Operators * C# Operator Precedence * Compound Assignment Operators * Increment and Decrement Operators * Comparison Operators * Boolean Logical Operators * The Ternary Operator 7. C# Flow Control Using if and else * Using the if Statement * Using if ... else .. Statements * Using if ... else if .. Statements 8. The C# switch Statement * Why Use a switch Statement? * Using the switch Statement Syntax * A switch Statement Example * Explaining the Example * Using goto in a C# switch Statement * Using continue in a C# switch Statement 9. C# Looping - The for Statement * The C# for Loop * C# Loop Variable Scope * Creating an Infinite for Loop * Breaking Out of a for Loop * Nested for Loops * Breaking From Nested Loops * Continuing for Loops 10. C# Looping with do and while Statements * The C# while Loop * C# do ... while loops * Breaking from Loops * The continue Statement 11. C# Object Oriented Programming * What is an Object? * What is a Class? * Declaring a C# Class * Creating C# Class Members * Static, Read-only and Const Data Members * Instantiating an Object from a C# Class * Accessing C# Object Members * Adding Methods to a C# Class * C# Constructors and Finalizers 12. C# Inheritance * What is Inheritance? * An Example of Inheritance * Creating a Subclass in C# * Passing Arguments to the Base Class Constructor 13. Understanding C# Abstract Classes * What is a C# Abstract Class? * Abstract Members * Declaring a C# Abstract Class * Deriving from an Abstract Class * The Difference Between abstract and virtual Members 14. Introducing C# Arrays * Creating Arrays in C# * Declaring a Multidimensional Array * Accessing Array Values * Getting the Length of an Array * Sorting and Manipulating C# Arrays 15. C# List and ArrayList Collections * What are C# Collection Classes * Creating C# List Collections - List<T> and ArrayList * Adding Items to Lists * Accessing List Items * Removing Items From Lists * Inserting Items into a C# List * Sorting Lists in C# * Finding Items in a C# List or ArrayList * Obtaining Information About a List * Clearing and Trimming C# Lists 16. Working with Strings in C# * Creating Strings in C# * Obtaining the Length of a C# String * Treating Strings as Arrays * Concatenating Strings in C# * Comparing Strings in C# * Changing String Case * Splitting a C# String into Multiple Parts * Trimming and Padding C# Strings * C# String Replacement 17. Formatting Strings in C# * The Syntax of the String.Format() Method * A Simple C# String Format Example * Using Format Controls * As Simple Format Control Example * The C# String.Format() Format Controls 18. Working with Dates and Times in C# * Creating a C# Date Time Objects * Getting the Current System Time and Date * Adding or Subtracting from Dates and Times * Retrieving Parts of a Date and Time * Formating Dates and Times in C# 19. C# and Windows Forms * Creating a New Form * Changing the Form Name * Changing the Form Title * Changing the Form Background Color * Changing The Form Background Image * Configuring the Minimize, Maximize and Close Buttons * Setting Minimum and Maximum Form Sizes * Specifying the Position of a Form on the Display * Changing the Form Border * Stopping a Form from Appearing the Windows Taskbar * Creating a Transparent Form 20. Designing Forms in C# and Visual Studio * Visual Basic Forms and Controls * Double Clicking the Control in the Toolbox * Dragging a Dropping Controls onto the Form * Drawing a Control on the Form * Positioning and Sizing Controls Using the Grid * Positioning Controls Using Snap Lines * Selecting Multiple Controls * Aligning and Sizing Groups of Controls * Setting Properties on a Group of Controls * Anchoring and Autosizing Form Controls * Setting Tab Order in a Form 21. Understanding C# GUI Events * Event Triggers * Wiring Up Events in Visual Studio * Compile and Running the Application * Setting Up a C# Timer Event 22. C# Events and Event Parameters * The Anatomy of an Event Handler * A C# EventArgs Example * C# EventArg Object Properties * Identifying which Mouse Button was Clicked 23. Hiding and Showing Forms in C# * Creating a C# Application Containing Multiple Forms * Understanding Modal and Non-modal Forms * Writing C# Code to Display a Non-Modal Form * Writing C# Code to Display a Modal Form * Hiding Forms in C# * Closing Forms in C# 24. Creating Top-Level Menus in C# * Creating a Top-Level Menu * Deleting and Moving Menu Items * Assigning Keyboard Shortcuts to Menu Items * Programming Menu Items in C# 25. Creating Context Menus in C# * Adding Context Menus to a C# Form * Associating a Component with a Context Menu * Programming C# Context Menu Options * Compiling and Running the Application 26. Building a Toolbar with C# and Visual Studio * Creating a Toolbar * Adding Tooltip Text to Toolbar Controls * Programming Toolbar Controls * Changing the Toolbar Position 27. Drawing Graphics in C# * Persistent Graphics * Creating a Graphics Object * Creating a Pen In C# * Drawing Lines in C# * Drawing Squares and Rectangles in C# * Drawing Ellipses and Circles in C# * Drawing Text with C# 28. Using Bitmaps for Persistent Graphics in C# * Why Use Bitmaps for Graphics Persistence in C#? * Creating a Bitmap * Instantiating a Bitmap and Creating a Graphics Object * Drawing onto the Bitmap * Rendering a Bitmap Image on a Control * Changing the Background Color of a Bitmap Online: http://www.techotopia.com/index.php/C_Sharp_Essentials
  21. Mercurial: The Definitive Guide by Bryan O'Sullivan Welcome to Mercurial: The Definitive Guide This is the online home of the book “Mercurial: The Definitive Guide”. It was published in 2009 by O'Reilly Media. Mercurial is a fast, lightweight source control management system designed for easy and efficient handling of very large distributed projects. My book tells you what it is, why you should care, and how you can use it effectively. # 2009-05-071. How did we get here? # 2009-05-072. A tour of Mercurial: the basics # 2009-05-073. A tour of Mercurial: merging work # 2009-05-074. Behind the scenes # 2009-05-075. Mercurial in daily use # 2009-05-076. Collaborating with other people # 2009-05-077. File names and pattern matching # 2009-05-078. Managing releases and branchy development # 2009-05-079. Finding and fixing mistakes # 2009-05-0710. Handling repository events with hooks # 2009-05-0711. Customizing the output of Mercurial # 2009-05-0712. Managing change with Mercurial Queues # 2009-05-0713. Advanced uses of Mercurial Queues # 2009-05-0714. Adding functionality with extensions # 2009-04-28A. Migrating to Mercurial # 2009-05-04B. Mercurial Queues reference # 2009-03-30C. Installing Mercurial from source # 2009-03-30D. Open Publication License Online: http://hgbook.red-bean.com/read/
  22. Programming in Lua The book is a detailed and authoritative introduction to all aspects of Lua programming, by Lua's chief architect. The first edition was aimed at Lua 5.0 and remains largely relevant. (See the errata.) If you find this online version useful, please consider buying a copy of the second edition, which updates the text to Lua 5.1 and brings substantial new material. This helps to support the Lua project. For the official definition of the Lua language, see the reference manual. Contents * Preface * Audience * Other Resources * A Few Typographical Conventions * About the Book * Acknowledgments * * Part I · The Language * 1 - Getting Started o 1.1 - Chunks o 1.2 - Global Variables o 1.3 - Some Lexical Conventions o 1.4 - The Stand-Alone Interpreter * 2 - Types and Values o 2.1 - Nil o 2.2 - Booleans o 2.3 - Numbers o 2.4 - Strings o 2.5 - Tables o 2.6 - Functions o 2.7 - Userdata and Threads * 3 - Expressions o 3.1 - Arithmetic Operators o 3.2 - Relational Operators o 3.3 - Logical Operators o 3.4 - Concatenation o 3.5 - Precedence o 3.6 - Table Constructors * 4 - Statements o 4.1 - Assignment o 4.2 - Local Variables and Blocks o 4.3 - Control Structures + 4.3.1 - if then else + 4.3.2 - while + 4.3.3 - repeat + 4.3.4 - Numeric for + 4.3.5 - Generic for o 4.4 - break and return * 5 - Functions o 5.1 - Multiple Results o 5.2 - Variable Number of Arguments o 5.3 - Named Arguments * 6 - More about Functions o 6.1 - Closures o 6.2 - Non-Global Functions o 6.3 - Proper Tail Calls * 7 - Iterators and the Generic for o 7.1 - Iterators and Closures o 7.2 - The Semantics of the Generic for o 7.3 - Stateless Iterators o 7.4 - Iterators with Complex State o 7.5 - True Iterators * 8 - Compilation, Execution, and Errors o 8.1 - The require Function o 8.2 - C Packages o 8.3 - Errors o 8.4 - Error Handling and Exceptions o 8.5 - Error Messages and Tracebacks * 9 - Coroutines o 9.1 - Coroutine Basics o 9.2 - Pipes and Filters o 9.3 - Coroutines as Iterators o 9.4 - Non-Preemptive Multithreading * 10 - Complete Examples o 10.1 - Data Description o 10.2 - Markov Chain Algorithm * * Part II · Tables and Objects * 11 - Data Structures o 11.1 - Arrays o 11.2 - Matrices and Multi-Dimensional Arrays o 11.3 - Linked Lists o 11.4 - Queues and Double Queues o 11.5 - Sets and Bags o 11.6 - String Buffers * 12 - Data Files and Persistence o 12.1 - Serialization + 12.1.1 - Saving Tables without Cycles + 12.1.2 - Saving Tables with Cycles * 13 - Metatables and Metamethods o 13.1 - Arithmetic Metamethods o 13.2 - Relational Metamethods o 13.3 - Library-Defined Metamethods o 13.4 - Table-Access Metamethods + 13.4.1 - The __index Metamethod + 13.4.2 - The __newindex Metamethod + 13.4.3 - Tables with Default Values + 13.4.4 - Tracking Table Accesses + 13.4.5 - Read-Only Tables * 14 - The Environment o 14.1 - Accessing Global Variables with Dynamic Names o 14.2 - Declaring Global Variables o 14.3 - Non-Global Environments * 15 - Packages o 15.1 - The Basic Approach o 15.2 - Privacy o 15.3 - Packages and Files o 15.4 - Using the Global Table o 15.5 - Other Facilities * 16 - Object-Oriented Programming o 16.1 - Classes o 16.2 - Inheritance o 16.3 - Multiple Inheritance o 16.4 - Privacy o 16.5 - The Single-Method Approach * 17 - Weak Tables o 17.1 - Memoize Functions o 17.2 - Object Attributes o 17.3 - Revisiting Tables with Default Values * Part III · The Standard Libraries * 18 - The Mathematical Library * 19 - The Table Library o 19.1 - Array Size o 19.2 - Insert and Remove o 19.3 - Sort * 20 - The String Library o 20.1 - Pattern-Matching Functions o 20.2 - Patterns o 20.3 - Captures o 20.4 - Tricks of the Trade * 21 - The I/O Library o 21.1 - The Simple I/O Model o 21.2 - The Complete I/O Model + 21.2.1 - A Small Performance Trick + 21.2.2 - Binary Files o 21.3 - Other Operations on Files * 22 - The Operating System Library o 22.1 - Date and Time o 22.2 - Other System Calls * 23 - The Debug Library o 23.1 - Introspective Facilities + 23.1.1 - Accessing Local Variables + 23.1.2 - Accessing Upvalues o 23.2 - Hooks o 23.3 - Profiles * Part IV · The C API * 24 - An Overview of the C API o 24.1 - A First Example o 24.2 - The Stack + 24.2.1 - Pushing Elements + 24.2.2 - Querying Elements + 24.2.3 - Other Stack Operations o 24.3 - Error Handling with the C API + 24.3.1 - Error Handling in Application Code + 24.3.2 - Error Handling in Library Code * 25 - Extending your Application o 25.1 - Table Manipulation o 25.2 - Calling Lua Functions o 25.3 - A Generic Call Function * 26 - Calling C from Lua o 26.1 - C Functions o 26.2 - C Libraries * 27 - Techniques for Writing C Functions o 27.1 - Array Manipulation o 27.2 - String Manipulation o 27.3 - Storing State in C Functions + 27.3.1 - The Registry + 27.3.2 - References + 27.3.3 - Upvalues * 28 - User-Defined Types in C o 28.1 - Userdata o 28.2 - Metatables o 28.3 - Object-Oriented Access o 28.4 - Array Access o 28.5 - Light Userdata * 29 - Managing Resources o 29.1 - A Directory Iterator o 29.2 - An XML Parser Online: http://www.lua.org/pil/
  23. Practical Common Lisp This page, and the pages it links to, contain text of the Common Lisp book Practical Common Lisp published by Apress These pages now contain the final text as it appears in the book. If you find errors in these pages, please send email to book@gigamonkeys.com. These pages will remain online in perpetuity—I hope they will serve as a useful introduction to Common Lisp for folks who are curious about Lisp but maybe not yet curious enough to shell out big bucks for a dead-tree book and a good Common Lisp tutorial for folks who want to get down to real coding right away. However, don't let that stop you from buying the printed version available from Apress at your favorite local or online bookseller. For the complete bookstore browsing experience, you can read the letter to the reader that appears on the back cover of the treeware edition of the book. 1. Introduction: Why Lisp? 2. Lather, Rinse, Repeat: A Tour of the REPL 3. Practical: A Simple Database 4. Syntax and Semantics 5. Functions 6. Variables 7. Macros: Standard Control Constructs 8. Macros: Defining Your Own 9. Practical: Building a Unit Test Framework 10. Numbers, Characters, and Strings 11. Collections 12. They Called It LISP for a Reason: List Processing 13. Beyond Lists: Other Uses for Cons Cells 14. Files and File I/O 15. Practical: A Portable Pathname Library 16. Object Reorientation: Generic Functions 17. Object Reorientation: Classes 18. A Few FORMAT Recipes 19. Beyond Exception Handling: Conditions and Restarts 20. The Special Operators 21. Programming in the Large: Packages and Symbols 22. LOOP for Black Belts 23. Practical: A Spam Filter 24. Practical: Parsing Binary Files 25. Practical: An ID3 Parser 26. Practical: Web Programming with AllegroServe 27. Practical: An MP3 Database 28. Practical: A Shoutcast Server 29. Practical: An MP3 Browser 30. Practical: An HTML Generation Library, the Interpreter 31. Practical: An HTML Generation Library, the Compiler 32. Conclusion: What's Next? Online: http://www.gigamonkeys.com/book/
  24. jQuery Fundamentals By Rebecca Murphey http://github.com/rmurphey/jqfundamentals With contributions by James Padolsey, Paul Irish, and others. See the GitHub repository for a complete history of contributions. Copyright © 2011 Licensed by Rebecca Murphey under the Creative Commons Attribution-Share Alike 3.0 United States license. You are free to copy, distribute, transmit, and remix this work, provided you attribute the work to Rebecca Murphey as the original author and reference the GitHub repository for the work. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license. Any of the above conditions can be waived if you get permission from the copyright holder. For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to the license. Contents * Chapter 1: Welcome * Chapter 2: JavaScript Basics * Chapter 3: jQuery Basics * Chapter 4: jQuery Core * Chapter 5: Events * Chapter 6: Effects * Chapter 7: Ajax * Chapter 8: Plugins * Chapter 9: Performance Best Practices * Chapter 10: Code Organization * Chapter 11: Custom Events List of Examples * Example 1.1: An example of inline JavaScript * Example 1.2: An example of including external JavaScript * Example 1.3: Example of an example * Example 2.1: A simple variable declaration * Example 2.2: Whitespace has no meaning outside of quotation marks * Example 2.3: Parentheses indicate precedence * Example 2.4: Tabs enhance readability, but have no special meaning * Example 2.5: Concatenation * Example 2.6: Multiplication and division * Example 2.7: Incrementing and decrementing * Example 2.8: Addition vs. concatenation * Example 2.9: Forcing a string to act as a number * Example 2.10: Forcing a string to act as a number (using the unary-plus operator) * Example 2.11: Logical AND and OR operators * Example 2.12: Comparison operators * Example 2.13: Flow control * Example 2.14: Values that evaluate to true * Example 2.15: Values that evaluate to false * Example 2.16: The ternary operator * Example 2.17: A switch statement * Example 2.18: Loops * Example 2.19: A typical for loop * Example 2.20: A typical while loop * Example 2.21: A while loop with a combined conditional and incrementer * Example 2.22: A do-while loop * Example 2.23: Stopping a loop * Example 2.24: Skipping to the next iteration of a loop * Example 2.25: A simple array * Example 2.26: Accessing array items by index * Example 2.27: Testing the size of an array * Example 2.28: Changing the value of an array item * Example 2.29: Adding elements to an array * Example 2.30: Working with arrays * Example 2.31: Creating an "object literal" * Example 2.32: Function Declaration * Example 2.33: Named Function Expression * Example 2.34: A simple function * Example 2.35: A function that returns a value * Example 2.36: A function that returns another function * Example 2.37: A self-executing anonymous function * Example 2.38: Passing an anonymous function as an argument * Example 2.39: Passing a named function as an argument * Example 2.40: Testing the type of various variables * Example 2.41: A function invoked using Function.call * Example 2.42: A function created using Function.bind * Example 2.43: A function being attached to an object at runtime * Example 2.44: Functions have access to variables defined in the same scope * Example 2.45: Code outside the scope in which a variable was defined does not have access to the variable * Example 2.46: Variables with the same name can exist in different scopes with different values * Example 2.47: Functions can "see" changes in variable values after the function is defined * Example 2.48: Scope insanity * Example 2.49: How to lock in the value of i? * Example 2.50: Locking in the value of i with a closure * Example 2.51: Using a closure to access inner and outer object instances simultaneously * Example 3.1: A $(document).ready() block * Example 3.2: Shorthand for $(document).ready() * Example 3.3: Passing a named function instead of an anonymous function * Example 3.4: Selecting elements by ID * Example 3.5: Selecting elements by class name * Example 3.6: Selecting elements by attribute * Example 3.7: Selecting elements by compound CSS selector * Example 3.8: Pseudo-selectors * Example 3.9: Testing whether a selection contains elements * Example 3.10: Storing selections in a variable * Example 3.11: Refining selections * Example 3.12: Using form-related pseduo-selectors * Example 3.13: Chaining * Example 3.14: Formatting chained code * Example 3.15: Restoring your original selection using $.fn.end * Example 3.16: The $.fn.html method used as a setter * Example 3.17: The html method used as a getter * Example 3.18: Getting CSS properties * Example 3.19: Setting CSS properties * Example 3.20: Working with classes * Example 3.21: Basic dimensions methods * Example 3.22: Setting attributes * Example 3.23: Getting attributes * Example 3.24: Moving around the DOM using traversal methods * Example 3.25: Iterating over a selection * Example 3.26: Changing the HTML of an element * Example 3.27: Moving elements using different approaches * Example 3.28: Making a copy of an element * Example 3.29: Creating new elements * Example 3.30: Creating a new element with an attribute object * Example 3.31: Getting a new element on to the page * Example 3.32: Creating and adding an element to the page at the same time * Example 3.33: Manipulating a single attribute * Example 3.34: Manipulating multiple attributes * Example 3.35: Using a function to determine an attribute's new value * Example 4.1: Checking the type of an arbitrary value * Example 4.2: Storing and retrieving data related to an element * Example 4.3: Storing a relationship between elements using $.fn.data * Example 4.4: Putting jQuery into no-conflict mode * Example 4.5: Using the $ inside a self-executing anonymous function * Example 5.1: Event binding using a convenience method * Example 5.2: Event biding using the $.fn.bind method * Example 5.3: Event binding using the $.fn.bind method with data * Example 5.4: Switching handlers using the $.fn.one method * Example 5.5: Unbinding all click handlers on a selection * Example 5.6: Unbinding a particular click handler * Example 5.7: Namespacing events * Example 5.8: Binding Multiple Events * Example 6.1: A basic use of a built-in effect * Example 6.2: Setting the duration of an effect * Example 6.3: Augmenting jQuery.fx.speeds with custom speed definitions * Example 6.4: Running code when an animation is complete * Example 6.5: Run a callback even if there were no elements to animate * Example 6.6: Custom effects with $.fn.animate * Example 6.7: Per-property easing * Example 7.1: Using the core $.ajax method * Example 7.2: Using jQuery's Ajax convenience methods * Example 7.3: Using $.fn.load to populate an element * Example 7.4: Using $.fn.load to populate an element based on a selector * Example 7.5: Turning form data into a query string * Example 7.6: Creating an array of objects containing form data * Example 7.7: Using YQL and JSONP * Example 7.8: Setting up a loading indicator using Ajax Events * Example 8.1: Creating a plugin to add and remove a class on hover * Example 8.2: The Mike Alsup jQuery Plugin Development Pattern * Example 8.3: A simple, stateful plugin using the jQuery UI widget factory * Example 8.4: Passing options to a widget * Example 8.5: Setting default options for a widget * Example 8.6: Creating widget methods * Example 8.7: Calling methods on a plugin instance * Example 8.8: Responding when an option is set * Example 8.9: Providing callbacks for user extension * Example 8.10: Binding to widget events * Example 8.11: Adding a destroy method to a widget * Example 10.1: An object literal * Example 10.2: Using an object literal for a jQuery feature * Example 10.3: The module pattern * Example 10.4: Using the module pattern for a jQuery feature * Example 10.5: Using RequireJS: A simple example * Example 10.6: A simple JavaScript file with dependencies * Example 10.7: Defining a RequireJS module that has no dependencies * Example 10.8: Defining a RequireJS module with dependencies * Example 10.9: Defining a RequireJS module that returns a function Online: http://jqfundamentals.com/book/index.html
  25. Eloquent JavaScript A Modern Introduction to Programming by Marijn Haverbeke Eloquent JavaScript is a book providing an introduction to the JavaScript programming language and programming in general. A concise and balanced mix of principles and pragmatics. I loved the tutorial-style game-like program development. This book rekindled my earliest joys of programming. Plus, JavaScript! —Brendan Eich, the man who gave us JavaScript The book exists in two forms. It was originally written and published in digital form, which includes interactive examples and a mechanism for playing with all the example code. This version is released under an open license. I have published a revised version of the book on paper. The structure of this version remained largely the same, but the whole text has been thorougly edited and updated. You can order from Amazon here. There is still an interactive coding environment for this version, as a seperate page. Errata are here. Contents 1. Introduction 2. Basic JavaScript: values, variables, and control flow 3. Functions 4. Data structures: Objects and Arrays 5. Error Handling 6. Functional Programming 7. Searching 8. Object-oriented Programming 9. Modularity 10. Regular Expressions 11. Web programming: A crash course 12. The Document-Object Model 13. Browser Events 14. HTTP requests Appendices 1. More (obscure) control structures 2. Binary Heaps Alphabetic index of terms Cover page Online: http://eloquentjavascript.net/print.html Sursa: Contents -- Eloquent JavaScript
×
×
  • Create New...