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
sm = Selmaho() | |
sm.selmaho = smt | |
sm.multi = 1 | |
session.save(sm) | |
print session.query(Selmaho).count() |
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
def query(self, query=None, type=None, valsi=[], gloss=None, | |
rafsi=[], selmaho=None, definition=None, notes=None, | |
regexp=False, like=None): | |
results = [] | |
if query: | |
args = {"gloss": gloss, "valsi": valsi, "rafsi": rafsi, | |
"selmaho": selmaho, "definition": definition, "notes": notes, | |
"regexp": regexp, "type": type} | |
listargs = ["valsi", "rafsi"] |
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
class Dancer | |
def description() | |
"is like a beautiful swan, gracefully flying over a lake" | |
end | |
def steps() | |
"⚡→→→→↓↓↓↓←↓→↓←↑↑↑↑→↓←↑Ϟ" | |
end | |
def dance() | |
puts self.WHAT | |
puts "My dance " + self.description |
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 threading | |
import time | |
import subprocess | |
# make the system preload the sound | |
subprocess.Popen(["mplayer", "/home/timo/.drama/drama.ogg", "-ao", "null"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) | |
def prebuffer_image(image): | |
open("/home/timo/Pictures/wallpapers/" + image, "r").read() | |
threading.Thread(target=prebuffer_image, args=("kittenface.jpg",)).start() |
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
class City(Base): | |
__tablename__ = "city" | |
name = Column(Unicode(6), primary_key=True) | |
rooms = relationship("Room", backref="city") | |
def __repr__(self): | |
return u'<City "%s" with %d rooms>' % (self.name, len(self.rooms)) | |
class Room(Base): | |
__tablename__ = "room" |
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 !exists('b:did_flymake') | |
let b:did_flymake = 1 | |
autocmd BufWritePost <buffer> | |
\ call FlyMake('cd %s; export FN="%s"; pylint "$FN"; pep8 "$FN"; pyflakes "$FN"', | |
\ '[^:]*:\([0-9]*\):\%\(.*:\)? \(.*\)', | |
\ '.*:\([0-9]*\):\%\(.*:\)? \(.*\)') | |
autocmd BufWinLeave <buffer> call FlyMakeCloseWindows() | |
endif |
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
function! s:FlyMakeDisplay(buf, type, msg, regexp) | |
let source_file = expand("%") | |
let dic = s:FlyMakeParseDictionary(a:msg, a:regexp) | |
if len(keys(dic)) == 0 | |
return 0 | |
endif | |
let sorted_keys = sort(keys(dic), function('s:FlyMakeNumberSort')) | |
execute 'match' a:type "'\\%" . sorted_keys[0] . "l'" | |
call cursor(sorted_keys[0], 1) |
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:utf8 -*- | |
import urllib | |
import lxml.etree | |
from subprocess import Popen | |
rohdaten = urllib.urlopen("http://events.ccc.de/camp/2011/Fahrplan/schedule.en.xml").read() | |
#daten = unicode(rohdaten, "latin1") | |
daten = rohdaten |
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
"""============================== | |
Branded IPython Notebook Launcher | |
================================= | |
Executing this module will create an overlay over ipython notebooks own static | |
files and templates and overrides static files and templates and copies over all | |
example notebooks into a temporary folder and launches the ipython notebook server. | |
You can use this to offer an interactive tutorial for your library/framework/... |
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
diff -r 07bd76d923fd pypy/module/micronumpy/interp_numarray.py | |
--- a/pypy/module/micronumpy/interp_numarray.py Wed Jan 18 09:32:00 2012 +1000 | |
+++ b/pypy/module/micronumpy/interp_numarray.py Sat Jan 21 21:33:07 2012 +0100 | |
@@ -558,6 +558,12 @@ | |
arr.setshape(space, new_shape) | |
return arr | |
+ def descr_ravel(self, space, w_order="C"): | |
+ if space.str_w(w_order) != "C": | |
+ raise OperationError(space.w_NotImplementedError, space.wrap( |
OlderNewer