Jump to content

User talk:Werdna

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Werdna (talk | contribs) at 02:20, 8 November 2008 (→‎Character-counting parser function: Not me). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Template:Werdnabot

If you are here to tell me you replied to a comment of mine in a discussion, don't bother unless it's been a few days. I've probably got it watchlisted.

Character-counting parser function

Wow Werdna. An actual programmer. Allow me a request:

There are two templates {{delimitnum}} and {{val}}, that delimit numbers (add narrow spaces) in values like this: 6.0224438467(40)×10−23 kg. Unfortunately, both these templates must rely upon math-based techniques and both suffer from unpredictable rounding errors. For instance, coding {{val|0.29872813|e=-23|u=kg}} produces 0.29872813×10−23 kg (note the …29) but adding 2 to the value, {{val|2.29872813|e=-23|u=kg}} produces the correct 2.29872813×10−23 kg.

All we need is a character-counting parser function  to use in these templates. Such a parser function would continually be asked the following question: “are there five or more remaining digits in the string?” If so, move over three more digits, add a space, and ask the question again. Details are at bugzilla:15677. A prior version of that bug (six moths ago) is bugzilla:13025. MOSNUM currently advised editors about {val} but cautions editors to be extremely careful and proof check the output to ensure it matches their input. Note too that our Kilogram article, starting here in this section, makes extensive use of the {val} template. However, a couple of numbers had to be hand-coded due to this bug.

Can you help in any way? There are two template editors who would be anxious to rewrite {delimitnum} and {val} if they could get their hands on such a parser function. Greg L (talk) 06:54, 1 November 2008 (UTC)[reply]

Werdna? How long do you think it would take a developer to create such a character-counting parser function? Greg L (talk) 05:54, 3 November 2008 (UTC)[reply]

I've discussed this over the last few days, and I think the general developer consensus is that such a parser function will not be created, because it encourages the use of templates where other parser functions should be written. If you like, I can certainly write a function to format a value in scientific notation. — Werdna • talk 06:49, 3 November 2008 (UTC)[reply]

  • Whereas it would be nice to see an easier-to-use template as is described in bugzilla:15677, looking at the number of articles that currently link to {{val}} and {{delimitnum}}, it would probably be better, if we were going to just make one template, to just re-write {val} with the character-counting capability. All it needs is to not choke on big numbers and not have rounding errors. Is that something that you could do? Greg L (talk) 02:55, 4 November 2008 (UTC)[reply]
  • Werdna, is there anything I can do to make the task of writing a magic word easier for you? Would a little chart-style, tabular checklist of specific features be handy? Greg L (talk) 20:24, 7 November 2008 (UTC)[reply]

I would probably not be the person to write it. I have been employed to work on certain projects starting on Monday. This is probably what I will focus on in terms of Wikimedia development, although I may poke other things as time permits. Add your request to bugzilla, and somebody else may write it for you. These sorts of requests might be done by Krimpet or Mr.Z-man, if you're after someone close to English Wikipedia. — Werdna • talk 02:20, 8 November 2008 (UTC)[reply]

Expiring protection

Werdna, would it be possible to add an option to the protection expiry allowing admins to choose whether the protected page should return to no protection or semi-protection? This comes up w/ vandalism targets that temporarily go to full protection, but should go back to semi after a while (I'm coming at the issue from the presidential candidate biographies). Is there a patch already in the works, perhaps?--chaser - t 21:21, 4 November 2008 (UTC)[reply]

Hey, good idea! That would be helpful. --Ckatzchatspy 21:37, 4 November 2008 (UTC)[reply]

Bugs are reported that way. You could also post on the village pump with this idea – I'm not the only developer, you know... ;-)Werdna • talk 23:41, 4 November 2008 (UTC)[reply]

I know. I'm picking on you b/c you developed cascading protection. I'm off to VPT.--chaser - t 02:29, 5 November 2008 (UTC)[reply]