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
function rc4(data, key) { | |
var box = Array(256) | |
for (var i = 0; i < 256; i++) { | |
box[i] = i | |
} | |
var x = 0 | |
for (var i = 0; i < 256; i++) { | |
x = (x + box[i] + key.charCodeAt(i % key.length)) % 256 |
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
# Python2.7 | |
# pip intall pynput | |
from pynput import mouse | |
from pynput import keyboard | |
from pynput.mouse import Button | |
from pynput.keyboard import Key, KeyCode | |
import time |
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
# lunar.py | |
# 2015/02/27 罗兵 | |
import datetime | |
class Lunar(object): | |
#****************************************************************************** | |
# 下面为阴历计算所需的数据,为节省存储空间,所以采用下面比较变态的存储方法. | |
#****************************************************************************** | |
#数组g_lunar_month_day存入阴历1901年到2050年每年中的月天数信息, | |
#阴历每月只能是29或30天,一年用12(或13)个二进制位表示,对应位为1表30天,否则为29天 |
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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |
<title>四数推理</title> | |
<style> | |
* { | |
font-size: 30px; | |
font-family: monospace; | |
} |
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
# ============ python2 ==================== | |
import commands | |
commands.getoutput("ls") | |
commands.getstatus("ls") | |
status, output = commands.getstatusoutput("ls") | |
# ============ python3 ==================== | |
from subprocess import Popen, PIPE |
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
assert 0.1 + 0.2 == 0.30000000000000004 | |
assert 0.3 - 0.2 == 0.09999999999999998 | |
assert 5.06 * 100 == 505.99999999999994 |
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 os | |
import requests | |
import BeautifulSoup | |
root_url = 'http://index-of.es/' | |
headers = { | |
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36' | |
} |
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
#!python2 | |
#coding=utf8 | |
import random | |
class Man(object): | |
def __init__(self, name, values): | |
self.name = name |
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
include world | |
include image | |
# 这些是我预先上传的数字图片,在开始先下载下来几个 | |
# 也可以不写这几行,这样在运行的过程中用到是会下载 | |
im_2 = image-url('http://taojy123.cn:2048/2.png') | |
im_4 = image-url('http://taojy123.cn:2048/4.png') | |
im_8 = image-url('http://taojy123.cn:2048/8.png') |
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 thread | |
import time | |
lock = thread.allocate_lock() | |
def mutex(func): |