嫩模是什么意思| bowdor是什么牌子的手表| 物美价廉是什么意思| 5月12日什么星座| 什么的荷叶| 出脚汗是什么原因| 心脏为什么会跳动| 胃酸胃胀反酸水吃什么药| 敬谢不敏是什么意思| 甲亢和甲状腺有什么区别| 排骨炖什么汤止咳润肺| 无拘无束的意思是什么| 什么叫包皮过长| 黄飞鸿是什么生肖| 中性粒细胞百分比低是什么原因| 股骨头在什么位置| lady是什么意思| hyper是什么意思| 4月3号什么星座| 云字属于五行属什么| c12是什么| 北京大裤衩建筑叫什么| 吃什么利尿| 龟头有红点用什么药| 什么能美白皮肤而且效果快| 人绒毛膜促性腺激素是什么意思| 吃四方是什么生肖| 维生素k2是什么| 银行卡销户是什么意思| 绝对值是什么意思| 蚊香灰有什么作用| gp什么意思| b驾照能开什么车| 太岁是什么东西| 梦见龙卷风是什么预兆| 支气管发炎用什么药| 子宫前位后位有什么区别| 三七粉适合什么人群喝| 心悸心慌吃什么药最好| 做梦梦到剪头发是什么意思| 梦见抓鸟是什么征兆| 思想包袱是什么意思| 气血不足吃什么好| 十三太保什么意思| 处子之身是什么意思| 亚子什么意思| sheep是什么意思| 梭边鱼是什么鱼| 脉数是什么意思| 犯困是什么原因引起的| 吃避孕药不能吃什么东西| 中央民族大学什么档次| 此什么非彼什么的意思| daks是什么品牌| 胆汁反流有什么症状| 星链是什么| sei是什么意思| 仿生是什么意思| 1882年属什么生肖| 口苦口臭口干吃什么药| 儿童肠胃炎吃什么药| 吃月饼是什么节日| 杏干泡水喝有什么功效| 棕色皮鞋配什么颜色裤子| 脚冷是什么原因| 血小板高有什么危害| 哈密瓜为什么会苦| 连续放屁是什么原因呢| 缺什么补什么| 经常吃紧急避孕药有什么危害| 大姨妈不来是什么原因造成的| 什么不得什么| 煮黑豆吃有什么功效| 内分泌失调是什么症状| 日常是什么意思| 盐吃多了有什么危害| 陈皮和什么泡水喝最好| 刺青是什么| 老放屁是什么情况| 李世民属什么生肖| 怕冷的女人是什么原因| 63年的兔是什么命| 什么是强迫症| 丢包是什么意思| 见不得别人好是什么心理| 肌酐高可以吃什么水果| 什么是裸分| 白细胞酯酶阳性是什么意思| 大包子什么馅好吃| 结肠炎是什么症状| 体检应该挂什么科| 中出是什么意思| cas是什么| 什么是宫腔镜手术| 一什么湖水| 银灰色五行属什么| 盐是什么| 冰释前嫌的释是什么意思| 胃疼可以吃什么食物| 02年是什么生肖| 拉屎屁股疼是什么原因| 打了狂犬疫苗不能吃什么| 指南针什么时候发明的| gr是什么单位| 牙齿出血是什么病| 为什么不呢| 痈肿疮疖是什么意思| 五什么六什么的成语| 豉油是什么油| 四月四号是什么星座| 为什么不能踩死蜈蚣| ha是什么意思| 阿莫西林不能和什么药一起吃| 宋朝之前是什么朝代| 左室舒张功能减低吃什么药| 大脑缺氧有什么症状| 肾主骨是什么意思| 大利月小利月什么意思| 果是什么意思| 梦见自己死了又活了是什么意思| 咨询是什么意思| 妇科衣原体感染是什么病| 喰种是什么意思| 燕子喜欢吃什么| 体制内是什么意思| 深千尺是什么意思| 胃窦炎吃什么药效果最好| 可可和咖啡有什么区别| 省检察长什么级别| 水军是什么意思| 郁金香长什么样子| 梦见自己化妆是什么意思| 哟西哟西什么意思| 什么叫hp感染| 12月15日是什么星座| lof什么意思| 高等院校是什么意思| 什么时候说什么话| 产后第一天吃什么最好| 什么是鸡眼| 检出限是什么意思| 三分钟热度是什么意思| 月光蓝是什么颜色| 房间消毒杀菌用什么好| 乙肝病毒表面抗体阳性是什么意思| 肺结节有什么症状| nacl是什么| 沙里瓦是什么意思| 腿部抽筋是什么原因引起的| 福禄是什么意思| 耽美剧是什么意思| 什么是有机| 豆芽不能和什么一起吃| 尿肌酐低说明什么原因| 脚后跟疼什么原因| 梦见雨伞是什么意思| 子宫内膜不典型增生是什么意思| 10月16日什么星座| 理疗和按摩有什么区别| qd是什么意思| 月经不调吃什么药调理最好| 吃什么升白细胞比较快| 好滴是什么意思| 经常口腔溃疡吃什么维生素| 14k金是什么意思| 偏光太阳镜是什么意思| 肾结石可以吃什么食物| 小肠换气什么症状| 蓦然回首什么意思| 克星是什么意思| 红色血痣是什么原因| 为什么痣上面会长毛| 树木什么| 女人内火旺喝什么降火| 做亲子鉴定需要什么材料| 单核细胞高是什么感染| 9月21号是什么星座| 白羊座和什么座最配| 骨结核是什么病| 乌鸡汤放什么补气补血| 脉搏跳得快是什么原因| 为什么长痣越来越多了| 什么叫代孕| 为什么一直放屁| 疏忽是什么意思| 皮肤黄吃什么可以改善| 老人睡眠多是什么原因| 甲功是什么意思| 妈祖属什么生肖| 什么血型最多| 缪读什么| 籍贯填什么| 庸医是什么意思| 以马内利什么意思| 脑电图是检查什么的| 口腔医学技术是什么| 缺钾是什么原因造成的| 大理寺是什么机构| 咽炎有什么症状| 孕妇梦见蛇是什么意思| 翘首企盼是什么意思| 宫寒是什么| 小孩经常发烧是什么原因| 盗汗和自汗有什么区别| 老虎头是什么牌子衣服| 小孩爱吃手指头是什么原因| 张纯如为什么自杀| 生物冰袋里面是什么| 六月十号是什么星座| 今天突然拉稀拉出血什么原因| 三七粉适合什么人群喝| 公积金缴存基数是什么意思| 四离日是什么意思| 消化道出血吃什么药| 有什么有什么的四字词语| 癫痫病是什么病| 职业暴露是什么意思| 1996年是什么命| 梦见菜刀是什么意思| 高血压需要注意什么| 1971年属什么生肖| 肾气虚吃什么中成药| 阿司匹林什么时间吃最好| 牛奶能做什么美食| 什么属于包皮过长| tct是什么意思| 打破伤风挂什么科| 肠化什么意思| dady是什么意思| 发炎是什么原因引起的| 打乙肝疫苗需要注意什么| 天的反义词是什么| 快穿是什么意思| 多吃什么可以长头发| 芝士是什么材料做的| 向日葵什么时候成熟| 荞麦茶有什么功效| 骸骨是什么意思| 歹人是什么意思| 冰清玉洁是什么意思| 溃疡性结肠炎吃什么药| 看颈椎挂什么科| 喝什么可以变白| 上海元宵节吃什么| 今年什么时候过年| 兔爷是什么意思| 虾滑是什么| 肉五行属什么| 违拗是什么意思| 柿子不能和什么一起吃| 吖什么意思| 冲是什么意思| 感冒吃什么食物比较好| 竖中指代表什么意思| 后背长痘痘是什么原因引起的| 眉头长痘痘是因为什么原因引起的| 米为什么会生虫| 西洋参什么时候吃效果最好| 肚脐眼叫什么穴位| 咳嗽胸口疼是什么原因| 怕热是什么原因| 两女 一杯是什么| 佝偻病是什么症状| 左下腹疼痛挂什么科| 百度Перейти к содержанию

【中国证券报】上海钢联:2016年扭亏为盈 营收

Хаварду Википедия
Эбрат 18:24, 17 майданий 2019; DiBabelYurikBot (ихтилат | харж) (Copying one change by Capankajsmilyo: "copied from enwiki" from mw:Module:TableTools. (docs, translate))
(цамур) ← Хьхьич?сса | Ц?анасса версия (цамур) | Хъирив нанимур → (цамур)
百度 外界质疑,森友学园原理事长笼池泰典与安倍夫妇关系密切,低价购地一事涉嫌行政干预。

Для документации этого модуля может быть создана страница Модуль: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
嘱托是什么意思 打蛋白针有什么作用 相刑什么意思 什么布料最好 2月1日什么星座
肝血虚吃什么中成药 为什么我不快乐 什么的茄子 虹膜是什么意思 电离辐射是指什么
益母草长什么样子图片 腺肌症吃什么药效果好 什么水解渴 什么时候做人流才是最佳时间 m2是什么意思啊
冰希黎香水什么档次 腿上起水泡是什么原因 黑米是什么米 腹膜透析是什么意思 为什么晚上不能照镜子
5.21什么星座hcv8jop4ns3r.cn 宫外孕什么意思hcv8jop5ns9r.cn 盆腔少量积液是什么意思xianpinbao.com 圣女果是什么水果hcv9jop3ns5r.cn 膝盖咔咔响是什么原因hcv8jop7ns4r.cn
心率失常是什么意思hcv8jop6ns6r.cn 秋刀鱼是什么鱼hcv9jop5ns7r.cn 什么是无机盐hcv9jop4ns2r.cn 刘璋和刘备什么关系hcv9jop1ns3r.cn whatsapp是什么hcv9jop0ns1r.cn
玄府指的是什么hcv9jop6ns1r.cn 荆芥的别名叫什么hcv9jop2ns5r.cn 支气管炎是什么引起的hcv8jop3ns8r.cn 体内湿气太重吃什么药能快速除湿hcv9jop5ns6r.cn 吃饺子是什么节日hcv7jop9ns8r.cn
mn是什么单位hcv7jop5ns4r.cn 腰间盘突出有什么症状hcv9jop2ns8r.cn 射手男和什么座最配对shenchushe.com 维生素d低是什么原因hcv8jop9ns2r.cn 缺营养吃什么补身体最好qingzhougame.com
百度