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 | |
import json | |
import urllib | |
import base64 | |
import hashlib | |
import requests | |
WBCLIENT = 'ssologin.js(v.1.3.18)' | |
sha1 = lambda x: hashlib.sha1(x).hexdigest() |
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 | |
from __future__ import unicode_literals | |
from __future__ import print_function | |
from argparse import ArgumentParser | |
import json | |
import re | |
import sys | |
try: | |
#Py3 |
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
Nested X session | |
To run a nested session of another desktop environment: | |
/usr/bin/Xnest :1 -geometry 1024x768+0+0 -ac -name Windowmaker & wmaker -display :1 | |
Virtual X session | |
To start another X session in, for example, Ctrl+Alt+F8, you need to type this on a console: | |
xinit /path/to/wm -- :1 | |
挂载windos上的共享目录 |
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
//kmp失效函数 | |
int* go(char *module) | |
{ | |
int m = strlen(module); | |
int i; | |
int *p = (int *) malloc (sizeof(int) * m); | |
memset(p, 0, sizeof(p)); | |
p[0] = -1; | |
int j = -1; |
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
first way: | |
{{ content }} | |
second way: | |
{% filter markdown %} | |
Your Markdown | |
============= | |
{% endfilter %} |
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
<style type="text/css"> | |
.linebr { | |
clear: both; /* 清除左右浮动 */ | |
width: 100px; /* 必须定义宽度 */ | |
word-break: break-word; /* 文本行的任意字内断开 */ |
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
/* | |
A. Greg and Array | |
time limit per test2 seconds | |
memory limit per test256 megabytes | |
inputstandard input | |
outputstandard output | |
Greg has an array a = a1, a2, ..., an and m operations. Each operation looks as: li, ri, di, (1 ≤ li ≤ ri ≤ n). To apply operation i to the array means to increase all array elements with numbers li, li + 1, ..., ri by value di. | |
Greg wrote down k queries on a piece of paper. Each query has the following form: xi, yi, (1 ≤ xi ≤ yi ≤ m). That means that one should apply operations with numbers xi, xi + 1, ..., yi to the array. |
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
/** | |
* Optimized Code For Quantizing Colors to xterm256 | |
* | |
* These functions are equivalent to the ones found in xterm256.py but | |
* orders of a magnitude faster and should compile quickly (fractions | |
* of a second) on most systems with very little risk of | |
* complications. | |
* | |
* Color quantization is very complex. This works by treating RGB | |
* values as 3D euclidean space and brute-force searching for the |
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 Queue | |
import threading | |
import urllib2 | |
import time | |
from BeautifulSoup import BeautifulSoup | |
hosts = ["http://yahoo.com", "http://google.com", "http://amazon.com", | |
"http://ibm.com", "http://apple.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
#include <stdio.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <math.h> | |
const int maxn = 50001; | |
int n; | |
double x[maxn]; | |
double y[maxn]; |
OlderNewer