Big-Q notation is exactly the same as Big-O notation, except for the understanding that the constant multiplier for the asymptotic bound function is greater.
For example Big-O is defined as:
f(x) <= C * g(x)
Big-Q notation could be defined as:
// put this in a bookmarklet | |
// click it as required | |
javascript: (function () { | |
var style = document.createElement('style'); | |
style.innerHTML = '* { -webkit-text-size-adjust:auto; }'; | |
document.head.appendChild(style); | |
})(); |
At present application loading is handled in different ways through Django. Because of some of the limitations of Python, and some peculiarities of how models work, modules should not be reimported. Consequently Django maintains a global static, called the application cache. Models are imported from the application cache transparently when interacting with the database. But applications listed in INSTALLED_APPS
contain more than just models. Some contain template tags, admin.py
files, search_indexes.py
files from
from urlparse import urlsplit, urlunsplit | |
from storages.backends.s3boto import S3BotoStorage | |
class ProtocolRelativeS3BotoStorage(S3BotoStorage): | |
"""Extends S3BotoStorage to return protocol-relative URLs | |
See: http://paulirish.com/2010/the-protocol-relative-url/ | |
""" |
So, basically, scanning a sentence becomes like this: | |
1. Split the sentence into words | |
2. For each word, create a cleaned version (basically strip off quotes and punctuation) and look up in the dictionary. | |
3. If not found, try a few fallbacks based on stemmming rules or such | |
4. Otherwise, add the word to a term_misses table. | |
These code is really ugly (sorry!), and you might notice I actually am talking about meter in it. This is because the background image for the haikus is generated from the meter. But I don't want to do the meter for new words (sorry, syllable is enough), so for those I just return - as the meter (otherwise it's a combination of 1 or 0) | |
HAIKU (11000 1010011 11110) |
[ | |
{ | |
"keys": ["super+alt+shift+5"], | |
"command": "set_layout", | |
"caption" : "1-2 Grid", | |
"args": | |
{ | |
"cols": [0.0, 0.5, 1.0], | |
"rows": [0.0, 0.5, 1.0], | |
"cells": |
/* | |
A simple new-line delimited JSON protocol with upgrades. | |
Receiving Usage: | |
protocol = require('./frame-protocol'); | |
// parsing data | |
parser = protocol.Parser(); |
#!/bin/bash | |
# | |
# Install Postgres 9.2, PostGIS and create PostGIS template on an Ubuntu 12.04 Server | |
# add official postgresql.org ubuntu repos (http://wiki.postgresql.org/wiki/Apt) | |
# Create /etc/apt/sources.list.d/pgdg.list. The distributions are called codename-pgdg. | |
echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg2.list | |
# Import the repository key from http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc, update the package lists, and start installing packages: |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>fileTypes</key> | |
<array> | |
<string>feature</string> | |
</array> | |
<key>firstLineMatch</key> | |
<string>기능|機能|功能|フィーチャ|خاصية|תכונה|Функціонал|Функционалност|Функционал|Особина|Могућност|Özellik|Właściwość|Tính năng|Savybė|Požiadavka|Požadavek|Osobina|Ominaisuus|Omadus|OH HAI|Mogućnost|Mogucnost|Jellemző|Fīča|Funzionalità|Funktionalität|Funkcionalnost|Funkcionalitāte|Funcționalitate|Functionaliteit|Functionalitate|Funcionalitat|Funcionalidade|Fonctionnalité|Fitur|Feature|Egenskap|Egenskab|Crikey|Característica|Arwedd(.*)</string> |
from cloudsearch import connect_cloudsearch, get_document_service | |
endpoint = 'paste your doc service endpoint here' | |
service = get_document_service(endpoint=endpoint) # Get a new instance of cloudsearch.DocumentServiceConnection | |
# Presumably get some users from your db of choice. | |
users = [ | |
{ | |
'id': 1, |