A PyQt application needs special build instructions.
To install PySide, you'll need to follow the [PySide installation guide][pyside-install], which will likely installing Qt at the system level along with development headers.
| """ | |
| Example of using namedtuple: | |
| >>> from collections import namedtuple | |
| >>> Point = namedtuple("Point", "x y") | |
| >>> point = Point(1, 2) | |
| >>> point | |
| Point(x=1, y=2) | |
| >>> point.x | |
| 1 |
| class Tree(dict): | |
| """A Tree is a dict-like object that nests arbitrarily. | |
| It supports both `tree["key"]` and `tree.key` syntax for lookups. | |
| A lookup for a missing key, by either syntax, results in creation | |
| of a new nested tree, e.g. | |
| >>> tree = Tree() | |
| >>> tree.a.b.c = "d" | |
| >>> tree |
| import functools | |
| def delayed(fn): | |
| """Convert fn into delayed_fn with delayed(fn). | |
| Take a function and convert it into a function that, rather than invoking | |
| the function's call, instead returns a 3-tuple of `(fn, args, kwargs)`. | |
| This can then be later called with the simple `fn(*args, **kwargs)` application | |
| syntax, or the 3-tuple can be passed to other APIs that expect it, like |
| postgres: | |
| image: postgres:9.4.4 | |
| ports: | |
| - "5432:5432" | |
| redis: | |
| image: redis:2.8.21 | |
| ports: | |
| - "6379:6379" | |
| elasticsearch: | |
| image: elasticsearch:1.7.2 |
| from __future__ import print_function | |
| import elasticsearch | |
| import collections | |
| import json | |
| def flatten(d, parent_key='', sep='_'): | |
| items = [] | |
| for k, v in d.items(): | |
| new_key = parent_key + sep + k if parent_key else k |
| #!/bin/sh | |
| # on Ubuntu 14.04, set a pm-hibernate resume hook | |
| # which is placed in /etc/pm/sleep.d/00_intel_pstate | |
| # it sets up CPU intel pstate appropriately, which by default | |
| # gets ruined by being scaled down to 50% of max CPU without the | |
| # easy ability to change it back; also sets governor to performance | |
| # for good measure, since apparently default is "powersave" |
| #/bin/bash | |
| # weird one-liner to find top 100 Python imports in a project | |
| # stolen/customized from Chris H. Wiggins @ https://gist.github.com/chrishwiggins/7518300e0d8649d8d791 | |
| find . -name '*.py' | grep -v -e '/venv/' -e '(' -e ')' | \ | |
| xargs -I % grep import % | sed -e 's/^[ ]*//' | \ | |
| grep -e '^from ' -e '^import ' | awk '{print $2}' | \ | |
| sed -e 's/^[\.]*//' | cut -d\. -f1 | tr '[A-Z]' '[a-z]' | \ | |
| sort -bfd | uniq -c | sort -nr | head -100 |
| feature | area | ||
|---|---|---|---|
| 0 | A | 32.5 | |
| 1 | A | 45.6 | |
| 2 | A | 42.1 | |
| 3 | B | 1.5 | |
| 4 | B | 6.08 | |
| 5 | B | 5.1 | |
| 6 | C | 5.9 | |
| 7 | C | 16.5 | |
| 8 | C | 32.5 |
Index aliasing lets us version and swap indices without downtime, which could improve the rebuild path.
This is the "swap" operation that would be used for upgrade_index.
http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/indices-aliases.html
-XPOST localhost:9200/_aliases
{
"actions": [
{ "remove": {