User talk:Matroc: Difference between revisions
m clean test |
m →Get Wikidata id if article exists in Wikipedia: testing ignore |
||
Line 209: | Line 209: | ||
#* http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Listing |
#* http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Listing |
||
== Get Wikidata id if article exists in Wikipedia == |
== Get Wikidata id if article exists in Wikipedia == |
||
lukup=Second Battle of Fort Fisher -- id=Q7443093 |
|||
title=[[Second Battle of Fort Fisher]] |
|||
date=January 13, 1865–15, 1865 |
|||
place=North Carolina |
|||
info=Union victory: Union takes fort. |
|||
\\ |
|||
lukup=Battle of Rivers' Bridge -- id=Q2036970 |
|||
title=[[Battle of Rivers' Bridge]] |
|||
date=February 3, 1865 |
|||
place=South Carolina |
|||
info=Union victory: Union forces capture river crossing. |
|||
\\ |
|||
lukup=Battle of Hatcher's Run -- id=Q4871195 |
|||
title=[[Battle of Hatcher's Run]] |
|||
date=February 5, 1865–7, 1865 |
|||
place=Virginia |
|||
info=Union victory: Union force launch unexpected attack. |
|||
\\ |
|||
lukup=Battle of Wilmington]] ([[North Carolina) -- id={{safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Wilmington]] ([[North Carolina)}} |
|||
title=[[Battle of Wilmington]] ([[North Carolina]]) |
|||
date=February 22, 1865 |
|||
place=North Carolina |
|||
info=Union victory: Last Confederate port falls. |
|||
\\ |
|||
lukup=Battle of Waynesboro, Virginia -- id=Q2890377 |
|||
title=[[Battle of Waynesboro, Virginia]] |
|||
date=March 2, 1865 |
|||
place=Virginia |
|||
info=Union victory: Remnants of Confederate [[Army of the Valley]] are destroyed. |
|||
\\ |
|||
lukup=Battle of Natural Bridge -- id=Q2611018 |
|||
title=[[Battle of Natural Bridge]] |
|||
date=March 6, 1865 |
|||
place=Florida |
|||
info=Confederate victory: Confederate victory in Florida prevents the capture of Tallahassee. |
|||
\\ |
|||
lukup=Battle of Wyse Fork -- id=Q586945 |
|||
title=[[Battle of Wyse Fork]] |
|||
date=March 7, 1865–10, 1865 |
|||
place=North Carolina |
|||
info=Union victory: Confederate attacks repelled by Union artillery. |
|||
\\ |
|||
lukup=Battle of Monroe's Cross Roads -- id= |
|||
title=[[Battle of Monroe's Cross Roads]] |
|||
date=March 10, 1865 |
|||
place=North Carolina |
|||
info=Inconclusive: |
|||
\\ |
|||
lukup=Battle of Averasborough -- id=Q2887919 |
|||
title=[[Battle of Averasborough]] |
|||
date=March 16, 1865 |
|||
place=North Carolina |
|||
info=Inconclusive: Union and Confederate forces attack one another in turn, both attacks fail. |
|||
\\ |
|||
lukup=Battle of Bentonville -- id=Q620244 |
|||
title=[[Battle of Bentonville]] |
|||
date=March 19, 1865–21, 1865 |
|||
place=North Carolina |
|||
info=Union victory: Sherman defeats Confederates |
|||
\\ |
|||
lukup=Battle of Fort Stedman -- id=Q543094 |
|||
title=[[Battle of Fort Stedman]] |
|||
date=March 25, 1865 |
|||
place=Virginia |
|||
info=Union victory: Lee attempts to break siege. |
|||
\\ |
|||
lukup=Battle of Spanish Fort -- id=Q2184295 |
|||
title=[[Battle of Spanish Fort]] |
|||
date=March 27, 1865 – April 8, 1865 |
|||
place=Alabama |
|||
info=Union victory: Union forces capture fort just east of Mobile. |
|||
\\ |
|||
lukup=Battle of Lewis's Farm -- id=Q1129674 |
|||
title=[[Battle of Lewis's Farm]] |
|||
date=March 29, 1865 |
|||
place=Virginia |
|||
info=Union victory: Union forces capture Confederate earthworks. |
|||
\\ |
|||
lukup=Battle of White Oak Road -- id=Q1872466 |
|||
title=[[Battle of White Oak Road]] |
|||
date=March 31, 1865 |
|||
place=Virginia |
|||
info=Union victory: Confederate forces under [[Richard H. Anderson]] defeated. |
|||
\\ |
|||
lukup=Battle of Dinwiddie Court House -- id=Q688807 |
|||
title=[[Battle of Dinwiddie Court House]] |
|||
date=March 31, 1865 |
|||
place=Virginia |
|||
info=Confederate victory: Pickett defeats Sheridan. |
|||
\\ |
|||
lukup=Battle of Five Forks -- id=Q194329 |
|||
title=[[Battle of Five Forks]] |
|||
date=April 1, 1865 |
|||
place=Virginia |
|||
info=Union victory: Sheridan routs Confederates. |
|||
\\ |
|||
lukup=Battle of Selma -- id=Q2313310 |
|||
title=[[Battle of Selma]] |
|||
date=April 2, 1865 |
|||
place=Alabama |
|||
info=Union victory: [[James H. Wilson|Wilson]] defeats Forrest. |
|||
\\ |
|||
lukup=Third Battle of Petersburg -- id=Q4462586 |
|||
title=[[Third Battle of Petersburg]] |
|||
date=April 2, 1865 |
|||
place=Virginia |
|||
info=Union victory: Grant defeats Lee. |
|||
\\ |
|||
lukup=Battle of Sutherland's Station -- id=Q2162088 |
|||
title=[[Battle of Sutherland's Station]] |
|||
date=April 2, 1865 |
|||
place=Virginia |
|||
info=Union victory: Lee's supply lines are cut. |
|||
\\ |
|||
lukup=Battle of Namozine Church -- id={{safesubst:safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Namozine Church}} |
|||
title=[[Battle of Namozine Church]] |
|||
date=April 3, 1865 |
|||
place=Virginia |
|||
info=Confederate victory: Several Confederates captured, [[George Armstrong Custer|Custer]]'s brother earns Medal of Honor. |
|||
\\ |
|||
lukup=Battle of Amelia Springs -- id={{safesubst:safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Amelia Springs}} |
|||
title=[[Battle of Amelia Springs]] |
|||
date=April 5, 1865 |
|||
place=Virginia |
|||
info=Inconclusive: |
|||
\\ |
|||
lukup=Battle of Rice's Station -- id={{safesubst:safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Rice's Station}} |
|||
title=[[Battle of Rice's Station]] |
|||
date=April 6, 1865 |
|||
place=Virginia |
|||
info=Union victory: |
|||
\\ |
|||
lukup=Battle of Sayler's Creek -- id={{safesubst:safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Sayler's Creek<br>(or Sailor's Creek)}} |
|||
title=[[Battle of Sayler's Creek]] or Sailor's Creek) |
|||
date=April 6, 1865 |
|||
place=Virginia |
|||
info=Union victory: Lee realizes his army is on the verge of defeat. |
|||
\\ |
|||
lukup=Battle of High Bridge -- id={{safesubst:safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of High Bridge}} |
|||
title=[[Battle of High Bridge]] |
|||
date=April 6, 1865–7, 1865 |
|||
place=Virginia |
|||
info=Inconclusive: Union forces thwart Lee's attempts to burn bridges and to resupply, Grant proposes that Lee surrender, but he refuses. |
|||
\\ |
|||
lukup=Battle of Cumberland Church -- id={{safesubst:safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Cumberland Church}} |
|||
title=[[Battle of Cumberland Church]] |
|||
date=April 7, 1865 |
|||
place=Virginia |
|||
info=Confederate victory: Union forces attack Confederate rearguard, but darkness cuts the attack short. |
|||
\\ |
|||
lukup=Battle of Appomattox Station -- id={{safesubst:safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Appomattox Station}} |
|||
title=[[Battle of Appomattox Station]] |
|||
date=April 8, 1865 |
|||
place=Virginia |
|||
info=Union victory: Union forces thwart Lee's final attempt to resupply. |
|||
\\ |
|||
lukup=Battle of Appomattox Court House -- id=Q1355391 |
|||
title=[[Battle of Appomattox Court House]] |
|||
date=April 9, 1865 |
|||
place=Virginia |
|||
info=Union victory: Lee's forces surrounded. He subsequently surrenders. |
|||
\\ |
|||
lukup=Battle of Fort Blakeley -- id=Q1438584 |
|||
title=[[Battle of Fort Blakeley]] |
|||
date=April 9, 1865, 1865 |
|||
place=Alabama |
|||
info=Union victory: Union forces capture fort east of Mobile. |
|||
\\ |
|||
lukup=Battle of Palmito Ranch -- id=Q48776 |
|||
title=[[Battle of Palmito Ranch]] |
|||
date=May 12, 1865–13, 1865 |
|||
place=Texas |
|||
info=Confederate victory: Last battle in Texas during final phases of the Civil War. |
|||
\\ |
|||
* Battle of Hoke's Run {{#invoke:Sandbox/Matroc/Misc|getname|Battle of Hoke's Run}} |
* Battle of Hoke's Run {{#invoke:Sandbox/Matroc/Misc|getname|Battle of Hoke's Run}} |
Revision as of 02:51, 17 August 2018
Welcome
|
Lua code snippets
For Loop a -z
local c = "" for x = string.byte('a'), string.byte('z') do c = c .. string.char(x) -- 'a' to 'z end
Length of a String
test = "This is a string" length = #test or length = test:len()
Combine tables together
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
string = string:match'^%s*(.*)'
Trim white space right
string = string:match'^(.*%S)'
Trim both left and right
string = string:match'^%s*(.*%S)'
Is a table
if (type(var) == "table") then do table work else do non-table work end
Pad to left of String
test = "Some String" char="." len=40 test = test .. string.rep(char, len - #test)
Pad to right of String
test = "Some String" char ="." len = 40 test = string.rep(char, len - #test) .. test
Chop to length
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
test = "This is a test" test = test:reverse()
Str left
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
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
test = "Yes" test = test:lower()
Str upper
test = "Yes" test = test:upper()
ESCAPE LUA SPECIAL CHARACTERS
ESC = mw.ustring.gsub(SOMESTRING, '[%-%.%+%[%]%(%)%$%^%%%?%*]','%%%1')
Sandbox TEST modules created on en.wikipedia
- These are some of the Lua Modules created in Sandbox for testing/learning
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/OSdate
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Misc
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Ship_prefix
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Str_left
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Str_right
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Str_swap
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/TestmvloadData
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Ship_prefix
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Testurlencode
- http://en.wikipedia.org/wiki/Module:Sandbox/Matroc/Listing
Get Wikidata id if article exists in Wikipedia
lukup=Second Battle of Fort Fisher -- id=Q7443093 title=Second Battle of Fort Fisher date=January 13, 1865–15, 1865 place=North Carolina info=Union victory: Union takes fort. \\ lukup=Battle of Rivers' Bridge -- id=Q2036970 title=Battle of Rivers' Bridge date=February 3, 1865 place=South Carolina info=Union victory: Union forces capture river crossing. \\ lukup=Battle of Hatcher's Run -- id=Q4871195 title=Battle of Hatcher's Run date=February 5, 1865–7, 1865 place=Virginia info=Union victory: Union force launch unexpected attack. \\ lukup=Battle of Wilmington]] ([[North Carolina) -- id={{safesubst:#invoke:Sandbox/Matroc/Misc|getname|Battle of Wilmington]] ([[North Carolina)}} title=Battle of Wilmington (North Carolina) date=February 22, 1865 place=North Carolina info=Union victory: Last Confederate port falls. \\ lukup=Battle of Waynesboro, Virginia -- id=Q2890377 title=Battle of Waynesboro, Virginia date=March 2, 1865 place=Virginia info=Union victory: Remnants of Confederate Army of the Valley are destroyed. \\ lukup=Battle of Natural Bridge -- id=Q2611018 title=Battle of Natural Bridge date=March 6, 1865 place=Florida info=Confederate victory: Confederate victory in Florida prevents the capture of Tallahassee. \\ lukup=Battle of Wyse Fork -- id=Q586945 title=Battle of Wyse Fork date=March 7, 1865–10, 1865 place=North Carolina info=Union victory: Confederate attacks repelled by Union artillery. \\ lukup=Battle of Monroe's Cross Roads -- id= title=Battle of Monroe's Cross Roads date=March 10, 1865 place=North Carolina info=Inconclusive: \\ lukup=Battle of Averasborough -- id=Q2887919 title=Battle of Averasborough date=March 16, 1865 place=North Carolina info=Inconclusive: Union and Confederate forces attack one another in turn, both attacks fail. \\ lukup=Battle of Bentonville -- id=Q620244 title=Battle of Bentonville date=March 19, 1865–21, 1865 place=North Carolina info=Union victory: Sherman defeats Confederates \\ lukup=Battle of Fort Stedman -- id=Q543094 title=Battle of Fort Stedman date=March 25, 1865 place=Virginia info=Union victory: Lee attempts to break siege. \\ lukup=Battle of Spanish Fort -- id=Q2184295 title=Battle of Spanish Fort date=March 27, 1865 – April 8, 1865 place=Alabama info=Union victory: Union forces capture fort just east of Mobile. \\ lukup=Battle of Lewis's Farm -- id=Q1129674 title=Battle of Lewis's Farm date=March 29, 1865 place=Virginia info=Union victory: Union forces capture Confederate earthworks. \\ lukup=Battle of White Oak Road -- id=Q1872466 title=Battle of White Oak Road date=March 31, 1865 place=Virginia info=Union victory: Confederate forces under Richard H. Anderson defeated. \\ lukup=Battle of Dinwiddie Court House -- id=Q688807 title=Battle of Dinwiddie Court House date=March 31, 1865 place=Virginia info=Confederate victory: Pickett defeats Sheridan. \\ lukup=Battle of Five Forks -- id=Q194329 title=Battle of Five Forks date=April 1, 1865 place=Virginia info=Union victory: Sheridan routs Confederates. \\ lukup=Battle of Selma -- id=Q2313310 title=Battle of Selma date=April 2, 1865 place=Alabama info=Union victory: Wilson defeats Forrest. \\ lukup=Third Battle of Petersburg -- id=Q4462586 title=Third Battle of Petersburg date=April 2, 1865 place=Virginia info=Union victory: Grant defeats Lee. \\ lukup=Battle of Sutherland's Station -- id=Q2162088 title=Battle of Sutherland's Station date=April 2, 1865 place=Virginia info=Union victory: Lee's supply lines are cut. \\ lukup=Battle of Namozine Church -- id=Template:Safesubst: title=Battle of Namozine Church date=April 3, 1865 place=Virginia info=Confederate victory: Several Confederates captured, Custer's brother earns Medal of Honor. \\ lukup=Battle of Amelia Springs -- id=Template:Safesubst: title=Battle of Amelia Springs date=April 5, 1865 place=Virginia info=Inconclusive: \\ lukup=Battle of Rice's Station -- id=Template:Safesubst: title=Battle of Rice's Station date=April 6, 1865 place=Virginia info=Union victory: \\ lukup=Battle of Sayler's Creek -- id=Template:Safesubst: title=Battle of Sayler's Creek or Sailor's Creek) date=April 6, 1865 place=Virginia info=Union victory: Lee realizes his army is on the verge of defeat. \\ lukup=Battle of High Bridge -- id=Template:Safesubst: title=Battle of High Bridge date=April 6, 1865–7, 1865 place=Virginia info=Inconclusive: Union forces thwart Lee's attempts to burn bridges and to resupply, Grant proposes that Lee surrender, but he refuses. \\ lukup=Battle of Cumberland Church -- id=Template:Safesubst: title=Battle of Cumberland Church date=April 7, 1865 place=Virginia info=Confederate victory: Union forces attack Confederate rearguard, but darkness cuts the attack short. \\ lukup=Battle of Appomattox Station -- id=Template:Safesubst: title=Battle of Appomattox Station date=April 8, 1865 place=Virginia info=Union victory: Union forces thwart Lee's final attempt to resupply. \\ lukup=Battle of Appomattox Court House -- id=Q1355391 title=Battle of Appomattox Court House date=April 9, 1865 place=Virginia info=Union victory: Lee's forces surrounded. He subsequently surrenders. \\ lukup=Battle of Fort Blakeley -- id=Q1438584 title=Battle of Fort Blakeley date=April 9, 1865, 1865 place=Alabama info=Union victory: Union forces capture fort east of Mobile. \\ lukup=Battle of Palmito Ranch -- id=Q48776 title=Battle of Palmito Ranch date=May 12, 1865–13, 1865 place=Texas info=Confederate victory: Last battle in Texas during final phases of the Civil War. \\
- Battle of Hoke's Run Q1497885
- Battle of Fort Donelson Q601359
- Siege of Tubac Q7510471
- Battle of Galveston id=Q609495 -- name=Battle of Galveston (Second Battle of Galveston) desc=January 1, 1863 Texas Confederate victory: John B. Magruder expels occupying Union troops from Galveston, Texas.
- Second Battle of Springfield id=Q2941587 -- name=Second Battle of Springfield desc=January 8, 1863 Missouri Union victory: Confederates enter town, but are unable to take nearby fort.
- Battle of Arkansas Post (1863) id=Q761031 -- name=Battle of Arkansas Post (Battle of Fort Hindman) desc=January 9, 1863 Arkansas Union victory: Part of Vicksburg Campaign, fight for control of mouth of Arkansas River.
- Battle of Mossy Creek id=Q4787087 -- name=Battle of Mossy Creek desc=December 29, 1863 Tennessee Union victory: Confederate cavalry forced back.
ArbCom Elections 2016: Voting now open!
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
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
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?)
{{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)