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
#Copyright (c) 2012 Vipin Nair <swvist@gmail.com> | |
#Permission is hereby granted, free of charge, to any person obtaining a copy of | |
#this software and associated documentation files (the "Software"), to deal in | |
#the Software without restriction, including without limitation the rights to | |
#use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies | |
#of the Software, and to permit persons to whom the Software is furnished to do | |
#so, subject to the following conditions: | |
#The above copyright notice and this permission notice shall be included in all |
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
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.datasets import fetch_mldata | |
from sklearn.decomposition import FastICA, PCA | |
from sklearn.cluster import KMeans | |
# fetch natural image patches | |
image_patches = fetch_mldata("natural scenes data") | |
X = image_patches.data |
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
// 99% done by @rauri rochford | |
// http://js1k.com/2012-love/demo/1071 | |
// i just rAF'd it. | |
// demo at http://bl.ocks.org/1823634 | |
e = [];// trails |
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.defaults import * | |
from tastypie.paginator import Paginator | |
from tastypie.exceptions import BadRequest | |
from tastypie.resources import ModelResource | |
from tastypie.utils import trailing_slash | |
from haystack.query import SearchQuerySet, EmptySearchQuerySet | |
from clips.models import Clip |
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
Dear soon-to-be-former user, | |
We've got some fantastic news! Well, it's great news for us anyway. You, on | |
the other hand, are fucked. | |
We've just been acquired by: | |
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
# Feel free to use me. I'm public domain! | |
from django.conf import settings | |
from django import template | |
register = template.Library() | |
class OnlySomethingNode(template.Node): | |
def __init__(self, nodelist, value='LIVE'): |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Histogram</title> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.17.0/d3.js"></script> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.17.0/d3.layout.js"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
<style> | |
body { | |
width: 500px; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Histogram</title> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.17.0/d3.js"></script> | |
<script type="text/javascript" src="https://github.com/mbostock/d3/raw/v1.17.0/d3.layout.js"></script> | |
<style> | |
body { | |
padding: 50px; | |
} |
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
<!-- this usually goes in <project-root>/templates/uni_form/field.html --> | |
{% if field.is_hidden %} | |
{{ field }} | |
{% else %} | |
<div class="clearfix {% if field.errors %}error{% endif %}"> | |
<label for="{{ field.auto_id }}" {% if field.field.required %}class="requiredField"{% endif %}> | |
{{ field.label|safe }}{% if field.field.required %}<span class="asteriskField">*</span>{% endif %} | |
</label> | |
<div class="input"> |
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 | |
import redis | |
import random | |
import pylibmc | |
import sys | |
r = redis.Redis(host = 'localhost', port = 6389) | |
mc = pylibmc.Client(['localhost:11222']) |