Models | Examples |
---|---|
Display ads | Yahoo! |
Search ads |
import couchdb | |
import random | |
import string | |
from beefish import encrypt_file | |
from subprocess import Popen | |
from subprocess import PIPE | |
# constants | |
SRC_DB_USER = "root" |
#!/bin/bash | |
# works with a file called VERSION in the current directory, | |
# the contents of which should be a semantic version number | |
# such as "1.2.3" | |
# this script will display the current version, automatically | |
# suggest a "minor" version update, and ask for input to use | |
# the suggestion, or a newly entered value. |
<?php | |
/** | |
* ODBC for DBO. Tested with AS400 V5R1 and iSeriesAccess unixodbc | |
* | |
* PHP versions 4 and 5 | |
* | |
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org) | |
* Copyright 2005-2009, Cake Software Foundation, Inc. (http://cakefoundation.org) | |
* |
# vim: ft=sh:ts=4:sw=4:autoindent:expandtab: | |
# Source: https://github.com/django/django/blob/stable/1.5.x/extras/django_bash_completion | |
# ######################################################################### | |
# This bash script adds tab-completion feature to django-admin.py and | |
# manage.py. | |
# | |
# Testing it out without installing | |
# ================================= | |
# |
Over the last 3 years or so I've helped a bunch of companies, small and large, switch to Django. As part of that, I've done a lot of teaching Django (and Python) to people new to the platform (and language). I'd estimate I've trained something around 200-250 people so far. These aren't people new to programming — indeed, almost all of them are were currently employed as software developers — but they were new to Python, or to Django, or to web development, or all three.
In doing so, I've observed some patterns about what works and what doesn't. Many (most) of the failings have been my own pedagogical failings, but as I've honed my coursework and my skill I'm seeing, time and again, certain ways that Django makes itself difficult to certain groups of users.
This document is my attempt at organizing some notes around what ways different groups struggle. It's not particularly actionable — I'm not making any arguments about what Django should or shouldn't do (at least
This is just a small post in response to [this tweet][tweet] by Julien Pauli (who by the way is the release manager for PHP 5.5). In the tweet he claims that objects use more memory than arrays in PHP. Even though it can be like that, it's not true in most cases. (Note: This only applies to PHP 5.4 or newer.)
The reason why it's easy to assume that objects are larger than arrays is because objects can be seen as an array of properties and a bit of additional information (like the class it belongs to). And as array + additional info > array
it obviously follows that objects are larger. The thing is that in most cases PHP can optimize the array
part of it away. So how does that work?
The key here is that objects usually have a predefined set of keys, whereas arrays don't: