由于网络原因,直接使用cabal update不成功,只能自己写脚本直接从网上拖包下来,自己安装。但是这样做的缺点是需要手动处理dependency,当然,也可以把脚本写的复杂些,自动来处理dependency。cabal.sh1 cat .tmp_sed_script2 s/]*>/&\n/g3 ...
分类:
其他好文 时间:
2014-07-22 22:56:15
阅读次数:
210
貌似有些不合理,麻烦大家帮忙指正指正!谢谢~=0;$j--){ if($j==0){ $tmp['b']=intval(0); $tmp['e']=intval($arr[$j]['v']); ...
分类:
Web程序 时间:
2014-07-19 21:24:27
阅读次数:
309
1.iter_swap
描述:将两个 ForwardIterator 所指的对象对调
源码:
//version 1
template
inline void __iter_swap(ForwardIterator1 a, ForwardIterator2 b, T*) {
T tmp = *a;
*a = *b;
*b = tmp;
}
//version 2
template...
分类:
其他好文 时间:
2014-07-18 21:32:42
阅读次数:
244
题解:简单的NIM游戏,直接计算SG函数,至于找先手策略则按字典序异或掉,去除石子后再异或判断,若可行则直接输出。#include const int N=1005;int SG[N],b[N],hash[N],a[N],sum,tmp,i,j,n,m; void FSG(int s){ ...
分类:
其他好文 时间:
2014-07-18 21:09:31
阅读次数:
206
题解:注意题目中规定取到最后一粒石子的人算输,所以是Anti-Nim游戏,胜负判断为:先手必胜: 1.所有堆的石子数都为1且游戏的SG值为0; 2.有些堆的石子数大于1且游戏的SG值不为0。#include int main(){ int t,n,s,x,tmp; scanf("%d...
分类:
其他好文 时间:
2014-07-17 11:09:17
阅读次数:
303
反向代理缓存:nginx做为反向代理时,能够将来自upstream的响应缓存至本地,并在后续的客户端请求同样内容时直接从本地构造响应报文。可以在http全局配置内定义缓存。http{proxy_cache_path/tmp/nginx/cachelevels=1:2keys_zone=cone:10mmax_size=1g;}在Server里调用。server{l..
分类:
其他好文 时间:
2014-07-17 10:47:33
阅读次数:
536
题解:直接使用STL中的hash去重即可#include #include using namespace std;int ans[50010];int main(){ int T,n,tmp; scanf("%d",&T); while(T--){ int cnt=...
分类:
其他好文 时间:
2014-07-17 10:02:58
阅读次数:
231
#!/bin/bash#forsecurityofosforipin`catip.txt`doecho-e"\033[31m##################$ip#####################\033[0m"scpopenssl-0.9.8za.tar.gz$ip:/tmp/ssh$ip-C"tar-xzvf/tmp/openssl-0.9.8za.tar.gz-C/tmp/&&cd/tmp/openssl-0.9.8za&&./configsharedno-z..
分类:
其他好文 时间:
2014-07-17 09:18:46
阅读次数:
205
mount-tcifs//192.168.0.254/test共享路劲/data/tmp(此为挂载点)-ousername=test,password=test
linux命令执行遵循环境变量PATH中的路径,但是有时我们会发现这种现象:#mv/sbin/ls/bin/
[root@xx~]#ls/tmp/
-bash:/sbin/ls:Nosuchfileordirectory/sbin和/bin同样是PATH环境变量中的搜索路径,但是移动之后却发现不了命令,这是因为,命令在上次执行之后以key-value形式缓存..
分类:
系统相关 时间:
2014-07-17 08:11:59
阅读次数:
347