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
# This is an example resource file for rTorrent. Copy to | |
# ~/.rtorrent.rc and enable/modify the options as needed. Remember to | |
# uncomment the options you wish to enable. | |
# 每个种子所允许的最小最大连接数 | |
#min_peers = 40 | |
#max_peers = 100 | |
# 同上,但仅针对已完成的种子(-1 表示与下载中的种子一致) | |
#min_peers_seed = 10 |
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
--[[ The nasty OO | |
Animal = { | |
size=1, age=2, | |
sleep = function (self) | |
print("I need sleep.") | |
print("size"..self.size.."\tage"..self.age) | |
end | |
} |
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
/*先是C++调用Lua。 | |
*/ | |
extern "C" { | |
#include "lua.h" | |
#include "lualib.h" | |
#include "lauxlib.h" | |
} | |
#include <cstdio> | |
using std::printf; |
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
/* | |
* 字符串匹配问题,给定一串字符串,按照指定规则对齐进行匹配,并将匹配结果 | |
* 保存至output数组中,多个匹配项用空格间隔,最后一个不需要空格。 要求: | |
* 1、匹配规则中包含通配符?和*。?表示匹配任意一个字符,*表示匹配任意 | |
* 多个字符串。 | |
* 2、匹配后的输入串不再进行匹配,从当前匹配后的字符串开始重新匹配其 | |
* 它字符串。 | |
*/ | |
#include <iostream> | |
#include <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
#include <iostream> | |
#include <string> | |
#include <vector> | |
#include <sstream> | |
#include <cstdlib> | |
using namespace std; | |
static int simple_arithmetic(const string &k_expression_) // No any brakets. |
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
// ======================= | |
// 华为的三道上机题, | |
// 第一题是求出一个数组中的最小数; | |
// 第二题是检验密码字符串,要求长度在8~128之间,并且同时有 | |
// 大写字符、小写字符、数字,同时没有空格。 | |
// 第三题是斗地主规则,A用1表示、K用13表示等等。 | |
// 要求根据相应的牌型返回相应的代码号(其中3代1不考虑, | |
// 只有3个相同的情况)。 | |
// ======================= |
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 foo(s_, i_ = 0): | |
strLen = len(s_) | |
if strLen == 0: | |
return False | |
if i_ < 0: | |
return False | |
if i_ == (strLen / 2 - 1): | |
return s_[i_] == s_[strLen - 1 - i_] | |
return (s_[i_] == s_[strLen - 1 - i_] and foo(s_, i_ + 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
#include <iostream> | |
using namespace std; | |
void foo(int *p_a_, int *p_b_, int n_); | |
int main() | |
{ | |
int a[] = {1, 2, 3, 4, 5}; | |
int b[] = {1, 1, 1, 1, 1}; |