创伤性关节炎有什么症状| 胃火喝什么茶降火| 什么时候进伏| 美容美体是干什么的| 颜面扫地什么意思| 吃什么容易瘦| IQ是什么| 舌吻是什么| 破损是什么意思| 什么如什么| 太阳是什么颜色的| 礼拜是什么意思| 2月18号什么星座| 5月25日什么星座| 吃什么能瘦肚子| 洞房是什么意思| 睡眠不好用什么泡脚助于睡眠| 多吃玉米有什么好处和坏处| 宫外孕和宫内孕有什么区别| 中盐是什么盐| 形婚是什么意思啊| 清浅是什么意思| 男性尿道口流脓吃什么药最管用| 许多的近义词是什么| 静待花开的前一句是什么| 双子后面是什么星座| 相亲第一次见面送什么礼物好| 奶水不足是什么原因造成的| 女人鼻子大代表什么| hpv感染吃什么药| 刚感染艾滋病什么症状| 癌胚抗原是什么意思| 什么是化合物| 为什么天天晚上做梦| 足跟痛是什么原因| 吴刚和嫦娥什么关系| 路痴是什么意思| 天空蓝是什么颜色| 足底麻木是什么原因| 经常流鼻血是什么病| 明胶是什么做的| 胃炎什么症状| 手的皮肤黄是什么原因| 打一个喷嚏代表什么| 宫颈炎吃什么药好得快| 买二手苹果手机要注意什么| 胃口不好吃什么| 帛书是什么意思| 半边脸肿是什么原因引起的| 回复是什么意思| 牛肉饺子馅配什么蔬菜好吃| 女汉子什么意思| 什么是小针刀治疗| 南瓜什么人不能吃| 画蛇添足是什么意思| 吃藕粉对身体有什么好处| 不什么声什么| 右下腹有什么器官| 今天农历什么日子| 魅惑是什么意思| 林冲是什么生肖| 杨紫属什么生肖| 湿疹为什么一热就出来| 仰天长叹的意思是什么| 水金龟属于什么茶| 乳房硬块疼是什么原因| 男朋友有什么用| 拉郎配是什么意思| 住院门槛费是什么意思| 100分能上什么大学| 葡萄胎是什么意思| 什么的麦田| 甲母痣是什么| 志趣相投是什么意思| 羸弱是什么意思| 敏感水体是什么意思| 枸杞子泡茶喝有什么好处| 梨状肌综合症吃什么药| 肩周炎挂什么科| 父亲生日送什么礼物| 什么样的阳光填形容词| 梦见买面条有什么预兆| 黑鱼是什么鱼| 手起皮是什么原因| 什么样的闪电| 清心寡欲什么意思| 心下痞是什么意思| 胎儿脐带绕颈是什么原因造成的| sheet是什么意思| 65年出生属什么| 老叹气是什么原因| 上上签什么意思| 契机是什么意思| 小马过河的故事告诉我们什么道理| 颇负什么什么| 一个大一个多念什么| 养胃吃什么| 人为什么要喝水| ipl是什么意思| 香蕉吃多了有什么坏处| 100是什么意思| 月经期间吃什么对身体好| 名侦探柯南什么时候完结| 红景天是什么药| 双飞是什么生肖| 日希是什么字| 脚有点浮肿是什么原因| 为什么一直打喷嚏| 什么是再生纤维面料| 做什么业务员好| 肾虚吃什么药最有效| 缺锌容易得什么病| 荨麻疹要注意些什么| 月全食是什么意思| 凌晨的凌是什么意思| 打嗝挂什么科| 什么叫匝道| 小米粥和什么搭配最好最养胃| 经常呕吐是什么原因| 舌头开裂是什么原因| 口腔挂什么科| 维生素b2是什么| 西字里面加一横是什么字| 衰竭是什么意思| 眼科pd是什么意思| 蜂蜜和柠檬一起喝有什么作用| 保守治疗是什么意思| 似是而非是什么意思| 扁桃体结石有什么症状| 吃羊肉不能吃什么水果| 辟谷是什么| 想一出是一出什么意思| 变白吃什么| 什么是高筋面粉| 牙周炎是什么症状| 血脂高饮食应注意什么| 玻尿酸面膜有什么功效| 去医院看肛门挂什么科| 淋巴细胞比率低是什么意思| 阿米替林片是治什么病的| 尿性什么意思| 减肥喝什么咖啡| 天麻泡水喝有什么功效| 活检是什么意思| 伤风败俗是什么意思| 尿蛋白2十吃什么药| 芒硝有什么作用| 蛇怕什么| 肾囊肿有什么症状表现| 健康证挂什么科| 收获颇丰什么意思| 两岁宝宝坐飞机需要什么证件| 脉弦是什么意思和症状| 啤酒ipa是什么意思| 饮水思源是什么意思| 钙化淋巴结是什么意思| 胃酸过多吃什么| vain是什么意思| 阿西是什么意思| 梦见自己在洗澡是什么意思| 萎缩性胃炎是什么原因引起的| 女人喝什么茶减肥好| 大象的天敌是什么动物| 夕阳无限好只是近黄昏是什么意思| 大学有什么专业适合女生| 吃什么容易流产| 头疼头晕去医院挂什么科| 钮祜禄氏现在姓什么| ipv是什么| 什么叫绿茶| 多愁善感的动物是什么生肖| 忌神是什么意思| 手足口疫苗叫什么名字| ehe是什么牌子| 肺癌有什么症状| 牛肉炒什么| cm是什么| 夏天适合用什么护肤品| 眼睛老是肿着是什么原因造成的| 星星像什么比喻句| 认知障碍是什么意思| 怀孕了有什么征兆| 为什么拍照脸是歪的| mpv是什么意思| 中药学专业学什么| 阿僧只劫是什么意思| c2能开什么车| 肺积水是什么原因引起的| 葱白是什么| 痞满是什么意思| 什么肠什么肚| 肚脐眼发炎是什么原因| 男人皮肤黑穿什么颜色的衣服好看| 静息心率是什么意思| 仿佛是什么意思| 人的五官是什么| 子宫肌瘤什么不能吃| tct检查什么项目| 男性全身皮肤瘙痒是什么原因| 什么是糖类抗原| 老人吃什么钙片补钙效果最好| 肾阴虚的症状吃什么药| 深水炸弹是什么| 战区司令员是什么级别| 幽门螺旋杆菌是什么症状| 冲床工是做什么的| 什么情况下要做肌电图| uno是什么| 正负得什么| 世事无常什么意思| 亭亭净植的亭亭是什么意思| 什么叫肝腹水| 五彩缤纷是什么生肖| 女人排卵是什么时间| 咳嗽有黄痰吃什么消炎药| 2017年什么年| 吃茶叶蛋有什么好处和坏处| 12点是什么时辰| 最高的学历是什么| 五行缺金是什么命| 什么的小花| 什么是思想| 聪明反被聪明误是什么意思| 吃什么补充dha| 痔疮发痒是什么原因| 栀是什么意思| 位置是什么意思| 般若波罗蜜是什么意思| 善待是什么意思| 什么的城市| 湿热吃什么食物| 甲钴胺不能和什么药一起服用| 红鸾星动是什么意思| 人为什么会生病| 妇科菌群失调吃什么药| 什么是直径| 为什么身上会长脂肪瘤| 刘字是什么偏旁| 羊蝎子是什么肉| 属狗男和什么属相最配| 宫内积液什么意思| 耳石是什么东西| 尿检粘液丝高什么意思| 拉大便出血是什么原因| 兔子拉稀是什么原因| 女人在什么时候最想男人| 每天尿都是黄的是什么原因| 小腹胀痛男性什么原因| 无公害什么意思| 高的部首是什么| 丽江机场叫什么名字| 1037年属什么生肖| 乳糖不耐受什么意思| 痛风反复发作什么原因| 疯狂动物城狐狸叫什么| 广东有什么市| 梦见背小孩是什么意思| 黄芪和枸杞泡水喝有什么作用| 一个西一个米念什么| 腿弯后面疼是什么原因| 诺丽果有什么功效| 小便发白是什么原因| b站是什么| 工种是什么意思| 百度Jump to content

什么体质的人才有季经

Sian 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)
	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
脚踝疼挂什么科 铅中毒有什么症状 经期喝咖啡有什么影响 氯偏低是什么原因 二氧化硅是什么晶体
虎年是什么年 土贝什么字 什么民族不吃猪肉 热痱子长什么样 gender什么意思
桂圆和龙眼有什么区别 马尿是什么意思 消防队属于什么单位 咳嗽吃什么药好 亥时是什么时候
肩膀发麻是什么原因 hpv男性有什么症状 肝火旺吃什么 盯眝是什么意思 嘴唇干燥是什么原因
claire是什么意思zhongyiyatai.com 去痘印用什么药膏好helloaicloud.com 手脚爱出汗是什么原因hcv9jop4ns3r.cn 什么的心情hcv9jop4ns7r.cn 名人轶事是什么意思sanhestory.com
胃胀痛吃什么药hcv8jop2ns6r.cn 球拍状胎盘对胎儿有什么影响hcv8jop4ns2r.cn 女人脾胃虚弱吃什么好jiuxinfghf.com 肺癌早期有什么症状hcv8jop6ns1r.cn 痛风喝什么水hcv7jop9ns5r.cn
嗓子痒咳嗽吃什么药hcv8jop6ns5r.cn mp是什么意思hcv8jop2ns4r.cn 排酸是什么意思hcv9jop7ns0r.cn 爱恨情仇是什么意思hcv9jop0ns9r.cn 螃蟹的血是什么颜色的hcv7jop5ns3r.cn
1956年属什么hcv7jop4ns5r.cn 醉清风是什么意思hcv9jop5ns2r.cn 11月7日是什么星座hcv8jop0ns8r.cn 橱窗是什么意思hcv9jop5ns7r.cn 规格是什么意思hcv9jop2ns6r.cn
百度