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 ruby | |
# -*- coding: utf-8 -*- | |
# | |
# exposure.rb => Break a position down into multiple spreads. | |
# Copyright (C) 2009 Zachary Voase | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. |
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
# -*- coding: utf-8 -*- | |
import eventlet | |
import eventlet.api | |
import eventlet.coros | |
def call_cc(function): | |
ev = eventlet.coros.event() | |
function(ev.send) | |
return ev.wait() |
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
# -*- coding: utf-8 -*- | |
# | |
# Copyright (c) 2009 Zachary Voase | |
# | |
# 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 |
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
Index: django/db/models/base.py | |
=================================================================== | |
--- django/db/models/base.py (revision 10088) | |
+++ django/db/models/base.py (working copy) | |
@@ -188,7 +188,11 @@ | |
new_class._prepare() | |
register_models(new_class._meta.app_label, new_class) | |
- | |
+ |
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
# -*- coding: utf-8 -*- | |
""" | |
Managers for pre-defined queries. | |
Example:: | |
from django.db import models | |
from qmanager import QManager |
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
# -*- coding: utf-8 -*- | |
""" | |
Models with signals. | |
Example:: | |
from django.db import models | |
import modsig | |
class MyModel(modsig.Model): |
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
*.pyc |
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
-- An implementation of call-with-current-continuation in Lua. | |
-- (c) 2009 Zachary Voase | |
function callcc (fun) | |
function coro () | |
-- The coroutine which will hold the value with which it is called, then | |
-- yield it back again later. | |
local val = coroutine.yield() | |
coroutine.yield() |
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
The following shows how you might go about using the processed data which is | |
output from parse_humsavar.py. | |
We’ll begin by reading it out from JSON; this involves importing the JSON | |
library, opening the file, and then just using ``json.load()``:: | |
# If you’re using Python 2.5, you probably have the bottom one (so you can | |
# just run `import simplejson as json`); if you’re using Python 2.6 then you | |
# definitely have the top one, so you can just do `import json`. | |
>>> import json |
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
# -*- coding: utf-8 -*- | |
# django_pave.py - Run Django management commands with a Paver task. | |
# | |
# It’s simple really; just run `paver manage syncdb`, or | |
# `paver manage runserver`, or indeed any Django management command. You can | |
# also define Paver tasks which load the Django settings before execution. | |
# | |
# Copyright (c) 2009 Zachary Voase <zacharyvoase@me.com> | |
# | |
# Permission is hereby granted, free of charge, to any person |
OlderNewer