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 pylibmc | |
print pylibmc.__file__ | |
from pylibmc import Client | |
import random | |
import sys | |
client = Client(['localhost:11211']) | |
client.behaviors.update({'cas': 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
""" | |
A simple LRU cache | |
""" | |
class NotFound(object): | |
pass | |
class LRUCacheEntry(object): | |
__slots__ = ('prev', # the next most recently used item | |
'next', |
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
#include <stdio.h> | |
#include <mach/std_types.h> | |
#include <stdlib.h> | |
#define TUMBLERS_PER_IMAGE 15 | |
typedef enum { | |
DEFCON, | |
EIGHTEEN, // * 0xE38 + 16¢ | |
BADGE, |
NewerOlder