User:Stux/sandbox2
From Homestar Runner Wiki
(Difference between revisions)
(I should be tallying the longest time, not the shortest) |
(revert back to previous state) |
||
| Line 1: | Line 1: | ||
| - | + | == Testing time == | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | == | + | === Testing Tally Templates === |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | <pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;"> | |
| + | {{hresetcount|sample|tally=1}} | ||
| - | {{ | + | * {{tally time|sample|60}} |
| + | * {{tally time|sample|33}} | ||
| + | * {{tally time|sample|72}} | ||
| + | * {{tally time|sample|192}} | ||
| - | {{ | + | * Total time: {{display time|sample|seconds}} seconds ({{display time|sample|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample|average_seconds}} seconds ({{display time|sample|average}} in hh:mm:ss) for {{display time|sample|count}} entries |
| + | * Compare to the original mechanism {{--}} Total time: {{#count:sample_tally|0}} seconds / {{format seconds|{{#count:sample_tally|0}}}} for {{#count:sample_count|0}} entries | ||
| + | </pre> | ||
| - | {{ | + | * '''Yields:''' |
| + | {{hresetcount|sample|tally=1}} | ||
| - | {{ | + | * {{tally time|sample|60}} |
| + | * {{tally time|sample|33}} | ||
| + | * {{tally time|sample|72}} | ||
| + | * {{tally time|sample|192}} | ||
| - | {{ | + | * Total time: {{display time|sample|seconds}} seconds ({{display time|sample|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample|average_seconds}} seconds ({{display time|sample|average}} in hh:mm:ss) for {{display time|sample|count}} entries |
| + | * Compare to the original mechanism {{--}} Total time: {{#count:sample_tally|0}} seconds / {{format seconds|{{#count:sample_tally|0}}}} for {{#count:sample_count|0}} entries | ||
| - | |||
| - | {{ | + | <pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;"> |
| - | {{ | + | * {{display time|sample|seconds|offset_seconds=3}} {{--}} {{display time|sample|total|offset_seconds=3}} |
| + | * {{display time|sample|seconds|offset_seconds=43}} {{--}} {{display time|sample|total|offset_seconds=43}} | ||
| + | * {{display time|sample|seconds|offset_seconds=143}} {{--}} {{display time|sample|total|offset_seconds=143}} | ||
| - | {{ | + | * Add 1 to count: {{display time|sample|count|offset_count=1}} |
| + | * Remove 1 from count: {{display time|sample|count|offset_count=-1}} | ||
| - | {{ | + | * {{display time|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=3|offset_count=1}} |
| - | {{ | + | * {{display time|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=43|offset_count=1}} |
| - | {{ | + | * {{display time|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=143|offset_count=1}} |
| + | * {{display time|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{display time|sample|average|offset_seconds=-60|offset_count=-1}} | ||
| - | + | </pre> | |
| - | + | * '''Yields:''' | |
| - | {{ | + | * {{display time|sample|seconds|offset_seconds=3}} {{--}} {{display time|sample|total|offset_seconds=3}} |
| + | * {{display time|sample|seconds|offset_seconds=43}} {{--}} {{display time|sample|total|offset_seconds=43}} | ||
| + | * {{display time|sample|seconds|offset_seconds=143}} {{--}} {{display time|sample|total|offset_seconds=143}} | ||
| - | {{ | + | * Add 1 to count: {{display time|sample|count|offset_count=1}} |
| + | * Remove 1 from count: {{display time|sample|count|offset_count=-1}} | ||
| - | {{ | + | * {{display time|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=3|offset_count=1}} |
| + | * {{display time|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=43|offset_count=1}} | ||
| + | * {{display time|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=143|offset_count=1}} | ||
| + | * {{display time|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{display time|sample|average|offset_seconds=-60|offset_count=-1}} | ||
| - | |||
| - | |||
| - | + | === Test Display Time (Local Sandbox) === | |
| - | {{ | + | '''Local Sandbox Tests:''' |
| + | * Display Time: {{pl|l=http://hrwiki.org/w/index.php?title=User:Stux/template-sandbox2&diff=836140&oldid=823395&rcid=799200 revision 836140}} and {{pl|l=http://hrwiki.org/w/index.php?title=User:Stux/template-sandbox2&diff=836144&oldid=836140 revision 836144}} | ||
| + | * Tally Time: {{pl|l=http://hrwiki.org/w/index.php?title=User:Stux/template-sandbox2&diff=836156&oldid=836153 revision 836156}} | ||
| - | {{ | + | <pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;"> |
| + | * {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=3}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=3}} | ||
| + | * {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=43}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=43}} | ||
| + | * {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=143}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=143}} | ||
| - | {{ | + | * Add 1 to count: {{:User:Stux/template-sandbox2|sample|count|offset_count=1}} |
| + | * Remove 1 from count: {{:User:Stux/template-sandbox2|sample|count|offset_count=-1}} | ||
| - | {{ | + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=3|offset_count=1}} |
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=43|offset_count=1}} | ||
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=143|offset_count=1}} | ||
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=-60|offset_count=-1}} | ||
| - | {{ | + | Weird coincidence: |
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=60|offset_count=-1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=-60|offset_count=-1}} | ||
| - | + | </pre> | |
| - | + | Yields (local, uncomment as needed): | |
| + | <!-- | ||
| - | {{ | + | * {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=3}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=3}} |
| + | * {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=43}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=43}} | ||
| + | * {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=143}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=143}} | ||
| - | {{ | + | * Add 1 to count: {{:User:Stux/template-sandbox2|sample|count|offset_count=1}} |
| + | * Remove 1 from count: {{:User:Stux/template-sandbox2|sample|count|offset_count=-1}} | ||
| - | {{ | + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=3|offset_count=1}} |
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=43|offset_count=1}} | ||
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=143|offset_count=1}} | ||
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=-60|offset_count=-1}} | ||
| - | {{ | + | Weird coincidence: |
| + | * {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=60|offset_count=-1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=-60|offset_count=-1}} | ||
| - | + | --> | |
| - | + | === Test Tally Time (Local Sandbox) === | |
| - | + | '''Tally Time Count Offset:''' | |
| - | + | <pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;"> | |
| + | {{hresetcount|sample2|tally=1}} | ||
| - | {{ | + | * {{tally time|sample2|160}} |
| + | * {{tally time|sample2|133}} | ||
| + | * {{tally time|sample2|172}} | ||
| + | * {{tally time|sample2|292}} | ||
| - | {{ | + | * Total time: {{display time|sample2|seconds}} seconds ({{display time|sample2|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample2|average_seconds}} seconds ({{display time|sample2|average}} in hh:mm:ss) for {{display time|sample2|count}} entries |
| - | {{ | + | {{hresetcount|sample_grand_total|tally=1}} |
| - | {{ | + | * {{tally time|sample_grand_total|{{display time|sample|seconds}}|offset_count={{display time|sample|count}}}} |
| + | * {{tally time|sample_grand_total|{{display time|sample2|seconds}}|offset_count={{display time|sample2|count}}}} | ||
| - | {{ | + | Yields (local, uncomment as needed): |
| + | <! -- | ||
| + | * {{:User:Stux/template-sandbox2|sample_grand_total|{{display time|sample|seconds}}|offset_count={{display time|sample|count}}}} | ||
| + | * {{:User:Stux/template-sandbox2|sample_grand_total|{{display time|sample2|seconds}}|offset_count={{display time|sample2|count}}}} | ||
| + | --> | ||
| - | {{ | + | * Grand Total time: {{display time|sample_grand_total|seconds}} seconds ({{display time|sample_grand_total|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample_grand_total|average_seconds}} seconds ({{display time|sample_grand_total|average}} in hh:mm:ss) for {{display time|sample_grand_total|count}} entries |
| - | + | </pre> | |
| - | + | '''Yields:''' | |
| - | {{ | + | {{hresetcount|sample2|tally=1}} |
| - | {{ | + | * {{tally time|sample2|160}} |
| + | * {{tally time|sample2|133}} | ||
| + | * {{tally time|sample2|172}} | ||
| + | * {{tally time|sample2|292}} | ||
| - | {{ | + | * Total time: {{display time|sample2|seconds}} seconds ({{display time|sample2|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample2|average_seconds}} seconds ({{display time|sample2|average}} in hh:mm:ss) for {{display time|sample2|count}} entries |
| - | {{ | + | {{hresetcount|sample_grand_total|tally=1}} |
| - | {{ | + | * {{tally time|sample_grand_total|{{display time|sample|seconds}}|offset_count={{display time|sample|count}}}} |
| + | * {{tally time|sample_grand_total|{{display time|sample2|seconds}}|offset_count={{display time|sample2|count}}}} | ||
| - | {{ | + | Yields (local, uncomment as needed): |
| + | <! -- | ||
| + | * {{:User:Stux/template-sandbox2|sample_grand_total|{{display time|sample|seconds}}|offset_count={{display time|sample|count}}}} | ||
| + | * {{:User:Stux/template-sandbox2|sample_grand_total|{{display time|sample2|seconds}}|offset_count={{display time|sample2|count}}}} | ||
| + | --> | ||
| - | {{ | + | * Grand Total time: {{display time|sample_grand_total|seconds}} seconds ({{display time|sample_grand_total|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample_grand_total|average_seconds}} seconds ({{display time|sample_grand_total|average}} in hh:mm:ss) for {{display time|sample_grand_total|count}} entries |
| - | + | ---- | |
| + | '''Testing Sort:''' | ||
| - | {{ | + | Yields (local, uncomment as needed): |
| + | <! -- | ||
| + | ====[[Character Videos]]==== | ||
| + | {{hresetcount|character|tally=1}} | ||
| + | {| class="wikitable sortable" width="75%" | ||
| + | |- | ||
| + | ! width="10%"|Rank !! width="15%"|Length !! Toon | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|{{hmss|1|15}}}} || [[Strong Sad's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|{{hmss|1|09}}}} || [[Strong Bad's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|59}} || [[Homestar Runner's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|58}} || [[The Cheat's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character|0}} || {{:User:Stux/template-sandbox2|character|58}} || [[Marzipan's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character|2}} || {{:User:Stux/template-sandbox2|character|54}} || [[Bubs's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|51}} || [[Coach Z's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|49}} || [[Pom Pom's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|47}} || [[The King of Town's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|38}} || [[Homsar's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|36}} || [[The Poopsmith's Character Video]] | ||
| + | |- | ||
| + | | #{{vcount|character}} || {{:User:Stux/template-sandbox2|character|34}} || [[Strong Mad's Character Video]] | ||
| + | |} | ||
| - | + | --> | |
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | + | ||
| - | == | + | === Test Uninitialized === |
| + | * Source: When editing [[Strong Bad Email By Length# By Era ]] | ||
{| class="wikitable" | {| class="wikitable" | ||
! width="5%" rowspan="2"|Era | ! width="5%" rowspan="2"|Era | ||
| Line 571: | Line 300: | ||
|} | |} | ||
| - | + | Local template: | |
| - | * | + | <pre> |
| - | * | + | * {{:User:Stux/template-sandbox2|lappier|average}} |
| + | * {{:User:Stux/template-sandbox2|lappier-ee|average}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier|count}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier-ee|count}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier|total}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier-ee|total}} | ||
| + | </pre> | ||
| - | <br /> | + | Yields (local, uncomment as needed): |
| - | {{ | + | <!-- |
| + | * {{:User:Stux/template-sandbox2|lappier|average}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier-ee|average}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier|count}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier-ee|count}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier|total}} | ||
| + | * {{:User:Stux/template-sandbox2|lappier-ee|total}} | ||
| + | --> | ||
| + | |||
| + | === First Try === | ||
| + | * From [[Help:ParserFunctions##time:]] | ||
| + | <pre> | ||
| + | {{#time: z | 20071031}} | ||
| + | </pre> | ||
| + | '''Yields:''' {{#time: z | 20071031}} | ||
| + | |||
| + | |||
| + | * 121 seconds? | ||
| + | <pre> | ||
| + | {{#time: i:s | 121}} | ||
| + | </pre> | ||
| + | '''Yields:''' {{#time: i:s | 121}} | ||
| + | |||
| + | * So time doesn't support converting seconds to "hh:mm:ss" format, unfortunately. We gotta do it manually using [[Help:ParserFunctions##expr:]], but now we have two more problems: | ||
| + | ** There is no {{w|modulo}} operation, and we can't use "round" to easily emulate it. | ||
| + | ** So, here goes nothing: | ||
| + | |||
| + | <pre> | ||
| + | {{#expr: 121/60}} <br/><!-- convert 121 seconds to minutes --> | ||
| + | {{#expr: 119/60}} <br/><!-- convert 119 seconds to minutes --> | ||
| + | {{#expr: 121/60 round 0}} <br/><!-- round 121 seconds to minutes --> | ||
| + | {{#expr: 119/60 round 0}} <br/><!-- round 119 seconds to minutes --> | ||
| + | </pre> | ||
| + | |||
| + | {{#expr: 121/60}} <br/><!-- convert 121 seconds to minutes --> | ||
| + | {{#expr: 119/60}} <br/><!-- convert 119 seconds to minutes --> | ||
| + | {{#expr: 121/60 round 0}} <br/><!-- round 121 seconds to minutes --> | ||
| + | {{#expr: 119/60 round 0}} <br/><!-- round 119 seconds to minutes --> | ||
| + | |||
| + | * Fortunately, we should be able to use the above logic for IF statements. ''Unfortunately'', this crazy logic may time out... | ||
| + | |||
| + | * But wait! Turns out there is module after all: | ||
| + | <pre> | ||
| + | {{#expr: 121%60}} <br/><!-- confirm there is no modulo symbol --> | ||
| + | {{#expr: 121 mod 60}} <br/><!-- confirm there is a modulo operator --> | ||
| + | {{#expr: 119 mod 60}} <br/><!-- confirm there is a modulo operator --> | ||
| + | </pre> | ||
| + | |||
| + | {{#expr: 121%60}} <br/><!-- confirm there is no modulo symbol --> | ||
| + | {{#expr: 121 mod 60}} <br/><!-- confirm there is a modulo operator --> | ||
| + | {{#expr: 119 mod 60}} <br/><!-- confirm there is a modulo operator --> | ||
| + | |||
| + | * So we can now "easily" convert seconds to hh:mm:ss: | ||
| + | <pre> | ||
| + | {{#expr: (121-(121 mod 60))/60}}:{{#expr:121 mod 60}} <br/> <!-- 121 seconds to mm:ss --> | ||
| + | {{#expr: (119-(119 mod 60))/60}}:{{#expr:119 mod 60}} <br/> <!-- 119 seconds to mm:ss --> | ||
| + | </pre> | ||
| + | {{#expr: (121-(121 mod 60))/60}}:{{#expr:121 mod 60}} <br/> <!-- 121 seconds to mm:ss --> | ||
| + | {{#expr: (119-(119 mod 60))/60}}:{{#expr:119 mod 60}} <br/> <!-- 119 seconds to mm:ss --> | ||
| + | * Okay, so this doesn't do zero padding :-/ | ||
| + | |||
| + | |||
| + | * For now let's do more complicated examples (with hand-coded zero-padding): | ||
| + | <pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;"> | ||
| + | {{#ifexpr: (3601>=3600)|{{#expr: (3601-(3601 mod 3600))/3600}}:|}}{{#ifexpr: (((3601-(3601 mod 60))/60) mod 60)<10|0|}}{{#expr: ((3601-(3601 mod 60))/60) mod 60}}:{{#ifexpr: (3601 mod 60)<10|0|}}{{#expr:3601 mod 60}} <br/> | ||
| + | <!-- 3601 seconds to hh:mm:ss --> | ||
| + | {{#ifexpr: (3599>=3600)|{{#expr: (3599-(3599 mod 3600))/3600}}:|}}{{#ifexpr: (((3599-(3599 mod 60))/60) mod 60)<10|0|}}{{#expr: ((3599-(3599 mod 60))/60) mod 60}}:{{#ifexpr: (3599 mod 60)<10|0|}}{{#expr:3599 mod 60}} <br/> | ||
| + | <!-- 3599 seconds to hh:mm:ss --> | ||
| + | {{#ifexpr: (7199>=3600)|{{#expr: (7199-(7199 mod 3600))/3600}}:|}}{{#ifexpr: (((7199-(7199 mod 60))/60) mod 60)<10|0|}}{{#expr: ((7199-(7199 mod 60))/60) mod 60}}:{{#ifexpr: (7199 mod 60)<10|0|}}{{#expr:7199 mod 60}} <br/> | ||
| + | <!-- 7199 seconds to hh:mm:ss --> | ||
| + | {{#ifexpr: (90001>=3600)|{{#expr: (90001-(90001 mod 3600))/3600}}:|}}{{#ifexpr: (((90001-(90001 mod 60))/60) mod 60<10)|0|}}{{#expr: ((90001-(90001 mod 60))/60) mod 60}}:{{#ifexpr: (90001 mod 60)<10|0|}}{{#expr:90001 mod 60}} <br/> | ||
| + | <!-- 90001 seconds to hh:mm:ss --> | ||
| + | </pre> | ||
| + | {{#ifexpr: (3601>=3600)|{{#expr: (3601-(3601 mod 3600))/3600}}:|}}{{#ifexpr: (((3601-(3601 mod 60))/60) mod 60)<10|0|}}{{#expr: ((3601-(3601 mod 60))/60) mod 60}}:{{#ifexpr: (3601 mod 60)<10|0|}}{{#expr:3601 mod 60}} <br/> | ||
| + | <!-- 3601 seconds to hh:mm:ss --> | ||
| + | {{#ifexpr: (3599>=3600)|{{#expr: (3599-(3599 mod 3600))/3600}}:|}}{{#ifexpr: (((3599-(3599 mod 60))/60) mod 60)<10|0|}}{{#expr: ((3599-(3599 mod 60))/60) mod 60}}:{{#ifexpr: (3599 mod 60)<10|0|}}{{#expr:3599 mod 60}} <br/> | ||
| + | <!-- 3599 seconds to hh:mm:ss --> | ||
| + | {{#ifexpr: (7199>=3600)|{{#expr: (7199-(7199 mod 3600))/3600}}:|}}{{#ifexpr: (((7199-(7199 mod 60))/60) mod 60)<10|0|}}{{#expr: ((7199-(7199 mod 60))/60) mod 60}}:{{#ifexpr: (7199 mod 60)<10|0|}}{{#expr:7199 mod 60}} <br/> | ||
| + | <!-- 7199 seconds to hh:mm:ss --> | ||
| + | {{#ifexpr: (90001>=3600)|{{#expr: (90001-(90001 mod 3600))/3600}}:|}}{{#ifexpr: (((90001-(90001 mod 60))/60) mod 60<10)|0|}}{{#expr: ((90001-(90001 mod 60))/60) mod 60}}:{{#ifexpr: (90001 mod 60)<10|0|}}{{#expr:90001 mod 60}} <br/> | ||
| + | <!-- 90001 seconds to hh:mm:ss --> | ||
| + | |||
| + | * This will become a new template: | ||
| + | <pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;"> | ||
| + | {{#ifexpr: ({{{1}}}>=3600)|{{#expr: ({{{1}}}-({{{1}}} mod 3600))/3600}}:|}}{{#ifexpr: ((({{{1}}}-({{{1}}} mod 60))/60) mod 60)<10|0|}}{{#expr: (({{{1}}}-({{{1}}} mod 60))/60) mod 60}}:{{#ifexpr: ({{{1}}} mod 60)<10|0|}}{{#expr:{{{1}}} mod 60}} | ||
| + | </pre> | ||
| + | * With comments: | ||
| + | <pre style="white-space: pre-wrap; word-break: normal; overflow: scroll;"> | ||
| + | {{#ifexpr: ({{{1}}}>=3600)|{{#expr: ({{{1}}}-({{{1}}} mod 3600))/3600}}:|}}<!-- /* Calculate the hours and only display more than 0 hours. */ | ||
| + | -->{{#ifexpr: ((({{{1}}}-({{{1}}} mod 60))/60) mod 60)<10|0|}}<!-- /* Calculate the minutes and pad with leading zero if less than 10. */ | ||
| + | -->{{#expr: (({{{1}}}-({{{1}}} mod 60))/60) mod 60}}:<!-- /* Calculate the minutes. */ | ||
| + | -->{{#ifexpr: ({{{1}}} mod 60)<10|0|}}<!-- /* Calculate the seconds and pad with leading zero if less than 10. */ | ||
| + | -->{{#expr:{{{1}}} mod 60}}<!-- /* Calculate the seconds. */ --> | ||
| + | </pre> | ||
| + | * New template name: {{t|format seconds}} | ||
| + | * Related templates: {{t|hcount}} and {{t|vcount}} | ||
| + | |||
| + | |||
| + | * Now let's package this up in a counter: | ||
| + | ** Note that {{t|hresetcount}} should facilitate resetting the counter to 0. (It must be set to 1, increment 1.) | ||
| + | ** Then we <code><nowiki>{{#count:tally}}</nowiki></code> by the number of seconds. Since it's an invisible counter, we use {{t|hcount}}. | ||
| + | <pre> | ||
| + | {{hcount|{{{1}}}|{{{2}}}}}{{format seconds|{{{2}}}}} | ||
| + | </pre> | ||
| + | * New template name: {{t|tally time}} | ||
| + | |||
| + | == Dangeresque Template == | ||
| + | ---- | ||
| + | {{clear}} | ||
| + | {|class="navbox" style="margin:0 auto 0 auto; padding:0.2em; background-color:#E5E5E5; width:42%" | ||
| + | |||
| + | ! style="text-align:center;background:#7F7F7F;" colspan="2" | [[Dangeresque (film series)|<span style="color:white">Dangeresque</span>]] | ||
| + | |- | ||
| + | |||
| + | <!--Movies--> | ||
| + | |- style="font-size:smaller;" | ||
| + | | style="background-color:#BFBFBF;text-align:center;width:8em" |'''Movies''' || | ||
| + | '''''Major:''''' [[dangeresque 3|'''Dangeresque 1:''' Dangeresque, too?]],<br /> | ||
| + | <span style="visibility:hidden">'''''Major:'''''</span> [[stunt double|'''Dangeresque 2:''' This Time, It's Not Dangeresque 1]],<br /> | ||
| + | <span style="visibility:hidden">'''''Major:'''''</span> [[Dangeresque 3: The Criminal Projective|'''Dangeresque 3:''' The Criminal Projective]] ([[Dangeresque 3 Mini-Site|Mini-Site]], [[Dangeresque: THREE in 3D|THREE in 3D]])<br/> | ||
| + | '''''Minor:''''' [[rock opera#Easter Eggs|Dangeresque: Put 'Em on Ice!]], [[sbemail 206|Dangeresque 4÷2=6]]<br/> | ||
| + | '''''Puppet Squad:''''' [[Dangeresque: Puppet Squad|The Curly Fried Caper]], [[Dangeresque Puppet Squad: The Hot Jones Hijack|The Hot Jones Hijack]] | ||
| + | |||
| + | <!--Characters--> | ||
| + | |- style="font-size:smaller;" | ||
| + | | style="background-color:#BFBFBF;text-align:center;" |'''Characters''' || | ||
| + | <table style="margin:0 auto 0 auto; padding:0em"><tr><td colspan="2"> | ||
| + | '''''Strong Bad:''''' [[Dangeresque (character)|Dangeresque]]<br /> | ||
| + | '''''Homestar Runner:''''' [[Dangeresque Too]], [[Uzi Bazooka]], [[Stingy Relenque]]<br /> | ||
| + | '''''Coach Z:''''' [[Renaldo]]</td></tr><tr><td> | ||
| + | '''''Marzipan:''''' [[Cutesy Buttons]], [[Sultry Buttons]]</td><td> | ||
| + | '''''Pom Pom:''''' [[Professor Experimento]]</td></tr><tr><td> | ||
| + | '''''The King of Town:''''' [[Perducci]]</td><td> | ||
| + | '''''Strong Mad (Himself):''''' [[Killingyouguy]]</td></tr><tr><td> | ||
| + | '''''Bubs:''''' [[Baron Darin Diamonocle]]</td><td> | ||
| + | '''''The Poopsmith:''''' [[Kidnapping Victim]]</td></tr><tr><td colspan="2"> | ||
| + | '''''Senor Cardgage:''''' [[Dadgeresque]]<br /> | ||
| + | '''''Strong Sad (El Dumpo):''''' [[Hot Tub]], [[The Informants]], [[The Monster]], [[The Stunt Double]]<br /> | ||
| + | '''''The Cheat:''''' [[Craig]], [[Istanbul]], [[Szechuan Steve]], [[Waitre D]]<br /> | ||
| + | '''''Unknown:''''' [[The Chief]]</td></tr></table> | ||
| + | |||
| + | <!--Music--> | ||
| + | |- style="font-size:smaller;" | ||
| + | | style="background-color:#BFBFBF;text-align:center;" |'''Music''' || [[The Theme from Dangeresque II]] ([[Dangeresque (karaoke)|karaoke]]), [[Today is Alright 4 2Nite]] | ||
| + | |||
| + | <!--Games--> | ||
| + | |- style="font-size:smaller;" | ||
| + | | style="background-color:#BFBFBF;text-align:center;" |'''Games''' || | ||
| + | [[Dangeresque: The Roomisode Triungulate]] ([[Dangeresque: The Roomisode Triungulate Trailer|Trailer]], [[Dangeresque: The Roomisode Triungulate Launch Trailer|Launch Trailer]])<br/> | ||
| + | [[Dangeresque Roomisode 1: Behind the Dangerdesque|Roomisode 1: Behind the Dangerdesque]] ([[Dangeresque Roomisode 1: Behind the Dangerdesque Walkthrough|Walkthrough]], [[Dangeresque Roomisode 1: Behind the Dangerdesque Responses|Responses]])<br/> | ||
| + | [[Dangeresque Roomisode 2: The Intersection of Doom & Boom|Roomisode 2: The Intersection of Doom & Boom]] ([[Dangeresque Roomisode 2: The Intersection of Doom & Boom Walkthrough|Walkthrough]], [[Dangeresque Roomisode 2: The Intersection of Doom & Boom Responses|Responses]])<br/> | ||
| + | [[Dangeresque Roomisode 3: Keep My Enemies, Loser|Roomisode 3: Keep My Enemies, Loser]] ([[Dangeresque Roomisode 3: Keep My Enemies, Loser Walkthrough|Walkthrough]], [[Dangeresque Roomisode 3: Keep My Enemies, Loser Responses|Responses]]) | ||
| + | <!--Items--> | ||
| + | |- style="font-size:smaller;" | ||
| + | | style="background-color:#BFBFBF;text-align:center;" |'''Other''' || [[Nunchuck Gun]], [[Brainblow City]], [[Ruby Powered Rocket]] | ||
| + | |||
| + | |} | ||
| - | [[Category: | + | <!-- /* Please feel free to edit this draft in order to fix the table above */ --> |
| + | <!-- <noinclude>[[Category:Strong Bad Navigation Templates|{{PAGENAME}}]]</noinclude><includeonly>[[Category:{{{cat|Dangeresque}}}]]</includeonly> --> | ||
Revision as of 16:24, 21 April 2025
Contents |
Testing time
Testing Tally Templates
{{hresetcount|sample|tally=1}}
* {{tally time|sample|60}}
* {{tally time|sample|33}}
* {{tally time|sample|72}}
* {{tally time|sample|192}}
* Total time: {{display time|sample|seconds}} seconds ({{display time|sample|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample|average_seconds}} seconds ({{display time|sample|average}} in hh:mm:ss) for {{display time|sample|count}} entries
* Compare to the original mechanism {{--}} Total time: {{#count:sample_tally|0}} seconds / {{format seconds|{{#count:sample_tally|0}}}} for {{#count:sample_count|0}} entries
- Yields:
- 1:00
- 0:33
- 1:12
- 3:12
- Total time: 357 seconds (5:57 in hh:mm:ss) · Average: 89 seconds (1:29 in hh:mm:ss) for 4 entries
- Compare to the original mechanism — Total time: 357 seconds / 5:57 for 4 entries
* {{display time|sample|seconds|offset_seconds=3}} {{--}} {{display time|sample|total|offset_seconds=3}}
* {{display time|sample|seconds|offset_seconds=43}} {{--}} {{display time|sample|total|offset_seconds=43}}
* {{display time|sample|seconds|offset_seconds=143}} {{--}} {{display time|sample|total|offset_seconds=143}}
* Add 1 to count: {{display time|sample|count|offset_count=1}}
* Remove 1 from count: {{display time|sample|count|offset_count=-1}}
* {{display time|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=3|offset_count=1}}
* {{display time|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=43|offset_count=1}}
* {{display time|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{display time|sample|average|offset_seconds=143|offset_count=1}}
* {{display time|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{display time|sample|average|offset_seconds=-60|offset_count=-1}}
- Yields:
- 360 — 6:00
- 400 — 6:40
- 500 — 8:20
- Add 1 to count: 5
- Remove 1 from count: 3
- 72 — 1:12
- 80 — 1:20
- 100 — 1:40
- 99 — 1:39
Test Display Time (Local Sandbox)
Local Sandbox Tests:
- Display Time: revision 836140 and revision 836144
- Tally Time: revision 836156
* {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=3}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=3}}
* {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=43}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=43}}
* {{:User:Stux/template-sandbox2|sample|seconds|offset_seconds=143}} {{--}} {{:User:Stux/template-sandbox2|sample|total|offset_seconds=143}}
* Add 1 to count: {{:User:Stux/template-sandbox2|sample|count|offset_count=1}}
* Remove 1 from count: {{:User:Stux/template-sandbox2|sample|count|offset_count=-1}}
* {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=3|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=3|offset_count=1}}
* {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=43|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=43|offset_count=1}}
* {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=143|offset_count=1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=143|offset_count=1}}
* {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=-60|offset_count=-1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=-60|offset_count=-1}}
Weird coincidence:
* {{:User:Stux/template-sandbox2|sample|average_seconds|offset_seconds=60|offset_count=-1}} {{--}} {{:User:Stux/template-sandbox2|sample|average|offset_seconds=-60|offset_count=-1}}
Yields (local, uncomment as needed):
Test Tally Time (Local Sandbox)
Tally Time Count Offset:
{{hresetcount|sample2|tally=1}}
* {{tally time|sample2|160}}
* {{tally time|sample2|133}}
* {{tally time|sample2|172}}
* {{tally time|sample2|292}}
* Total time: {{display time|sample2|seconds}} seconds ({{display time|sample2|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample2|average_seconds}} seconds ({{display time|sample2|average}} in hh:mm:ss) for {{display time|sample2|count}} entries
{{hresetcount|sample_grand_total|tally=1}}
* {{tally time|sample_grand_total|{{display time|sample|seconds}}|offset_count={{display time|sample|count}}}}
* {{tally time|sample_grand_total|{{display time|sample2|seconds}}|offset_count={{display time|sample2|count}}}}
Yields (local, uncomment as needed):
<! --
* {{:User:Stux/template-sandbox2|sample_grand_total|{{display time|sample|seconds}}|offset_count={{display time|sample|count}}}}
* {{:User:Stux/template-sandbox2|sample_grand_total|{{display time|sample2|seconds}}|offset_count={{display time|sample2|count}}}}
-->
* Grand Total time: {{display time|sample_grand_total|seconds}} seconds ({{display time|sample_grand_total|total}} in hh:mm:ss) {{dot}} Average: {{display time|sample_grand_total|average_seconds}} seconds ({{display time|sample_grand_total|average}} in hh:mm:ss) for {{display time|sample_grand_total|count}} entries
Yields:
- 2:40
- 2:13
- 2:52
- 4:52
- Total time: 757 seconds (12:37 in hh:mm:ss) · Average: 189 seconds (3:09 in hh:mm:ss) for 4 entries
- 5:57
- 12:37
Yields (local, uncomment as needed): <! --
-->
- Grand Total time: 1114 seconds (18:34 in hh:mm:ss) · Average: 139 seconds (2:19 in hh:mm:ss) for 8 entries
Testing Sort:
Yields (local, uncomment as needed): <! --
Character Videos
-->
Test Uninitialized
- Source: When editing Strong Bad Email By Length# By Era
| Era | Shortest email | Longest email | Average runtime | No. of emails | Total runtime | Notes | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| Shortest | with Easter eggs | Longest | with Easter eggs | Average | with Easter eggs | Total | with Easter eggs | |||
| Tandy | sb_email 22 0:34 | i rule 0:40 | vacation 4:26 | vacation 4:26 | 0:00 | 0:00 | 0 | 0:00 | 0:00 | The postcard segments of vacation were released over several weeks. The longest Tandy era email released in one part is dullard, at 2:15. |
| Compy | theme party 1:06 | your friends 1:11 | flashback 5:01 | flashback 6:05 | 0:00 | 0:00 | 0 | 0:00 | 0:00 | flashback is the 100th-anniversary email. |
| Lappy | myths & legends 2:55 | specially marked 3:08 | retirement 6:53 | retirement 7:21 | 0:00 | 0:00 | 0 | 0:00 | 0:00 | retirement was initially released in two parts on different release dates. retirement B can be considered the shortest at 2:48; the longest Lappy email released in one part is alternate universe at 5:52 (6:48 including Easter eggs). |
| Compé | videography 3:30 | videography 3:49 | independent 5:20 | independent 5:48 | 0:00 | 0:00 | 0 | 0:00 | 0:00 | |
| Lappier | too cool 4:41 | too cool 5:13 | parenting 7:53 | parenting 10:00 | 0:00 | 0:00 | 0 | 0:00 | 0:00 | parenting's runtime beat the previous record holders by the largest margin (1:00 over retirement without easter eggs compared to retirement's 0:59 over alternate universe, 2:39 over retirement with easter eggs compared to vacation's 2:29 over 1 step ahead). |
| All Emails | sb_email 22 0:34 | i rule 0:40 | parenting 7:53 | parenting 10:00 | 0:00 | 0:00 | 0 | 0:00 | 0:00 | |
Local template:
* {{:User:Stux/template-sandbox2|lappier|average}}
* {{:User:Stux/template-sandbox2|lappier-ee|average}}
* {{:User:Stux/template-sandbox2|lappier|count}}
* {{:User:Stux/template-sandbox2|lappier-ee|count}}
* {{:User:Stux/template-sandbox2|lappier|total}}
* {{:User:Stux/template-sandbox2|lappier-ee|total}}
Yields (local, uncomment as needed):
First Try
{{#time: z | 20071031}}
Yields: 303
- 121 seconds?
{{#time: i:s | 121}}
Yields: Error: invalid time
- So time doesn't support converting seconds to "hh:mm:ss" format, unfortunately. We gotta do it manually using Help:ParserFunctions##expr:, but now we have two more problems:
- There is no modulo operation, and we can't use "round" to easily emulate it.
- So, here goes nothing:
{{#expr: 121/60}} <br/><!-- convert 121 seconds to minutes -->
{{#expr: 119/60}} <br/><!-- convert 119 seconds to minutes -->
{{#expr: 121/60 round 0}} <br/><!-- round 121 seconds to minutes -->
{{#expr: 119/60 round 0}} <br/><!-- round 119 seconds to minutes -->
2.0166666666667
1.9833333333333
2
2
- Fortunately, we should be able to use the above logic for IF statements. Unfortunately, this crazy logic may time out...
- But wait! Turns out there is module after all:
{{#expr: 121%60}} <br/><!-- confirm there is no modulo symbol -->
{{#expr: 121 mod 60}} <br/><!-- confirm there is a modulo operator -->
{{#expr: 119 mod 60}} <br/><!-- confirm there is a modulo operator -->
Expression error: Unrecognised punctuation character "%"
1
59
- So we can now "easily" convert seconds to hh:mm:ss:
{{#expr: (121-(121 mod 60))/60}}:{{#expr:121 mod 60}} <br/> <!-- 121 seconds to mm:ss -->
{{#expr: (119-(119 mod 60))/60}}:{{#expr:119 mod 60}} <br/> <!-- 119 seconds to mm:ss -->
2:1
1:59
- Okay, so this doesn't do zero padding :-/
- For now let's do more complicated examples (with hand-coded zero-padding):
{{#ifexpr: (3601>=3600)|{{#expr: (3601-(3601 mod 3600))/3600}}:|}}{{#ifexpr: (((3601-(3601 mod 60))/60) mod 60)<10|0|}}{{#expr: ((3601-(3601 mod 60))/60) mod 60}}:{{#ifexpr: (3601 mod 60)<10|0|}}{{#expr:3601 mod 60}} <br/>
<!-- 3601 seconds to hh:mm:ss -->
{{#ifexpr: (3599>=3600)|{{#expr: (3599-(3599 mod 3600))/3600}}:|}}{{#ifexpr: (((3599-(3599 mod 60))/60) mod 60)<10|0|}}{{#expr: ((3599-(3599 mod 60))/60) mod 60}}:{{#ifexpr: (3599 mod 60)<10|0|}}{{#expr:3599 mod 60}} <br/>
<!-- 3599 seconds to hh:mm:ss -->
{{#ifexpr: (7199>=3600)|{{#expr: (7199-(7199 mod 3600))/3600}}:|}}{{#ifexpr: (((7199-(7199 mod 60))/60) mod 60)<10|0|}}{{#expr: ((7199-(7199 mod 60))/60) mod 60}}:{{#ifexpr: (7199 mod 60)<10|0|}}{{#expr:7199 mod 60}} <br/>
<!-- 7199 seconds to hh:mm:ss -->
{{#ifexpr: (90001>=3600)|{{#expr: (90001-(90001 mod 3600))/3600}}:|}}{{#ifexpr: (((90001-(90001 mod 60))/60) mod 60<10)|0|}}{{#expr: ((90001-(90001 mod 60))/60) mod 60}}:{{#ifexpr: (90001 mod 60)<10|0|}}{{#expr:90001 mod 60}} <br/>
<!-- 90001 seconds to hh:mm:ss -->
1:00:01
59:59
1:59:59
25:00:01
- This will become a new template:
{{#ifexpr: ({{{1}}}>=3600)|{{#expr: ({{{1}}}-({{{1}}} mod 3600))/3600}}:|}}{{#ifexpr: ((({{{1}}}-({{{1}}} mod 60))/60) mod 60)<10|0|}}{{#expr: (({{{1}}}-({{{1}}} mod 60))/60) mod 60}}:{{#ifexpr: ({{{1}}} mod 60)<10|0|}}{{#expr:{{{1}}} mod 60}}
- With comments:
{{#ifexpr: ({{{1}}}>=3600)|{{#expr: ({{{1}}}-({{{1}}} mod 3600))/3600}}:|}}<!-- /* Calculate the hours and only display more than 0 hours. */
-->{{#ifexpr: ((({{{1}}}-({{{1}}} mod 60))/60) mod 60)<10|0|}}<!-- /* Calculate the minutes and pad with leading zero if less than 10. */
-->{{#expr: (({{{1}}}-({{{1}}} mod 60))/60) mod 60}}:<!-- /* Calculate the minutes. */
-->{{#ifexpr: ({{{1}}} mod 60)<10|0|}}<!-- /* Calculate the seconds and pad with leading zero if less than 10. */
-->{{#expr:{{{1}}} mod 60}}<!-- /* Calculate the seconds. */ -->
- New template name: {{format seconds}}
- Related templates: {{hcount}} and {{vcount}}
- Now let's package this up in a counter:
- Note that {{hresetcount}} should facilitate resetting the counter to 0. (It must be set to 1, increment 1.)
- Then we
{{#count:tally}}by the number of seconds. Since it's an invisible counter, we use {{hcount}}.
{{hcount|{{{1}}}|{{{2}}}}}{{format seconds|{{{2}}}}}
- New template name: {{tally time}}
Dangeresque Template
