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 random | |
from django.conf import settings | |
from django.db import models | |
from library.cachemethod.decorator import cachemethod | |
from library.cachemethod.api import delete_method_cache |
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 re | |
class PlayerShardRouter(object): | |
regex_app = re.compile('.*player.*') | |
regex_db = re.compile('.*shard.*') | |
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 | |
class Entity(object): | |
def __init__(self, entity_type, entity_id): | |
self.entity_type = entity_type | |
self.entity_id = entity_id | |
class Reward(object): | |
def __init__(self, entity_type, entity_id, number): |
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
""" | |
PERSON_DAILY: {Date: [PersonID, PersonID]} | |
指定期間中に人は会議に2回参加しなければならない。 | |
同じ日には2度参加できない。 | |
1回目の参加日は下記(PERSON_DAILY)で決まっており、 | |
2回目移行は自動で割り振られる。 | |
自動で割り振る際に日による人数の偏りをできるだけ無くすようにする | |
アルゴリズムを考えよ。 | |
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
# coding: utf-8 | |
from __future__ import unicode_literals | |
from flask import Flask, jsonify, session, request, redirect, url_for | |
app = Flask(__name__) | |
class User(object): | |
fixtures = { | |
'1': { | |
'name': "Johnson", |
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 | |
from __future__ import absolute_import, unicode_literals | |
import gevent | |
from django.db import models | |
from django.utils.functional import cached_property | |
class AppUser(models.Model): | |
id = models.CharField(max_length=100, primary_key=True) | |
name = models.CharField(max_length=100) |
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 Smaple(models.Model): | |
var_id = models.IntegerField() | |
@cached_property | |
def var(self): | |
return Var.get(self.var_id) | |
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
var count = 0 | |
for scene in scenes { | |
if scene.hasPrefix("Act 1") { | |
count += 1 | |
} | |
} | |
count = scenes.filter({$0.hasPrefix("Act 1")}).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
source 'https://rubygems.org' | |
gem 'chef' | |
gem 'knife-solo' |
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 | |
from boto import ses | |
from django.conf import settings | |
class EMail(object): | |
def __init__(self): | |
self._connection = ses.connect_to_region( |
OlderNewer