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
#===请按实际情况修改路径 | |
#定时保存进度 | |
#input-file=/root/.aria2/aria2.session | |
save-session=/root/.aria2/aria2.session | |
#定时保存会话,需要1.16.1之后的release版 | |
save-session-interval=1200 | |
#文件保存路径, 默认为当前启动位置 | |
dir=/mnt/disks/sda4/Downloads/ | |
# fix EOF error |
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
#!/bin/sh | |
NAME=aria2c | |
prefix="/usr" | |
DAEMON=${prefix}/bin/${NAME} | |
DAEMON_OPTS="-D" | |
test -x $DAEMON || exit 0 | |
if [ -z "$1" ] ; then |
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 python2 | |
#!coding=utf-8 | |
from time import time | |
import json | |
import logging | |
import re | |
import os | |
from urllib import urlencode | |
import urllib2 |
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 argparse | |
parser = argparse.ArgumentParser() | |
parser.add_argument("square", type=int, | |
help="display a square of a given number") | |
parser.add_argument("-v", "--verbosity", action="count", default=0, | |
help="increase output verbosity") | |
args = parser.parse_args() | |
answer = args.square**2 | |
if args.verbosity >= 2: | |
print "the square of {} equals {}".format(args.square, answer) |
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 uniqify_list(seq): | |
seen = Set() | |
return [x for x in seq if x not in seen and not seen.add(x)] |
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 <ctype.h> | |
#include <stdio.h> | |
int main(void) | |
{ | |
int ch; | |
while((ch = getchar()) != EOF) { | |
putchar(toupper(ch)); | |
} | |
return 0; |
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
int checkSymbol(Stack S){ | |
char ch; | |
while((ch = getchar()) != '#'){ | |
if(ch == '(' || ch == '[' || ch == '{'){ | |
Push(ch, S); | |
} | |
else if(ch == ')' || ch == ']' || ch == '}'){ | |
if(isEmpty(S)) | |
Error("Stack is empty"); | |
else{ |
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 <stdio.h> | |
#define MAXNUM 100 // Count数组大小(M) | |
/* 功能:桶式排序 | |
* 输入: 待排序数组arrayForSort[] | |
* 待排序数组大小arraySize (N) | |
* 上界maxitem,元素都落在[0, maxitem] | |
* 输出 void | |
* 时间复杂度 O(M+N) | |
*/ |
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 base64 | |
def xunlei_url_encode(url): | |
return 'thunder://'+base64.encodestring('AA'+url+'ZZ').replace('\n', '') | |
def xunlei_url_decode(url): | |
assert url.startswith('thunder://') | |
url = base64.decodestring(url[10:]) | |
assert url.startswith('AA') and url.endswith('ZZ') | |
return url[2:-2] |
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 <stdio.h> | |
#define MAXSIZE 25 | |
#define OK 1 | |
#define ERROR 0 | |
typedef int Status; | |
typedef int SElemType; | |
typedef struct { | |
SElemType data[MAXSIZE]; |