Skip to content

Instantly share code, notes, and snippets.

View cowlicks's full-sized avatar
💭
SEE TRANSLATION

cowlicks

💭
SEE TRANSLATION
View GitHub Profile
so gist is like pastebin with the features of git?
@cowlicks
cowlicks / django-messages-fail
Created July 20, 2012 17:47
django-messages failure
TemplateSyntaxError at /messages/trash/
Caught DatabaseError while rendering: Only AND filters are supported
Request Method: GET
Request URL: http://localhost:8000/messages/trash/
Django Version: 1.3
Exception Type: TemplateSyntaxError
Exception Value:
@cowlicks
cowlicks / django-messages test fail
Created July 20, 2012 17:53
django-messages test fail
blake@RectangularPrism:~/illuminus$ python manage.py test django_messages
/usr/local/google_appengine/google/appengine/api/search/search.py:232: UserWarning: DocumentOperationResult._code is deprecated. Use OperationResult._code instead.
'Use OperationResult.%s instead.' % (name, name))
/usr/local/google_appengine/google/appengine/api/search/search.py:232: UserWarning: DocumentOperationResult._CODES is deprecated. Use OperationResult._CODES instead.
'Use OperationResult.%s instead.' % (name, name))
Creating test database for alias 'default'...
Skipping creation of NoticeTypes as notification app not found
Creating test database for alias 'native'...
......ERROR 2012-07-20 10:52:08,820 base.py:209] Internal Server Error: /messages/trash/
Traceback (most recent call last):
@cowlicks
cowlicks / Bye Chris.
Created July 28, 2012 18:55
Letter to Chris.
print("By Chris, have fun at Stanford. Don't work too hard ;)."
@cowlicks
cowlicks / :
Created September 26, 2012 05:27
German homework
1. Wie viele Männer und Frauen wohnen schon in dieser Wohngemeinschaft (WG)?
Achtzehn Männer und Siebzehn Fruen wohnen in dieser WG.
2. Soll ein Mann oder eine Frau einziehen?
Das ist keine Präferenz.
3. Wie groß ist das Zimmer?
Das Zimmer ist 13m^2.
4. In welcher Stadt und in welcher Stadtteil ist das Zimmer?
@cowlicks
cowlicks / gist:5954708
Created July 9, 2013 04:24
build failure trying to use nikola with ipython notebook.
(nikola)blake@quadrilateral:~/cowlicks$ nikola build
Scanning posts..Traceback (most recent call last):
File "/home/blake/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit/doit_cmd.py", line 103, in run
return self.sub_cmds[command].parse_execute(args)
File "/home/blake/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit/cmd_base.py", line 60, in parse_execute
return self.execute(params, args)
File "/home/blake/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit/cmd_base.py", line 226, in execute
args)
File "/home/blake/.virtualenvs/nikola/local/lib/python2.7/site-packages/nikola/main.py", line 87, in load_tasks
tasks = generate_tasks('render_site', self.nikola.gen_tasks('render_site', "Task"))
@cowlicks
cowlicks / nikola_fail
Created July 9, 2013 05:44
more nikola failures with ipython notebook
(nikola)blake@quadrilateral:~/cowlicks$ nikola build
Scanning posts....done!
. render_sources:output/posts/week-6-ufunc-overrides.ipynb
. render_posts:cache/posts/week-6-ufunc-overrides.html
########################################
TaskError - taskid:render_posts:cache/posts/week-6-ufunc-overrides.html
PythonAction Error
Traceback (most recent call last):
File "/home/blake/.virtualenvs/nikola/local/lib/python2.7/site-packages/doit/action.py", line 324, in execute
returned_value = self.py_callable(*self.args, **kwargs)
@cowlicks
cowlicks / primes.py
Last active December 25, 2015 02:29
Simple python prime generator
def next_prime():
"""Prime generator.
>>> import primes
>>> a = primes.next_prime()
>>> a.next()
2
>>> a.next()
3
"""
def is_prime(n):
@cowlicks
cowlicks / Laplacian operator in frequency domain
Created October 13, 2013 17:49
Function to compute the discrete 2D Laplacian operator in the frequency domain.
import math
import numpy as np
def kv2(Nx, Ny, Lx, Ly):
""" Compute the discrete 2D Laplacian in the frequency domain."""
kv2 = np.empty((Nx, Ny))
# We don't want floor division with Lx, Ly
Lx = float(Lx)
Ly = float(Ly)
def set_point(kx, ky):
@cowlicks
cowlicks / serve_slides.py
Last active December 26, 2015 02:19
script to generate and serve slides from an ipython notebook, it regenerates the slides when they are changed.
#!/usr/bin/env python
"""A script to generate and serve the slides from a ipython notebook
that auto updates the slides. It would be nice to include something like
this in IPython. Usage:
>>> python serve_slides.py presentation.ipynb
"""
import sys