If you want to make us angry you can do
<ng-class="{'ng-hidden': condition}">
instead of ng-hidden="condition"
or even better
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"<[email protected]> | |
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) | |
# Python 3 | |
# http://www.reddit.com/r/learnpython/comments/13ugqf/getting_information_from_xml_python_3/ | |
from xml.etree import ElementTree as ET | |
from urllib import request | |
URL = 'http://weather.yahooapis.com/forecastrss?w=3369&u=c' | |
# XML name-space for yweather elements. Note you have to use the correct | |
# name-space when selecting elements, which is what all the '{%s}' stuff |
# Test for scaling function. Python 2.7. | |
# http://www.nerdydork.com/django-custom-upload-handler-to-compress-image-files.html | |
def scale_dimensions(width, height, longest_side): | |
if width > longest_side: | |
ratio = longest_side * 1. / width | |
return (int(width * ratio), int(height * ratio)) | |
elif height > longest_side: | |
ratio = longest_side * 1. / height | |
return (int(width * ratio), int(height * ratio)) | |
return (width, height) |
from __future__ import unicode_literals | |
from bottle import Bottle, request, response | |
from mypkg import analyse_data | |
# http://www.reddit.com/r/learnpython/comments/1037g5/whats_the_best_lightweight_web_framework_for/ | |
# http://bottlepy.org/docs/dev/tutorial.html | |
app = Bottle() | |