This file contains hidden or 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 java.util.*; | |
// 给一个N的正帧数 返回不大于Log2N的最大整数 | |
public class Log { | |
public static int lg(int N) { | |
double log2n = N / 2; // base is 2 | |
int result = 1; | |
while ( result < log2n) { |
This file contains hidden or 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
package Rectangle; | |
class myRectangle { | |
double width = 1.0; | |
double height = 1.0; | |
myRectangle() { | |
} | |
This file contains hidden or 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 | |
__author__ = "swsend" | |
import json | |
import hashlib | |
import datetime | |
from flask import Flask, request, jsonify, Response, render_template |
This file contains hidden or 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 flask import Flask, Blueprint, request | |
app = Flask(__name__) | |
app.config.DEBUG = True | |
#app.url_map.default_subdomain = 'www' | |
app.config['SERVER_NAME'] = 'example.com' |
This file contains hidden or 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
def simple_decorator(f): | |
def wrapper(): | |
print "Entering Function" | |
f() | |
print "Exit" | |
return wrapper |
This file contains hidden or 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 | |
# encoding: utf-8 | |
import os | |
import time | |
import logging | |
import hashlib | |
from sqlalchemy import create_engine, ForeignKey, Column, Integer, String, Text, DateTime,\ |
This file contains hidden or 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 urllib2 | |
from bs4 import BeautifulSoup | |
def get(url): | |
req=urllib2.Request(url) | |
req.add_header("User-Agent","Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)") | |
req.add_header("Referer",url) | |
req.add_header("Cookie","jyean=flVZbRitNuOM44i3VjCPjP93MgxEj24GZ8yvM6fZ9HM4MfiQXQP6_eTlsA1lvSOqypz4l1Dj8OV4X-1xEwkoKZ6P1SyGgiNtNxi3n50-q6H_cTMs3jTa8oHBA47MLuyU0; JYE_FP2=58f1a56e5f3cea7fd10be747461acba5; CNZZDATA2018550=cnzz_eid%3D562178188-1448873225-http%253A%252F%252Fwww.jyeoo.com%252F%26ntime%3D1448873225") |
This file contains hidden or 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 requests | |
import random | |
def getproxy(): | |
foo = ['124.200.33.146:8118', '112.90.72.83:80'] | |
rand = random.choice((foo)) | |
''' Get a dict format proxy randomly ''' | |
proxy= rand |
This file contains hidden or 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 -*- | |
""" | |
Date 16-Jan-3q lastest progres | |
""" | |
#from __future__ import print_function | |
import gevent | |
from gevent import monkey |
This file contains hidden or 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 -*- | |
""" | |
Date 16-Jan-3q lastest progres | |
""" | |
#from __future__ import print_function | |
import gevent | |
from gevent import monkey |