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
| // #[feature(globs)]; | |
| extern crate collections; | |
| // use std::iter::*; | |
| use std::from_str::from_str; | |
| // use std::str::from_utf8; | |
| // use collections::hashmap::HashSet; | |
| #[deriving(Clone)] | |
| struct Knapsack { | |
| score: uint, |
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
| class KyotoTycoon(object): | |
| ... | |
| def get(self, key): | |
| with self.pool.acquire() as c: | |
| return c.get(key, db=self.db) | |
| # example #2 | |
| def set(self, key, value): | |
| conn = self.pool.acquire() | |
| with conn: |
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
| __pycache__/ | |
| *.pyc |
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 eventlet | |
| eventlet.monkey_patch() | |
| import time | |
| import flask | |
| def a(i): | |
| # shsh~~! | |
| return '<p>{0}</p>'.format(i) |
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
| tag_types = ['location', 'category'] | |
| class Tag(db.Model, BaseEntityMixIn, | |
| IgnoreDeletionMixIn): | |
| __tablename__ = "tag" | |
| name = db.Column(db.Unicode(255), index=True) | |
| type = db.Column(db.Enum(*tag_types, native_enum=False), index=True) | |
| __mapper_args__ = {'polymorphic_on': type} |