穿旗袍配什么发型好看| 中国属于什么气候| 手指长倒刺是什么原因| 2008年是属什么| 吃三七粉有什么功效| 内务是什么意思| 小腿前面的骨头叫什么| 宫颈hpv感染是什么病| 经期不能吃什么| 4月2号是什么星座| 马齿苋什么人不能吃| 打点是什么意思| 爬山有什么好处| 射精是什么感觉| 大连机场叫什么名字| 伤口用什么消毒最好| 朋友越来越少暗示什么| 狗感冒吃什么药| 元阳是什么意思| 什么样的声音| 小宇宙是什么意思| 早餐吃什么简单又营养| 肝火旺盛吃什么中成药| 皮肤炎症用什么药| 先河是什么意思| 一日无书下一句是什么| 宵夜吃什么| 结石能喝什么茶| 慈禧和光绪是什么关系| 什么是棱长| 乙肝表面抗体高是什么意思| 京畿是什么意思| trc是什么意思| 什么的树丛| 男人梦见老鼠什么征兆| ecco什么牌子| 缺黄体酮会有什么症状| 办离婚证需要带什么证件| 家政是干什么的| 出类拔萃是什么意思| 口腹蜜剑什么意思| 一个益一个蜀念什么| 怀疑是什么意思| 怀孕初期会有什么症状| 妗子是什么意思| 薄荷泡水喝有什么功效| 吃红枣有什么好处和坏处| 43是什么意思| 包菜是什么菜| 小燕子吃什么食物| 断头婚是什么意思| 转氨酶升高有什么症状| 降压药什么时候吃好| 粉色玫瑰花代表什么意思| 五四运动是什么| 左肾轻度积水是什么意思| 羊胡子疮用什么药膏| 桃子可以做什么美食| 脑白质疏松是什么意思| 手为什么会发麻| 血燥吃什么药| 人为什么要生孩子| model是什么意思| 降血脂吃什么药效果好| 立棍是什么意思| 营业执照什么时候年审| hp是什么牌子的电脑| 休克是什么症状| 梨花代表什么生肖| 为什么一分钟就出来了| 脂肪肝可以吃什么水果| 头皮脂溢性皮炎用什么洗发水| 什么叫闭经| 生肖猴和什么生肖最配| 舌炎是什么原因引起的怎样治疗| 惠州有什么特产| 4月9号是什么星座| 布洛芬起什么作用| 3月25是什么星座| 什么是指标生| 理想是什么意思| 胎儿右侧脉络丛囊肿是什么意思| bae什么意思| 什么是洁癖| 618什么意思| 荆棘是什么植物| 垂体饱满是什么意思| 倒挂金钩什么意思| 鸡眼是什么原因引起的| 养老保险什么时候开始交| 曩是什么意思| hazzys是什么牌子价格| 黑苦荞茶有什么功效| 什么是辛亥革命| 男士检查精子挂什么科| 尿发黄是什么原因| 慕强什么意思| 梦龙什么口味好吃| 上岗证是什么| 降血压喝什么茶| kps是什么意思| 已是什么生肖| 微针是什么美容项目| 预包装食品指的是什么| 紫色是什么颜色调出来的| 儿童身份证需要什么材料| 忌作灶是什么意思| 过期橄榄油有什么用途| 七宗罪是什么| x射线是什么| 一把把什么| 11月24是什么星座| c1e驾照能开什么车| 什么是象声词| 来大姨妈不能吃什么水果| 人属于什么界门纲目科属种| 黑色水笔是什么笔| 甘草配什么泡水喝最好| 梭子蟹什么季节吃最好| 扁桃体肿大是什么原因引起的| 疤痕憩室什么意思| 熊猫为什么被称为国宝| 什么症状吃保心丸| 什么是介入治疗| 手腕关节疼痛什么原因引起的| 做梦杀人了是什么征兆| 乳头出血是什么原因| 造纸术什么时候发明的| 什么是附件炎| 凝血功能是什么意思| 右肺上叶肺大泡是什么意思| 冰点是什么意思| 匆匆那年是什么意思| 盐酸西替利嗪片主治什么| 98属什么| 为什么会得乙肝| 玉簟秋是什么意思| 鱼香肉丝用什么肉| 扁桃体发炎吃什么药效果最好| 印度阿三是什么意思| 教师资格证有什么用| 心脏房颤吃什么药| 宫颈阳性是什么意思| 窗口是什么意思| 德艺双馨什么意思| co2是什么意思| 草莓印是什么意思| 白带有血丝是什么情况| 经常眩晕是什么原因引起的| 白头发越来越多是什么原因| bi什么意思| 消化快容易饿什么原因| 0tc是什么意思| 眼底出血用什么眼药水| 湿疹是什么样的| 唐氏综合征是什么原因造成的| 碳13是检查什么的| 一月19日是什么星座| 扁平足是什么样的| 螃蟹为什么吐泡泡| 苹果什么时间吃最好| 什么的夏夜| 猫什么时候绝育| 过度什么意思| 智商100属于什么水平| 血常规检查什么| 为什么会睡不着| 鼻梁高的男人说明什么| 排浊是什么意思| 自怨自艾是什么意思| 大黄蜂是什么车| henry是什么意思| 知心朋友是什么意思| 喝什么酒不会胖| 低烧挂什么科| 人中起痘痘是什么原因| coupon是什么意思| 银耳不能和什么一起吃| 女人什么发型最有气质| 吃什么水果对肺好| 9.11是什么星座| 里脊肉是什么肉| 辣椒蟹吃什么| 蛇床子是什么| 做梦梦见地震是什么意思| 内涵什么意思| 大步向前走永远不回头是什么歌| 车水马龙什么意思| 杜甫世称什么| 苹果不能和什么一起吃| 白斑用什么药膏| 防弹衣为什么能防弹| 无为而治是什么意思| 三岁看小七岁看老是什么意思| 黄柏的功效与作用是什么| 苯磺酸氨氯地平片什么时候吃最好| 铁低的原因是什么| 儿童抗o高会引起什么病| 猴赛雷什么意思| 什么动听四字词语| 脚拇指外翻是什么原因造成的| 乙肝两对半和乙肝五项有什么区别| 三公经费指什么| 生殖感染有什么症状| 者羽念什么| 寿眉属于什么茶| 腿筋疼吃什么药| 坐骨神经痛用什么药| 吃什么能快速降血压| 一什么一什么| 什么车子寸步难行脑筋急转弯| 尿道痒男吃什么消炎药| 蹲久了站起来头晕是什么原因| 高同型半胱氨酸血症吃什么药| 早上起来口干口苦口臭是什么原因| 备孕吃什么好| 切尔西是什么意思| 晚上七点半是什么时辰| 鹅翅膀下垂是什么原因| tmc是什么意思| 一幅什么| 望眼欲穿什么意思| 盐酸多西环素片治什么病| 朱砂红是什么颜色| 山楂泡水喝有什么好处| 界代表什么生肖| 老放屁吃什么药| 看眼睛挂什么科| 急性胃炎吃什么药| 肋骨外翻是什么原因| 冒菜为什么叫冒菜| 中气下陷吃什么药| 无穷是什么意思| 黛是什么颜色| 为什么小腹隐隐作痛| 上火了吃什么药好| 5.5号是什么星座| 夏季有什么蔬菜| 梦到被蛇咬是什么意思周公解梦| 什么的原始森林| 屁多屁臭是什么原因| 放屁很臭是什么原因| 支教回来后有什么待遇| 眼花缭乱什么意思| 子代表什么意思| 是什么有什么| 免疫力是什么意思| 耳朵堵塞感是什么原因| ad医学上是什么意思| 会车是什么| 1940年出生属什么生肖| whatsapp是什么软件| 岔气是什么意思| 肝的作用和功能是什么| 水光针是什么| 沈殿霞为什么地位高| 灰色是什么颜色调出来的| 什么叫强直性脊柱炎| 啃手指甲是什么毛病| hmb是什么意思| 诺言背叛诺言是什么歌| ic50是什么意思| 激素六项检查挂什么科| 两癌筛查主要查什么| 百度Przejd? do zawarto?ci

南宁市超3万人自行申报年所得12万元以上个人所得税

Z Wikipedii, wolnej encyklopedii
 Dokumentacja modu?u[zobacz] [edytuj] [historia] ? [od?wie?] ? § podstrony
warning Uwaga:Nie edytuj. Ta strona jest utrzymywana przez bota. Wszelkie edycje powinny by? robione na mediawiki.org. (przet?umacz to ostrze?enie)
--[[
------------------------------------------------------------------------------------
--                               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
什么是糖类抗原 儿童头痛挂什么科 hpc是什么 秋葵什么时候种植最好 肝肾不足是什么意思
左眼一直跳有什么预兆 心悸心慌焦虑吃什么药能缓解 维生素b2有什么作用和功效 备孕前要注意什么 吃什么能让头发变黑
五谷中的菽是指什么 心超是检查什么的 晚上睡觉口苦是什么原因 睡觉总醒是什么原因 什么主皮毛
上挂是什么意思 月经不调去医院挂什么科 二甲双胍是什么药 什么叫手足口病 什么的肩膀
人工虎骨粉是什么做的hcv8jop6ns8r.cn 月经量减少是什么原因hcv9jop0ns0r.cn 襁褓是什么意思hcv8jop6ns0r.cn 心脏缺血吃什么药hcv8jop2ns1r.cn 喝酒睡不着是什么原因hcv9jop7ns2r.cn
什么奶茶最好喝hcv8jop6ns6r.cn bic是什么意思hcv9jop0ns3r.cn 每天拉肚子是什么原因引起的hcv8jop9ns9r.cn 虾头部黄黄的是什么hcv9jop8ns1r.cn 减肥期间适合喝什么酒hcv9jop0ns1r.cn
牙疼可以吃什么hcv7jop6ns4r.cn 包公代表什么生肖hcv9jop1ns6r.cn 什么床垫最健康hcv7jop7ns0r.cn 雷蒙欣氨麻美敏片是什么药hcv9jop5ns1r.cn 什么时候量血压最准hcv8jop3ns6r.cn
胃寒是什么原因引起的naasee.com 什么人容易得骨髓瘤hcv9jop8ns3r.cn 脑梗是什么意思hcv9jop5ns3r.cn 孔雀开屏是什么行为hcv9jop5ns7r.cn 测五行缺什么hcv8jop7ns7r.cn
百度