Skip to content

Instantly share code, notes, and snippets.

@wangyangkobe
wangyangkobe / daemon.py
Created February 29, 2016 07:41 — forked from jamiesun/daemon.py
一个python守护进程的例子
#! /usr/bin/env python2.7
#encoding:utf-8
#@description:一个python守护进程的例子
#@tags:python,daemon
import sys
import os
import time
import atexit
from signal import SIGTERM
@wangyangkobe
wangyangkobe / main.cpp
Created July 14, 2016 00:29
Akuna Capital (Shanghai) C++ Coding Challenge For Regular Program
#include <iostream>
#include <fstream>
#include <stdint.h>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
using namespace std;
#pragma pack(push)
@wangyangkobe
wangyangkobe / foo.log
Created September 8, 2016 04:47 — forked from ibeex/foo.log
Flask logging example
A warning occurred (42 apples)
An error occurred
@wangyangkobe
wangyangkobe / parallel_accumulate.cpp
Created December 15, 2016 05:44
a parallel version of std::accumulate.
#include <thread>
#include <iostream>
#include <memory>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
using namespace std;
template<typename Iterator, typename T>
@wangyangkobe
wangyangkobe / Fibonacci.py
Created March 2, 2017 01:05
Python斐波那契数列的实现
def fabinacci(n):
x,y = 0,1
for index in range(n):
x,y = x+y, x
return x
def cache(fun):
_cache = {}
def _inner(n):
if n in _cache: