If you want to make us angry you can do
<ng-class="{'ng-hidden': condition}">
instead of ng-hidden="condition"
or even better
| import itertools | |
| def grouper(iterable, n): | |
| """Collect data into chunks. | |
| This is different to the grouper recipe in itertools in that the final | |
| chunk may be shorter. | |
| >>> grouper('ABCDEF', 3) |
| #!/usr/bin/env python2 | |
| import csv | |
| import hashlib | |
| import sys | |
| # Calculate an MD5 checksum for every row in the first column of a CSV. | |
| # Example: | |
| # $ python digests.py < src.csv > dest.csv |
| # Speed comparison of bencodepy and buxtor.bencode | |
| # bencodepy is consistently 0.3 - 0.5 seconds faster. Why? | |
| # bencodepy: https://github.com/eweast/BencodePy/blob/master/bencodepy/encode.py | |
| # 4914005 function calls (3618005 primitive calls) in 2.830 seconds | |
| # | |
| # | |
| # buxtor.bencode: https://github.com/davidwtbuxton/buxtor/blob/master/buxtor/bencode.py | |
| # 5592005 function calls (4548005 primitive calls) in 3.183 seconds |
If you want to make us angry you can do
<ng-class="{'ng-hidden': condition}">
instead of ng-hidden="condition"
or even better
| import mimetypes | |
| from django.http import HttpResponse | |
| from google.appengine.api import app_identity | |
| from google.appengine.ext import blobstore | |
| def serve_cloud_storage_file(request, object_name): | |
| """Serve a file from cloud storage by setting a header on the response. | |
| The blobstore will serve it for you. |
| # List all URLs in a Django application. | |
| from collections import namedtuple | |
| from django.conf.urls import RegexURLResolver, include | |
| from django.views.generic import View | |
| def walk_patterns(patterns, prefix=()): | |
| """Yields pairs of (RegexURLPattern, prefixes) where the first is the | |
| pattern instance which has the actual view function, url name, etc. and the |
| $ python -m timeit -s 'd = {}' 'd.update({"key": "value"})' | |
| 1000000 loops, best of 3: 0.293 usec per loop | |
| $ python -m timeit -s 'd = {}' 'd["key"] = "value"' | |
| 10000000 loops, best of 3: 0.0433 usec per loop |
| From: "Captain Michael Kelvington"<test@jlcity.gov.cn> | |
| Subject: DEAR FRIEND | |
| Date: Thu, 17 Oct 2013 23:39:09 +0200 | |
| Dear Friend | |
| Forgive my indignation if this message comes to you as a surprise and may | |
| offend your personality for contacting you without your prior consent and | |
| Writing through this channel. I got your contact from the professional data | |
| base found in the internet Yahoo tourist search; I was searching for a foreign |
11 January 2013. Double-encoded markup in BBC Atom/RSS feeds.
BBC Atom feeds are double-encoding XHTML markup. But content of an <content type="xhtml">...</content> element must be the actual markup, not escaped markup.
This bug results in reader software showing the markup rather than the formatted content.
See Atom processing model: http://tools.ietf.org/html/rfc4287#section-4.1.3.3
E.g. http://www.bbc.co.uk/blogs/radio4/atom/ contains an entry like this (edited for clarity). Note the <p> tag is encoded as <p>.
| # http://www.reddit.com/r/learnpython/comments/167cay/using_python_with_excel_and_sql/ | |
| # pip install xlwt ibm_db | |
| import xlrd | |
| import logging | |
| import ibm_db_dbi | |
| logging.basicConfig(level=logging.DEBUG) | |