- Date
07/03 2016
- Source
daxue.qq.com/content/content/id/2578
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: utf8 | |
import sys | |
try: | |
import Image | |
except: | |
from PIL import Image | |
# YUV420P To RGB |
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
"use strict"; | |
function primes_with_generator(start, max){ | |
// start: int ( start >= 2 ) | |
// max : int | |
if ( start < 2 ) throw new Error("start > 2 | start == 2"); | |
var generator = function* (start, max){ | |
var n = start || 2; | |
while ( n <= max ){ | |
yield n++; |
- Date
10/20 2016
官方资料: Create an Auto-Incrementing Sequence Field
Pymongo方法: update_one
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
#!/usr/bin/env python | |
import sys, time, operator, datetime | |
"""" | |
$ pip2 install pytz tzlocal | |
""" | |
try: | |
import pytz |
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
#![allow(dead_code)] | |
// Copy from https://golang.org/src/hash/adler32/adler32.go | |
// mod is the largest prime that is less than 65536. | |
const MOD: usize = 65521; | |
// nmax is the largest n such that | |
// 255 * n * (n+1) / 2 + (n+1) * (mod-1) <= 2^32-1. | |
// It is mentioned in RFC 1950 (search for "5552"). | |
const NMAX: usize = 5552; |
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
{ | |
"name": "webapp", | |
"version": "1.0.0", | |
"description": "web application", | |
"keywords": [ | |
"web", | |
"application" | |
], | |
"author": "", | |
"license": "", |