子宫内膜双层什么意思| hbcab偏高是什么意思| 张紫妍为什么自杀| 1月26号是什么星座| 睡觉时间长是什么原因| 水痘疤痕用什么药膏| 两个务必是什么| 中年危机是什么意思| 什么地溜达| 警察代表什么生肖| 什么是会车| 拿铁咖啡什么意思| trust阴性tppa阳性说明什么| 亲热是什么意思| 中国的国树是什么| 梦见在河里抓鱼是什么征兆| 一个立一个羽读什么| 白凉粉是什么| 喉咙干咳吃什么药| lps医学上是什么意思| 汉武帝属什么生肖| 人出现幻觉是什么原因| 长高吃什么| 手足口吃什么药| 阿米巴病是什么病| 芦笋炒什么好吃| 鱼肝油又叫什么名字| 什么的寒风| 边缘是什么意思| 胆囊炎能吃什么水果| 因势利导什么意思| 牙齿松动是什么原因| 什么原因导致子宫内膜息肉| 畏寒肢冷是什么意思| 皮肤痒挂什么科| 职称是什么| 懵是什么意思| 怀孕7天有什么症状| 阴道出血是什么样的| 百香果配什么好喝| 口羊读什么| 坐骨神经痛是什么原因引起的| 来例假喝什么好| 男人交公粮什么意思| 吃什么蔬菜对眼睛好| 一点点奶茶什么最好喝| 软柿子是什么意思| 不能喝酒是什么原因| 眼皮跳是什么预兆| 褪黑素有什么作用| 血糖看什么指标| 女生是什么意思| 财务是什么意思| 子宫内膜厚有什么危害| 缺钾是什么原因引起| 客服是什么工作| 吃中药不能吃什么水果| 去湿气吃什么最好| 天伦之乐什么意思| 西安和咸阳什么关系| 调岗是什么意思| 纠结是什么意思| 包皮开裂用什么药| 眼睛模糊用什么药| 梦见孩子拉屎是什么意思| 即什么意思| 剖腹产后可以吃什么食物| 脾切除对身体有什么影响| 香蕉有什么作用与功效| 孩子咳嗽能吃什么水果| 吃什么对身体好| 拈花一笑什么意思| 蕾字五行属什么| 什么淀粉最好| 痛风吃什么食物| 胃病吃什么药最好根治| 板栗不能和什么一起吃| 什么的月季| 吃什么维生素对眼睛好| 婴儿黄疸母亲忌口什么| 阴囊痒是什么原因| ab型血可以给什么血型输血| 什么是血沉| 猪蛋是什么| 睡醒手麻是什么原因引起的| visa卡是什么| 肾虚是什么原因造成的| 迎风流泪用什么眼药水| 什么是癔症| 儿童口腔溃疡用什么药| 阿莫西林什么时候吃| 红配什么颜色最好看| 农历什么意思| biw医学上是什么意思| 催乳素高是什么原因| 圣诞节送孩子什么礼物好| 裘皮是什么皮| 前列腺炎吃什么药最好| 放屁臭鸡蛋味什么原因| 妇科检查清洁度3度什么意思| 什么是复句| 高密度脂蛋白偏高是什么意思| 奥美拉唑和雷贝拉唑有什么区别| 吃什么可以瘦肚子| 杉菜是什么意思| 冗长什么意思| 1比1是什么意思| conch是什么牌子| bug是什么意思中文翻译| 火龙果有什么好处| 明天属什么生肖| 空调一匹是什么意思| 软助什么意思| 过生日吃什么菜寓意好| 什么原因引起静脉曲张| 糖尿病患者能吃什么水果| 肚脐眼的作用是什么| 细水长流是什么意思| 黄喉是牛的什么部位| 深圳副市长什么级别| 灵芝有什么作用| 喝什么酒对身体好| 尿蛋白是什么原因造成的| 什么是介入治疗| 男生进入是什么感觉| 骨骼肌率是什么意思| 皮肤科属于什么科室| 腰腿疼痛吃什么药效果好| 腿抽筋是什么原因造成的| 大白条是什么鱼| 梦到自行车丢了是什么意思| 男人为什么累| 艾灸是什么意思| 拘泥是什么意思| 纲是什么意思| 塑胶厂是做什么的| 焦虑症是什么意思| 抑郁症的表现是什么| 暗度陈仓是什么意思| 凶神宜忌是什么意思| 溴隐亭是什么药| 酸梅是什么水果| 喜大普奔是什么意思| 大红袍是什么茶类| 维密是什么意思| 3.7号是什么星座| 肚脐周围痛是什么原因| 做t是什么意思| 心率低有什么危害| 夸父是一个什么样的人| 检查颈椎挂什么科| 什么叫戈壁滩| 53年属什么| 脚底抽筋是什么原因引起的| 什么茶| 均码是什么码| 太作了是什么意思| 肠癌有什么症状| 回门带什么礼物| 羽字属于五行属什么| 扁桃体2度是什么意思| v是什么化学元素| 阳春白雪是什么意思| 流鼻血挂什么科| 阴道有味道是什么原因| 学籍有什么用| 手脚心发热是什么原因| 公主是什么意思| 窦卵泡是什么意思| 军国主义是什么意思| 薇诺娜适合什么年龄| 咽鼓管炎吃什么药| 世界上牙齿最多的动物是什么| 爱出油的人身体缺什么| 山东人喜欢吃什么| 扁桃体结石有什么危害| 糖尿病可以吃什么菜| 借记卡是什么卡| 美味佳肴是什么意思| 空调一级能效什么意思| 决明子是什么东西| 化疗病人吃什么好| 脚踝疼是什么原因| 午睡后头疼是什么原因| 法院庭长是什么级别| 心肌供血不足用什么药| 肉炒什么好吃| 黄花胶是什么鱼的胶| 强迫症有什么症状| 宫颈息肉吃什么药能消| 碎花裙配什么鞋子| 肾上腺结节挂什么科| 卵巢囊性占位是什么意思| 电解质水是什么水| 头皮疼是什么原因引起的| hardly什么意思| 湿热吃什么水果| 佛历是什么意思| 双子座和什么座最配| 牙齿痛吃什么消炎药| 一月四号是什么星座| 社日是什么意思| 肥肠炖什么好吃| 情趣是什么| 一什么尾巴| 乳糖不耐受吃什么奶粉好| 家五行属什么| 受持是什么意思| 主意正是什么意思| 抗核抗体是检查什么病| 计发月数是什么意思| dikang是什么药| 每晚都做梦是什么原因| 什么水果对嗓子好| 为什么喜欢春天| 娃娃鱼属于什么类动物| 跳蚤最怕什么东西| 梦见别人怀孕是什么意思| 蜂窝织炎用什么抗生素| 多吃核桃有什么好处和坏处| 三番四次是什么生肖| 盆腔炎吃什么消炎药效果好| 豆汁是什么味道| 表情包什么意思| 杨梅用什么酒泡最好| 昙花一现是什么意思| 镶什么牙实惠耐用| 什么叫白内障| 吊兰开花有什么兆头| 野兽之王是什么动物| 耸肩是什么原因造成的| 抗坏血酸是什么意思| 上海最高楼叫什么大厦有多少米高| 月经推迟半个月是什么原因| 孕妇吃什么能马上通便| 探病是什么意思| 内径是什么意思| 六月初二是什么日子| 脑白质缺血性改变什么意思| 烽烟是什么意思| 桑叶长什么样子图片| 红米有什么功效和作用| 泌尿系统感染有什么症状| 来月经喝红糖水有什么好处| 1.8是什么星座| 国资委什么级别| 大红袍属于什么档次| 间歇脉多见于什么病| 白细胞低吃什么| 梦到兔子是什么征兆| 湿疹用什么药最有效| 寸脉弱是什么原因| 落子是什么意思| 头发油性大是什么原因| 什么是过敏性咳嗽| 1111是什么意思| 左眼皮跳什么意思| 7号来的月经什么时候是排卵期| 阴虚内热吃什么药好| 6月份种什么菜| emma什么意思| skll什么牌子| 手指缝溃烂擦什么药膏| Mo什么元素| 百度Aqbe? g?all-kontentut

安眠药有什么副作用

Minn Wikipedija, l-en?iklopedija l-?ielsa
百度 ”链家数据显示,环北京、环上海和环深圳的三四线城市的二手房交易占比基本超过50%。

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
4月19是什么星座 吃坏东西拉肚子吃什么药 排骨和什么一起炖好吃 眼带用什么方法消除 舌苔厚有齿痕吃什么药
湿疹有什么症状和图 儿童割包皮挂什么科 抽搐是什么原因引起的 舌头肥大有齿痕是什么原因 母亲节说什么
女儿的孩子叫什么 电轴左偏是什么原因 依托是什么意思 三文鱼为什么可以生吃 腹主动脉壁钙化是什么意思
什么药治便秘最好最快 虚火旺吃什么去火最快 八八年属什么 胆囊是什么 养成系是什么意思
梦见发大水是什么意思hcv7jop6ns3r.cn 吃什么清肺效果最好zhiyanzhang.com 回盲瓣呈唇形什么意思hcv9jop6ns0r.cn 张五行属性是什么hcv8jop5ns9r.cn 羊肉馅饺子放什么菜hcv8jop1ns8r.cn
什么的琥珀gangsutong.com 献血有什么好处hcv9jop6ns8r.cn 这是什么踏板hcv9jop2ns0r.cn 什么减肥效果最好hanqikai.com 什么不能托运beikeqingting.com
下午3点到5点是什么时辰hcv8jop6ns1r.cn 肠胃炎有什么症状hcv9jop0ns7r.cn 什么是棱长zsyouku.com 夏天喝什么饮料好hcv7jop6ns1r.cn 25属什么hcv8jop0ns9r.cn
1943年属什么baiqunet.com 怀不上孕做什么检查hcv9jop1ns2r.cn vsop是什么酒hcv9jop1ns4r.cn 冰箱不制冷是什么问题hcv9jop5ns0r.cn 空鼻症是什么症状adwl56.com
百度