User:Mr. Stradivarius/Tools

From Wikipedia, the free encyclopedia
Jump to: navigation, search

Code snippets[edit]

deepToString
local dts = require( 'Module:User:Anomie/deepToString' ).deepToString -- for debugging
Get a title object through pcall, defaulting to the current title.
function p.getTitleObject( page )
    if page then
        -- Get the title object, passing the function through pcall 
        -- in case we are over the expensive function count limit.
        local noError, titleObject = pcall( mw.title.new, page )
        if not noError then
            return nil
        else
            return titleObject
        end
    else
        return mw.title.getCurrentTitle()
    end    
end
Get a title object through pcall, defaulting to nil.
function p.getTitleObject( page )
    -- Get the title object, passing the function through pcall 
    -- in case we are over the expensive function count limit.
    local noError, titleObject = pcall( mw.title.new, page )
    if not noError then
        return nil
    else
        return titleObject
    end
end
Get a title object through pcall, defaulting to nil, inline.
-- Get the title object, passing the function through pcall 
-- in case we are over the expensive function count limit.
local noError, titleObject = pcall( mw.title.new, page )
if not noError or noError and not titleObject then
    return nil
end
Check that a number is a positive integer.
if type( k ) == 'number' and k >= 1 and math.floor( k ) == k and k ~= math.huge then
    -- Do something
end

Highlight a line in CodeEditor[edit]

https://en.wikipedia.org/w/index.php?title=page_title&action=edit#mw-ce-ln

Where page_title is the url-encoded page title, and n is the line number.

Reference books I own[edit]

  • Brown, H. Douglas (2007). Principles of Language Learning and Teaching (5th ed.). White Plains, NY: Pearson Education. ISBN 0-13-199128-0. 
  • Cook, Vivian (2008). Second Language Learning and Language Teaching. London: Arnold. ISBN 978-0-340-95876-6. 
  • Ellis, Rod (1997). Second Language Acquisition. Oxford Introductions to Language Study. Oxford, New York: Oxford University Press. ISBN 978-0-19-437212-1. 
  • Ellis, Rod (2008). The Study of Second Language Acquisition. Oxford, UK: Oxford University Press. ISBN 978-0-19-442257-4. 
  • Gass, Susan; Selinker, Larry (2008). Second Language Acquisition: An Introductory Course. New York, NY: Routledge. ISBN 978-0-8058-5497-8. 
  • Larsen-Freeman, Diane (2011). Techniques and Principles in Language Teaching (3rd ed.). Oxford, New York: Oxford University Press. ISBN 978-0-19-442360-1. 
  • Lightbown, Patsy M.; Spada, Nina (2006). How Languages Are Learned (3rd ed.). Oxford, New York: Oxford University Press. ISBN 978-0-19-442224-6. 
  • Richards, Jack C.; Rodgers, Theodore S. (2001). Approaches and Methods in Language Teaching (2nd ed.). Cambridge, New York: Cambridge University Press. ISBN 978-0-521-00843-3. 
  • Richards, Jack C.; Schmidt, Richard, eds. (2009). Longman Dictionary of Language Teaching and Applied Linguistics. New York: Longman. ISBN 978-1-4082-0460-3. 
  • VanPatten, Bill; Benati, Alessandro G. (2010). Key Terms in Second Language Acquisition. London: Continuum. ISBN 978-0-8264-9914-1. 

Policy explanations[edit]

A video showing the basics of neutral point of view policy and verifiability policy.
File:Verifiability and Neutral point of view (Common Craft)-en.ogv

My custom templates[edit]

Copyright permission note[edit]

{{subst:User:Mr. Stradivarius/copyreq}}

Boilerplate RfC[edit]

{{subst:User:Mr. Stradivarius/Templates/Boilerplate RfC}}

Useful templates[edit]

Other[edit]

Main tool page: toolserver.org
  • Reflinks - Edits bare references - adds title/dates etc. to bare references
  • Checklinks - Edit and repair external links
  • Dab solver - Quickly resolve ambiguous links.
  • Peer reviewer - Provides hints and suggestion to improving articles.