This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"9781568981352": { | |
"small": { | |
"url": "http://covers.openlibrary.org/b/isbn/9781568981352-S.jpg?default=false", | |
"source": "openlibrary" | |
}, | |
"large": { | |
"url": "http://covers.openlibrary.org/b/isbn/9781568981352-L.jpg?default=false", | |
"source": "openlibrary" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If everything were perfectly predictable, we'd be able | |
# to replace these next two ifs with one that considers | |
# whether addendum.__package__ == addendumstring ... but no. | |
# C'est la guerre. | |
if hasattr(addendum, '__package__'): | |
if addendum.__package__ not in (None, ''): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.conf.urls import patterns, include, url | |
# you can only define a namespace for urls when calling include() -- hence this rigamarole: | |
app_patterns = patterns('', | |
url(r'^(?P<pk>[\w\-]+)/$', 'yourapp.views.your_view_function', | |
name="your-view"), | |
) | |
urlpatterns = patterns('', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ASIO-OTUS:tmp$ brew remove pango | |
Uninstalling /usr/local/Cellar/pango/1.29.4... | |
ASIO-OTUS:tmp$ brew edit pango | |
ASIO-OTUS:tmp$ brew -v install pango | |
Homebrew 0.8 | |
==> Downloading http://ftp.gnome.org/pub/gnome/sources/pango/1.29/pango-1.29.4.tar.bz2 | |
/usr/bin/curl -f#LA Homebrew 0.8 (Ruby 1.8.7-249; Mac OS X 10.7.2) http://ftp.gnome.org/pub/gnome/sources/pango/1.29/pango-1.29.4.tar.bz2 -o /Users/fish/Library/Caches/Homebrew/pango-1.29.4.tar.bz2 | |
######################################################################## 100.0% | |
/usr/bin/tar xf /Users/fish/Library/Caches/Homebrew/pango-1.29.4.tar.bz2 | |
==> ./configure --disable-dependency-tracking --disable-debug --prefix=/usr/local/Cellar/pango/1.29.4 --enable-man --with-x --with-html-dir=/usr/local/Cellar/pango/1.29.4/share/doc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
#sudo chmod -R a+rw /etc/apt | |
#echo 'deb http://http.us.debian.org/debian unstable main contrib non-free' > /etc/apt/sources.list | |
export PATH=/usr/local/bin:/usr/local/sbin:/sbin:/usr/sbin:${PATH} | |
sudo apt-get -y update | |
sudo apt-get --force-yes -f --install-recommends --fix-missing upgrade | |
sudo apt-get -y purge python2.6 python2.6-dev python2.7 python2.7-dev python3-minimal python3.2-minimal python3 python3.2 | |
sudo apt-get -y autoclean |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db.models.loading import cache | |
from apps.mercer import models as mx | |
def print_mf(mf): | |
print "%15s %20s %20s %20s" % (mf.db_column,mf.column,mf.name,mf.attname) | |
for modl in [cache.get_model('mercer', mi) for mi in mx.__dict__.keys()]: | |
if modl is not None and not modl._meta.object_name.lower().startswith('mm'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
strip-pdf-metadata.py | |
Created by FI$H 2000 on 2012-01-17. | |
Copyright (c) 2012 Objects In Space And Time, LLC. All rights reserved. | |
See also: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyflann import * | |
from numpy import * | |
from numpy.random import * | |
dataset = rand(10000, 128) | |
testset = rand(1000, 128) | |
flann = FLANN() | |
result,dists = flann.nn(dataset,testset,5,algorithm="kmeans", | |
branching=32, iterations=7, checks=16) | |
print '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Installation script for the vlfeat module | |
""" | |
import sys, os | |
from distutils.core import Extension, setup | |
from distutils.errors import DistutilsFileError |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from guidata.qt.QtGui import (QMainWindow, QMessageBox, QSplitter, QListWidget, | |
QFileDialog, QVBoxLayout, QHBoxLayout, QWidget, | |
QTabWidget, QMenu, QApplication, QCursor, QFont) | |
from guidata.qt.QtCore import Qt, QT_VERSION_STR, PYQT_VERSION_STR, SIGNAL | |
import sys, platform, os.path as osp, os | |
import numpy as np | |
from guidata.dataset.datatypes import DataSet, ValueProp | |
from guidata.dataset.dataitems import (IntItem, FloatArrayItem, StringItem, |