background preloader

Languages

Facebook Twitter

PEP 8 -- Style Guide for Python Code. Code should be written in a way that does not disadvantage other implementations of Python (PyPy, Jython, IronPython, Cython, Psyco, and such).For example, do not rely on CPython's efficient implementation of in-place string concatenation for statements in the form a += b or a = a + b. This optimization is fragile even in CPython (it only works for some types) and isn't present at all in implementations that don't use refcounting. In performance sensitive parts of the library, the ''.join() form should be used instead. This will ensure that concatenation occurs in linear time across various implementations.Comparisons to singletons like None should always be done with is or is not, never the equality operators.Also, beware of writing if x when you really mean if x is not None -- e.g. when testing whether a variable or argument that defaults to None was set to some other value.

The other value might have a type (such as a container) that could be false in a boolean context! Learn Prolog Now! Extensible Markup Language (XML) 1.0 (Fifth Edition) 2 Documents [Definition: A data object is an XML document if it is well-formed, as defined in this specification. In addition, the XML document is valid if it meets certain further constraints.] Each XML document has both a logical and a physical structure. Physically, the document is composed of units called entities. An entity may refer to other entities to cause their inclusion in the document. A document begins in a "root" or document entity. Logically, the document is composed of declarations, elements, comments, character references, and processing instructions, all of which are indicated in the document by explicit markup. 2.1 Well-Formed XML Documents [Definition: A textual object is a well-formed XML document if:] Taken as a whole, it matches the production labeled document.It meets all the well-formedness constraints given in this specification.Each of the parsed entities which is referenced directly or indirectly within the document is well-formed.

Document 2.2 Characters Note: <! <? TextBlob: Simplified Text Processing — TextBlob 0.9.0-dev documentation. Release v0.8.4. (Changelog) TextBlob is a Python (2 and 3) library for processing textual data. It provides a simple API for diving into common natural language processing (NLP) tasks such as part-of-speech tagging, noun phrase extraction, sentiment analysis, classification, translation, and more. TextBlob stands on the giant shoulders of NLTK and pattern, and plays nicely with both. Features Noun phrase extractionPart-of-speech taggingSentiment analysisClassification (Naive Bayes, Decision Tree)Language translation and detection powered by Google TranslateTokenization (splitting text into words and sentences)Word and phrase frequenciesParsingn-gramsWord inflection (pluralization and singularization) and lemmatizationSpelling correctionJSON serializationAdd new models or languages through extensionsWordNet integration Get it now $ pip install -U textblob $ python -m textblob.download_corpora Ready to dive in?

Python Programming/Creating Python Programs. Welcome to Python! This tutorial will show you how to start writing programs. Python programs are nothing more than text files, and they may be edited with a standard text editor program.[1] What text editor you use will probably depend on your operating system: any text editor can create Python programs. It is easier to use a text editor that includes Python syntax highlighting, however. Hello, World! [edit] The first program that every programmer writes is called the "Hello, World! " Open up your text editor and create a new file called hello.py containing just this line (you can copy-paste if you want): This program uses the print function, which simply outputs its parameters to the terminal. Now that you've written your first program, let's run it in Python! Windows[edit] Create a folder on your computer to use for your Python programs, such as C:\pythonpractice, and save your hello.py program in that folder.In the Start menu, select "Run Mac[edit] Linux[edit] Linux (advanced)[edit] #!

Rabbits Example. Welcome to schemers.org! Structure and Interpretation of Computer Programs. A powerful programming language is more than just a means for instructing a computer to perform tasks. The language also serves as a framework within which we organize our ideas about processes. Thus, when we describe a language, we should pay particular attention to the means that the language provides for combining simple ideas to form more complex ideas. Every powerful language has three mechanisms for accomplishing this: primitive expressions, which represent the simplest entities the language is concerned with,means of combination, by which compound elements are built from simpler ones, andmeans of abstraction, by which compound elements can be named and manipulated as units. In programming, we deal with two kinds of elements: procedures and data.

(Later we will discover that they are really not so distinct.) 1.1.1 Expressions One easy way to get started at programming is to examine some typical interactions with an interpreter for the Scheme dialect of Lisp. (define size 2) 1. (f 5) Frink. What's New * FAQ * Download * Frink Applet * Web Interface * Sample Programs * Frink Server Pages * Frink on Android * Donate About Frink Frink is a practical calculating tool and programming language designed to make physical calculations simple, to help ensure that answers come out right, and to make a tool that's really useful in the real world.

It tracks units of measure (feet, meters, kilograms, watts, etc.) through all calculations, allowing you to mix units of measure transparently, and helps you easily verify that your answers make sense. It also contains a large data file of physical quantities, freeing you from having to look them up, and freeing you to make effortless calculations without getting bogged down in the mechanics. Perhaps you'll get the best idea of what Frink can do if you skip down to the Sample Calculations further on this document. Come back up to the top when you're done. Features Get Notified Frink changes almost every day. Donate Mailing Lists Table of Contents. Frink on Android. Frink Documentation * What's New * FAQ * Download * Frink Applet * Web Interface * Sample Programs * Frink Server Pages * Donate Frink Documentation This page only contains information about Android-specific features of Frink.

For more information about Frink, please view the full Frink documentation. Download Frink for Android Frink for Android is available (for free!) In the Android Market from your Android device as "Frink Programming Language". (Search for "Frink" and you'll find it, or just scan the image to the right with an application like Barcode Scanner, or click that image if you're viewing this on your Android already.) Note that the new Market application is severely broken! If you don't have access to the Android Market from your device, you can also download it here. Features Frink is available for the Android mobile phone platform, as well as for your other computers (Mac, Linux, Windows, etc.) Permissions The Frink application currently requests permissions for the following: The Scheme Programming Language, 3rd Edition. Prolog Tutorial.

Simple Scheme, for Android. I was on the train, wanted to write some code, and I though, "I wonder if there are any good Scheme implementations for my phone? ". I didn't find any that were simple, easy to use, and efficient (the first one I installed crashed my phone). I also wanted to be able to write graphical and interactive programs easily (see image examples and/or big-bang/interaction examples). So... I started an implementation of all the major features I could think of (see traditional Scheme forms and examples). The execution needed to be tail-recursive, and even non-tail-recursive functions shouldn't run out of stack space, so I implemented a continuation-passing style interpreter with efficient binding and lookup. While I tried to remain faithful to the term "Scheme-like", I made a few changes to the language (and the implementation) to make the it a little easier.

Like traditional Scheme, Simple Scheme supports define, define-struct, begin, let, and many other forms/expressions. Simple stuff... Symbols... Frink. Home · nltk/nltk Wiki. Alan Eliasen. Prolog in Javascript (!) Prolog.