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
// 笔试题目的简单实现 | |
// 请看博客: https://corvo.myseu.cn/2018/04/20/2018-04-20-斐波那契数列的Log(n)解法/ | |
#include <vector> | |
#include <iostream> | |
#include <sstream> | |
#include <string> | |
#include <vector> | |
#include <limits.h> | |
#include <cstdio> |
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
" Just for windows gvim, now maybe you could use it on linux. | |
colorscheme desert | |
set nu | |
" Windows上与Linux上配置是不同的 | |
if has('win32') | |
set guifont=consolas:h12 |
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
import urllib | |
import urllib.request | |
import json | |
import base64 | |
def init(): | |
res = urllib.request.urlopen('http://w.seu.edu.cn/index.php/index/init') | |
body = res.read() |
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
/* | |
*======================================================================= | |
* Filename:clock_test.c | |
* | |
* Version: 1.0 | |
* Created on: May 20, 2018 | |
* | |
* Author: corvo | |
* | |
* gcc clock_test.c -o clock_test -lm |
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
// 基于网站 http://www.cunet.com.cn/gaozhao/HTML/239864.html | |
// 姐姐托我给外甥女估分选个学校, 看到了下面这个网址, 可是这里面的信息是没有排序的, 所以自己写了一个排序程序 | |
// 可以按照分数进行排序. | |
var wrap = document.getElementsByClassName('wrap_centerfont'); | |
var tbl = wrap[0].children[2]; | |
var all_tbs = tbl.tBodies[0].children |
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
import matplotlib.pyplot as plt | |
import numpy as np | |
import math | |
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签 | |
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号 | |
x = np.arange(0, 10, 0.1) |
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
#!/bin/bash | |
# 使用方式: | |
# curl https://gist.githubusercontent.com/corvofeng/f16a1fab54757f32879ae4d326c27518/raw/prod.sh | bash - | |
# curl -sL https://corvo.myseu.cn/xyz/prod.sh | bash - | |
sudo apt install -y git htop tmux zsh cscope ranger | |
function save_env() { | |
# 必须有两个参数, key, value | |
[ $# != 2 ] && return |
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
# 0 is too far from ` ;) | |
set -g base-index 1 | |
# Automatically set window title | |
set-window-option -g automatic-rename on | |
set-option -g set-titles on | |
#set -g default-terminal screen-256color | |
set -g status-keys vi | |
set -g history-limit 10000 |
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
package main | |
import ( | |
"log" | |
"net" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
) | |
// From: https://stackoverflow.com/a/26224019/5563477 |
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
package main | |
// Refer to: | |
// https://github.com/golang/oauth2/pull/356/files/7cf8880eb1e002ce6fb90ffadae90b41452462e3 | |
// https://docs.github.com/cn/developers/apps/building-oauth-apps/authorizing-oauth-apps#device-flow | |
import ( | |
"context" | |
"encoding/json" | |
"errors" | |
"fmt" | |
"io" |