This is an old revision of this page, as edited by RexxS (talk | contribs) at 19:23, 24 February 2021 (→Arbitration notice: note about RfC). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Revision as of 19:23, 24 February 2021 by RexxS (talk | contribs) (→Arbitration notice: note about RfC)(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)This is RexxS's talk page, where you can send him messages and comments. |
|
Archives: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66Auto-archiving period: 28 days |
St Lucy's day for you
Happy New Year
Happy New Year 2021 I hope your New Year holiday is enjoyable and the coming year is much better than the one we are leaving behind. Best wishes from Los Angeles. // Timothy :: talk |
2021
I tried to give 2021 a good start by updating the QAI project topics, and one item mentions your essay on indenting. Please check and correct, - not a member, but an old friend! - For moar private "happy new year" see here. --Gerda Arendt (talk) 20:18, 6 January 2021 (UTC)
I don't see how {{WPEUR10k}} leaves a blank line afterwards, and it shouldn't. --Gerda Arendt (talk) 11:50, 8 January 2021 (UTC)
- @Gerda: There were extra newlines in the template's definition. I've removed them now. You may have to purge the article where the template is used to see the change. --RexxS (talk) 13:04, 8 January 2021 (UTC)
- Aha, I see some magic fixie dust! That'll come in handy! darwin bish 13:07, 8 January 2021 (UTC).
- Thank you, I thought it was that because I was sure I saw it without before a 31 Dec change. I just couldn't change the template. It's not for articles but a project claim on (thousands of) talk pages. --Gerda Arendt (talk) 13:36, 8 January 2021 (UTC)
- Next: I am blind for why, in the structure table in BWV 1, the last line for movement 6 looks different from the others. --Gerda Arendt (talk) 21:42, 9 January 2021 (UTC)
- @Gerda: There was a blank line before the table end. That appeared in the final cell of the last row, which caused the disturbance. I've sprinkled more magic fixie dust; let's hope Darwinbish doesn't take all of it. --RexxS (talk) 23:38, 9 January 2021 (UTC)
- Thank you, and for the chocolate cake for WP's 20th! I am proud of a little bit on the Main page today, and 5 years ago, and 10 years ago, look: create a new style - revive - complete! I sang in the revival mentioned. --Gerda Arendt (talk) 17:24, 15 January 2021 (UTC)
- Thank you for a different cake today! I think of Jerome Kohl, remembered in friendship --Gerda Arendt (talk) 15:11, 28 January 2021 (UTC)
- @Gerda: There was a blank line before the table end. That appeared in the final cell of the last row, which caused the disturbance. I've sprinkled more magic fixie dust; let's hope Darwinbish doesn't take all of it. --RexxS (talk) 23:38, 9 January 2021 (UTC)
Natalia Tena revert
Wanted to apologize for my mistake. I straight up glossed over the description of the tag and assumed it was referring to her being a musician, so I thought it was an easy solve. Thank you for catching me! Sock (tock talk) 21:57, 31 January 2021 (UTC)
- @Sock: thank you for reaching out. I do agree about her main notability is as an actress judging from the sources, so I've tried to put back that part of your edit. Hope that looks alright now. --RexxS (talk) 22:24, 31 January 2021 (UTC)
WikiProject Medicine Newsletter - February 2021
- Issue 9—February 2021
- WikiProject Medicine Newsletter
Happy February everyone. I hope the new year is starting to look better than the last one did. As always, if you have any ideas to improve the newsletter, please post them at the talkpage. Otherwise, here is what's happening around the project:
Late onset congenital adrenal hyperplasia nom. Maxim Masiutin, reviewed by Vaticidalprophet |
Louise Boursier nom. Doug Coldwell |
News from around the site
- Another discussion has closed, with consensus supporting continued use of the phrase "committed suicide" in articles.
- The Medicine Collaboration of the Month for February is Cirrhosis. Head to Talk:Cirrhosis to coordinate our efforts. You can nominate future collaborations at WP:MCOTM.
- This month's target maintenance backlog is "articles that need more wikilinks". Just 65 medicine pages have {{Underlinked}} on them, so hopefully we can clean them all up this month.
- Flyer22 Frozen, longtime and prolific editor on medicine and television/film topics, has died. You can read a brief reflection on her Misplaced Pages work here, and leave condolences at her talk page.
Discussions of interest
- Continued discussion on the role of subject-specific notability guidelines at Misplaced Pages talk:Notability.
- An ongoing effort to trim talk page banners has brought us a discussion regarding whether {{English variant notice}}s should be converted to editnotices.
- An ongoing discussion at WT:MED considers spinning out parts of the infobox for medicines/drugs into other templates.
You are receiving this because you added your name to the WikiProject Medicine mailing list. If you no longer wish to receive the newsletter, please remove your name.
MediaWiki message delivery (talk) 05:02, 1 February 2021 (UTC)
Pseudoscience/hypothesis
Thanks for your help with the infobox! Just one problem -- the infobox is captioned with "Pseudoscientific concepts", which can't be removed from the template with my current understanding of template editing (see it on the article itself), and this still applies to the Template:Infobox hypothesis redirect. How would one fix that issue? Vaticidalprophet (talk) 13:59, 2 February 2021 (UTC)
- @Vaticidalprophet: I've added another parameter
|note=
to the infobox; the parameter defaults to]
. As a demo, I've used it to create a link to Hypothesis at the bottom of the infobox in Imprinted brain hypothesis. Obviously, you can change it if you have a better target or wording. Cheers --RexxS (talk) 14:26, 2 February 2021 (UTC)
Shortcut
You must have a template that you substitute to get <code><nowiki>{{template}}</nowiki></code> → {{template}} because there is no way you type that every time! — Martin (MSGJ · talk) 21:54, 3 February 2021 (UTC)
- @Martin: yeah, somebody created a template to do that, but I can't remember its name, so I can't use it. Please excuse me refactoring your markup, but it screws up my syntax-highlighting if you allow the parser to see an opening angle bracket.
- Anyway, before I compose a reply, I use the edit-box to test the code I'm calling. I use an old editing interface that allows me to insert <code><nowiki></nowiki></code> with the cursor positioned in the centre, so I just cut the code, insert the code-nowiki; paste the code; add → at the end; and then paste the code again.
- If I had a better memory, I could subst a template, but sadly, my powers are declining as my seventh decade approaches. Cheers --RexxS (talk) 22:32, 3 February 2021 (UTC)
- RexxS, Was it {{tl}}? Vexations (talk) 22:41, 3 February 2021 (UTC)
- @Vexations: nope, sorry. It would have to have content something like
<code><nowiki>{{{1|}}}</nowiki></code> → {{{1|}}}
I know it's out there somewhere. --RexxS (talk) 22:52, 3 February 2021 (UTC)- While looking at some changes at Template:Val/doc, I noticed Module:DemoTemplate. I have never used it and I don't think RexxS or I will change our ways, but anyone compiling a list might like to start with that. Johnuniq (talk) 02:20, 4 February 2021 (UTC)
- Sadly, I can't get it to work quite right when there's an invoke inside a parameter. Compare:
{{Cite Q/sandbox| Q2924826, Q13872896 }}
→ Admiralty List of Lights and Fog Signals, United Kingdom Hydrographic Office, Wikidata Q2924826, NGA List of Lights, Radio Aids and Fog Signals, National Geospatial-Intelligence Agency, Wikidata Q13872896{{Cite Q/sandbox| }}
→{{Cite Q/sandbox|1= {{#invoke:WikidataIB |getPropertyIDs |qid=Q2752669 |P1343 |fwd=ALL |osd=n}} }}
→
- The first one just uses
Q2924826, Q13872896
as the parameters to CiteQ; the second one actually has an invoke of WikidataIB, but you don't see it; the third one usessafesubst:
. but the module sticks an extra1=
into it. Close, though. --RexxS (talk) 03:08, 4 February 2021 (UTC)
- Sadly, I can't get it to work quite right when there's an invoke inside a parameter. Compare:
- While looking at some changes at Template:Val/doc, I noticed Module:DemoTemplate. I have never used it and I don't think RexxS or I will change our ways, but anyone compiling a list might like to start with that. Johnuniq (talk) 02:20, 4 February 2021 (UTC)
- @Vexations: nope, sorry. It would have to have content something like
- RexxS, Was it {{tl}}? Vexations (talk) 22:41, 3 February 2021 (UTC)
I nearest thing I found was Template:Codenowiki, but it doesn't do the arrow and the evaluation — Martin (MSGJ · talk) 12:06, 4 February 2021 (UTC)
User:Zongqi
Hello. User:Zongqi who you unblocked the other day is repeating inappropriate editing. In Shikigami page, which has nothing to do with traditional Chinese medicine, he used sources that have nothing to do with shikigami to promote traditional Chinese medicine. His edits was also confirmed in the Ikigai from October to December 2020, and his behavior did not change before and after he was blocked. His edits have also been criticized by IP users in the summary section of Ikigai. I am concerned that he keeps writing incorrect information to promote traditional Chinese medicine and philosophy, using irrelevant or inaccurate sources on various wikipedia pages.--Green cigarette (talk) 02:52, 7 February 2021 (UTC)
- Please look at the talk:Ikigai. Talking with him is very difficult because of his irrational beliefs about traditional Chinese medicine and his extraordinary zeal.--Green cigarette (talk) 13:26, 7 February 2021 (UTC)
- @Green cigarette: I've dealt with it. But please remember WP:Vandalism defines "vandalism" as
"editing (or other behavior) deliberately intended to obstruct or defeat the project's purpose"
. I know it's galling to be accused of vandalism, but it is never appropriate to reply in kind. It doesn't matter how inaccurate or inappropriate another editor's contributions may be, unless they are irrefutably editing with a clear intent to damage the encyclopedia, you can't accuse them of vandalism, or you may find yourself in trouble for personal attacks. I hope you will consider this advice in the spirit in which it is intended. Cheers --RexxS (talk) 20:30, 7 February 2021 (UTC)
- @Green cigarette: I've dealt with it. But please remember WP:Vandalism defines "vandalism" as
- I understood your advice. Thank you.--Green cigarette (talk) 06:01, 8 February 2021 (UTC)
The time allocated for running scripts has expired
Hi, I wanted to ask your advice because I am starting to see occasional errors appearing on List of lighthouses in England. Is there a technical limit on the number of wikidata items that a page can access, or do I need to make my template more efficient? Either way I would like to analyse loading times, lags, memory usage, etc. of this page more carefully and I don't know the best tools to do that. Thanks — Martin (MSGJ · talk) 21:35, 8 February 2021 (UTC)
Page watcher: The limits/data of interest can be found in the HTML source at the bottom of the parser output. For my version of the page, this is what it had to say:
Extended content |
---|
<!-- NewPP limit report Parsed by mw1327 Cached time: 20210209001128 Cache expiry: 2592000 Dynamic content: false Complications: CPU time usage: 11.632 seconds Real time usage: 13.253 seconds Preprocessor visited node count: 78404/1000000 Post‐expand include size: 940720/2097152 bytes Template argument size: 77672/2097152 bytes Highest expansion depth: 14/40 Expensive parser function count: 93/500 Unstrip recursion depth: 1/20 Unstrip post‐expand size: 400331/5000000 bytes Lua time usage: 8.525/10.000 seconds Lua memory usage: 14755567/52428800 bytes Lua Profile: recursiveClone <mwInit.lua:41> 2540 ms 29.6% Scribunto_LuaSandboxCallback::getEntity 880 ms 10.3% Scribunto_LuaSandboxCallback::incrementStatsKey 460 ms 5.4% Scribunto_LuaSandboxCallback::getExpandedArgument 440 ms 5.1% type 420 ms 4.9% Scribunto_LuaSandboxCallback::getLabelByLanguage 400 ms 4.7% ? 400 ms 4.7% Scribunto_LuaSandboxCallback::getAllExpandedArguments 360 ms 4.2% Scribunto_LuaSandboxCallback::getSiteLinkPageName 300 ms 3.5% Scribunto_LuaSandboxCallback::getEntityStatements 300 ms 3.5% 2080 ms 24.2% Number of Wikibase entities loaded: 83/400 --> <!-- Transclusion expansion time report (%,ms,calls,template) 100.00% 12223.804 1 -total 92.59% 11318.557 80 Template:List_item 92.47% 11303.378 80 Template:List_item/core 90.01% 11002.214 720 Template:List_item/row 11.50% 1406.236 160 Template:If_empty 11.34% 1385.918 80 Template:List_item/focal_height 10.32% 1261.618 80 Template:List_item/location+coordinates 8.43% 1031.049 69 Template:List_item/range 8.28% 1012.675 80 Template:List_item/image 4.74% 579.481 80 Template:List_item/opened --> <!-- Saved in parser cache with key enwiki:pcache:idhash:145763-0!canonical!tmh-videojs and timestamp 20210209001115 and revision id 1005669894. Serialized with JSON. --> |
The error that you have been seeing is directly related to the Lua time usage: 8.525/10.000 seconds
line; if I had had the same issue it would have been >10 seconds.
While there is a limit to the number of Wikidata items accessed (400 apparently), this issue is only indirectly related (in that you are accessing 80 items and that's taking Lua a long time to chew on). As you can see, a lot of that time is being spent either in the Wikibase Lua library or one of our implementations of that module.
I am not personally sure what can be done to fix these issues, or how to troubleshoot inefficient code better, since we don't have access to the instructions generated or any other standard IDE offerings. --Izno (talk) 00:51, 9 February 2021 (UTC)
- (edit conflict)
- Hi Martin. There is indeed a technical limit of 400 Wikidata items that can be accessed on a page, but that's not what's bumping up against the limit on that page. When you get performance issues, you should open the relevant page for editing and preview it. That ensures you get an uncached version. At the bottom of the preview you will find some tables labelled as 'parser profile data', which you may have to expand to see. Looking through those, you will get an idea of what values are getting close to their limits. By the way, those values fluctuate from run to run depending on a host of other factors, but they will give you a good idea of what's happening. In the case of List of lighthouses in England, you only have 83 out of 400 entities loaded, so that's not your problem, but you will see that the Lua is taking over 8 seconds to run the scripts, and only 10 seconds are allowed before it times out. If you hit a busy time when there is some extra latency in returning the database calls, then it can easily hit the time limit. So time is the problem and you need faster code. I see that you have a count of 93 expensive parser functions, and they are often the prime culprits (certain calls are marked as 'expensive' because of the amount of resources/time they consume).
- You have 80 {{list item}}s in the page. If I remove 40 of them and preview, I can see that the Lua time drops to around 4 seconds and the count of expensive parser functions is 53. That indicates that each list item is taking around 100 ms and 1 expensive call. The {list items} are responsible for almost all of the Lua time in rendering the page ({{convert}} uses relatively little). I should point out that I got Lua times between 3.5 and 5 seconds on several runs, so you have to take a guess at the average and worst cases – you soon get a feel for it after a few previews. There are 8 expensive parser calls in {{Portal bar}}, but that's a minor contribution.
- Anyway, Lua time is the barrier (and we don't really want pages taking over 10 seconds to load), so you need to optimise the speed of the {{list item}} template.
- You can use something like this to isolate the template call in your user sandbox:
{| class="wikitable" {{list item|qid=Q15182446|aid=Q920649}} |}Template:List item
- Preview that and you'll see a Lua time around 100 ms with an expensive parser function count of 1 as expected. Then you'll need to look at the 'Templates used in this preview' and try to work out which one is taking the time. I think it might be that each cell is a separate call to Wikidata with all its overheads. Here's the county:
{{#invoke:wd|properties|linked|Q15182446|P7959}}
→ Dorset- Lua time: 21 ms; Expensive parser count: 1
- You can't improve that by switching to WikidataIB (
{{#invoke:wikidataIB|getValue|ps=1|qid=Q15182446|P7959}}
) as it also takes 21 ms. You only need about half a dozen calls per row at 20 ms each to push the row time over 100 ms, and then when you have 80 rows, you run into the 10 second limit. - So, I would have to recommend getting a specific Lua module to create each table row for you, which should reduce the overhead. Let me know if you want me to try to work on that with you. --RexxS (talk) 01:04, 9 February 2021 (UTC)
- @Izno and Martin: I got interested in the general problem and performance. To test out my guess that the overhead in the #invoke was the main culprit, I wrote a demo module to create a table from Wikidata at Module:Sandbox/RexxS/Wikidata table. It just does fetching of raw values but it can fetch 80 rows of 6 columns in 600 ms – preview an edit at Module talk:Sandbox/RexxS/Wikidata table and see the parser profiling data. The Lua code only creates the table rows, so you make your own caption, header, etc. as usual, but that's probably a good thing. I'll refine it a bit and see if I can make it usable. --RexxS (talk) 14:58, 9 February 2021 (UTC)
- Yeah, I was pretty close to suggesting that but hadn't looked at the details to know if that would work. --Izno (talk) 17:42, 9 February 2021 (UTC)
- Adding about 150 conversions increases the Lua time to about 1 second. --RexxS (talk) 18:47, 9 February 2021 (UTC)
- That's very nice and at least proves that the approach is viable. It will need a bit of work before it's ready to insert in articles, e.g. with references, qualifiers, editonwikidata links, etc. which I would be happy to work with you on. The downside of having the module produce the whole table, rather than row by row, is that individual columns can't be overwritten, which I think would be important in an article. I guess {{list item}} could be made more efficient in Lua while still retaining much of its flexibility. For a start, would it be possible to remove the expensive function? Anyway thanks for the useful technical information. — Martin (MSGJ · talk) 20:26, 9 February 2021 (UTC)
- @MSGJ: well it shows how fast it can run with optimisations. I wasn't suggesting it as a replacement. Actually making each invoke consumes quite a lot of time, and you can gain a fair amount by moving from 1 call per table cell to 1 call per table row, which would allow overrides for any cell on a per-column basis. I'll have a look at that later. As it turns out the "expensive" functions don't make much difference, as Module:Wd uses expensive calls to get values and Module:WikidataIB doesn't, but they consume the same amount of time to fetch a value. --RexxS (talk) 21:02, 9 February 2021 (UTC)
- One call per table row would be good to try, and it would be interesting to compare the times with the whole table version. — Martin (MSGJ · talk) 13:16, 10 February 2021 (UTC)
- @MSGJ: I've added the single row functionality to Module:Sandbox/RexxS/Wikidata table, and created a couple of demo templates at Template:Wdtable row and Template:Wdtable row/lighthouse to encapsulate the invoke. Using the second template, I've made a demo with 95 rows at Module talk:Sandbox/RexxS/Wikidata table #Testing WDtable row. I've previewed it a few times and it takes between 1.2 and 1.8 seconds for 95 rows, which seems to indicate that one call per row is the optimisation you need. Cheers --RexxS (talk) 18:40, 10 February 2021 (UTC)
- @MSGJ: Thanks for the reformatting of the columns. I've added functionality to enable multiple pids per cell, like location and coordinates. You need to make sure that each cell's properties are separated by spaces or commas or both. Pids not separated by spaces or commas (I use '+') will all go inside the same table cell separated by a
<br>
. The pids string for Template:Wdtable row/lighthouse is now|pids=P18, P276+P625, P7959, P571, P2048, P2923, P2929, P137
. I've built functionality to allow qualifiers separated from the pids in the cell by a '/', (so something likeP137/P580+P582
}, but I haven't coded the actual fetching of the parameters yet. --RexxS (talk) 23:33, 10 February 2021 (UTC)- I've moved the module to Module:Wikidata table as sandbox code can't realistically be used in articles. Further discusion is at Template talk:Wdtable row. --RexxS (talk) 17:54, 11 February 2021 (UTC)
- One call per table row would be good to try, and it would be interesting to compare the times with the whole table version. — Martin (MSGJ · talk) 13:16, 10 February 2021 (UTC)
- @MSGJ: well it shows how fast it can run with optimisations. I wasn't suggesting it as a replacement. Actually making each invoke consumes quite a lot of time, and you can gain a fair amount by moving from 1 call per table cell to 1 call per table row, which would allow overrides for any cell on a per-column basis. I'll have a look at that later. As it turns out the "expensive" functions don't make much difference, as Module:Wd uses expensive calls to get values and Module:WikidataIB doesn't, but they consume the same amount of time to fetch a value. --RexxS (talk) 21:02, 9 February 2021 (UTC)
- Yeah, I was pretty close to suggesting that but hadn't looked at the details to know if that would work. --Izno (talk) 17:42, 9 February 2021 (UTC)
Zongqi
Hello, RexxS. Is there any insight you can give me? Requesting unblock at UTRS appeal #40392. Quotes:
I had a another new editor start removing my edits on curtain pages without giving a reasonable explanation for their removal
The page in question has a very lucrative publishing purpose.
so other editors could not see it to make a good judgement of the situation,
please look into sock puppetry and editor cohesion with these editors
I've seen your extensive AGFness on their talk page. Thanks, --Deepfriedokra (talk) 10:34, 11 February 2021 (UTC)
- (talk page watcher) Hi, RexxS, Deepfriedokra! Sorry to butt in, I happened to see this. Isn't it likely that this is another sock of Shenqijing, who RexxS already knows? I haven't looked deeply, but the timing looks right (account created a few days after the Sntmichael sock was created and blocked), they both claim to be Dharma teachers, and there seems to be a good deal of overlap in edits. Regards to you both, Justlettersandnumbers (talk) 13:28, 11 February 2021 (UTC)
- @Justlettersandnumbers: Thanks. Not familiar with that SM, but I was wondering if they were someone's sock. --Deepfriedokra (talk) 15:33, 11 February 2021 (UTC)
- Hi Deepfriedokra! Without seeing the UTRS ticket, I obviously can't comment on the request as a whole, but Zongqi seems to concentrate only on other people's behaviour and rarely addresses their own. I looked through their contributions before taking action and there is a catalogue of attempting to link Wuxing (Chinese philosophy) to a wide range of "fringey" topic areas despite regular objections from editors on the affected articles. You only need look at Talk:Ayurveda/Archive 18 #Addition of Wyxing for an example of how difficult it is to communicate with them, and their seeming inability to understand other editors. I removed my initial block on the grounds that they might keep away from conflict, but they simply went back to their previous modus operandi, sadly.
- As for the quotes you gave above, I believe the first was when another editor removed Zongqi's addition of Wuxing to an article (a Japanese article, I think) on the grounds of Wuxing being unrelated, Zongqi simply dismissed that as 'unreasonable' and proceeded to label the reverts as vandalism.
- I have no idea what "a very lucrative publishing purpose" is intended to mean in relation to a Misplaced Pages article.
- Zongqi has no idea that page histories exist, and so believes that any edit they make should remain until other editors can judge it. I believe that is an untenable situation.
- Zongqi has clearly been quick to level evidence-free accusations of sockpuppetry against editors who disagree with them, which unfortunately I no longer find surprising.
- Sorry I can't be of more assistance, but I've reached the end of my tether with Zongqi, and I think we're firmly in WP:standard offer territory now. --RexxS (talk) 16:24, 11 February 2021 (UTC)
Semi-protection psychosis
RexxS or Ajpolino could you glance at Psychosis (edit | talk | history | protect | delete | links | watch | logs | views) in terms of semi-protection? SandyGeorgia (Talk) 16:50, 13 February 2021 (UTC)
- Semi-protected for two weeks. Will post on IP's talk page (not sure IPs ever really see their talk pages, but worth a shot), and look into their contributions at Hallucination as well. Ajpolino (talk) 17:33, 13 February 2021 (UTC)
- Thx ... ipad typing ... possibly related to that crazy psychosis in pregnancy thread at wt:med months ago, but I am on hotspot in car ... SandyGeorgia (Talk) 17:36, 13 February 2021 (UTC)
- Thanks, Ajpolino, good call. The IP is conducting "fringey" OR, but not vandalism, so we can AGF on their intentions. I'll watchlist the page for a few weeks. The Ipv6 made a couple of edits from a slightly different IP, still in the /64 range, so the IP hops and it's unlikely they will ever see any messages left for them. It's a Comcast Cable address, so may be stable in the /64 range for the individual. As they are the only editor causing problems, their /64 range could be partially blocked form the page if necessary to avoid further semi-protection once it expires. Cheers --RexxS (talk) 18:42, 13 February 2021 (UTC)
- They have registered now ... I would add to talk but am ipad hotspot ... SandyGeorgia (Talk) 18:46, 13 February 2021 (UTC)
- Thanks, Ajpolino, good call. The IP is conducting "fringey" OR, but not vandalism, so we can AGF on their intentions. I'll watchlist the page for a few weeks. The Ipv6 made a couple of edits from a slightly different IP, still in the /64 range, so the IP hops and it's unlikely they will ever see any messages left for them. It's a Comcast Cable address, so may be stable in the /64 range for the individual. As they are the only editor causing problems, their /64 range could be partially blocked form the page if necessary to avoid further semi-protection once it expires. Cheers --RexxS (talk) 18:42, 13 February 2021 (UTC)
- Thx ... ipad typing ... possibly related to that crazy psychosis in pregnancy thread at wt:med months ago, but I am on hotspot in car ... SandyGeorgia (Talk) 17:36, 13 February 2021 (UTC)
Module:Formatnum
Hello. What happened with what you were doing in the sandbox? Trigenibinion (talk) 19:25, 18 February 2021 (UTC)
- Hi Trigenibinion.
- In this edit, I enabled the main function to be called via a direct invoke, as it otherwise can only pick up parameters from a wrapper template. I use an external IDE that cleans up indents from using spaces to using tabs, so that accounts for the other changes in that diff and is the reason why the sandbox was 449 bytes smaller.
- In this edit and the subsequent one, I allowed the main function to accept "none" as a value for
|lang=
that can be passed to the formatNum function. I also set a fallback to the site's content language, which is useful for multilingual wikis. - Nothing came of it, because I think it was only a demo when I was discussing the modules called by Module:WikidataIB with Jarekt, who maintains Module:Formatnum on Commons. --RexxS (talk) 19:42, 18 February 2021 (UTC)
- OK, then I will just reset the sandbox because I think this module is a good place for a function that will replace a template I am using. Trigenibinion (talk) 21:36, 18 February 2021 (UTC)
- Change of plans: I have converted the Commons test cases. I will promote your code. Trigenibinion (talk) 23:40, 18 February 2021 (UTC)
- frame:getParent().args would grab the wrong arguments. Trigenibinion (talk) 18:57, 19 February 2021 (UTC)
- If the module were called from a wrapper template, frame:getParent().args would contain the arguments supplied to the wrapper template. There are no "wrong" arguments; it just depends on whether the module is invoked directly or through a template. --RexxS (talk) 19:06, 19 February 2021 (UTC)
- You broke {{FXConvert}} by reinstating that code. Trigenibinion (talk) 15:33, 20 February 2021 (UTC)
- And now you broke it again by removing wordify. Trigenibinion (talk) 15:54, 20 February 2021 (UTC)
- You broke {{FXConvert}} by reinstating that code. Trigenibinion (talk) 15:33, 20 February 2021 (UTC)
- If the module were called from a wrapper template, frame:getParent().args would contain the arguments supplied to the wrapper template. There are no "wrong" arguments; it just depends on whether the module is invoked directly or through a template. --RexxS (talk) 19:06, 19 February 2021 (UTC)
- frame:getParent().args would grab the wrong arguments. Trigenibinion (talk) 18:57, 19 February 2021 (UTC)
- Change of plans: I have converted the Commons test cases. I will promote your code. Trigenibinion (talk) 23:40, 18 February 2021 (UTC)
- OK, then I will just reset the sandbox because I think this module is a good place for a function that will replace a template I am using. Trigenibinion (talk) 21:36, 18 February 2021 (UTC)
Then fix {{FXConvert}}. You must not alter the main entry point for an established module without sandboxing it and testing there. I've restored Module:Formatnum to the state it was prior to your changes. Your code is still in the sandbox, but is faulty in how it handles the parameters passed. It is clear that code like this:
local args = frame.args if not args and not args.number then args = frame.args end
is nonsensical. --RexxS (talk) 15:55, 20 February 2021 (UTC)
- I just left your
if not args and not args.number then args = frame.args end
to point out that something was being attempted here. It is harmless.
- {{FXConvert}} is not broken. The code from the sandbox was tested before being promoted. It was later in the {{FXConvert}} sandbox where I caught the problem with your code.
- The Formatnum sandbox now uses Module:Arguments. It is working both for the testcases and the {{FXConvert}} sandbox. Trigenibinion (talk) 18:09, 20 February 2021 (UTC)
What do you mean "my code"? The sandbox code I wrote was:
local args = frame:getparent().args if not args and not args.number then args = frame.args end
Note the :getParent() in the first line.
This is the diff] where you changed the first line to local args = frame.args
which results in the nonsense I pointed out. That's your code, not mine. The Module:Formatnum may be called by Module:WikidataIB, which is in use on about 1,120,000 pages on the English Misplaced Pages and 118 other Wikimedia projects. You can't just change its main entry point or its dependencies without causing chaos across multiple projects if they synchronise from enwiki. It's easy enough to deal with parameters without making yet another dependency. --RexxS (talk) 19:09, 20 February 2021 (UTC)
- Ah, I see the getParent() was already there, you only added:
if not args and not args.number then args = frame.args end
- Well, this getParent() handling was already wrong then. Let Module:Arguments do its job. Trigenibinion (talk) 19:51, 20 February 2021 (UTC)
- Note that the test cases (which did not exist until I added them) show that the production code is broken if you use that instead of the sandbox. Trigenibinion (talk) 19:59, 20 February 2021 (UTC)
- The code you added fixes one problem but not both. Trigenibinion (talk) 20:07, 20 February 2021 (UTC)
- The frame:getParent().args handling was was perfectly correct. It fetches the parameters supplied to any template that wraps the #invoke calling the module. If you remove it, wrapper templates won't function unless they explicitly pass each parameter in the #invoke of the module. That is completely unnecessary and causes maintenance work on every wrapper template if the module is updated to include another parameter.
- The original author of the module did not use Module:Arguments because it's unnecessary to add a dependency for trivial tasks like reading parameters. We can't ask over a hundred other projects who use Formatnum to add yet another dependency just because you won't code the parameter handling.
- The sole problem with the standard module is that it only picks up parameters from a wrapper template (i.e via frame:getParent().args). The change I put into the sandbox was to show how it could be simply modified to use the parameters from a direct #invoke. It doesn't need Module:Arguments. Almost all of the time, it's called from another module, not from #invoke, anyway. If you don't believe me, go and ask Jarekt on Commons. --RexxS (talk) 20:38, 20 February 2021 (UTC)
- I looked at the getArgs() code in Module:Arguments, this will by default get the parameters from both the frame and the parent, putting the frame arguments first, which is the correct normal behavior. Trigenibinion (talk) 20:58, 20 February 2021 (UTC)
- There is no "correct normal behaviour". You could also look at Module:Wikidata table, function makerow (line 442) that will show you how to merge the arguments from frame and parent, with the frame overwriting the parent arguments when they conflict. You would swap the lines 445 and 448 to achieve the opposite effect. You can also see how getWD (line 317) does custom processing of its parameters (but only uses frame because it's for debugging), or even how function ucf (line 102) does a minimal amount of processing on the passed parameter, again because it's just for debugging. "Horses for courses" and not a single dependency. You really don't want them as far as possible if other wikis are going to install your modules. --RexxS (talk) 22:14, 20 February 2021 (UTC)
- OK, I have removed the dependency in the sandbox. It also checks out. Trigenibinion (talk) 23:52, 20 February 2021 (UTC)
- That looks much better to me. Have you had a chance to compare the outputs of the sandbox and the main module? I would expect no difference in the main function when called from a wrapper, but I would expect the main function to return nothing when invoked directly. If that checks out and you're ready to commit, I'd be happy to update the module from the the sandbox for you, although if you're thinking of applying for template editor permission at some point, you'll need a number of successful edit-protected requests, so you could make a formal request at Module talk:Formatnum using {{edit-protected}} - read its documentation carefully if you haven't used it before, and let me know if you need any help with it. --RexxS (talk) 01:11, 21 February 2021 (UTC)
- I tried calling the original code from the test cases but it returns nothing without your fix. The foreign test cases need to be looked at by someone familiar with those languages, because I copied the results from Commons and some do not match, but the main function was not changed. Trigenibinion (talk) 12:46, 21 February 2021 (UTC)
- Is Module:Math OK or should I duplicate _round()? Is Module:TableTools OK or should I duplicate 2 new functions? Thanks. Trigenibinion (talk) 01:17, 23 February 2021 (UTC)
- Module:TableTools has a version on most wikis and Module:Math has a version on a number of wikis, so you might be able to use them without causing problems in most cases. I don't think it's a good idea to use them inside the main function call, but you can always write an alternative function to call via #invoke. Try to load external modules 'lazily', that is, define the variable to hold the imported table of functions without a value, and then test whether that variable is nil before you use imported functions, only loading the external module if it is nil. It may be that you're getting to the point where you are better off writing a separate new module and requiring Formatnum into your new module. Then you could experiment with different imported modules without compromising the ability of Formatnumber to be updated to sync with other wikis. --RexxS (talk) 01:32, 23 February 2021 (UTC)
- That looks much better to me. Have you had a chance to compare the outputs of the sandbox and the main module? I would expect no difference in the main function when called from a wrapper, but I would expect the main function to return nothing when invoked directly. If that checks out and you're ready to commit, I'd be happy to update the module from the the sandbox for you, although if you're thinking of applying for template editor permission at some point, you'll need a number of successful edit-protected requests, so you could make a formal request at Module talk:Formatnum using {{edit-protected}} - read its documentation carefully if you haven't used it before, and let me know if you need any help with it. --RexxS (talk) 01:11, 21 February 2021 (UTC)
- OK, I have removed the dependency in the sandbox. It also checks out. Trigenibinion (talk) 23:52, 20 February 2021 (UTC)
- The code you added fixes one problem but not both. Trigenibinion (talk) 20:07, 20 February 2021 (UTC)
- Note that the test cases (which did not exist until I added them) show that the production code is broken if you use that instead of the sandbox. Trigenibinion (talk) 19:59, 20 February 2021 (UTC)
Module:Formatnum is used on Commons to presents digits in a way customized for given language. On Commons it is only used from modules and occasionally from templates and never through "#invoke" statements. The input argument handling is done in a way that works with those modules and templates, and it did not changed much in last ~7 years. In the modules I write now I only use c:Module:Core's getArgs function which is lightweight, merges 2 ways of passing arguments from templates, is not case sensative and treats "_" and spaces in field names interchangeably. It is also used without issues on ~60+M pages. But this module really did not need it. --Jarekt (talk) 03:34, 21 February 2021 (UTC)
- Hello, before applying changes to production code, I saw that on wikipedia it was only being called from other modules. So {{FXConvert}} would be the first template that tries to call it here. Trigenibinion (talk) 12:39, 21 February 2021 (UTC)
- Period grouping separator is not working. Trigenibinion (talk) 00:16, 22 February 2021 (UTC)
Notice of noticeboard discussion
There is currently a discussion at Misplaced Pages:Administrators' noticeboard regarding an issue with which you may have been involved. The thread is Consensus_required_on_COVID?. Thank you. ProcrastinatingReader (talk) 02:32, 19 February 2021 (UTC)
You've got mail!
Hello, RexxS. Please check your email; you've got mail!Message added 04:20, 19 February 2021 (UTC). It may take a few minutes from the time the email is sent for it to show up in your inbox. You can remove this notice at any time by removing the {{You've got mail}} or {{ygm}} template.
KevinL (aka L235 · t · c) 04:20, 19 February 2021 (UTC)
English heritage data and Wikidata
Hi, about a year ago you started a template at {{English Heritage listed building row/Wikidata}} based on a discussion we had about pulling the data from WD rather than manual compilation from WP in a list article. For whatever reasons we put it on the back-burner, anyway I finally go off my fat-backside to have a look at LUA coding. I'd mocked up at User:Nthep/sandbox8 an idea of what I wanted to achieve and my first go at a module to populate it is at Module:Sandbox/Nthep/building. It's undoubtedly poorly written so I'd appreciate any feedback on how it can be improved. Also I have some questions about how to achieve a couple of things.
- Inserting the equivalent of a <BR> into a cell. If I use \n in the module it pushes all the subsequent cells into the one I put the newline in. There's a couple of cells e.g. heritage designation where I'd like the designation and the date on separate rows.
- Also on heritage designation I've managed to set the background colour of the cell based on the designation but it's by matching the text in property P1435 which is subject to error if the label of the item is changed. How do you make the comparison with the designation of the item e.g.Q15700831 rather than the text "Grade II* listed building" ?
Thanks for any assistance. Nthep (talk) 11:59, 20 February 2021 (UTC)
- @Nthep: the code works, but will be slow and resource-heavy because you are calling frame:expandTemplate to make each wikidata call. It's using around 50ms of Lua time per row, so will start to run into problems once you reach around 100 rows in a table. If you add references, that will probably double the processing time and halve the number of rows attainable. You would improve it a lot by requiring Module:Wd and using its functions directly. I can try to give you example code when I get a chance.
- To insert
<br>
into a cell, you can just concatenate"<br>"
. I've amended line 60 to include an html break (using "\n" inserts a newline into the source wikitext, not what you want inside a table). - To get the entity-id, you can use the
raw
parameter. Compare: {{wikidata|property|Q26547186|P1435}}
→ Grade II listed building{{wikidata|property|raw|Q26547186|P1435}}
→ Q15700834- which is Grade II listed building (Q15700834). You can make your choice of colour from that.
- Coincidentally, I've been working with MSGJ to create generic table rows using a new module Module:Wikidata table. It won't do all of the customisation that you've built into your module, so I don't suggest replacing it, but it can generate the sort of tables that are commonly used in list articles directly from Wikidata. The idea is to allow non-Lua programmers to leverage the speed and functionality of a module for many common lists. Here's an example, using your data:
Name | Location | Completed | Architect | Heritage designation (Date of listing) |
Notes | Grid ref Geo-coordinates |
Image | Entry number | Commons category |
---|---|---|---|---|---|---|---|---|---|
1-8, Woodsley Terrace | Leeds | 1856 | Grade II listed building (from Oct 1995) | notes for Woodsley Terrace | SE2905934481 53°48′21″N 1°33′37″W | 1255607 | |||
Roger Stevens Building | Leeds | 1970 | Chamberlin, Powell and Bon | Grade II* listed building (from Jun 2010) | Roger Stevens Building | SE2943134378 53°48′18″N 1°33′17″W | 1393836 | Stevens Building, University of Leeds Roger Stevens Building, University of Leeds |
References
- ^ Historic England. "Details from listed building database (1255607)". National Heritage List for England.
- ^ Historic England. "Details from listed building database (1393836)". National Heritage List for England.
It's a work in progress and needs to recognise that Commons category should be urlencoded before being linked. It's easy to create a sub-template like {{Wdtable row/lighthouse}} to save having to type the list of properties each time. You can see it used in List of lighthouses in England and that might give you some ideas. --RexxS (talk) 17:22, 20 February 2021 (UTC)
- that's really helpful, thanks. An example of requiring module:WD would be useful as I'm still finding my feet (very slowly) into the LUA coding so require etc are still mostly a mystery to me. Nthep (talk) 17:36, 20 February 2021 (UTC)
- @Nthep: I've made a demo module at Module:Sandbox/RexxS/Wd and put its output along with comparisons with the equivalent {{wikidata}} calls at its talk page Module talk:Sandbox/RexxS/Wd. See if that gives you sufficient idea. --RexxS (talk) 21:40, 20 February 2021 (UTC)
- Again, thanks for the guidance. I've done some tidying up and although I'm sure it can be drastically improved I'm ok with it. I ever managed to work out some SQL to populate it with. One last question (for the time being anyway) - is there a way to return a site link. For example wikidata:Q7432461 has a sitelink to the WP article School of Geography, University of Leeds. I can't see any property value associated with the sitelink. The idea is to use the WD label unless there is a WP article in which case I'd link to the WP article. Nthep (talk) 20:48, 22 February 2021 (UTC)
- @Nthep: You've done a good job, I've been following your module sandbox and it looks absolutely fine. The function you want in Lua is
mw.wikibase.getSitelink("Q7432461")
, but you might want to look at Module:Wikidata table lines 179-203, the _getLink function for code that will return a complete wiki-link from the entity-id (qid), wherever possible. The display returned from the function matches the capitalisation of the label (sitelinks are always capitalised). You're always free to re-use any code I write and there's no attribution required. Cheers --RexxS (talk) 22:00, 22 February 2021 (UTC)
- @Nthep: You've done a good job, I've been following your module sandbox and it looks absolutely fine. The function you want in Lua is
- Again, thanks for the guidance. I've done some tidying up and although I'm sure it can be drastically improved I'm ok with it. I ever managed to work out some SQL to populate it with. One last question (for the time being anyway) - is there a way to return a site link. For example wikidata:Q7432461 has a sitelink to the WP article School of Geography, University of Leeds. I can't see any property value associated with the sitelink. The idea is to use the WD label unless there is a WP article in which case I'd link to the WP article. Nthep (talk) 20:48, 22 February 2021 (UTC)
- @Nthep: I've made a demo module at Module:Sandbox/RexxS/Wd and put its output along with comparisons with the equivalent {{wikidata}} calls at its talk page Module talk:Sandbox/RexxS/Wd. See if that gives you sufficient idea. --RexxS (talk) 21:40, 20 February 2021 (UTC)
Arbitration notice
You are involved in a recently filed request for arbitration. Please review the request at Misplaced Pages:Arbitration/Requests/Case#RexxS and, if you wish to do so, enter your statement and any other material you wish to submit to the Arbitration Committee. As threaded discussion is not permitted on most arbitration pages, please ensure that you make all comments in your own section only. Additionally, the guide to arbitration and the Arbitration Committee's procedures may be of use.
Thanks, ProcrastinatingReader (talk) 14:08, 20 February 2021 (UTC)
- I've opened an RfC at Misplaced Pages talk:General sanctions/Coronavirus disease 2019 #RfC on use of COVID-19 editnotice to settle the question "Should admins have the ability to place the General sanctions/Coronavirus disease 2019 editnotice template on pages in scope that do not have page-specific sanctions?" That should throw some light on the issues. --RexxS (talk) 19:23, 24 February 2021 (UTC)