婴儿胎毛什么时候剃最好| 精气神是什么意思| 手指关节痛挂什么科| 梦到自己开车是什么意思| 山药有什么营养| 一个小时尿一次是什么原因| 肛瘘是什么原因造成的| 桥本甲状腺炎有什么症状表现| 打喷嚏鼻塞吃什么药| 时光如梭是什么意思| 皮肤黄是什么原因引起的| 乳腺导管局限性扩张是什么意思| 厌氧菌是什么| 卡路里什么意思| 曹操是什么生肖| 火烈鸟为什么是红色的| 拔完智齿第三天可以吃什么| 白细胞弱阳性是什么意思| 开放性神经管缺陷是什么意思| 康复治疗学学什么| 智商100属于什么水平| 盘尼西林是什么药| 风湿因子高是什么原因引起的| 剁椒鱼头是什么鱼| 复方氨酚烷胺片是什么药| 谪仙是什么意思| 长疱疹是什么原因| 小三阳吃什么药能转阴| 微针是什么美容项目| move什么意思| 女命劫财代表什么| 纤维灶是什么意思| 粤语点解什么意思| 什么是熊猫血| 什么情况挂全科门诊| 拉红色的屎是什么原因| 为什么眼皮会跳| 红色加黄色是什么颜色| 痱子长什么样| 甲减和甲亢有什么区别| 突破性出血是什么意思| 64是什么| 乙肝表面抗体弱阳性是什么意思| 鼻子大说明什么| 为什么会自言自语| 罹患率是什么意思| 神经衰弱吃什么好| 卵圆孔未闭挂什么科| 拉肚子想吐是什么原因| hvr是什么意思| 纤维素是什么| 介词后面跟什么| 痛风能喝什么饮料| 锅贴是什么| 女性肾虚吃什么药| 父母都是a型血孩子是什么血型| 乔丹是什么品牌| 神经内科主要看什么| 什么是毛囊炎及症状图片| 煞气是什么意思| 戊五行属什么| 登高望远是什么生肖| 肠化生是什么症状| 湿气重是什么原因造成的| 甲亢是什么原因造成的| 此言念什么| 什么工作挣钱多| 土鸡炖什么好吃| 水痘长什么样| elephant是什么意思| 钝角是什么意思| 丘疹性荨麻疹吃什么药| 咽喉炎吃什么好| 火文念什么| 手指关节肿大是什么原因| yolo是什么| 丙肝是什么病| 鸡胗是什么器官| 中性粒细胞百分比偏低是什么意思| 肚子胀打嗝是什么原因| 老花眼是什么原因引起的| 肩膀疼是什么原因| 白腊金是什么意思| 吃什么升白细胞最快| 螚什么意思| merry是什么意思| 天然气是什么气体| 哭夫痣是什么意思| 左手有点麻是什么原因| 治疗呼吸道感染用什么药最好| 看舌头应该挂什么科| 狗吃什么食物| 小孩嗓子哑了吃什么药| 姑爹是什么意思| 领结婚证需要准备什么| 灵芝孢子粉治什么病| 男人早泄吃什么药最好| 玉佛寺求什么最灵验| 刺激是什么意思| 桃子不能跟什么一起吃| 自我感动是什么意思| 什么是植物神经| 夏天什么花会开| 马太效应是什么意思| 窦性心律逆钟向转位是什么意思| 人为什么会得肿瘤| 调理牛肉是什么意思| 孙耀威为什么被封杀| 为什么会长黄褐斑| 肾内科是看什么病的| 男人吃叶酸片有什么好处| 熊猫为什么吃竹子| 牙齿松动什么原因| 轻奢是什么意思| 国家三有保护动物是什么意思| 什么原因引起耳石症| salsa什么意思| tim是什么| 公假是什么意思| 念旧的人是什么样的人| 火险痣是什么意思| 松子吃多了有什么害处| 羊肉炖什么补肾壮阳| 女人腰疼是什么妇科病| 吃什么药可以流产不用去医院| 睾酮是什么意思| 青椒是什么意思| 腿凉是什么原因引起的| 晚上喝蜂蜜水有什么好处| 夜卧早起是什么意思| 99年的兔是什么命| 电波系是什么意思| 查贫血挂什么科| 激素是什么意思| 痛经吃什么止疼药| 烤乳猪用的是什么猪| 地动山摇是什么生肖| 在水一方是什么意思| 绝眼是什么原因引起的| 为什么喝咖啡会心慌| 万能输血者是什么血型| 现在什么最赚钱| 肉质瘤是什么东西| 凭什么是什么意思| 胎儿宫内窘迫是什么意思| 老人吃什么水果对身体好| 麻风病是什么症状图片| 央企董事长什么级别| 1948年属鼠的是什么命| 离是什么生肖| 花都有什么花| 蛇缠腰是什么症状| 善太息是什么意思| 医院按摩挂什么科| 1977属什么| 淋巴吃什么药好| 摄政王是什么意思| elsa是什么意思| 一什么童话| 蛇为什么会咬人| b细胞是什么| 口腔溃疡反反复复是什么原因| 孕妇吃西红柿对胎儿有什么好处| 黑豆有什么功效和作用| 狗肉配什么菜好吃| 高丽参是什么参| 查艾滋病挂什么科| 黄晓明和杨颖什么时候结婚的| 侧柏是什么植物| 上腹胀是什么原因| 什么年马月| 高潮是什么| 相宜的意思是什么| 胳肢窝痒是什么原因| 征兵什么时候开始| 脖子疼什么原因| 法警是干什么的| 发烧想吐是什么原因| 晒伤涂什么| 随意是什么意思| 双侧甲状腺弥漫病变是什么意思| vivo是什么牌子的手机| 朱允炆为什么不杀朱棣| 血脂高适合吃什么食物| 医学上pi是什么意思| 忧郁症挂什么科| crab是什么意思| 背疽是什么病| 五月十八什么星座| 眼睛有重影是什么原因| 1.9号是什么星座| 小便黄是什么原因| 阿拉伯人属于什么人种| 肠炎有什么症状表现| 合盘是什么意思| 不一样的烟火什么意思| 托帕石是什么宝石| 优甲乐是什么药| 庆大霉素治疗鱼什么病| 昏天黑地什么意思| 灰蓝色是什么颜色| 脑脊液是什么| pi是什么| 礼金是什么意思| 定增股票是什么意思| 筷子掉地上是什么征兆| 孕妇佩戴什么保胎辟邪| 自由基是什么| 肚子不舒服是什么原因| 户主有什么权利| 什么笑组词| 老戏骨是什么意思| 碳酸盐质玉是什么玉| 下午4点多是什么时辰| 狼吞虎咽什么意思| 受控是什么意思| 人为什么会死亡| 诸葛亮为什么气死周瑜| 头七有什么讲究| 赵云的马叫什么| 3p 什么 感觉| 梦见蝎子是什么意思| 叶酸有什么作用和功效| h2o是什么| 三点水翟读什么| 管状腺瘤是什么意思| 工会经费是什么| 襄是什么意思| 为什么说有钱难买孕妇B| 重阳节是什么意思| 35岁属什么| 宽宽的什么填空| 耕田是什么意思| 手臂长斑是什么原因| sp什么意思| 老是打哈欠是什么原因| 3人死亡属于什么事故| 手关节疼痛挂什么科| 吃什么尿酸高| 子宫内膜增生有什么症状| 爆竹声中一岁除下一句是什么| 洧是什么意思| 滔滔不绝的绝什么意思| 上午九点半是什么时辰| 早上9点半是什么时辰| 冠周炎吃什么药| 水瓶座的幸运色是什么颜色| 喝酒不能吃什么东西| 一本万利是什么生肖| 吃榴莲补什么| 怀孕送什么礼物| 西米是什么做的| ct和b超有什么区别| 30岁以上适合用什么牌子的护肤品| 蝉又叫什么名字| 嗓子疼可以吃什么水果| 桃花什么时候开| pd990是什么金| 蛇床子是什么| 星期一左眼皮跳是什么预兆| 闻风丧胆指什么动物| 精囊腺囊肿是什么意思| 什么是打飞机| 慢热型是什么意思| 百度Aller au contenu

浙江省委书记点发展关键:抓住机遇、抓好落实

Depi Wikipedya, ansiklopedi lib
百度 记者25日获悉,对于宋某的病情,太湖县寺前镇党委政府将持续跟进,稳妥解决,积极做好善后工作。

La documentation pour ce module peut être créée à Module: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)
	if type(v) == 'number' and v >= 1 and floor(v) == v and v < infinity then
		return true
	else
		return false
	end
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)
	if type(v) == 'number' and tostring(v) == '-nan' then
		return true
	else
		return false
	end
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.
		s = s:gsub('([%(%)%%%.%[%]%*%+%-%?%^%$])', '%%%1')
		return s
	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

--[[
-- This returns the length of a table, or the first integer key n counting from
-- 1 such that t[n + 1] is nil. 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)
	local i = 1
	while t[i] ~= nil do
		i = i + 1
	end
	return i - 1
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
车水马龙是什么意思 青茶是什么茶 cm是什么 优五行属性是什么 私奔什么意思
脑供血不足吃什么药好 老而弥坚是什么意思 前置胎盘是什么原因引起的 乘字五行属什么 绿茶婊什么意思
腐竹和什么一起炒好吃 心脏不大是什么意思 耳堵是什么 什么牛奶好 悦己是什么意思
缺金的人戴什么最旺 尿酸高适合喝什么茶 tpo是什么意思 月经迟迟不来是什么原因 舌尖起泡是什么原因
吃什么减肚子上的赘肉最快hcv8jop2ns4r.cn 山水不相逢什么意思hcv7jop7ns3r.cn 郁郁寡欢是什么意思hcv8jop9ns5r.cn 养生吃什么最好hcv9jop7ns5r.cn 孕前检查什么时候去最合适hcv7jop7ns4r.cn
顺字五行属什么hcv9jop3ns4r.cn 男人下面流脓吃什么药bfb118.com 心率是什么意思hcv8jop1ns4r.cn 属牛的生什么属相的孩子好1949doufunao.com 锦鲤什么意思wuhaiwuya.com
65年出生属什么hcv9jop3ns4r.cn 什么是物理hkuteam.com 簋是什么bjcbxg.com 等回声结节是什么意思hcv9jop8ns0r.cn 子年是什么年hcv7jop6ns1r.cn
空腹洗澡有什么危害xscnpatent.com 蝙蝠怕什么shenchushe.com 骨质密度不均匀是什么意思hcv8jop7ns7r.cn 为什么水不会燃烧hcv9jop8ns1r.cn 电解质氯高是什么原因gysmod.com
百度