
Apache Thrift Understanding JavaScript Closures In JavaScript, a closure is a function to which the variables of the surrounding context are bound by reference. Every JavaScript function forms a closure on creation. In a moment I’ll explain why and walk through the process by which closures are created. Then I’ll address some common misconceptions and finish with some practical applications. But first a brief word from our sponsors: JavaScript closures are brought to you by lexical scope and the VariableEnvironment… Lexical Scope The word lexical pertains to words or language. Consider the following example: Function inner is physically surrounded by function outer which in turn is wrapped by the global context. global outer inner The outer lexical scope of any given function is defined by its ancestors in the lexical hierarchy. VariableEnvironment The global object has an associated execution context. We could represent the VariableEnvironment with pseudo-code… However, it turns out this is only part of the picture. The [[scope]] property
Django + skelJS / Static Files Issue / References to Images in CSS Fast Track - Get lost! The new art of travel for the 21st Century Rajan Datar looks at how people and technology could shape future of travel Why do we spend so much of our precious holiday time queuing up to see famous paintings like the Mona Lisa, even if we are not that interested in art? And why do we drag ourselves to all those cathedrals, museums and monuments listed in our guidebooks when - let's be honest - they usually turn out to be a bit boring, and we can't wait to get to the cafe? The answer lies in history. Few of us realise that we are unwittingly following an itinerary set by aristocratic tourists 300 ago. It is time to escape their legacy and find more adventurous ways to travel in the 21st Century. Modern travel is rooted in the tradition of the Grand Tour of the 18th Century, when upper-class gents - and the occasional lucky lady - set off with their servants on a high-culture jaunt around Europe to round off a classical education. Wrong turn All well and good for them, but it is hardly what most of us would call a great time.
The Node Beginner Book » A comprehensive Node.js tutorial The Django template language Django’s template language is designed to strike a balance between power and ease. It’s designed to feel comfortable to those used to working with HTML. If you have any exposure to other text-based template languages, such as Smarty or CheetahTemplate, you should feel right at home with Django’s templates. Philosophy If you have a background in programming, or if you’re used to languages which mix programming code directly into HTML, you’ll want to bear in mind that the Django template system is not simply Python embedded into HTML. The Django template system provides tags which function similarly to some programming constructs – an if tag for boolean tests, a for tag for looping, etc. – but these are not simply executed as the corresponding Python code, and the template system will not execute arbitrary Python expressions. Templates A template is simply a text file. Below is a minimal template that illustrates a few basics. Oh, and one more thing: Making humans edit XML is sadistic! <! <!
Emulation Collective PyQT Tutorial Tutorial: Creating GUI Applications in Python with QTby Alex Fedosov Python is a great language with many awesome features, but its default GUI package (TkInter) is rather ugly. Besides, who wants to write all that GUI code by hand, anyway? So the following is a brief tutorial on how to go about creating your first semi-interesting application with Python & QT. First, you need to have the following packages installed: Python 2.x PyQt 3.x QT Designer 3.x I did everything with default packages that came with Fedora Core 1, and had no problems. QT Designer will come up. In the New/Open dialog box, click on Dialog, and hit OK. QT Designer will create a new dialog canvas for you and call it Form1. In the toolbar on the left select the LineEdit tool and create an edit box on the canvas. Now, select the ListBox tool in the toolbar on the left and create a list box on the canvas. Notice that there is already an item in the box. Double-click on the button on the canvas. Here's the tricky part.
Widgets A widget that is composed of multiple widgets. MultiWidget works hand in hand with the MultiValueField. MultiWidget has one required argument: widgets An iterable containing the widgets needed. And one required method: decompress(value) This method takes a single “compressed” value from the field and returns a list of “decompressed” values. This method must be implemented by the subclass, and since the value may be empty, the implementation must be defensive. The rationale behind “decompression” is that it is necessary to “split” the combined value of the form field into the values for each widget. An example of this is how SplitDateTimeWidget turns a datetime value into a list with date and time split into two separate values: from django.forms import MultiWidget class SplitDateTimeWidget(MultiWidget): # ... def decompress(self, value): if value: return [value.date(), value.time().replace(microsecond=0)] return [None, None] Tip Other methods that may be useful to override include:
HackFwd PyQt About PyQt PyQt is one of the two most popular Python bindings for the Qt cross-platform GUI/XML/SQL C++ framework (another binding is PySide). PyQt developed by Riverbank Computing Limited. Qt itself is developed as part of the Qt Project. PyQt provides bindings for Qt 4 and Qt 5. PyQt is available in two editions: PyQt4 which will build against Qt 4.x and 5.x and PyQt5 which will only build against 5.x. The latest iteration of PyQt is v5.4. PyQt Documentation Current documentation is available for PyQt4 and PyQt5. The PyQt Wiki contains more actively-updated information and examples: A collection of links to books can be found on the Books page. On this Wiki, you can find the following tutorials: A tutorial presented by Jonathan Gardner at the 2003 Northwest Linux Fest is available at JonathanGardnerPyQtTutorial. Developing with PyQt and PyKDE PyQt Applications A list of applications that use PyQt as their UI layer can be found on the Some Existing Applications page. Earlier Versions
Model field reference This document contains all the gory details about all the field options and field types Django’s got to offer. Field options The following arguments are available to all field types. All are optional. null Field.null If True, Django will store empty values as NULL in the database. Avoid using null on string-based fields such as CharField and TextField because empty string values will always be stored as empty strings, not as NULL. For both string-based and non-string-based fields, you will also need to set blank=True if you wish to permit empty values in forms, as the null parameter only affects database storage (see blank). Note When using the Oracle database backend, the value NULL will be stored to denote the empty string regardless of this attribute. If you want to accept null values with BooleanField, use NullBooleanField instead. blank Field.blank If True, the field is allowed to be blank. choices Field.choices The first element in each tuple is the name to apply to the group. db_column unique