Here’s an idea that’s been kicking around inside my head recently.
A standard M2M relationship, as represented in SQL, looks like this:
CREATE TABLE movie (
id SERIAL PRIMARY KEY,
name VARCHAR(255)
);
| import sys | |
| import json | |
| import ntriples | |
| import time | |
| from datetime import datetime | |
| import httplib | |
| ES_URL = "localhost:9200" | |
| ES_PATH = "/bibserver/" |
| require 'httparty' | |
| class Github | |
| include HTTParty | |
| base_uri "https://api.github.com" | |
| BaseDirectory = "/Users/ugorelik/programming/repos" | |
| def initialize(u, p) | |
| @auth = { username: u, password: p} | |
| load_bitbucket_repos |
| import zlib | |
| from base64 import b64decode, b64encode | |
| from django.db import models | |
| # django-jsonfield | |
| from jsonfield import JSONField | |
| class CompressedJSONField(JSONField): |
| """ | |
| Example of using the old BeautifulSoup API to extract content from downloaded html files into CSV... if you're doing this sort of thing today, I recommend using the newer lxml interface directly, but lxml also has a BeautifulSoup compatibility layer. | |
| """ | |
| import os | |
| NSString *const kColorShiftFragmentShaderString = SHADER_STRING | |
| ( | |
| varying highp vec2 textureCoordinate; | |
| uniform sampler2D inputImageTexture; | |
| uniform lowp float redShift; | |
| uniform lowp float greenShift; | |
| uniform lowp float blueShift; |
| import sys | |
| import json | |
| import ntriples | |
| from datetime import datetime | |
| import httplib | |
| ES_URL = "localhost:9200" | |
| ES_PATH = "/bibserver/" | |
| field_mapping = { |
Here’s an idea that’s been kicking around inside my head recently.
A standard M2M relationship, as represented in SQL, looks like this:
CREATE TABLE movie (
id SERIAL PRIMARY KEY,
name VARCHAR(255)
);
| # UPDATE IN 2020 | |
| # You almost always will want to use the version at | |
| # https://github.com/luispedro/imread, which is | |
| # up-to-date and works with Python 3 | |
| # Copyright: Luis Pedro Coelho <luis@luispedro.org>, 2012 |
| #include "Python.h" // should be before any standard headers | |
| #include <errno.h> | |
| #include <pthread.h> | |
| static void* | |
| non_python_thread(void *python_callback) { | |
| //XXX without PyEval_InitThreads() it produces: | |
| // Fatal Python error: PyEval_SaveThread: NULL tstate | |
| //XXX with PyEval_InitThreads() it deadlocks!! | |
| //XXX without PyGILState_*() (with/without PyEval_InitThreads()) it produces: |
| """ | |
| # This snippet is in public domain | |
| # https://gist.github.com/techtonik/4066623/ | |
| # Minified (Python 2.6+, 3+ compatible): | |
| import io | |
| from os.path import dirname, join | |
| def get_version(relpath): |