- Sponsored search
- Contextual advertising
- Display advertising
- pay per click
- pay per impression
| from random import randint | |
| from time import time | |
| def swap(array, i, j): | |
| array[i], array[j] = array[j], array[i] | |
| def bubble(array): | |
| n = len(array) |
| # hints from http://wuchong.me/blog/2014/03/25/interview-link-questions/ | |
| class Node: | |
| def __init__(self, value): | |
| self.value = value | |
| self.next = None | |
| class LinkList: | |
| def __init__(self, values): |
| # run this with bash: `EPOCH=20 python config.py` | |
| import os | |
| class Config: | |
| def __init__(self): | |
| self.EMBEDDING_DIM = 256 | |
| self.EPOCH = 10 | |
| self.SAVE_PATH = os.path.join(os.path.curdir, 'checkpoint') |
| from time import time | |
| def timeit(func): | |
| def wrap(*args, **kwargs): | |
| start = time() | |
| result = func(*args, **kwargs) | |
| print('[Time]: {:6f}'.format(time() - start)) | |
| return result | |
| return wrap |
| install: | |
| pip install -e . | |
| test: | |
| py.test tests | |
| doc: | |
| cd docs && make html | |
| clean: |
| from setuptools import setup, find_packages | |
| from os import path | |
| from io import open | |
| here = path.abspath(path.dirname(__file__)) | |
| with open(path.join(here, 'README.md'), encoding='utf-8') as f: | |
| readme = f.read() |