胃炎吃什么药好使| 龙冲什么生肖| 月经突然停止是什么原因| 子字属于五行属什么| 尿分叉是什么原因| lo娘是什么意思| 非萎缩性胃炎伴糜烂吃什么药| 睾头囊肿是什么意思| 冻雨是什么| 李子什么季节成熟| 奶粉可以做什么美食| 草长莺飞是什么生肖| 胎儿头偏小是什么原因引起的| 凹儿念什么| 离苦得乐什么意思| pacs什么意思| 宫腔内钙化灶是什么意思| neo什么意思| 2007年五行属什么| 祭是什么意思| 支气管炎能吃什么水果| 额头长痘什么原因| 净身出户需要什么条件| 甲状腺炎吃什么药好| 降压药什么时候吃好| 玄学是什么| pedro是什么牌子| 终身为国是什么生肖| 桃胶有什么作用| 红玫瑰花语是什么意思| 丙氨酸氨基转移酶是查什么的| 单亲是什么意思| 无什么| 一什么毛驴| 一库一库雅蠛蝶是什么意思| 什么是射线| 阁僚是什么意思| 汽车点火线圈坏了有什么症状| 周易和易经有什么区别| 俞字五行属什么| er是什么元素| 汤伤用什么药| 测骨龄挂什么科| 乳白色是什么颜色| 人为什么有五根手指| 阴囊瘙痒挂什么科室| 吃什么会导致流产| 巡礼是什么意思| 不由自主的摇头是什么病| tax是什么意思| 身上长红疙瘩很痒是什么原因| 芬太尼是什么| 高血压适合做什么运动| 怀孕初期吃什么蔬菜好| 四肢麻木是什么病| 颈椎曲度变直是什么意思| 男人吃秋葵有什么好处| 跑得最快的是什么生肖| 咳必清又叫什么| 那是什么呢| 土地兼并是什么意思| 梦见晒被子是什么意思| 医师是什么级别| 明天是什么日子| 胰腺炎是什么引起的| 养儿防老下一句是什么| 什么人适合喝蛋白粉| 女性下面流水什么原因| 不动产是什么意思| 北极熊吃什么| 上夜班吃什么对身体好| 万中无一什么意思| 红曲米是什么| 经常呕吐是什么原因| 阳气不足吃什么药| 排卵试纸两条杠是什么意思| 什么是粉丝| 什么饮料解酒| 溜车是什么意思| 痔疮肛瘘是什么症状| 211属于什么大学| 我是什么课文| 脸部肌肉跳动是什么原因| 张力是什么意思| 神经病吃什么药效果好| 小处男是什么意思| 火龙果和香蕉榨汁有什么功效| 儿童拉肚子吃什么药| 颇负盛名的颇是什么意思| 白羊跟什么星座最配| 十全十美指什么生肖| 为什么会落枕| 拉肚子拉稀水吃什么药管用| 晚上8点半是什么时辰| 手抖是什么毛病| 八面玲珑指什么生肖| 白猫是什么品种| 躁郁症是什么| 肩颈疼痛挂什么科| 优柔寡断是什么意思| 10015是什么电话| 69年什么时候退休| 感触什么意思| 九月七日是什么星座| 鲨鱼用什么呼吸| 被马蜂蛰了用什么药| 竞走是什么意思| 有脚气是什么原因引起的| 什么颜色的包包招财并聚财| 美尼尔眩晕症吃什么药| 老师家访需要准备什么| 肾病什么东西不能吃| 什么品牌的沙发好| 拉肚子吃什么| 猪胰是什么东西| 隐翅虫怕什么| 脊髓炎是什么病| 为什么会黄体功能不足| 忧心忡忡是什么意思| 钦此是什么意思| 猪肝可以钓什么鱼| 面部肌肉跳动是什么原因| 嗯嗯嗯是什么意思| 老打嗝是什么原因引起的| 手臂粗是什么原因| 翠鸟吃什么| 1977属什么| 对视是什么意思| 3月5日是什么星座的| 回声欠均匀是什么意思| 家里有蚂蚁是什么原因| 阿魏酸是什么| 红细胞高是什么原因| henry是什么意思| 单飞什么意思| 折什么时候读she| 为什么会心肌梗死| 血管瘤是什么病严重吗| 什么的雪花| 鸭蛋不能和什么一起吃| 什么网站| 不什么而同| 上海虹桥医院属于什么医院| 什么是呼吸性碱中毒| 眼皮发肿是什么原因| 什么的流动| 琼玖是什么意思| 口爆是什么| 软骨瘤是什么病| 为什么不建议吃茵栀黄| 熬夜伤什么| 璠字取名寓意什么| 尿蛋白十一是什么意思| 牛有几个胃分别叫什么| 傀儡什么意思| 什么清什么秀| 邹字五行属什么| 蚊子喜欢什么血型| 318什么意思| 纤维增殖灶是什么意思| 腰扭伤吃什么药最有效| 2020年是什么生肖| 斑鸠吃什么| 胰岛素起什么作用| 秘语是什么意思| 睡觉喜欢流口水是什么原因| 准确值是什么意思| 狗狗细小是什么症状| 晨僵是什么症状| 眼睛充血用什么眼药水好| 特需病房是什么意思| 天上为什么有星星| cfa是什么证书| 乙肝表面抗体弱阳性是什么意思| 地龙是什么东西| suki什么意思| 冬眠是什么意思| 什么样的西瓜| 花胶和什么煲汤最适合| 嗓子有黄痰是什么原因| 眼皮跳是什么原因引起的| 介入医学科是什么科室| 属猪生什么属相宝宝好| 物欲横流是什么意思| 奥斯卡是什么意思| 喉咙痛流鼻涕吃什么药| 老是做噩梦是什么原因| 头秃了一块是什么原因| abob是什么药| 女生排卵期是什么时候| 西湖醋鱼是什么鱼| 肾炎吃什么药好| 牙科属于什么科| 瘦脸针的危害有什么副作用| 17年属什么生肖| 凤梨跟菠萝有什么区别| 叶黄素有什么功效| 直视是什么意思| 徘徊什么意思| 跪乳的动物是什么生肖| 睡觉起来口苦是什么原因| 湿疹用什么药效果好| 脚气泡脚用什么泡最好| 中药一般什么时候喝最好| inr医学上是什么意思| 扼腕是什么意思| 口舌生疮吃什么药最好| 看手指甲挂什么科室| 什么叫菩提心| 6月份什么星座| 六六大顺是什么意思| 咒怨讲的是什么故事| 切除扁桃体有什么好处和坏处| 什么什么为什么| chocker是什么| 外阴瘙痒用什么效果好| 海胆是什么东西| 走青是什么意思| 什么是积食| 前壁后壁有什么区别| 喉咙痛吃什么药| 失而复得什么意思| ed病毒是什么| 龙马精神代表什么生肖| 凝血功能差有什么危害| 肾衰竭五期是什么意思| 7.14日是什么日子| 晕血是什么原因| 欲购从速什么意思| 溃烂用什么药治愈最快| 日龙包什么意思| 夏天吃什么汤| 泡面吃多了有什么危害| 口臭严重吃什么药好得快| 拉屎为什么是绿色的| 朱元璋为什么杀徐达| 肚脐眼右边是什么器官| vampire是什么意思| 胎盘植入是什么意思| 做什么运动能瘦肚子| 头发油是什么原因| 一个人自言自语的说话是什么病| 寒疾现代叫什么病| 拉尼娜现象是什么| 史迪奇是什么动物| 为什么来我家| 乙肝核心抗体偏高是什么意思| 心脑血管挂什么科| 高危hpv阳性是什么意思| 吃核桃有什么好处和坏处| 巨蟹男喜欢什么样的女生| 玫瑰茄是什么| 什么是追溯码| 生姜泡水喝有什么好处| egg是什么意思| 什么是靶向治疗| 扑感敏又叫什么名字| 图字五行属什么| 印字五行属什么| 抄送和密送是什么意思| edg是什么意思| 痔疮有什么症状表现| 水中加什么擦玻璃干净| 维生素b2有什么作用| 百度Jump to content

土耳其1架战机训练飞行中坠毁 机上1名飞行员死亡

From Tsétsêhéstahese Wikipedia
百度     北京青年报记者从多家出租车公司获悉,目前北京正通过科技手段监管出租车,本市1万余辆出租车上已经试点安装了智能车载终端一体机。

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
宝宝入盆有什么感觉 猫哭了代表什么预兆 慎重考虑是什么意思 什么而不什么 玉子是什么
痔疮的初期症状是什么 45是什么生肖 隐晦是什么意思 榴莲什么时候吃最好 李连杰是什么国籍
汗管瘤用什么药能去掉 为什么会得静脉曲张 人加一笔变成什么字 氯低是什么原因 肝内低回声区是什么意思
三进宫是什么意思 感冒发烧不能吃什么食物 梅毒症状男有什么表现 便秘挂什么科室 成因是什么意思
10万个为什么的作者jasonfriends.com 四氯化碳是什么jingluanji.com 蚊虫叮咬红肿用什么药hcv8jop8ns7r.cn 摄人心魄是什么意思hcv8jop3ns7r.cn 枸杞泡茶喝有什么功效0297y7.com
串联质谱筛查是什么病hcv8jop1ns7r.cn 管型尿是什么意思hcv7jop5ns5r.cn 真菌感染是什么引起的hcv8jop5ns7r.cn 色拉油是什么油hcv8jop6ns6r.cn 肉桂粉是什么做的hcv7jop6ns9r.cn
漂头发是什么意思hcv9jop3ns6r.cn 厉兵秣马是什么意思clwhiglsz.com 属虎生什么属相宝宝好onlinewuye.com 牙根吸收是什么意思hcv9jop1ns7r.cn 地震为什么会发生hcv9jop1ns8r.cn
不除外是什么意思hcv8jop4ns5r.cn 红颜什么意思1949doufunao.com 大惊小怪是什么生肖hcv8jop8ns3r.cn 印第安纹是什么hcv9jop3ns3r.cn 宫颈筛查hpv阳性是什么意思hcv7jop6ns0r.cn
百度