User talk:Fred Gandt

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

Contents

Tracker tool[edit]

Hi Fred, thanks mucho for the watchUserContribs.js tool! I was going to write to you with a request for some way to ID pages that are already on my watchlist (perhaps with the cute watchlist star), but I see you took care of that with the slick blue border around the checkboxes. That's cool! Seems to be working fine. Many thanks and I plan to keep using it! Regards, Cyphoidbomb (talk) 16:28, 10 April 2016 (UTC)

You're welcome. Let me know if it goes wrong; there may be cases I've not accounted for.
I was going to add the watchlist stars, but it'd require more code, and processing and makes clutter. The outline gets the job done on the cheap :-)
FYI: If your watchlist is epic, the load time may be slowed significantly (API limits). If that is a problem, I can fix it, but would prefer to avoid it (it would have knock on effects that then also need solutions).
I'm always open to requests/suggestions if you ever need/want anything. I enjoy code :-) fredgandt 16:36, 10 April 2016 (UTC)
I haven't noticed any problems thus far. My watchlist is pretty epic with 8000+ pages, but so far so good. Cyphoidbomb (talk) 19:53, 10 April 2016 (UTC)
Wow! If that's 8000 excluding talk pages, that's 16000 titles to be fetched at 500 per API call - 32 requests before anything else can happen! I'll add session caching of the results. fredgandt 02:39, 11 April 2016 (UTC)
8,668, to be exact, excluding talk pages. Of course many of them are dead and not frequently used... I do notice that it takes about 7 seconds for the tool to fully load on Chrome. I do, however, have several other tools in my common.js, so that might be contributing. Cyphoidbomb (talk) 15:32, 11 April 2016 (UTC)
Yeah, that's 35 API requests @ approx. 200ms per call, so 7 seconds doesn't surprise me ;-)
I've tweaked the code a little already in advance of adding caching, and it should actually run a little faster, but the initial API requests to gather the watchlist for comparison aren't ever going to run any faster. They won't actually block the page from loading or being interactive, since the calls are dealt with asynchronously, but while they're going on in the background, the UI elements involved won't show.
The idea is to cache the watchlist, so subsequent page views will process almost instantly. I've not decided which storage solution to utilise yet though (pros and cons); once I've actioned the decision, the update will be pleasingly obvious.
There's an opportunity for some nifty side benefits to keeping a cached copy of your watchlist handy; like the ability to highlight links to watched pages, and/or un/watch from anywhere. If I choose to go down that route, I'll make that into a unique script, and have both feed off the same cache. fredgandt 16:39, 11 April 2016 (UTC)
@Cyphoidbomb: - I've added session caching with a major caveat. Any watch or unwatch action outside the operation of this script's functions will not affect the cache, which means, the cache and reality can become desynchronised. I have added a button to manually clear the cache, which you should use if you have reason to suspect the cache is inaccurate.
Example
  1. You're looking at a user's contribs in one tab, and looking at page histories in another tab.
  2. In the histories tab, you watch the page manually by clicking the star at the top, then go back to the contribs tab.
  3. At that point, the cache of your watchlist will be missing the page you just watched, so you should clear the cache.
Qs
Why didn't I make it so any watch actions were monitored and used to keep the cache in sync?
Because there are ways the watchlist can be updated that no JavaScript can keep track of; more than there being no guarantee it would work, it'd be guaranteed to fail.
Why use session caching instead of something more permanent?
Privacy, security and because the longer it lasts, the less useful it is per the above.
Why cache the watchlist at all?
Assuming you want to look at several pages worth each of several users' contribs (especially in the hunt for sockpuppets), without caching, the watchlist would need to be recompiled from many API requests on every page load. With caching (accepting the caveat), the watchlist is requested fewer times and possibly only once (depending on other activity).
Any questions or problems - let me know. fredgandt 00:52, 16 April 2016 (UTC)
I trust your judgment! Also, I'm not too sharp with the technicals. :D Many thanks! Cyphoidbomb (talk) 01:13, 16 April 2016 (UTC)

Tech News: 2016-15[edit]

20:45, 11 April 2016 (UTC)

"Edit wars" in LZ related articles[edit]

More nonsense similar to what you addressed at Talk:The Rain Song#Edit war over cited content has been going on at "Dazed and Confused"[10], "Beck's Bolero"[11], Peter Grant,[12], and maybe others. Besides temporary RfPPs, any ideas for a longer term solution? —Ojorojo (talk) 17:51, 14 April 2016 (UTC)

  1. Don't join in, reach out to the involved editors on their user talk pages softly warning them that they are edit warring and if they continue, they may be reported to WP:ANEW.
  2. Start a related talk page section specifically to tackle the dispute (per dispute), and {{ping}} the involved editors.
  3. Leave long gaps between messages to give editors a chance to read and think, then read and think again - and again.
  4. If you have an opinion, and as far as you're concerned you're right, someone else should arbitrate.
As for long term, policies and guidelines (yawn) can be found or drawn up (very long term) to establish exactly what, where, how etc. should be in articles. I'm on the fuzzy edge at the end of a long day right now, so don't fancy searching, but maybe look for a style guide for music/song articles, and if there isn't one, consider writing one and posting an RfC at WP:VPP for wider input to bring it up to consensus. Then that can be used to settle any disputes over content.
I'll pay more attention tomorrow. See ya then :-) fredgandt 18:11, 14 April 2016 (UTC)
Let's say, for sake of discussion, that this is just the work of one or two editors who is/are seeking to draw attention. They know the ins and outs of WP and use constantly changing IPs. Whatever the sources say is secondary, so discussing facts and references will make little difference. Established policies about verifiability, improper synthesis, neutral point of view, etc. are routinely ignored as would newly established ones. With the history at LZ articles, editors avoid discussions, such as this recent RfC. A situation such as this would require a different approach. —Ojorojo (talk) 21:29, 14 April 2016 (UTC)
@Ojorojo: - I've looked and am now watching. Ugly. There's no magic bullet, but verifiability not truth applies. However, especially on Peter Grant, the users should have been warned about their warring a long time ago. If it flares up again, I'll jump on it. fredgandt 01:00, 16 April 2016 (UTC)

Idea for a new JS script[edit]

Hi, Fred! From VPT I see, you like creating some javascript scripts for others :) May I suggest a new one? I would love to have a script OK, my home Wikipedia is another one, but that shouldn't be a reason not to have one here, too, that creates redirects. I have expressed my ideas about it here. OK, I have some more ideas, but they can wait :) Thoughts? --Edgars2007 (talk/contribs) 17:25, 18 April 2016 (UTC)

Am I correct in thinking you'd like to:
  1. Land on any page
  2. Desire to create a redirect to it
  3. Use a scripted tool to create the redirect page remotely
rather than
  1. Land on any page
  2. Use a scripted tool to create a redirect from there to another page
fredgandt 17:45, 18 April 2016 (UTC)
Yes, because the second one is basically the same, what is done currently (that is, a script wouldn't save basically any time). --Edgars2007 (talk/contribs) 17:49, 18 April 2016 (UTC)
Sure. I'll ping you when it's done. Don't hold your breath - I'm working on the other thing 'till it's done. fredgandt 17:51, 18 April 2016 (UTC)
@Edgars2007: - Not done yet. It's being built under teleDirect.js (name will probably change) and isn't even the complete GUI yet. I'm pinging to let you know that it could take a while. There are a lot of variables to be accounted for, and a lot to get wrong if I'm not careful. The next ping will be when it does something useful. No need to reply. fredgandt 19:29, 20 April 2016 (UTC)
@Edgars2007: - Just letting you know I haven't forgotten (and won't). fredgandt 23:18, 28 April 2016 (UTC)

This is not in hurry, of course. I know, you currently have other work to do. Just updated dialog window. Now I understood, that I don't have to use Paint, but can use MS Access :) Those "#Name?" are meant to be "First redirect" and "Second redirect" (by default at start only first one is shown, of course). Next three buttons to them are "Delete redirect", "Add new", "Copy this redirect to a new redirect". The buttons "A", "B", "C", "D" would be images. "A" would input in last (or the one, where cursor is set, if it's not too difficult) redirect pagename, "B" - pagenamebased title, C - well, in my Wikipedia it would input enwiki pagenamebased title (if there is such), here at enwiki it could be let's say dewiki pagenamebased title, "D" - I had something in my mind, but now I forgot it, but we can come up with some idea later :) --Edgars2007 (talk/contribs) 08:03, 22 May 2016 (UTC)

Acknowledged. Mind busy; I'll be back. Fred Gandt · talk · contribs 10:55, 22 May 2016 (UTC)
@Edgars2007: Sorry - I'm all over the place right now, but your request is not forgotten; it might just be a while.Fred Gandt · talk · contribs 00:25, 18 June 2016 (UTC)

Welcome to the Teahouse![edit]

Welcome to the Teahouse Badge Welcome to the Teahouse Badge
Awarded to editors who have introduced themselves at the Wikipedia Teahouse.

Guest editors with this badge show initiative and a great drive to learn how to edit Wikipedia.

Earn more badges at: Teahouse Badges

from: Elsa Enchanted (talk) 17:37, 18 April 2016 (UTC)

Techy things.[edit]

You told me to send you a message on your talk page about helping with techy things (on Template_talk:By_whom). I would love to help with techy things (I have done quite a bit of programming, and I love tech) I don't know much about what is used on MediaWiki (WikiMarkUp—I think—, HTML, CSS—Is it used?—, and javascript—I know a bit about this—) do I need to know some of this to help? Do you have a recommendation on where I can learn? Hungryce (talk) 18:42, 21 April 2016 (UTC)

Hi. There's a lot to summarize:
Templates
Templates work by transclusion, which is a way to include parts of another page where the template is called. The content of the transclusion is limited in all the same ways as all other wiki content.
Magic Words and Parser Functions allow us to create conditional templates utilizing a limited range of variables.
Lua has been introduced, further extending the possibilities by invoking modules to process data in many ways, more efficiently and logically than without.
HTML
There are limits to what HTML can be used in wiki markup.
CSS
Although we can create stylesheets for users (including ourselves) in our user space, which can be utilized by JavaScripts or included separately, there isn't yet a way to apply CSS in pages or templates. However, there is a light at the end of that tunnel will be archived soon. We can include inline styles in accepted HTML markup, which can also be transcluded.
Every registered editor has a common.css they can edit to affect the presentation of the relative MediaWiki site, and global.css (and .js) to affect ALL the wikimedia sites you're registered on. There are also skin specific CSS and JS pages.
JavaScript
We can create user scripts for ourselves and others within our user space. The common.js is where to start, then as with CSS, further resources can be created in subpages e.g. User:Example/example.js. JavaScript can call the ever present jQuery and built in MediaWiki library, and utilise the API.
So there's some info to get you started. Please feel free to ask for more. I will respond. fredgandt 21:57, 21 April 2016 (UTC)

Disambiguation link notification for April 28[edit]

Hi. Thank you for your recent edits. Wikipedia appreciates your help. We noticed though that when you edited List of Google easter eggs, you added a link pointing to the disambiguation page Carlsbad. Such links are almost always unintended, since a disambiguation page is merely a list of "Did you mean..." article titles. Read the FAQ • Join us at the DPL WikiProject.

It's OK to remove this message. Also, to stop receiving these messages, follow these opt-out instructions. Thanks, DPL bot (talk) 10:29, 28 April 2016 (UTC)

User script request[edit]

Would it be possible to create a user script that automated the process of closing Requested moves discussions. Also, a script for accepting/declining WP:Articles for creation/Redirects requests? Thank you. Music1201 talk 23:25, 3 May 2016 (UTC)

Hi. Semi automating the closure of WP:Articles for creation/Redirects is relatively trivial, and I will happily make something for you, but Wikipedia:Requested moves/Closing instructions is a long page and the throbbing headache that accompanied the abscess in the back of my lower mandible I developed a few days ago makes it hard to muster the energy to read - so will have to wait.
I'll ping you. Fred Gandt (talk|contribs) 01:05, 4 May 2016 (UTC)
@Music1201: The first script - easy-AfC-Redirect-and-Category-Response.js is nearly done. I just need to establish the options for category request responses and weave them in. It currently outputs, to the browser console, what it would submit to the API as the section content. I'll ping again when I've finished. In the meantime, please try it and let me know if there's any problems. Fred Gandt (talk|contribs) 05:53, 7 May 2016 (UTC)
P.S. I've still got the edit response handling to do too (edit conflicts etc.). Fred Gandt (talk|contribs)
I tried the script and could not seem to get it working. After the dialog box comes up and I enter the page title and press okay it just exits the box and doesn't do anything. Music1201 talk 18:15, 7 May 2016 (UTC)
Correct. As I said above, it's not finished yet and outputs what would be submitted to the API to the browser console. It'll be finished later tonight (UTC). Fred Gandt (talk|contribs) 23:32, 7 May 2016 (UTC)
@Music1201: easy-AfC-Redirect-and-Category-Response.js is done. Everything happens behind the scenes. If you make selections, they WILL result in edits to the page, so be careful. If anything goes wrong, let me know.
I'll have a look at the other script at some point, but am really quite ill right now, and feel like curling up into a little ball and crying for my mummy to bring me soup. Unfortunately she's 250 miles away and I'm supposed to be a grown man :-( Fred Gandt (talk|contribs) 06:12, 8 May 2016 (UTC)
Thank you so much! Music1201 talk 06:18, 8 May 2016 (UTC)

Script: Copy/Paste tables from Word to Wiki[edit]

@Martinevans123: I'm adding this thread here to keep track of it. I'll let you know here when there's something to try. Fred Gandt (talk|contribs) 06:19, 8 May 2016 (UTC)

Many thanks, Fred. Martinevans123 (talk) 10:17, 8 May 2016 (UTC)
No problem. Did you see that someone linked to a bunch of tools that might do the job on your post on WP:VPT? If anything there does the job, there's little point me reinventing the wheel. Fred Gandt (talk|contribs) 11:40, 8 May 2016 (UTC)
Thanks for tipping me off. Yes, that seems to provide all I may need for now. Martinevans123 (talk) 12:39, 8 May 2016 (UTC)
Okay. Feel free to let me know if you ever need any technical things later; I like technical things :-) Fred Gandt (talk|contribs) 12:41, 8 May 2016 (UTC)
Cheers, Fred. Martinevans123 (talk) 12:43, 8 May 2016 (UTC)

Proposed deletion of List of Google easter eggs/see it[edit]

Hello, Fred Gandt. I wanted to let you know that I’m proposing an article that you started, List of Google easter eggs/see it, for deletion because I don't think it meets our criteria for inclusion. If you don't want the article deleted:

  1. edit the page
  2. remove the text that looks like this: {{proposed deletion/dated...}}
  3. save the page

Also, be sure to explain why you think the article should be kept in your edit summary or on the article's talk page. If you don't do so, it may be deleted later anyway.

You can leave a note on my talk page if you have questions. —swpbT 17:31, 13 May 2016 (UTC)

Hi. Yeah that was my error. I forgot that subpages are disabled in the mainspace. I wondered why the markup wasn't working as expected - duh. I've moved the functionality to {{see it}}, and blanked the content (except for the PROD) in the issue page.
To err is human - whoops! Fred Gandt · talk · contribs 19:26, 13 May 2016 (UTC)

My unexplaned action[edit]

Hello. I was very surprised to read your message now. I checked the history and I still do not know what happened. I did not do it intentionally, of course. Why will I remove some pages and add some another I never heared about them? I am a sysop, I do not play with such things. This particular edit has one purpose: undo revision 15495015. Why did it undo another 6 revisions (all from that one till current) - I have no idea. I am glad you found this bug (mine or editor's one, I don't know), and thank you very much for this. I did not wanted this, but still I am very sorry for troubles I made without knowing. Next time I'll know this can happened somehow and check changes even on undoing. Now I removed the redundant line manually. Thanks again. IKhitron (talk) 10:41, 24 May 2016 (UTC)

@IKhitron: I see. Well then, sorry for the grumpy tone of my message to you. It did not look like a mistake since the entries were so perfectly targeted. Very strange; these things are sent to try us!
Thanks for explaining; I feel better knowing it's unlikely going to happen again. It does highlight a potential problem that could realistically do with a solution. Perhaps fully protecting the page, and having a bot handle user requests to add and remove subscriptions? Fred Gandt · talk · contribs 11:12, 24 May 2016 (UTC)
Thank you again. I did not see any grumpy tone. Maybe because English and me are not such good friends. The solution you proposed is possible, but I can think about something much simpler: you (and maybe one or two people) add it to the watchlist. A mail that this particular page was edited should not come more than once a month, so it will not disturb. IKhitron (talk) 13:39, 24 May 2016 (UTC)
Done, but the bot option is a longer term solution with a faster response and unbiased result.
For public record: this conversation is about the tech news subscription page at meta. Fred Gandt · talk · contribs 22:16, 24 May 2016 (UTC)
Great. I did this too. IKhitron (talk) 22:34, 24 May 2016 (UTC)

Tech News: 2016-22[edit]

16:19, 30 May 2016 (UTC)

Tech News: 2016-23[edit]

20:51, 6 June 2016 (UTC)

The Template:Rfd2 RfC[edit]

Just wanted to inform you that I requested a close for the RfC. Hopefully, the RfC gets closer soon so that whatever result can be implemented. Steel1943 (talk) 13:34, 10 June 2016 (UTC)

@Steel1943: thanks for letting me know. There are several minor improvements in the new code. If the decision is made to not update to the proposed thing (brain refuses to give me the word I want), those little tweaks can still be included. Gotta take dog out. See ya later!Fred Gandt · talk · contribs 14:09, 10 June 2016 (UTC)
@Steel1943: Didn't know this was going on. I haven't been at RfD much, but I've noticed the large amount of stuff Rfd2 dumps. I recently made a simplification to {{RMassist}}, which spit out a large amount of "template guts" that cluttered requests. I made a new template {{RMassist/core}} to hold this logic (couldn't put some of it in, like anchors), and let {{RMassist}} call it (Special:Diff/725435173/725447178). Part of what made the {{RMassist}} refactor easy is that WP:RM/TR doesn't hold on to requests, unlike daily RfD pages, so transclusions don't accumulate. It looks like {{Rfd2}} has much more complicated use cases though. I don't know if this post makes me involved in the RfC (probably not) but if no one is around to close it, I possibly can if I can find the time. --Andy�W.(talk·ctb) 01:07, 17 June 2016 (UTC)
I actually went ahead and closed the RfC. Special:Permalink/725657614. --Andy�W.(talk·ctb) 02:12, 17 June 2016 (UTC)
Thanks for the heads up Andy; I now think it's worth discussing making the proposed change but adding subst: to the call to {{rfd links}}. This would add a couple of cleanups and navigation features to the fully substituted output.
I'm pretty sure AnomieBOT can handle substituting {{rfd links}} in closed requests with a little tweak, but unfortunately Anomie didn't respond to pings. If anyone (maybe myself later) wants to start a new discussion about this, Anomie should be more directly contacted for input.Fred Gandt · talk · contribs 04:52, 17 June 2016 (UTC)
No one ever actually pang me there. This edit didn't ping because pings don't happen when you're adding subsections, and pings of the bot don't notify the operator.
AnomieBOT's existing substitution code cannot handle "only in closed discussions"; doing this would require custom code specifically for RfD. If you already have a bot clerking RfD, it would likely be better to see if that bot can add the substing to its duties instead of having two bots doing different parts of it. Anomie** 13:03, 17 June 2016 (UTC)
Sorry Anomie, that whole no pangs in a new sub-section thing went under my radar (and got lost under the desk), then you and your bot came up in conversation so often I just assumed (never works out well) you weren't interested. I did you a grave injustice and must be punished. Can I haz cake? I promise I won't like it ;-)
As for if there are already bots patrolling those pages - I have no idea; Steel1943 may or Oiyarbepsy? I still think it's trivial to ask the closing editors to do it... Fred Gandt · talk · contribs 13:22, 17 June 2016 (UTC)
In my opinion, an additional bot doesn't need to be closing the discussions and day subpages at RfD: other editors do that just fine. Also, RfD already has a bot doing some of the clerking: DumbBOT. Steel1943 (talk) 13:33, 17 June 2016 (UTC)
(edit conflict) It's no big deal, I just wanted to let you know I wasn't ignoring pings. I see User:DumbBOT maintains the list of subpages at Wikipedia:Redirects for discussion#Current list, although I don't know what (if anything) else it might do there or if there are already other clerking bots. Anomie** 13:35, 17 June 2016 (UTC)
So it looks like DumbBOT operated by Tizio would be best employed if ever desired/needed/wanted.
Steel1943, the idea isn't to have the BOT closing the discussions, just substing {{rfd links}} if ever employed as earlier proposed. The discussions would still be closed as normal - manually, then the BOT would come along and subst any unsubsted instances of the links. Fred Gandt · talk · contribs 13:44, 17 June 2016 (UTC)
About your first question, I'm not sure given that the aforementioned bot operator isn't very active on Wikipedia anymore. Steel1943 (talk) 13:51, 17 June 2016 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── Actually, @Steel1943: {{Rfd top collapse}} is "transcluded but not counted" when {{subst:Rfd top}} happens. I'm assuming you don't have a problem with this, since it's behind an #ifeq check, right? --Andy�W.(talk·ctb) 21:04, 17 June 2016 (UTC)

@Andy M. Wang:, I'm not so concerned with transclusions that are enclosed in "includeonly" tags since they only have potential to "mess up" the page which it is transcluded on. But, to answer a question you asked on your closing statement: Using a bot to substitute the transclusions of {{Rfd2}} may work, but the "when" for that should be "when the page's transclusion is removed from Wikipedia:Redirects for discussion". Steel1943 (talk) 21:09, 17 June 2016 (UTC)
I've emailed Tizio, outlining the events so far, and requested that if interested, they come and join the conversation. I made it clear that this was an open request, and to feel no pressure, so if they're not keen, they may not show up (fair enough).Fred Gandt · talk · contribs 00:22, 18 June 2016 (UTC)
Hi. I took a look at the issue, and while it seems a relatively easy task, it would be a new functionality for the bot. Given the little time I can spend on this nowadays, I'd prefer not to. Tizio 08:15, 18 June 2016 (UTC)
No problem Tizio; thanks for getting back to us. We now know more than we did :-) May the clock be kind to you. Fred Gandt · talk · contribs 08:19, 18 June 2016 (UTC)
@Steel1943: See Special:Diff/663597074. {{Relist}} is used at TfD, but note how it adds a transclusion of {{resize}} when substituted. It's probably not as big a deal as {{rfd links}} because it's used only occasionally, and not on every single discussion... but just an FYI. — Andy W. (talk ·ctb) 15:42, 25 June 2016 (UTC)

Tech News: 2016-24[edit]

18:41, 13 June 2016 (UTC)

Javascript question[edit]

Hi! I have one quick question. So I have such script, that does many F->R. Is it possible to include some variable in replace text? That is, for line

sel = sel.replace( /\|(\s*)name(\s*)=(\s*)([^\n]*)/g, "|$1name$2=$3$4\n|$1origname$2=$3''$4''" );

I would like to use wgTitle instead of first $4. Easy? --Edgars2007 (talk/contribs) 06:54, 18 June 2016 (UTC)

Like
sel = sel.replace( /\|(\s*)name(\s*)=(\s*)([^\n]*)/g, "|$1name$2=$3" + mw.config.get( 'wgTitle' ) + "\n|$1origname$2=$3''$4''" );
 ? Fred Gandt · talk · contribs 07:14, 18 June 2016 (UTC)
S* :D That looked too wrong to try out :) Thanks! --Edgars2007 (talk/contribs) 07:35, 18 June 2016 (UTC)
 :-) No problem. If you're going to use that value multiple times, store it as var wgTitle = mw.config.get( 'wgTitle' ); in the appropriate parent scope. Then use it as "|$1name$2=$3" + wgTitle + "\n|$1origname$2=$3$4". Fred Gandt · talk · contribs 07:48, 18 June 2016 (UTC)
Yeah, thanks. --Edgars2007 (talk/contribs) 08:35, 18 June 2016 (UTC)

Part 2[edit]

Hi again! My next silly question. Why does this isn't working properly, that is, why padDigits('$2') returns "3", not "03"?

function padDigits(number) {
  number = number.toString();
  while (number.length < 2) number = "0" + number;
  return number;
}

sel = "1 min 3 s 1"

sel = sel.replace( /(\d+)\s*min\s*(\d+)\s*s\s*(\d+)/g, padDigits('$2') );
console.log(sel);//returns "3"

console.log(padDigits('3'));//returns "03"

Edgars2007 (talk/contribs) 07:10, 26 July 2016 (UTC)

Solution =
function padDigits( number ) {
  number = number.toString();
  while ( number.length < 2 ) number = "0" + number;
  return number;
}

sel = "1 min 3 s 1"

sel = sel.replace( /(\d+)\s*min\s*(\d+)\s*s\s*(\d+)/g, function( match, group1, group2 ) {
  return padDigits( group2 );
} );

console.log( sel ); //returns "03"
Reason = TBA (I will explain later)
console.log() the number argument inside the function, and you'll see that it's always $2 literal, rather than the matched digit(s). Fred Gandt · talk · contribs 16:42, 26 July 2016 (UTC)
As with most scripting concerns, the correct way to do something will depend on specific circumstances; there are many ways to skin a cat.
The following code will cut to the chase:
function padDigits( number ) {
  return ( number.length < 2 ? "0" : "" ) + number;
}

sel = "1 min 3 s 1"

sel = padDigits( sel.replace( /(\d+)\s*min\s*(\d+)\s*s\s*(\d+)/g, '$2' ) );

console.log( sel ); // returns "03"
When concatenating a number with a string, the number's variable type will be automagically changed to string since we can't do maths with strings, so it's assumed correctly) we mean to concatenate. Other mathematical operations including strings will try to use the strings as numbers, rather than the numbers as strings.
So there's no need to explicitly change the function's argument type, and there's no need to loop since it's only ever going to add 1 zero (or not).
The reason for the function not returning the padded 03 as expected, is that the padDigits( '$2' ) was processing the argument as a literal string, then returning it unchanged, then replace() acted on the return. We need to establish the value of the capture group before handing it to padDigits.
In my first solution, we can do all kinds of clever things to account for variable conditions, since we've got a safe zone to work in by the use of a function. The second simpler solution does exactly what you need, but has little wiggle room for development; it establishes the value from the capture group, then hands it to padDigits.
It will depend entirely on the specific circumstances as to which method suits best.
As for why replace works this way around: dunno; it just does. Fred Gandt · talk · contribs 01:13, 27 July 2016 (UTC)
Thanks for the code and explanation! Probably after some few hours searching Internet I would come to conclusion, that I have to place function in the replacement text, but... have other things to do :) In my case the first solution was the needed one, because I showed you only the essential part of my problem. The real thing looks like this. Again, thanks. --Edgars2007 (talk/contribs) 06:23, 27 July 2016 (UTC)

Part 3[edit]

One more problem/question. This time this is the script. After clicking "Rio props" in toolbar, window opens, where I can fill inputfields. What I would need, is some kind of button "Generate", which after pressing it stores all non-empty inputfields in some array/string (currently I don't care which one). --Edgars2007 (talk/contribs) 11:37, 28 July 2016 (UTC)

I haven't used the OOjs UI stuff at all, and would have to become familiar with it before I could make helpful suggestions. It will be more efficient for you to read and use the documentation, than for me to read it, so I can explain how to use it to you. It looks like you may be using the wrong type of dialog, and should perhaps employ a form inside a popup. Fred Gandt · talk · contribs 21:24, 28 July 2016 (UTC)
{{resolved}}. Found simple example with standart jQuery dialog window (now I start to know, what jQuery is :D ) and rewrote the script. I probably made it in the most unpretties way (I know, I will have to rewrite it as loop), but it works, what currently is the most important part. That means, that maybe you can put #Idea for a new JS script lower in your to-do-list, if it's not already on the last place in it :D Looks like I could try to create something usable, if not for enwiki use, then for my wiki. Anyway, thanks! --Edgars2007 (talk/contribs) 11:05, 29 July 2016 (UTC)

Tech News: 2016-25[edit]

19:14, 20 June 2016 (UTC)

User page[edit]

Hi. Is "loath ignorance" on your user page intended to be a joke? The verb is loathe, of course. --MZMcBride (talk) 19:12, 22 June 2016 (UTC)

Nope, just a lack of knowledge. Corrected; thank you. Fred Gandt · talk · contribs 19:47, 22 June 2016 (UTC)

Tech News: 2016-26[edit]

15:42, 27 June 2016 (UTC)

Tech News: 2016-27[edit]

19:45, 4 July 2016 (UTC)

Tech News: 2016-28[edit]

15:14, 11 July 2016 (UTC)

Tech News: 2016-29[edit]

12:01, 18 July 2016 (UTC)

Tech News: 2016-30[edit]

19:54, 25 July 2016 (UTC)

Tech News: 2016-31[edit]

21:48, 1 August 2016 (UTC)

Tech News: 2016-32[edit]

15:41, 8 August 2016 (UTC)

Tech News: 2016-33[edit]

19:37, 15 August 2016 (UTC)

Tech News: 2016-34[edit]

21:18, 22 August 2016 (UTC)

Tech News: 2016-35[edit]

16:01, 29 August 2016 (UTC)

Tech News: 2016-36[edit]

17:12, 5 September 2016 (UTC)

Tech News: 2016-37[edit]

18:04, 12 September 2016 (UTC)

Tech News: 2016-38[edit]

22:08, 19 September 2016 (UTC)

Tech News: 2016-39[edit]

18:07, 26 September 2016 (UTC)

Tech News: 2016-40[edit]

21:30, 3 October 2016 (UTC)

Tech News: 2016-41[edit]

20:30, 10 October 2016 (UTC)

Tech News: 2016-42[edit]

16:42, 17 October 2016 (UTC)

Tech News: 2016-43[edit]

17:39, 24 October 2016 (UTC)

Tech News: 2016-44[edit]

16:18, 31 October 2016 (UTC)

Tech News: 2016-45[edit]

23:01, 7 November 2016 (UTC)

Tech News: 2016-46[edit]

19:17, 14 November 2016 (UTC)

Tech News: 2016-47[edit]

15:33, 21 November 2016 (UTC)

ArbCom Elections 2016: Voting now open![edit]

Scale of justice 2.svg Hello, Fred Gandt. Voting in the 2016 Arbitration Committee elections is open from Monday, 00:00, 21 November through Sunday, 23:59, 4 December to all unblocked users who have registered an account before Wednesday, 00:00, 28 October 2016 and have made at least 150 mainspace edits before Sunday, 00:00, 1 November 2016.

The Arbitration Committee is the panel of editors responsible for conducting the Wikipedia arbitration process. It has the authority to impose binding solutions to disputes between editors, primarily for serious conduct disputes the community has been unable to resolve. This includes the authority to impose site bans, topic bans, editing restrictions, and other measures needed to maintain our editing environment. The arbitration policy describes the Committee's roles and responsibilities in greater detail.

If you wish to participate in the 2016 election, please review the candidates' statements and submit your choices on the voting page. MediaWiki message delivery (talk) 22:08, 21 November 2016 (UTC)

Tech News: 2016-48[edit]

21:16, 28 November 2016 (UTC)

Tech News: 2016-49[edit]

18:07, 5 December 2016 (UTC)

Tech News: 2016-50[edit]

19:29, 12 December 2016 (UTC)

Tech News: 2016-51[edit]

20:33, 19 December 2016 (UTC)

Tech News: 2017-02[edit]

19:12, 9 January 2017 (UTC)

Tech News: 2017-03[edit]

23:24, 16 January 2017 (UTC)

Tech News: 2017-04[edit]

20:15, 23 January 2017 (UTC)

User Resources[edit]

Almost all the time I click on the button to open the resource manager interface it won't open and gives me this error in my console:

Uncaught DOMException: Failed to execute 'toggle' on 'DOMTokenList': The token provided ('fg-js-and-css-manager webfonts-changed') contains HTML space characters, which are not valid in tokens.
at HTMLLIElement.<anonymous> (https://en.wikipedia.org/w/index.php?title=User:Fred_Gandt/userResourceManager.js&action=raw&ctype=text/javascript:269:25)

--TerraCodes (talk to me) 02:33, 29 January 2017 (UTC)

@TerraCodes: Hi. It looks like something (MediaWiki code) is adding webfonts-changed to the CSS classlist of your button. I've simulated the issue and got the expected result you describe. I'll fix it soon. Sorry for the inconvenience. Fred Gandt · talk · contribs 04:59, 29 January 2017 (UTC)
@TerraCodes: Hi again. I've stuck a bit of tape over the crack. Let me know if it comes unstuck ;-) Fred Gandt · talk · contribs 11:40, 30 January 2017 (UTC)
ok, thanks --TerraCodes (talk to me) 12:22, 30 January 2017 (UTC)
Its now giving me this error when I try to save Uncaught DOMException: Failed to execute 'toggle' on 'DOMTokenList': The token provided ('fg-js-and-css-manager-saving webfonts-changed') contains HTML space characters, which are not valid in tokens. --TerraCodes (talk to me) 00:11, 9 February 2017 (UTC)
The WebFonts Extension is screwing with the CSS classes in the Manager's UI. I'll apply a fix, and ping you back when it's done. Fred Gandt · talk · contribs 02:08, 9 February 2017 (UTC)
@TerraCodes: Should be fixed now. Fred Gandt · talk · contribs 02:32, 9 February 2017 (UTC)

Tech News: 2017-05[edit]

18:45, 30 January 2017 (UTC)

CSS styling in templates[edit]

Hello everyone, and sincere apologies if you're getting this message more than once. Just a heads-up that there is currently work on an extension in order to enable CSS styling in templates. Please check the document on mediawiki.org to discuss best storage methods and what we need to avoid with implementation. Thanks, m:User:Melamrawy (WMF), 09:11, 6 February 2017 (UTC)

Tech News: 2017-06[edit]

19:45, 6 February 2017 (UTC)

Tech News: 2017-07[edit]

18:06, 13 February 2017 (UTC)

Tech News: 2017-08[edit]

19:25, 20 February 2017 (UTC)

Tech News: 2017-09[edit]

19:55, 27 February 2017 (UTC)

Tech News: 2017-10[edit]

23:23, 6 March 2017 (UTC)

Tech News: 2017-11[edit]

15:25, 13 March 2017 (UTC)

Tech News: 2017-12[edit]

22:03, 20 March 2017 (UTC)

Tech News: 2017-13[edit]

14:46, 27 March 2017 (UTC)

Tech News: 2017-14[edit]

17:53, 3 April 2017 (UTC)

Tech News: 2017-15[edit]

18:35, 10 April 2017 (UTC)

Tech News: 2017-16[edit]

19:32, 17 April 2017 (UTC)

Tech News: 2017-17[edit]

16:40, 24 April 2017 (UTC)

New Page Reviewer granted[edit]

Wikipedia New page reviewer.svg

Hello Fred Gandt. Your account has been added to the "New page reviewers" user group, allowing you to review new pages and mark them as patrolled, tag them for maintenance issues, or in some cases, tag them for deletion. The list of articles awaiting review is located at the New Pages Feed. New page reviewing is a vital function for policing the quality of the encylopedia, if you have not already done so, you must read the new tutorial at New Pages Review, the linked guides and essays, and fully understand the various deletion criteria. If you need more help or wish to discuss the process, please join or start a thread at page reviewer talk.

  • URGENT: Please consider helping get the huge backlog (around 18,000 pages) down to a manageable number of pages as soon as possible.
  • Be nice to new users - they are often not aware of doing anything wrong.
  • You will frequently be asked by users to explain why their page is being deleted - be formal and polite in your approach to them too, even if they are not.
  • Don't review a page if you are not sure what to do. Just leave it for another reviewer.
  • Remember that quality is quintessential to good patrolling. Take your time to patrol each article, there is no rush. Use the message feature and offer basic advice.

The reviewer right does not change your status or how you can edit articles. If you no longer want this user right, you may ask any administrator to remove it for you at any time. In case of abuse or persistent inaccuracy of reviewing, the right can be revoked at any time by an administrator. Lord Roem ~ (talk) 18:13, 30 April 2017 (UTC)

Tech News: 2017-18[edit]

19:50, 1 May 2017 (UTC)

Tech News: 2017-19[edit]

02:25, 9 May 2017 (UTC)

What level are you?[edit]

I found your name at Category:User js (probably because you posted the corresponding userbox on your user page), in the level-unspecified list of JavaScript programmers.

I was wondering how experienced you are at JavaScript, and whether you might be interested in getting involved with developing user scripts, hobnobbing with other JavaScript programmers, and organizing and improving JavaScript articles and support pages.

We do all of that and more at the JavaScript WikiProject.

Scripts undergoing development, and the state of JavaScript on Wikipedia, are discussed on the talk page.

For an overview of JavaScript coverage on Wikipedia, see Draft:Outline of JavaScript and Index of JavaScript-related articles. For everything on user scripts, see User:The Transhumanist/Outline of scripts.

The WikiProject also organizes every resource it can find about JavaScript out there, such as articles, books, tutorials, etc. See our growing Reference library. If you know of any good ones, please add them.

If you would like to join the JavaScript WikiProject, feel free to add your name to the participants list.

Hope to see you there! The Transhumanist 16:59, 12 May 2017 (UTC)

Tech News: 2017-20[edit]

21:48, 15 May 2017 (UTC)

Re: google easter eggs[edit]

Literally all you had to do was google "flight of conchords lyrics robots"

http://lyrics.wikia.com/wiki/Flight_Of_The_Conchords:Robots

http://www.azlyrics-dot-com/lyrics/flightoftheconchords/robots.html

http://www.metrolyrics.com/robots-lyrics-flight-of-the-conchords.html?ModPagespeed=noscript

https://genius.com/Flight-of-the-conchords-robots-lyrics

--Petzl (talk) 23:06, 17 May 2017 (UTC)

As a user of Wikipedia, I do not expect to have to literally google everything claimed in this encyclopedia to verify its validity. That's what references are for. Fred Gandt · talk · contribs 00:27, 18 May 2017 (UTC)


I have given you 4 websites that all have the lyrics to the "Robots" song. The "robots.txt" used by google is an quotation of those lyrics.

Also, are you going to delete the other ones that "require citation" or are you just going to keep reverting my edits only? --Petzl (talk) 00:47, 18 May 2017 (UTC)

There's really no need or use taking this so personally. You're not helping yourself or this project. I however have been looking for a suitable reference, and think I've found one that's okay. Would you like to do the honours?
If so, add <ref>{{Cite web|url=https://getflywheel.com/layout/entertaining-code-comments/|website=getflywheel.com|title=7 entertaining comments left in code|author=Ben Stevinson|date=June 5, 2014|accessdate=May 18, 2017}}</ref> as the reference, and try to make clear that a third party has suggested that YouTube have "paid tribute"; we don't have any "official" word that they did. Fred Gandt · talk · contribs 00:58, 18 May 2017 (UTC)

Here's the definitive reference:

<ref>{{cite web|title=Flight of the Conchords Episode 1 - Sally |url=http://www.hbo.com/conchords/img/episode/lyrics_sally.pdf |publisher=HBO.com |accessdate=15 February 2012 |deadurl=yes |archiveurl=https://web.archive.org/web/20081221040620/http://www.hbo.com/conchords/img/episode/lyrics_sally.pdf |archivedate=December 21, 2008 }}</ref>--Petzl (talk) 01:48, 18 May 2017 (UTC)

New Page Review - Newsletter No.4[edit]

Hello Fred Gandt,
Wikipedia New page reviewer.svg

Since rolling out the right in November, just 6 months ago, we now have 484 reviewers, but the backlog is still mysteriously growing fast. If every reviewer did just 55 reviews, the 22,000 backlog would be gone, in a flash, schwoop, just like that!

But do remember: Rather than speed, quality and depth of patrolling and the use of correct CSD criteria are essential to good reviewing. Do not over-tag. Make use of the message feature to let the creator know about your maintenance tags. See the tutorial again HERE. Get help HERE.

Stay up to date with recent new page developments and have your say, read THIS PAGE.


If you wish to opt-out of future mailings, go here. MediaWiki message delivery (talk) 15:43, 21 May 2017 (UTC)

Tech News: 2017-21[edit]

22:06, 22 May 2017 (UTC)

Tech News: 2017-22[edit]

12:18, 30 May 2017 (UTC)

Tech News: 2017-23[edit]

19:04, 5 June 2017 (UTC)

Tech News: 2017-24[edit]

15:29, 12 June 2017 (UTC)

Tech News: 2017-25[edit]

15:44, 19 June 2017 (UTC)

Tech News: 2017-26[edit]

15:38, 26 June 2017 (UTC)

Tech News: 2017-27[edit]

15:31, 3 July 2017 (UTC)

Tech News: 2017-28[edit]

15:07, 10 July 2017 (UTC)

New Page Reviewer Newsletter[edit]

Hello Fred Gandt, thank you for your efforts reviewing new pages!
Wikipedia New page reviewer.svg

Backlog update:

  • The new page backlog is currently at 18,511 pages. We have worked hard to decrease from over 22,000, but more hard work is needed! Please consider reviewing even just a few pages a a day.
  • Some editors are committing to work specifically on patrolling new pages on 15 July. If you have not reviewed new pages in a while, this might be a good time to be involved. Please remember that quality of patrolling is more important than quantity, that the speedy deletion criteria should be followed strictly, and that ovetagging for minor issues should be avoided.

Technology update:

  • Several requests have been put into Phabractor to increase usability of the New Pages Feed and the Page Curation toolbar. For more details or to suggest improvements go to Wikipedia:Page Curation/Suggested improvements
  • The tutorial has been updated to include links to the following useful userscripts. If you were not aware of them, they could be useful in your efforts reviewing new pages:

General project update:


If you wish to opt-out of future mailings, go here. TonyBallioni (talk) 03:48, 14 July 2017 (UTC)

Tech News: 2017-29[edit]

22:59, 17 July 2017 (UTC)

Tech News: 2017-30[edit]

15:57, 24 July 2017 (UTC)

Tech News: 2017-31[edit]

21:45, 31 July 2017 (UTC)

Tech News: 2017-32[edit]

21:45, 7 August 2017 (UTC)

Tech News: 2017-33[edit]

23:29, 14 August 2017 (UTC)

Tech News: 2017-34[edit]

18:01, 21 August 2017 (UTC)

New Page Reviewer Newsletter[edit]

Hello Fred Gandt, thank you for your efforts reviewing new pages!
Wikipedia New page reviewer.svg

Backlog update:

  • The new page backlog is currently at 16,991 pages. We have worked hard to decrease from over 22,000, but more hard work is needed! Please consider reviewing even just a few pages a a day.

Technology update:

  • Rentier has created a NPP browser in WMF Labs that allows you to search new unreviewed pages using keywords and categories.

General project update:

  • The Wikimedia Foundation Community Tech team is working with the community to implement the autoconfirmed article creation trial. The trial is currently set to start on 7 September 2017, pending final approval of the technical features.
  • Please remember to focus on the quality of review: correct tagging of articles and not tagbombing are important. Searching for potential copyright violations is also important, and it can be aided by Earwig's Copyvio Detector, which can be added to your toolbar for ease of use with this user script.
  • To keep up with the latest conversation on New Pages Patrol or to ask questions, you can go to Wikipedia talk:New pages patrol/Reviewers and add it to your watchlist.

If you wish to opt-out of future mailings, go here. TonyBallioni (talk) 20:33, 24 August 2017 (UTC)

Tech News: 2017-35[edit]

22:09, 28 August 2017 (UTC)

Tech News: 2017-36[edit]

22:14, 4 September 2017 (UTC)

Tech News: 2017-37[edit]

19:15, 11 September 2017 (UTC)

Tech News: 2017-38[edit]

15:31, 18 September 2017 (UTC)

New Page Reviewer Newsletter[edit]

Hello Fred Gandt, thank you for your efforts reviewing new pages!
Wikipedia New page reviewer.svg

Backlog update:

  • The new page backlog is currently at 14304 pages. We have worked hard to decrease from over 22,000, but more hard work is needed! Please consider reviewing even just a few pages a day.
  • Currently there are 532 pages in the backlog that were created by non-autoconfirmed users before WP:ACTRIAL. The NPP project is undertaking a drive to clear these pages from the backlog before they hit the 90 day Google index point. Please consider reviewing a few today!

Technology update:

  • The Wikimedia Foundation is currently working on creating a new filter for page curation that will allow new page patrollers to filter by extended confirmed status. For more information see: T175225

General project update:

  • On 14 September 2017 the English Wikipedia began the autoconfirmed article creation trial. For a six month period, creation of articles in the mainspace of the English Wikipedia will be restricted to users with autoconfirmed status. New users who attempt article creation will now be redirected to a newly designed landing page.
  • Before clicking on a reference or external link while reviewing a page, please be careful that the site looks trustworthy. If you have a question about the safety of clicking on a link, it is better not to click on it.
  • To keep up with the latest conversation on New Pages Patrol or to ask questions, you can go to Wikipedia talk:New pages patrol/Reviewers and add it to your watchlist.

If you wish to opt-out of future mailings, go here. TonyBallioni (talk) 02:16, 19 September 2017 (UTC)

Tech News: 2017-39[edit]

15:59, 25 September 2017 (UTC)

Tech News: 2017-40[edit]

23:25, 2 October 2017 (UTC)

Tech News: 2017-41[edit]

14:21, 9 October 2017 (UTC)

Tech News: 2017-42[edit]

15:31, 16 October 2017 (UTC)

New Page Reviewer Newsletter[edit]

Hello Fred Gandt, thank you for your efforts reviewing new pages!
Wikipedia New page reviewer.svg

Backlog update:

  • The new page backlog is currently at 12,878 pages. We have worked hard to decrease from over 22,000, but more hard work is needed! Please consider reviewing even just a few pages a day.
  • We have successfully cleared the backlog of pages created by non-confirmed accounts before ACTRIAL. Thank you to everyone who participated in that drive.

Technology update:

  • Primefac has created a script that will assist in requesting revision deletion for copyright violations that are often found in new pages. For more information see User:Primefac/revdel.

General project update:


If you wish to opt-out of future mailings, go here. TonyBallioni (talk) 17:47, 21 October 2017 (UTC)

Tech News: 2017-43[edit]

18:18, 23 October 2017 (UTC)

Would you mind taking a look?[edit]

Dear Fred,

I've noticed that you know your way around JavaScript, and like helping others. I've been writing scripts to view and automate the development of outlines, and I was wondering if you would take a look to see if there is anything I could be doing better (in my programming approach, programming style, etc.). So that other programmers can follow along with how the source code works, I provide extensive notes on the scripts' talk pages.

So far, there is:

  • User:The Transhumanist/OutlineViewAnnotationToggler.js – this one provides a menu item to turn annotations on/off, so you can view lists bare when you want to (without annotations). When done, it will work on (the embedded lists of) all pages, not just outlines. Currently it is limited to outlines only, for development and testing purposes. It supports hotkey activation/deactivation of annotations, but that feature currently lacks an accurate viewport location reset for retaining the location on screen that the user was looking at. The program also needs an indicator that tells the user it is still on. Otherwise, you might wonder why a bare list has annotations in edit mode, when you go in to add some. :) Though it is functional as is. Check it out. After installing it, look at Outline of cell biology, and press ⇧ Shift+Alt+a. And again.
  • User:The Transhumanist/RedlinksRemover.js – strips out entries in outlines that are nothing but a redlink. It removes them right out of the tree structure. But only end nodes (i.e., not parent nodes, which we need to keep). It delinks redlinks that have non-redlink offspring, or that have or are embedded in an annotation. It does not yet recognize entries that lack a bullet (it treats those as embedded).

It is my objective to build a set of scripts that fully automate the process of creating outlines. This end goal is a long way off (AI-complete?). In the meantime, I hope to increase editor productivity as much as I can. Fifty percent automation would double an editor's productivity. I think I could reach 80% automation (a five-fold increase in productivity) within a couple years.

There's more:

  • User:The Transhumanist/StripSearchInWikicode.js – another script, which strips WP search results down to a bare list of links, and inserts wikilink formatting for ease of insertion of those links into lists. This is useful for gathering links for outlines. I'd like this script to sort its results. So, if you know how, or know someone who knows how, please let me know. A more immediate problem is that the output is interlaced with CR/LFs. I can't figure out how to get rid of them. Stripping them out in WikEd via regex is a tedious extra step. It would be nice to track them down and remove them with the script.

I look forward to your comments and suggestions. The Transhumanist 07:24, 26 October 2017 (UTC)

Hi. Just a quick message to let you know that I am taking notice; I'll get back to you. Fred Gandt · talk · contribs 02:54, 27 October 2017 (UTC)

Tech News: 2017-44[edit]

00:20, 31 October 2017 (UTC)

Tech News: 2017-45[edit]

18:45, 6 November 2017 (UTC)

Tech News: 2017-46[edit]

19:19, 13 November 2017 (UTC)