This file contains hidden or 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
#include <assert.h> | |
#include <pthread.h> | |
#include <setjmp.h> | |
#include <signal.h> | |
#include <stdlib.h> | |
#include "eepy.h" | |
// Information about an active eepy process | |
typedef struct eepy_process { | |
jmp_buf context; |
This file contains hidden or 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
A unit test helper library for App Engine. | |
Note that this is currently COMPLETELY UNTESTED. Consider it demo code only. | |
This library aims to make it easier to unit-test app engine apps and libraries | |
by handling the creation and registration of service stubs and so forth for you. | |
It also provides a custom implementation of the Capability service that allows | |
you to specify what capabilities you want it to report as disabled, and it wraps | |
all stubs in a wrapper that will throw a CapabilityDisabledError if you attempt | |
to use a disabled service or method. |
This file contains hidden or 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
"""Implements a distributed transaction for transfers of funds. | |
Invariant: The sum of all accounts, plus all partially applied transfers, is 0. | |
Steps: | |
1) In a transaction, an Account is debited, and a Transaction object is created, with the | |
appropriate amount and target, but no other transaction. | |
2) In a transaction, the target Account is credited, and a Transaction object is created with | |
a predefined key name, and the other transaction referencing the one created in step 1. | |
3) The original Transaction object created in step 1 is updated to reference the transaction |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<Module> | |
<ModulePrefs title="Links from appengine.reddit.com" height="300"> | |
<Require feature="dynamic-height"/> | |
</ModulePrefs> | |
<Content type="html"><![CDATA[ | |
<style type="text/css"> | |
.rembeddit { | |
margin-bottom: 10px; | |
} |
This file contains hidden or 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
package main | |
import "fmt" | |
type state struct { | |
board [7][6]int; | |
heights [7]int; | |
} | |
type move struct { |
This file contains hidden or 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
include $(GOROOT)/src/Make.$(GOARCH) | |
TARG=kademlia | |
GOFILES=\ | |
nodeid.go\ | |
routingtable.go\ | |
contact.go\ | |
kademlia.go | |
include $(GOROOT)/src/Make.pkg |
This file contains hidden or 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/python | |
import base64 | |
import logging | |
import Queue | |
import sys | |
import threading | |
import time | |
import urllib2 |
This file contains hidden or 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
package main | |
import ( | |
"flag"; | |
"log"; | |
"os"; | |
"strings"; | |
"time"; | |
) |
This file contains hidden or 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 google.appengine.ext import db | |
class EntityCache(object): | |
"""Caches fetched entities so subsequent fetches return the same instance. | |
Usage: | |
cache = EntityCache() | |
e1, e2 = cache.get([k1, k2]) | |
e3, e4 = cache.get([k2, k3]) | |
assert e2 == e3 |
This file contains hidden or 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 logging | |
import time | |
from google.appengine.api import mail | |
from google.appengine.ext import db | |
from google.appengine.ext.deferred import defer | |
from google.appengine.runtime import apiproxy_errors | |
class BulkUpdater(object): | |
"""A bulk updater for datastore entities. |