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 createXHR(){ | |
return window.XMLHttpRequest? | |
new XMLHttpRequest(): | |
new ActiveXObject("Microsoft.XMLHTTP"); | |
} | |
function getappkey(url){ | |
xmlHttp = createXHR(); | |
xmlHttp.open("GET",url,false); | |
xmlHttp.send(); | |
result = xmlHttp.responseText; |
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 MONKEY 5 | |
// 由当前猴子数和最终剩下的桃数求出总桃数 |
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
# Maintainer: Bartosz Chmura <chmurli at gmail dot com> | |
pkgname=sublime-text-2 | |
pkgver=2126 | |
_build=2126 | |
pkgrel=1 | |
pkgdesc="sophisticated text editor for code, html and prose" | |
arch=('i686' 'x86_64') | |
url="http://www.sublimetext.com/2" | |
license=('custom') |
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
// see : http://acm.nankai.edu.cn/p1010.html | |
#include <stdio.h> | |
#define MAX_SEAT 51 | |
// 计算n个座的情况下第x号座和过道的距离。(x: 0~ n-1) | |
int distance(int x, int n) { | |
if(x < n/2) | |
return x; | |
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> | |
// swap 函数 | |
void swap(int *a, int *b) { | |
int tmp = *a; | |
*a = *b; | |
*b = tmp; | |
} | |
// 选择排序 |
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/expect | |
# require expect openssh | |
# modify PORT USER HOST PASS | |
set timeout 60 | |
spawn /usr/bin/ssh -D PORT -g USER@HOST | |
expect { | |
"password:" { | |
send "PASS\r" | |
} |
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
<?xml version='1.0'?> | |
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'> | |
<fontconfig> | |
<!-- created by WenQuanYi FcDesigner v0.5 --> | |
<match> | |
<test name="family"> | |
<string>sans-serif</string> | |
</test> | |
<edit binding="strong" mode="prepend" name="family"> | |
<string>Ubuntu</string> |
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
// JingDong - Price History Image | |
// GNU General Public License | |
// Forked from http://userscripts.org/scripts/show/115573 | |
// Modified by ninehills <ninehills.github.com> | |
// ==UserScript== | |
// @name JingDong - Price History Image | |
// @namespace http://qixinglu.com | |
// @description Insert a price history image from 360444.com to 360buy.com product page. | |
// @include http://book.360buy.com/*.html |
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
! Swap caps lock and escape in X | |
! Usage: :"xmodmap .speedswapper | |
remove Lock = Caps_Lock | |
keysym Escape = Caps_Lock | |
keysym Caps_Lock = Escape | |
add Lock = Caps_Lock |
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/bash | |
#------------------------------- | |
# 南开大学网关自动登录脚本 | |
# 用法请用help命令查询 | |
# 支持ipv4/ipv6登录 | |
# 作者:cynic<[email protected]> | |
# 网站:http://ninehills.github.com | |
#------------------------------- |