减肥期间适合吃什么| 苏打水有什么作用和功效| 胰腺癌晚期什么症状| 玫瑰茄是什么| 硕是什么意思| smile是什么意思| 突然吐血是什么原因| 吃什么补气虚最快最好| 避孕套什么牌子好用又安全| 大雪是什么意思| 一路走好是什么意思| opv是什么疫苗| gris是什么颜色| 怡五行属性是什么| 血沉高说明什么问题| 精干是什么意思| fl表示什么意思| pinsp呼吸机代表什么| 冠状动脉钙化什么意思| gucci是什么品牌| 甲低有什么危害| 咳必清又叫什么| nt检查是什么| 118是什么星座| 书生是什么意思| 维生素B1有什么副作用| 书中自有颜如玉是什么意思| 12583是什么电话| 鹭鸶是什么动物| 为什么总是睡不着| 一个永一个日念什么| 医院三甲是什么意思| 木字旁羽字是什么字| 盆腔炎吃什么药有效| 名声是什么意思| 检查hpv需要注意什么提前注意什么| 清末民初是什么时候| 三千大千世界什么意思| 肝硬化是什么| 人体最大的细胞是什么| 三月六号是什么星座| 茶水费是什么意思| 缺铁性贫血吃什么食物好| 308是什么意思| 果子狸携带什么病毒| 咽喉肿痛吃什么消炎药| 孕妇手肿是什么原因| 血压低是什么原因| 省长属于什么级别| 艾附暖宫丸什么时候吃| 为什么会有血管瘤| 中耳炎用什么药| 八婆什么意思| 榴莲什么时间段吃最好| 前列腺增生用什么药好| 有什么树| 手不释卷的释是什么意思| 一什么金光| 男生生日礼物送什么| 黄芪入什么经| 什么时候立春| 逼是什么| 双侧肾盂分离是什么意思| 什么是宫刑| 党的性质是什么| 高密度脂蛋白胆固醇偏高什么意思| 苦命是什么意思| 什么叫囊性结节| 慈是什么意思| 嘴唇发麻是什么病兆| 什么是黄色视频| 香菇炒什么菜好吃| 心电图伪差是什么意思| 白露是什么季节| 沙蚕是什么动物| 阴部瘙痒用什么药| 覆盆子有什么作用| diss是什么意思| 阴道刺痛什么原因| 拉肚子是什么原因导致的| 长期熬夜会有什么后果| 解脲脲原体阳性是什么| 55年属什么生肖| 慰问金是什么意思| 盗墓笔记它到底是什么| 朝鲜钱币叫什么| 撸是什么意思| ryan是什么意思| p波代表什么| 梦见不干净的东西代表什么| 切片是什么| 流鼻血吃什么药效果好| 12月13日是什么纪念日| 菲妮迪女装是什么档次| 高血压不能吃什么水果| 老九门2什么时候上映| 山人是什么意思| 扬琴属于什么乐器| 甲沟炎是什么原因引起的| 肺虚吃什么药| novo是什么牌子| 鸡毛换糖是什么意思| 身体出现白斑有可能患什么病| 端字五行属什么| 梦见房子漏水是什么意思| 人为什么会怕鬼| 艾草泡脚有什么好处| 盐为什么要加碘| 为什么一进去就射了| 身价是什么意思| 一什么云| 蹲着有什么好处| 感冒引起的喉咙痛吃什么药| 大便干燥吃什么| 佳人是什么生肖| 早期流产是什么症状| 钾低吃什么| 三伏吃什么| 怔忡是什么意思| 凭什么姐| 殊胜的意思是什么| b超fl是什么意思| 热感冒吃什么药| 来大姨妈拉肚子是什么原因| 相见不如怀念是什么意思| 朊病毒是什么| 脖子淋巴结发炎吃什么药| 口臭吃什么| 高考报名号是什么| 恩惠是什么意思| 凡人修仙传什么时候写的| 床上有横梁有什么害处| 蛋白粉什么时候吃效果最好| 月经提前了10天是什么原因| 埋单是什么意思| 脂肪肝看什么科| 吃什么食物排湿气| 不规则抗体筛查是什么意思| 马克华菲属于什么档次| 胃疼是什么症状| 心口疼是什么原因引起的| 三叉神经痛吃什么药效果最好| 甲醛是什么味道| 痛风吃什么食物好得快| 三焦湿热吃什么中成药| 头不舒服去医院挂什么科| 尿白细胞3十什么意思| 什么肉是碱性的| 黄墙绿地的作用是什么| 为什么会射精| 尿频什么原因| 气血不足吃什么中成药| 驴血为什么是白色的| 虎斑猫是什么品种| 黄芪是什么样子的| 什么是气短| 吃什么可以让奶水增多| 西宁有什么好玩的| 沦丧是什么意思| 毛囊炎长什么样| 高血压是什么原因引起的| 放风是什么意思| 晚上睡觉多梦是什么原因| 吃护肝片有什么副作用| 血淋是什么意思| sample是什么意思| 嗓子干痒咳嗽吃什么药| 青岛有什么好吃的| 隐翅虫咬了用什么药膏| 粗人是什么意思| 孕检都检查什么项目| 维生素c有什么作用| 经常生气会得什么病| 怀孕吃辣对胎儿有什么影响| 十六年是什么婚| 一树梨花压海棠什么意思| 抑郁症是什么| 女人性冷淡吃什么药| 朋友梦到我怀孕了是什么意思| 廉航是什么意思| 犹太人为什么聪明| u是什么单位| 脖子上长小肉粒是什么| 高锰酸钾用什么能洗掉| 肺结核吃什么食物好| 愤青是什么意思| mrcp是什么检查| 跌倒摔伤用什么药| 莲子适合什么人吃| 花生的种子是什么| 无私是什么意思| 胆汁反流是什么原因引起的| 海灵菇是什么东西| 鸡肠炎用什么药效果好| 吃什么能补钙| 蛇进家是什么意思| 韩国烧酒什么味道| 痈疽是什么意思| 特应性皮炎是什么| 血糖高会出现什么症状| 我不知道你在说什么英文| 厉兵秣马什么意思| 扁桃体肿大是什么原因引起的| 心脏瓣膜关闭不全吃什么药| 大使是什么行政级别| 肝左叶囊性灶什么意思| 什么是朋友| 尿糖阳性是什么意思| 21三体高风险是什么原因造成的| 牙根痛吃什么药| 频繁做梦是什么原因| 勾芡是什么意思| 早孕是什么意思| 918是什么日子| 香客是什么意思| 手机为什么会发热| 及什么意思| 胖子从12楼掉下来会变什么| 普瑞巴林是什么药| 跌宕起伏什么意思| 欧诗漫是个什么档次| 肝硬化前期有什么症状| 2月24日是什么星座| 经常便秘吃什么调理| t1w1高信号代表什么| 梦见拉麦子是什么预兆| 什么是hp感染| pink是什么颜色| 脉冲是什么意思| 百合不能和什么一起吃| 血小板体积偏低是什么原因| 七杀大运是什么意思| 处女座的幸运色是什么颜色| 欧莱雅适合什么年龄| 骨盆前倾挂什么科| 复方丹参片治什么病| 福禄寿什么意思| 儿童支气管炎吃什么药| 中性粒细胞比率偏高是什么意思| vc什么时候吃最好| 座是什么结构| 什么的火车| 性格好的女生是什么样| 祸不及家人前一句是什么| 吃什么壮阳补肾| 睡眠不好挂什么科门诊| 甲子日五行属什么| 早餐可以吃什么| 彪马属于什么档次| 胰岛素抵抗是什么意思| 十二指肠球炎是什么病| 减肥为什么不让吃茄子| 黑色是什么颜色组成的| 超敏c反应蛋白正常说明什么| 我不知道你在说什么英文| 虎皮鹦鹉吃什么| 黄疸偏高有什么危害| 尿酸高可以喝什么饮料| 滑液是由什么分泌的| 出家人是什么意思| 延迟是什么意思| 3月31日是什么星座| 一案双查是什么意思| 爽肤水和精华水有什么区别| 百度Jump to content

禹字五行属什么的

From Wikipedia
百度 (编译/箫雨)新鲜有料的产业新闻、深入浅出的企业市场分析,轻松有趣的科技人物吐槽。

Documentation for this module may be created at 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
阴道发炎用什么药 结核抗体弱阳性什么意思 龙代表什么象征意义 bell什么意思 词讼是什么意思
肚子胀气吃什么通气 臭鱼烂虾什么意思 口爆是什么 ab血型和o型生的孩子是什么血型 屁多又臭是什么原因
颈动脉硬化有什么症状 尿发红什么原因 火焰山为什么这么热 218是什么星座 什么中药治肝病最好
皓什么意思 心阳不足吃什么中成药 邓字五行属什么 脑膜炎吃什么药 你是我的唯一什么意思
什么而不什么成语hcv8jop2ns4r.cn 石榴什么时候成熟hcv7jop9ns4r.cn 北方人立秋吃什么dajiketang.com 艾滋病通过什么途径传播hcv9jop6ns9r.cn 车厘子是什么季节的hcv8jop3ns1r.cn
国树是什么树hcv9jop2ns8r.cn 家里为什么有小飞虫hcv9jop4ns3r.cn pks是什么意思hcv8jop0ns8r.cn 皮肤病是什么原因造成的hcv8jop0ns2r.cn 心系是什么意思hcv9jop6ns2r.cn
料酒是什么酒hcv8jop6ns8r.cn 甲状腺有什么功能hcv9jop7ns3r.cn 慢性阑尾炎吃什么消炎药hcv9jop5ns7r.cn 什么手机有红外线功能hcv8jop6ns1r.cn 小儿肠炎吃什么药最好hcv8jop8ns9r.cn
他将是你的新郎是什么歌hcv9jop7ns3r.cn 什么是结膜炎hcv9jop8ns0r.cn 90岁叫什么hcv8jop5ns7r.cn 吃什么能提神不打瞌睡hcv7jop7ns2r.cn 小叶增生是什么症状hcv9jop8ns1r.cn
百度