Difference between revisions of "Template:List lookup helper"

From QBWiki
Jump to navigation Jump to search
m
m
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
<includeonly>{{Save|page_name}}{{#ifeq:{{#var:page_name}}|{{{1}}}|<!--
+
<includeonly>{{#ifeq:{{#var:page_name}}|{{{1}}}|<!--
  
 
If page name is previously defined AND it equals arg1 then this invocation of the template can be skipped. This maintains the invariant of "loaded exactly once" if this is transcluded in another template that is itself transcluded multiple times.
 
If page name is previously defined AND it equals arg1 then this invocation of the template can be skipped. This maintains the invariant of "loaded exactly once" if this is transcluded in another template that is itself transcluded multiple times.
Line 14: Line 14:
 
In the default case: check whether the page is too large and embed a Warning if so - otherwise do work
 
In the default case: check whether the page is too large and embed a Warning if so - otherwise do work
  
-->|{{#iferror:{{#len:{{#var:loaded_page}}}}|{{Warning|This list is too large to be parsed with the default behavior - please [{{#var:page_name}}edit it] to make use of the [[Template:Sublist|Sublist]] template.}}|{{List lookup helper/default case}}}}<!--
+
-->|{{#iferror:{{#explode:{{#var:loaded_page}}}}|{{Warning|This list is too large to be parsed with the default behavior - please [[{{#var:page_name}}|edit it]] to make use of the [[Template:Sublist|Sublist]] template.}}|{{List lookup helper/default case}}}}<!--
 
   -->}}<!--
 
   -->}}<!--
-->}}{{Load|page_name}}</includeonly><noinclude>
+
-->}}</includeonly><noinclude>
 
{{Template doc|
 
{{Template doc|
 
Given a list page, loads it exactly once and sets up enough variables it will not need to be loaded again to retrieve any entry. If this template has been invoked before with the same page_name, no-op.
 
Given a list page, loads it exactly once and sets up enough variables it will not need to be loaded again to retrieve any entry. If this template has been invoked before with the same page_name, no-op.
Line 32: Line 32:
  
 
<pre>
 
<pre>
{{:QBWiki:Quick links/lingo}}
+
{{List lookup helper|Matt Bollinger/anecdotes}}
{{List lookup helper|QBWiki:Quick links/lingo}}
 
 
{{#var:cleaned_page}}
 
{{#var:cleaned_page}}
 
{{#var:length}}, {{#var:invocations}}
 
{{#var:length}}, {{#var:invocations}}
 
 
{{Save|jj}}
 
{{Save|jj}}
{{#loop:jj|1|{{#var:length}}|{{#var:entry_{{#var:jj}}}}<br/>}}
+
{{#loop:jj|1|{{#var:length}}|<nowiki/>
{{Load|jj}}
+
* {{#var:entry_{{#var:jj}}}}
 +
}}
 
</pre>
 
</pre>
  
{{:QBWiki:Quick links/lingo}}
+
{{List lookup helper|Matt Bollinger/anecdotes}}
{{List lookup helper|QBWiki:Quick links/lingo}}
 
 
{{#var:cleaned_page}}
 
{{#var:cleaned_page}}
 
{{#var:length}}, {{#var:invocations}}
 
{{#var:length}}, {{#var:invocations}}
 
 
{{Save|jj}}
 
{{Save|jj}}
{{#loop:jj|1|{{#var:length}}|{{#var:entry_{{#var:jj}}}}<br/>}}
+
{{#loop:jj|1|{{#var:length}}|<nowiki/>
 +
* {{#var:entry_{{#var:jj}}}}
 +
}}
 
{{Load|jj}}
 
{{Load|jj}}
 
}}</noinclude>
 
}}</noinclude>

Latest revision as of 20:03, 20 December 2025

Template documentation

Given a list page, loads it exactly once and sets up enough variables it will not need to be loaded again to retrieve any entry. If this template has been invoked before with the same page_name, no-op.

  • page_name - the page name provided as arg1
  • length - the length of the list
  • entry_i - the entry in the list at position i, where i is in [1, length-1] (0-indexed)

If using the default case (<1000 total characters), the following will be set:

  • loaded_page - the text of page_name
  • cleaned_page - the text of page_name before the first section header ("==")

There is also the housekeeping variable "invocations", which equals the number of times this template was resolved and should thus always be 1.

Implementation is split between List lookup helper/default case and List lookup helper/sublist case.

{{List lookup helper|Matt Bollinger/anecdotes}}
{{#var:cleaned_page}}
{{#var:length}}, {{#var:invocations}}
{{Save|jj}}
{{#loop:jj|1|{{#var:length}}|<nowiki/>
* {{#var:entry_{{#var:jj}}}}
}}


5, 1

  • Matt is the best known user of the phrase "that's a word", which he directed towards moderator Mike Sorice while playing a bonus part on "hapticity" in the NSC All-Star Round.
  • The answerline of "zeppelins" was briefly a facetious benchmark of absurd difficulty after Matt insisted that a NASAT tossup on zeppelins written by Mike Cheyne was extremely difficult to answer.
  • At one point Carsten Gehring and Mike Cheyne referred to the duo of Bollinger and Evan Adams as "Rizzoli and Isles" respectively in reference to the unpopular TNT program - an attempt to find other quizbowlers to fit the similarly-titled TNT show Franklin & Bash was inconclusive.
  • Matt's involvement in a long argument about a NASAT tossup on the United States-Canada border spawned the parodic phrase "true knowledge of the Pig War" to describe the question's failure to reward Jacob Wasserman's "real knowledge".
  • Matt has been noted for his tendency to blush, a fact he was unaware of until an IRC conversation in which he claimed not to know what his own face looks like.