梦见拔花生是什么预兆| nba常规赛什么时候开始| hyper是什么意思| 膝关节积液吃什么药| 经典什么意思| 什么是催眠| 营卫不和是什么意思| 二月十七是什么星座| 贫血吃什么补的快| 早上起来眼皮肿是什么原因| 团长相当于地方什么官| poscer是什么牌子手表| 婚姻宫是什么意思| 无创什么时候出结果| 吃三七粉不能吃什么| 青年补钙吃什么好| 肠管积气是什么原因| 国医堂是什么意思| 事后紧急避孕药什么时候吃有效| 滋阴是什么意思| 250什么意思| 耳洞为什么会发臭| 不能喝酒是什么原因| 1948年属什么生肖| 屁很臭是什么原因| 例假血是黑色的是什么原因| 早上五点半是什么时辰| 做脑ct对人体有什么危害| 生不如死什么意思| 睡午觉有什么好处| 狗懒子是什么意思| 什么叫服务贸易| 什么是g点| 阿贝数是什么意思| 为什么射出来的精子是黄色的| 时至今日是什么意思| 阑尾炎应该挂什么科| 我想知道为什么| as是什么| 什么是性瘾| 蒙昧是什么意思| 淋巴结是什么| 炒菜用什么油比较好| 菊花什么时候开花| 贱痣是什么意思| 桂林山水下一句是什么| 11月1号是什么星座| 白起为什么被赐死| 梨花压海棠是什么意思| 什么是内分泌| 好好的什么意思| 海肠是什么| 火气重喝什么茶| 淮山和山药有什么区别| 三伏天什么时候结束| 口腔溃疡吃什么好的快| 言尽于此是什么意思| 脚抽筋吃什么钙片好| 同事过生日送什么礼物| 鹌鹑蛋不能和什么一起吃| 梦见杀人是什么预兆| 明鉴是什么意思| 男士内裤买什么牌子好| 爱什么意思| 女人后脑勺出汗多是什么原因| 什么的花纹| 皮下囊肿是什么原因引起的| 梦见骡子是什么意思| 为什么会得多囊| cafe是什么意思| 八零年属什么生肖| 颜艺是什么意思| 2002年是什么生肖| 乳腺结节低回声是什么意思| 韬光养晦是什么意思| 内分泌是什么意思| 社科院是干什么的| 什么地指挥| 足跟疼挂什么科室| 苦瓜干泡水喝有什么功效| 豕是什么动物| 惊恐症是什么病| 放的屁很臭是什么原因| 梦到和别人吵架是什么意思| mirror什么意思| chemical是什么意思| 改年龄需要什么手续| 猪沙肝是什么部位| 阴差阳错代表什么生肖| 白细胞数目偏高是什么意思| 尿黄是什么病| 狗上皮过敏是什么意思| 体雕是什么| 什么东西最贵| 62年属什么| cb是什么| 红豆与赤小豆有什么区别| 什么飞什么跳| 什么是周期| 微不足道是什么意思| 姨妈期可以吃什么水果| 手术后喝什么鱼汤最好| 霸王龙吃什么| 什么糖不能吃| 缺钾吃什么食物| 派特ct主要检查什么| 小孩一到晚上就发烧是什么原因| gif什么意思| 冷得什么| 氯化钾是什么| 啷个是什么意思| 眼睛粘糊是什么原因| 蝉什么时候出现| 低压偏高有什么危害| 8月1日是什么星座| 不可多得是什么意思| 煜怎么读音是什么意思| 红薯叶不能和什么一起吃| 肉苁蓉和什么搭配最好| 上环什么时候去最合适| 肺间质纤维化是什么病| 秀才相当于什么学历| 农历3月12日是什么星座| 晚上睡觉腿酸难受是什么原因| 霜降吃什么| 腮腺炎是什么引起的| 心安是什么意思| 为什么叫拉丁美洲| 肛裂是什么样子的图片| 养尊处优是什么意思| 爱出者爱返福往者福来什么意思| kr是什么货币| 气泡水是什么水| 胆固醇高是什么引起的| 乙肝核心抗体高是什么意思| 做人流挂什么科| 脚经常抽筋是什么原因| 什么蔬菜降血压效果最好| 月办念什么| 爸爸的姐姐叫什么| 宫颈萎缩意味着什么| 6月适合种什么菜| 眉毛上的痣代表什么| 故宫里面有什么| 巽什么意思| 做梦梦到老公出轨代表什么预兆| 仰天长叹的意思是什么| 女人排卵期有什么反应| 那天午后我站在你家门口什么歌| 福利姬什么意思| 女性胆固醇高吃什么| 肉馅可以做什么美食| 皮肤敏感是什么意思| 品规是什么意思| 心脏除颤是什么意思| 性病是什么| 胃一阵一阵绞痛是什么原因| 什么的拼音怎么写| 羡字五行属什么| 夏天都有什么花| 白洞是什么| 鸡蛋不能和什么食物一起吃| 伤官伤尽是什么意思| 细菌感染吃什么抗生素| 黄鼠狼进屋是什么兆头| 远山含黛是什么意思| 什么水果减肥| 矽肺病是什么症状| 中性粒细胞绝对值高是什么原因| oct是什么| peb是什么意思| 又什么又什么的词语| 梦见抓了好多鱼是什么意思| 什么人适合吃蛋白质粉| 火鸡面为什么这么贵| 二十二岁属什么| 男人吃四环素治什么病| 咖啡什么时候喝最好| 女孩为什么难得午时贵| 仙鹤代表什么生肖| 什么是轻食| 两手发麻是什么原因| 美尼尔综合症是一种什么病| 第二天叫什么日| 孕妇适合喝什么茶| llbean是什么牌子| 什么叫柏拉图式的爱情| 曲安奈德针治疗什么| 县公安局局长是什么级别| 心率失常是什么意思| 办理健康证需要带什么| 一什么眉毛填量词| 皓石是什么| 一什么柜子| 招风耳适合什么发型| 乳腺属于什么科室| 肾不好是什么原因引起的| 锌过量会引发什么症状| 为什么会长智齿| 脆哨是什么| 青光眼是什么意思| 男生下面叫什么| 经常做梦是什么原因| 开除党籍有什么后果| 慢脚是什么| 榻榻米床垫什么材质的好| 怀孕不到一个月有什么症状| 跑步后脸红是什么原因| 醍醐灌顶什么意思| 胃反酸吃点什么能缓解| 多潘立酮片治什么病| 射频消融术是什么意思| 纠察是什么意思| 什么样的礼物| 小腹隐隐作痛是什么原因女性| 柚子是什么季节的水果| 1960属什么生肖| 野生型是什么意思| 自控能力是什么意思| 嘴角裂口是什么原因| 低血压是什么原因| 夏天用什么护肤品比较好| 喝太多水对身体有什么影响| 晚上十一点半是什么时辰| 救济的近义词是什么| 什么是ci| 淼读什么字| 统考是什么意思| 巧克力有什么功效与作用| 甲状腺跟甲亢有什么区别| 颈椎病用什么枕头最好| 发膜是什么| 师傅和师父有什么区别| 老公的姐姐叫什么| 吃葡萄对身体有什么好处| 男人下面流脓吃什么药| aoerbo是什么牌子的手表| 什么人容易得白血病| 血氨是什么检查项目| 肤专家抑菌软膏主要治什么| 什么水果对胃好更养胃| 鼻子经常流鼻涕是什么原因| 成都市市长是什么级别| 十全十美指什么生肖| 掉马是什么意思| 月经提前了10天是什么原因| 什么植物好养又适合放在室内| 生物学父亲是什么意思| 冰箱双变频是什么意思| 法克是什么意思| 糜烂性胃炎吃什么药效果好| 漂洗是什么意思| 空调自动关机什么原因| 抗酸杆菌是什么意思| 小孩尖叫是什么原因| 吃什么能长胖| 长公主是什么意思| 取保候审是什么意思还会判刑吗| 8月26号是什么星座| 耳后长痣代表什么意思| 一票制什么意思| 一个不一个好念什么| 嘤嘤嘤什么意思| 热痱子用什么药| 百度????????? ???? ???

2017国际反病毒大会召开 全球专家热议网络安全前沿技术

?????????? ???????
百度 那么,被动式建筑又是如何做到的?据了解,被动式太阳能建筑是利用太阳能提供的室内热能,不需要任何机械设备提供能源,仅仅依靠传导、对流和辐射的自然热传递。

Documentation for this module may be created at ???: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 v ~= v
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)
	checkType('shallowClone', 1, t, 'table')
	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(arr)
	checkType('removeDuplicates', 1, arr, 'table')
	local isNan = p.isNan
	local ret, exists = {}, {}
	for _, v in ipairs(arr) 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 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 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 _ 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
	elseif type1 == 'table' or type1 == 'boolean' or type1 == 'function' then
		return tostring(item1) < tostring(item2)
	else
		return item1 < item2
	end
end
------------------------------------------------------------------------------------
-- keysToList
--
-- Returns an array 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 arr = {}
	local index = 1
	for k in pairs(t) do
		arr[index] = k
		index = index + 1
	end

	if keySort ~= false then
		keySort = type(keySort) == 'function' and keySort or defaultKeySort
		table.sort(arr, keySort)
	end

	return arr
end

------------------------------------------------------------------------------------
-- sortedPairs
--
-- 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 arr = p.keysToList(t, keySort, true)

	local i = 0
	return function ()
		i = i + 1
		local key = arr[i]
		if key ~= nil then
			return key, t[key]
		else
			return nil, nil
		end
	end
end

------------------------------------------------------------------------------------
-- isArray
--
-- Returns true if the given value is a table and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArray(v)
	if type(v) ~= 'table' then
		return false
	end
	local i = 0
	for _ in pairs(v) do
		i = i + 1
		if v[i] == nil then
			return false
		end
	end
	return true
end

------------------------------------------------------------------------------------
-- isArrayLike
--
-- Returns true if the given value is iterable and all keys are consecutive
-- integers starting at 1.
------------------------------------------------------------------------------------
function p.isArrayLike(v)
	if not pcall(pairs, v) then
		return false
	end
	local i = 0
	for _ in pairs(v) do
		i = i + 1
		if v[i] == nil then
			return false
		end
	end
	return true
end

------------------------------------------------------------------------------------
-- invert
--
-- Transposes the keys and values in an array. For example, {"a", "b", "c"} ->
-- {a = 1, b = 2, c = 3}. Duplicates are not supported (result values refer to
-- the index of the last duplicate) and NaN values are ignored.
------------------------------------------------------------------------------------
function p.invert(arr)
	checkType("invert", 1, arr, "table")
	local isNan = p.isNan
	local map = {}
	for i, v in ipairs(arr) do
		if not isNan(v) then
			map[v] = i
		end
	end

	return map
end

------------------------------------------------------------------------------------
-- listToSet
--
-- Creates a set from the array part of the table. Indexing the set by any of the
-- values of the array returns true. For example, {"a", "b", "c"} ->
-- {a = true, b = true, c = true}. NaN values are ignored as Lua considers them
-- never equal to any value (including other NaNs or even themselves).
------------------------------------------------------------------------------------
function p.listToSet(arr)
	checkType("listToSet", 1, arr, "table")
	local isNan = p.isNan
	local set = {}
	for _, v in ipairs(arr) do
		if not isNan(v) then
			set[v] = true
		end
	end

	return set
end

------------------------------------------------------------------------------------
-- deepCopy
--
-- 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

------------------------------------------------------------------------------------
-- sparseConcat
--
-- 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 arr = {}

	local arr_i = 0
	for _, v in p.sparseIpairs(t) do
		arr_i = arr_i + 1
		arr[arr_i] = v
	end

	return table.concat(arr, sep, i, j)
end

------------------------------------------------------------------------------------
-- length
--
-- 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

------------------------------------------------------------------------------------
-- inArray
--
-- Returns true if valueToFind is a member of the array, and false otherwise.
------------------------------------------------------------------------------------
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
舌头两侧溃疡吃什么药 新生婴儿吃什么奶粉 吃月饼是什么节日 决定的近义词是什么 赤者念什么
甲沟炎去医院挂什么科 凌晨3点多是什么时辰 儿童办护照需要什么证件 层出不穷是什么意思 女人要矜持是什么意思
什么什么一什么 共度良宵是什么意思 考药师证需要什么条件 一只眼睛充血是什么原因 牛肉饺子配什么菜好吃
tory burch什么牌子 频次是什么意思 免疫组化检查是什么 逍遥丸有什么作用 什么食物嘌呤高
猪肝不能和什么一起吃wuhaiwuya.com 长期戴耳机有什么危害hcv8jop4ns9r.cn 圣女果是什么水果hcv8jop0ns4r.cn 酸是什么beikeqingting.com 全糖是什么意思baiqunet.com
心气不足吃什么中成药hcv9jop4ns5r.cn hpv感染吃什么药hcv7jop5ns0r.cn 背水一战什么意思hcv9jop1ns8r.cn 唐氏综合征是什么意思hcv9jop7ns0r.cn 小孩肠胃感冒吃什么药比较好hcv7jop6ns7r.cn
社交恐惧是什么zsyouku.com 高烧不退有什么好办法weuuu.com 大明湖畔的夏雨荷是什么意思hcv9jop1ns0r.cn 白醋和陈醋有什么区别hcv9jop4ns9r.cn crpa是什么细菌hcv8jop3ns8r.cn
腰椎挂什么科hcv8jop5ns9r.cn 脸长的人适合什么发型bfb118.com 白居易有什么之称hcv9jop3ns4r.cn 尿比重是什么意思hcv9jop4ns5r.cn 失独是什么意思hcv7jop9ns7r.cn
百度