User talk:Matroc
Welcome
[edit]
|
Lua code snippets
[edit]For Loop a -z
[edit]local c = "" for x = string.byte('a'), string.byte('z') do c = c .. string.char(x) -- 'a' to 'z end
Length of a String
[edit]test = "This is a string" length = #test or length = test:len()
Combine tables together
[edit]newtable = {} t1 = {"Alabama", "New York"} t2 = {"New Hampshire", "Vermont"} for k,v in ipairs(t1) do table.insert(newtable, v) end for k,v in ipairs(t2) do table.insert(newtable, v) end -- newtable now has both t1 and t2 --- can do this for multiple tables
Trim white space left
[edit]string = string:match'^%s*(.*)'
Trim white space right
[edit]string = string:match'^(.*%S)'
Trim both left and right
[edit]string = string:match'^%s*(.*%S)'
Is a table
[edit]if (type(var) == "table") then do table work else do non-table work end
Pad to left of String
[edit]test = "Some String" char="." len=40 test = test .. string.rep(char, len - #test)
Pad to right of String
[edit]test = "Some String" char ="." len = 40 test = string.rep(char, len - #test) .. test
Chop to length
[edit]test = "This is a test" test = test:sub(1,5)
- can pad left or right to insure size is fixed
- may wish to trim spaces off right and left as well
Reverse a String
[edit]test = "This is a test" test = test:reverse()
Str left
[edit]test = "This is a test" test = test:sub(1,count)
- Have to make decision as in case of count being greater than the length of a string or empty string or nil
Str right
[edit]test = "This is a test" test = test:sub(#test - count + 1, test:len()) --or test = test:reverse() test = test:sub(1,count) test = test:reverse()
- Have to make decision as in case of count being greater than the length of a string or empty string or nil
Str lower
[edit]test = "Yes" test = test:lower()
Str upper
[edit]test = "Yes" test = test:upper()
ESCAPE LUA SPECIAL CHARACTERS
[edit]ESC = mw.ustring.gsub(SOMESTRING, '[%-%.%+%[%]%(%)%$%^%%%?%*]','%%%1')
Sandbox TEST modules created on en.wikipedia
[edit]- These are some of the Lua Modules created in Sandbox for testing/learning
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/OSdate
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Misc
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Ship_prefix
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Str_left
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Str_right
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Str_swap
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/TestmvloadData
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Ship_prefix
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Testurlencode
- http://wiki.riteme.site/wiki/Module:Sandbox/Matroc/Listing
Get Wikidata id if article exists in Wikipedia
[edit]- Battle of Hoke's Run Q1497885
Get DISPLAYTITLE
[edit]- No Display Title
- iCarly (season 6)
ArbCom Elections 2016: Voting now open!
[edit]Hello, Matroc. Voting in the 2016 Arbitration Committee elections is open from Monday, 00:00, 21 November through Sunday, 23:59, 4 December to all unblocked users who have registered an account before Wednesday, 00:00, 28 October 2016 and have made at least 150 mainspace edits before Sunday, 00:00, 1 November 2016.
The Arbitration Committee is the panel of editors responsible for conducting the Wikipedia arbitration process. It has the authority to impose binding solutions to disputes between editors, primarily for serious conduct disputes the community has been unable to resolve. This includes the authority to impose site bans, topic bans, editing restrictions, and other measures needed to maintain our editing environment. The arbitration policy describes the Committee's roles and responsibilities in greater detail.
If you wish to participate in the 2016 election, please review the candidates' statements and submit your choices on the voting page. MediaWiki message delivery (talk) 22:08, 21 November 2016 (UTC)
Thanks
[edit]Thanks Matroc, my objective was to get all points and shapes from osm which are tagged with federal bank qid ... checked with Yurik . asif now it is not supported -- naveenpf (talk) 05:30, 5 October 2017 (UTC)
ArbCom 2017 election voter message
[edit]Hello, Matroc. Voting in the 2017 Arbitration Committee elections is now open until 23.59 on Sunday, 10 December. All users who registered an account before Saturday, 28 October 2017, made at least 150 mainspace edits before Wednesday, 1 November 2017 and are not currently blocked are eligible to vote. Users with alternate accounts may only vote once.
The Arbitration Committee is the panel of editors responsible for conducting the Wikipedia arbitration process. It has the authority to impose binding solutions to disputes between editors, primarily for serious conduct disputes the community has been unable to resolve. This includes the authority to impose site bans, topic bans, editing restrictions, and other measures needed to maintain our editing environment. The arbitration policy describes the Committee's roles and responsibilities in greater detail.
If you wish to participate in the 2017 election, please review the candidates and submit your choices on the voting page. MediaWiki message delivery (talk) 18:42, 3 December 2017 (UTC)
Protected Module Edit (Opinion?)
[edit]{{Roman|MMXVIII}} → 2018
Given your past editing of {{Roman}} I wonder if you could point me in the right direction to get some competent eyes on this and also what you might think of {{Roman}} converting both ways depending on input only.
Not sure of process for getting code (as opposed to encyclopedia content) reviewed; didn't even realize there was a [diff] web function until after posting a static diff onto talk page.
–ASiplas (talk) 11:17, 20 February 2018 (UTC)
- ASiplas - I don't think or remember if I edited the Roman Template - I think that perhaps the only person that I can think of to assist you would possibly be Mr. Stradivarius -- Best wishes! Matroc (talk) 00:35, 21 February 2018 (UTC)
ArbCom 2018 election voter message
[edit]Hello, Matroc. Voting in the 2018 Arbitration Committee elections is now open until 23.59 on Sunday, 3 December. All users who registered an account before Sunday, 28 October 2018, made at least 150 mainspace edits before Thursday, 1 November 2018 and are not currently blocked are eligible to vote. Users with alternate accounts may only vote once.
The Arbitration Committee is the panel of editors responsible for conducting the Wikipedia arbitration process. It has the authority to impose binding solutions to disputes between editors, primarily for serious conduct disputes the community has been unable to resolve. This includes the authority to impose site bans, topic bans, editing restrictions, and other measures needed to maintain our editing environment. The arbitration policy describes the Committee's roles and responsibilities in greater detail.
If you wish to participate in the 2018 election, please review the candidates and submit your choices on the voting page. MediaWiki message delivery (talk) 18:42, 19 November 2018 (UTC)