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
from celery.utils.log import get_task_logger | |
task_logger = get_task_logger(__name__) | |
def send_pushes(wishlist, old_price, new_price): | |
""" | |
하나의 제품의 여러 개의 wishlist 에 대하여 | |
각 wish 의 방해금지 시간을 체크하여 user 에게 푸쉬를 보내거나 딜레이시킵니다 | |
""" | |
for wish in wishlist: |
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
import time | |
from math import sqrt | |
def euler_10(num): | |
""" | |
변수 num 이하의 소수의 합을 구합니다 | |
""" | |
prime_sum = 0 | |
for_x = 2 |
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
from celery import Celery | |
app = Celery('tasks', broker='amqp://') | |
@app.task | |
def add(x,y): | |
return x+y |
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
from marshmallow import Schema, fields, ValidationError, pprint | |
from collections import OrderedDict | |
# model | |
import datetime as dt | |
class User(object): | |
def __init__(self, email, provider): |
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
import time | |
import math | |
def pytha_tri(start, num): | |
tri_set = [] | |
for a in range(start, num+1): | |
for b in range(a, num+1): | |
c = math.sqrt(a**2+b**2) | |
if(a+b+c==1000): | |
tri_set.append([a,b,int(c)]) |
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
import time | |
def find_g_product(num): | |
g_product = 0 | |
digit_list = "73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949545950173795833195285320880551112540698747158523863050715693290963295227443043557668966489504452445231617318564030987111217223831136222989342338030813533627661428280644448664523874930358907296290491560440772390713810515859307960866701724271218839987979087922749219016997208880937766572733300105336788122023542180975125454059475224352584907711670556013604839586446706324415722155397536978179778461740649551492908625693219784686224828397224137565705605749026140797296865241453510047482166370484403199890008895243450658541227588666881164271714799244429282308634656748139191231628245861786645835912456652947654568284891288314260769004224219022671055626321111109370544217506941658960408071984038509624554443629812309878799272442849091888458015616609791913387549920052406368991256071760605886116467109405077541002256983155200055935729725 |