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 cv2 | |
import numpy as np | |
from tkinter import filedialog, Tk | |
from os import getcwd | |
from re import findall | |
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 pymysql | |
from random import shuffle | |
def get_rand_option(cursor, pk): | |
sql = "SELECT `explain` FROM `words190905` where id <> %d order by rand() limit 3 ;" % pk | |
cursor.execute(sql) | |
result = cursor.fetchall() | |
return [item[0] for item in result] |
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 re | |
def parse_question(file_path): | |
result = [] | |
with open(file_path, encoding='utf8') as f: | |
question = '' | |
answer = '' | |
option = '' | |
tmp = dict() |
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,sys,re | |
#(start, end, ratio, fastleft) | |
tax_ratio = [(0, 36000, 0.03, 0), (36000, 144000, 0.1, 2520), (144000, 300000, 0.2, 16920), (300000, 420000, 0.25, 31920), (420000, 660000, 0.3, 52920), (660000, 960000, 0.35, 85920), (960000, -1, 0.45, 181920)] | |
input_str = input("Please Input Your Monthly Salary Like This : 月薪-专项扣除数+年终奖:") | |
#获取工资信息 |
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
///验证ISSN是否有效 | |
/* | |
ISSN有效性的算法: | |
1 ISSN号共8个字符每四位一组,以'-'连接,其中前7位是0-9的数字,最后一位是标识位,可能为 0-9 或者X | |
2 取ISSN号的前7位数字,并分别乘以对应的加权值(8 7 6 5 4 3 2 ) | |
3 将第2步的各个乘积相加, 并对模数(11)求余 | |
4 模数(11)减去余数即为标识位,若模数减余数值为10,则标识位为'X' | |
*/ | |
function isISSN(value) { | |
var re = new RegExp("^[0-9]{4}-[0-9X]{4}$"); |
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
static void Main(string[] args) | |
{ | |
List<MethodInvoker> list = new List<MethodInvoker>(); | |
for (int i = 0; i < 5; i++) | |
{ | |
int counter = i * 10; | |
list.Add(delegate | |
{ |