总lge是什么| kenzo是什么牌子| 糖尿病的人可以吃什么水果| 哪吒他妈叫什么名字| 八月一号是什么星座| 均一性红细胞什么意思| 11月1号是什么星座| 大腿根内侧发黑是什么原因| 舌头根发麻是什么原因| 白虎什么意思| 不对劲是什么意思| 什么是211大学| 狗尾巴草有什么功效| 月经发黑是什么原因| 什么原因造成耳鸣| 什么是教育| 睡觉腿麻是什么原因引起| 嗓子不舒服吃什么消炎药| 女强人是什么意思| 什么水果最有营养| lh是什么意思啊| 品质是什么| 纯牛奶可以做什么美食| 银耳为什么助湿气| 94年属狗的是什么命| 1997年属牛的是什么命| 孕晚期吃什么水果好| 2.3是什么星座| 过敏擦什么药膏好得快| 舌头发白有齿痕是什么原因| 私生饭是什么意思| 吃什么水果对子宫和卵巢好| 发来贺电是什么意思| 胃一阵一阵绞痛是什么原因| 脑膜瘤钙化意味着什么| 傲娇是什么意思| 子宫直肠窝积液是什么意思| 骨龄挂什么科| 男性hpv挂什么科| 瑶五行属性是什么| 排卵试纸强阳说明什么| 肚子胀气是什么原因引起的| 女性体寒 吃什么好| 胎停了有什么明显症状| 丁克夫妻是什么意思| 身上经常痒是什么原因| 制氧机什么牌子好| 晚上吃黄瓜有什么好处| 鲤鱼最爱吃什么食物| 烤麸是什么做的| 属兔配什么属相最好| 为什么胸会痛| o型血容易得什么病| 抗体是什么| 怀孕了为什么还会出血| bhpc是什么牌子| 指责的意思是什么| 胸片可以检查出什么| 生殖器是什么| 佛珠生菇讲述什么道理| 绿豆什么时候成熟| 嘴角裂口是什么原因怎么办| 观音菩萨成道日是什么意思| 水豚吃什么| 老是流鼻血是什么原因| 屎为什么是臭的| 当兵苦到什么程度| 缺镁吃什么食物补充最快| 周期是什么| lm是什么意思| 猫是什么生肖| peppa是什么意思| 均金念什么| 脚底心发热是什么原因| 为什么会阑尾炎| 双向情感障碍症是什么病| 喜怒无常是什么意思| 一个火一个华念什么| 为什么会得抑郁症| 调和营卫是什么意思| 金银花入什么经| 女性得疱疹是什么症状| 红豆杉是什么植物| 8月13号什么星座| atp是什么意思| 宝玑手表是什么档次| 百褶裙配什么鞋子| 柔然人是现在的什么人| 增大淋巴结是什么意思| pp材质是什么材料| 什么时候怀孕几率最高| 小孩记忆力差需要补充什么营养| 血压低有什么危险| 舌头上火是什么原因| 黑枸杞对男性性功能有什么帮助| 晚上尿多是什么原因| 唯粉是什么意思| 后脚跟疼是什么原因| 男性婚检都检查什么项目| 吃什么补肾虚| 智商140是什么水平| 小孩个子矮小吃什么促进生长发育| 男人吃什么壮阳| 女人叫床最好喊什么| 为什么家里会有蚂蚁| 龟头炎什么症状| 就加鸟念什么| 冬枣什么时候上市| 孔雀的尾巴有什么作用| 类风湿是什么意思| 头发稀少是什么原因导致的| 水鸭跟什么煲汤最佳| 人老是放屁是什么原因| 皮肤软组织感染是什么意思| 女人下巴有痣代表什么| 肝左叶囊肿是什么意思| 头晕目眩吃什么药| 夜晚的星星像什么| 红蓝光照射有什么作用| 心脏不好有什么症状| 香港商务签证需要什么条件| 脚底板疼用什么药| 8月11号是什么星座| 残月是什么意思| 哪吒他妈叫什么名字| 儿童便秘吃什么最管用| 羊水偏多是什么原因| 消化不好吃什么药最好| 脚气是什么| 婴儿放屁多是什么原因| 耐药是什么意思| 龙飞凤舞是什么意思| 布洛芬不能和什么药一起吃| 知了有什么功效与作用| 富豪是什么意思| 做梦来月经了什么预兆| 什么清什么楚| 有什么黄色网站| 麻疹是什么病| 咖啡soe是什么意思| 结肠ca是什么意思| swisse是什么药| 长生香是什么意思| 脱发看什么科| 指甲月牙白代表什么| 气胸吃什么药| 先知是什么意思| 光敏反应是什么意思| 冲煞是什么意思| 心口窝疼是什么原因| 茉莉花是什么颜色| 丞字五行属什么| 女人矜持是什么意思| 吃什么能让胸变大| scr是什么意思| 播客是什么意思| 怀孕为什么要吃叶酸| bnp是什么检查| 拔牙第二天可以吃什么| 梦泪什么意思| 悔教夫婿觅封侯是什么意思| 梦见杀鸡是什么预兆| 保卡是什么意思| 经常干咳嗽是什么原因| 包子都有什么馅| 三番四次是什么生肖| 什么是个体工商户| 尿酸吃什么药| 脂肪肝是什么原因造成的| 紫外线过敏吃什么药| 寄生虫长什么样子| 阿司匹林什么时间吃最好| 耳朵不舒服是什么原因| 5月22号是什么星座| 丫丫的老公叫什么| 节气是什么意思| 耳鸣和脑鸣有什么区别| 芝士是什么材料做的| 庭长是什么级别| 水飞蓟是什么| 2b铅笔和hb铅笔有什么区别| 结婚25年属于什么婚| 为什么经常做梦| 880什么意思| 结婚5年是什么婚| 金鱼可以吃什么| 月经期间吃什么好| 劲仔小鱼是什么鱼做的| 香蕉皮擦脸有什么作用与功效| copd是什么病的简称| 血钾低会有什么症状| 佳字属于五行属什么| 什么网名好听| 檀香是什么味道| 吃什么东西增加免疫力| 湿厕纸是干什么用的| 舌苔紫色是什么原因| 邮电局是干什么的| 狗和什么属相相冲| 芸豆长什么样子| 为什么会得纤维瘤| 痛经是什么引起的| 猪笼入水是什么意思| 智齿是什么| 乳酸脱氢酶高是什么原因| 吐奶严重是什么原因| 为什么早上起来恶心想吐| 身体不出汗是什么原因| bj是什么意思| 捡什么废品最值钱| 2003是什么年| 老子姓什么| 肋间神经痛吃什么药| 什么时候建档| 盗汗什么意思| 什么叫心悸| 吃蒜有什么好处| 0.618是什么意思| 化疗期间吃什么好| 排班是什么意思| 牛筋草有什么功效| 跨境电商是做什么的| 12月20号是什么星座| 河南什么烟出名| 骨髓抑制什么意思| 促销员是做什么的| 低烧挂什么科| 什么头什么气| 白色搭配什么颜色好看| 后代是什么意思| 心肌炎有什么症状和表现| 牙酸是什么原因| 彻底是什么意思| 杀马特是什么| 上火吃什么食物| 喉咙干吃什么药| 胃疼检查什么项目| 什么是ts| 无性恋是什么| 为什么叫大姨妈| 舌吻是什么| 什么东西放进去是硬的拿出来是软的| 先兆流产是什么原因| 梦见离家出走是什么意思| 威海的海是什么海| 单字五行属什么| 暑假是什么时候| 心肌桥是什么意思| 三文鱼长什么样| 寂寞的反义词是什么| 脚有点浮肿是什么原因| 孕妇怕冷是什么原因| 当归什么味道| 摩纳哥为什么这么富| 霉菌孢子是什么意思| 冻结账户需要什么条件| spa按摩是什么意思| 玛卡是什么药| 茶叶过期了有什么用途| 尿液有泡沫什么原因| 菜花是什么| 尖锐是什么意思| 瑞典和瑞士有什么区别| 脂肪肝吃什么药效果好| 百度Saltar para o conteúdo

Fortinet:比360°还要多1°的安全是怎样的?

Husi Wikipédia, ensiklopédia livre
百度 台商李荣福登报反“台独”,拥护“九二共识”(图截于台媒)此外,台湾明眼的网友也看出了赖清德诡辩和欺骗的伎俩,纷纷对其批驳。

A documenta??o para este módulo pode ser criada na página Módulo:TableTools/doc

--[[
------------------------------------------------------------------------------------
--                               TableTools                                       --
--                                                                                --
-- This module includes a number of functions for dealing with Lua tables.        --
-- It is a meta-module, meant to be called from other Lua modules, and should     --
-- not be called directly from #invoke.                                           --
------------------------------------------------------------------------------------
--]]

local libraryUtil = require('libraryUtil')

local p = {}

-- Define often-used variables and functions.
local floor = math.floor
local infinity = math.huge
local checkType = libraryUtil.checkType
local checkTypeMulti = libraryUtil.checkTypeMulti

--[[
------------------------------------------------------------------------------------
-- isPositiveInteger
--
-- This function returns true if the given value is a positive integer, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a given table key is in the array part or the
-- hash part of a table.
------------------------------------------------------------------------------------
--]]
function p.isPositiveInteger(v)
	return type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity
end

--[[
------------------------------------------------------------------------------------
-- isNan
--
-- This function returns true if the given number is a NaN value, and false
-- if not. Although it doesn't operate on tables, it is included here as it is
-- useful for determining whether a value can be a valid table key. Lua will
-- generate an error if a NaN is used as a table key.
------------------------------------------------------------------------------------
--]]
function p.isNan(v)
	return type(v) == 'number' and tostring(v) == '-nan'
end

--[[
------------------------------------------------------------------------------------
-- shallowClone
--
-- This returns a clone of a table. The value returned is a new table, but all
-- subtables and functions are shared. Metamethods are respected, but the returned
-- table will have no metatable of its own.
------------------------------------------------------------------------------------
--]]
function p.shallowClone(t)
	local ret = {}
	for k, v in pairs(t) do
		ret[k] = v
	end
	return ret
end

--[[
------------------------------------------------------------------------------------
-- removeDuplicates
--
-- This removes duplicate values from an array. Non-positive-integer keys are
-- ignored. The earliest value is kept, and all subsequent duplicate values are
-- removed, but otherwise the array order is unchanged.
------------------------------------------------------------------------------------
--]]
function p.removeDuplicates(t)
	checkType('removeDuplicates', 1, t, 'table')
	local isNan = p.isNan
	local ret, exists = {}, {}
	for i, v in ipairs(t) do
		if isNan(v) then
			-- NaNs can't be table keys, and they are also unique, so we don't need to check existence.
			ret[#ret + 1] = v
		else
			if not exists[v] then
				ret[#ret + 1] = v
				exists[v] = true
			end
		end	
	end
	return ret
end			

--[[
------------------------------------------------------------------------------------
-- numKeys
--
-- This takes a table and returns an array containing the numbers of any numerical
-- keys that have non-nil values, sorted in numerical order.
------------------------------------------------------------------------------------
--]]
function p.numKeys(t)
	checkType('numKeys', 1, t, 'table')
	local isPositiveInteger = p.isPositiveInteger
	local nums = {}
	for k, v in pairs(t) do
		if isPositiveInteger(k) then
			nums[#nums + 1] = k
		end
	end
	table.sort(nums)
	return nums
end

--[[
------------------------------------------------------------------------------------
-- affixNums
--
-- This takes a table and returns an array containing the numbers of keys with the
-- specified prefix and suffix. For example, for the table
-- {a1 = 'foo', a3 = 'bar', a6 = 'baz'} and the prefix "a", affixNums will
-- return {1, 3, 6}.
------------------------------------------------------------------------------------
--]]
function p.affixNums(t, prefix, suffix)
	checkType('affixNums', 1, t, 'table')
	checkType('affixNums', 2, prefix, 'string', true)
	checkType('affixNums', 3, suffix, 'string', true)

	local function cleanPattern(s)
		-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
		return s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
	end

	prefix = prefix or ''
	suffix = suffix or ''
	prefix = cleanPattern(prefix)
	suffix = cleanPattern(suffix)
	local pattern = '^' .. prefix .. '([1-9]%d*)' .. suffix .. '$'

	local nums = {}
	for k, v in pairs(t) do
		if type(k) == 'string' then			
			local num = mw.ustring.match(k, pattern)
			if num then
				nums[#nums + 1] = tonumber(num)
			end
		end
	end
	table.sort(nums)
	return nums
end

--[[
------------------------------------------------------------------------------------
-- numData
--
-- Given a table with keys like ("foo1", "bar1", "foo2", "baz2"), returns a table
-- of subtables in the format 
-- { [1] = {foo = 'text', bar = 'text'}, [2] = {foo = 'text', baz = 'text'} }
-- Keys that don't end with an integer are stored in a subtable named "other".
-- The compress option compresses the table so that it can be iterated over with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.numData(t, compress)
	checkType('numData', 1, t, 'table')
	checkType('numData', 2, compress, 'boolean', true)
	local ret = {}
	for k, v in pairs(t) do
		local prefix, num = mw.ustring.match(tostring(k), '^([^0-9]*)([1-9][0-9]*)$')
		if num then
			num = tonumber(num)
			local subtable = ret[num] or {}
			if prefix == '' then
				-- Positional parameters match the blank string; put them at the start of the subtable instead.
				prefix = 1
			end
			subtable[prefix] = v
			ret[num] = subtable
		else
			local subtable = ret.other or {}
			subtable[k] = v
			ret.other = subtable
		end
	end
	if compress then
		local other = ret.other
		ret = p.compressSparseArray(ret)
		ret.other = other
	end
	return ret
end

--[[
------------------------------------------------------------------------------------
-- compressSparseArray
--
-- This takes an array with one or more nil values, and removes the nil values
-- while preserving the order, so that the array can be safely traversed with
-- ipairs.
------------------------------------------------------------------------------------
--]]
function p.compressSparseArray(t)
	checkType('compressSparseArray', 1, t, 'table')
	local ret = {}
	local nums = p.numKeys(t)
	for _, num in ipairs(nums) do
		ret[#ret + 1] = t[num]
	end
	return ret
end

--[[
------------------------------------------------------------------------------------
-- sparseIpairs
--
-- This is an iterator for sparse arrays. It can be used like ipairs, but can
-- handle nil values.
------------------------------------------------------------------------------------
--]]
function p.sparseIpairs(t)
	checkType('sparseIpairs', 1, t, 'table')
	local nums = p.numKeys(t)
	local i = 0
	local lim = #nums
	return function ()
		i = i + 1
		if i <= lim then
			local key = nums[i]
			return key, t[key]
		else
			return nil, nil
		end
	end
end

--[[
------------------------------------------------------------------------------------
-- size
--
-- This returns the size of a key/value pair table. It will also work on arrays,
-- but for arrays it is more efficient to use the # operator.
------------------------------------------------------------------------------------
--]]

function p.size(t)
	checkType('size', 1, t, 'table')
	local i = 0
	for k in pairs(t) do
		i = i + 1
	end
	return i
end


local function defaultKeySort(item1, item2)
	-- "number" < "string", so numbers will be sorted before strings.
	local type1, type2 = type(item1), type(item2)
	if type1 ~= type2 then
		return type1 < type2
	else -- This will fail with table, boolean, function.
		return item1 < item2
	end
end

--[[
	Returns a list of the keys in a table, sorted using either a default
	comparison function or a custom keySort function.
]]
function p.keysToList(t, keySort, checked)
	if not checked then
		checkType('keysToList', 1, t, 'table')
		checkTypeMulti('keysToList', 2, keySort, { 'function', 'boolean', 'nil' })
	end
	
	local list = {}
	local index = 1
	for key, value in pairs(t) do
		list[index] = key
		index = index + 1
	end
	
	if keySort ~= false then
		keySort = type(keySort) == 'function' and keySort or defaultKeySort
		
		table.sort(list, keySort)
	end
	
	return list
end

--[[
	Iterates through a table, with the keys sorted using the keysToList function.
	If there are only numerical keys, sparseIpairs is probably more efficient.
]]
function p.sortedPairs(t, keySort)
	checkType('sortedPairs', 1, t, 'table')
	checkType('sortedPairs', 2, keySort, 'function', true)
	
	local list = p.keysToList(t, keySort, true)
	
	local i = 0
	return function()
		i = i + 1
		local key = list[i]
		if key ~= nil then
			return key, t[key]
		else
			return nil, nil
		end
	end
end

--[[
	Returns true if all keys in the table are consecutive integers starting at 1.
--]]
function p.isArray(t)
	checkType("isArray", 1, t, "table")
	
	local i = 0
	for k, v in pairs(t) do
		i = i + 1
		if t[i] == nil then
			return false
		end
	end
	return true
end

-- { "a", "b", "c" } -> { a = 1, b = 2, c = 3 }
function p.invert(array)
	checkType("invert", 1, array, "table")
	
	local map = {}
	for i, v in ipairs(array) do
		map[v] = i
	end
	
	return map
end

--[[
	{ "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true }
--]]
function p.listToSet(t)
	checkType("listToSet", 1, t, "table")
	
	local set = {}
	for _, item in ipairs(t) do
		set[item] = true
	end
	
	return set
end

--[[
	Recursive deep copy function.
	Preserves identities of subtables.
	
]]
local function _deepCopy(orig, includeMetatable, already_seen)
	-- Stores copies of tables indexed by the original table.
	already_seen = already_seen or {}
	
	local copy = already_seen[orig]
	if copy ~= nil then
		return copy
	end
	
	if type(orig) == 'table' then
		copy = {}
		for orig_key, orig_value in pairs(orig) do
			copy[deepcopy(orig_key, includeMetatable, already_seen)] = deepcopy(orig_value, includeMetatable, already_seen)
		end
		already_seen[orig] = copy
		
		if includeMetatable then
			local mt = getmetatable(orig)
			if mt ~= nil then
				local mt_copy = deepcopy(mt, includeMetatable, already_seen)
				setmetatable(copy, mt_copy)
				already_seen[mt] = mt_copy
			end
		end
	else -- number, string, boolean, etc
		copy = orig
	end
	return copy
end

function p.deepCopy(orig, noMetatable, already_seen)
	checkType("deepCopy", 3, already_seen, "table", true)
	
	return _deepCopy(orig, not noMetatable, already_seen)
end

--[[
	Concatenates all values in the table that are indexed by a number, in order.
	sparseConcat{ a, nil, c, d }  =>  "acd"
	sparseConcat{ nil, b, c, d }  =>  "bcd"
]]
function p.sparseConcat(t, sep, i, j)
	local list = {}
	
	local list_i = 0
	for _, v in p.sparseIpairs(t) do
		list_i = list_i + 1
		list[list_i] = v
	end
	
	return table.concat(list, sep, i, j)
end

--[[
-- Finds the length of an array, or of a quasi-array with keys such
-- as "data1", "data2", etc., using an exponential search algorithm. 
-- It is similar to the operator #, but may return
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
-- Note: #frame.args in frame object always be set to 0, regardless of 
-- the number of unnamed template parameters, so use this function for
-- frame.args.
--]]

function p.length(t, prefix)
	-- requiring module inline so that [[Module:Exponential search]]
	-- which is only needed by this one function
	-- doesn't get millions of transclusions
	local expSearch = require("Module:Exponential search")
	checkType('length', 1, t, 'table')
	checkType('length', 2, prefix, 'string', true)
	return expSearch(function(i)
		local key
		if prefix then
			key = prefix .. tostring(i)
		else
			key = i
		end
		return t[key] ~= nil
	end) or 0
end
function p.inArray(arr, valueToFind)
	checkType("inArray", 1, arr, "table")
	
	-- if valueToFind is nil, error?
	
	for _, v in ipairs(arr) do
		if v == valueToFind then
			return true
		end
	end
	
	return false
end

return p
什么动物捉害虫 乡镇派出所所长是什么级别 内科是看什么病的 钠低是什么原因造成的 微信加入黑名单和删除有什么区别
81年属什么的 糖化高是什么意思 1905年属什么生肖 梦到和别人打架是什么意思 感冒干咳无痰吃什么药
射频消融术是什么手术 碧玺五行属什么 32周做什么检查 乳酸是什么 男人少一个睾丸有什么影响
阴道口发白是什么原因 鲜卑族现在是什么族 幽闭恐惧症是什么症状 早上起来眼睛肿了是什么原因 腰痛是什么原因引起的
兔子爱吃什么hcv8jop5ns8r.cn 做梦笑醒了有什么征兆hcv8jop9ns9r.cn 咳血是什么原因hcv8jop0ns1r.cn 6月27号是什么星座aiwuzhiyu.com 开业送什么好hcv9jop7ns9r.cn
为什么会长结节hcv8jop0ns3r.cn 吃燕窝有什么功效hcv7jop5ns5r.cn prc什么意思hcv7jop9ns8r.cn hrs是什么意思hcv9jop6ns0r.cn 他达拉非是什么药hcv9jop0ns7r.cn
白色裤子配什么上衣好看hcv9jop5ns5r.cn 咳嗽头晕是什么原因imcecn.com 农村做什么生意赚钱creativexi.com 泥淖是什么意思hcv8jop7ns4r.cn 湖南为什么叫湖南zhongyiyatai.com
会车是什么hcv8jop8ns2r.cn 玄学是什么意思hcv9jop6ns0r.cn 雄黄是什么hcv7jop4ns7r.cn 你好是什么意思hcv8jop1ns4r.cn 排卵期同房后要注意什么weuuu.com
百度