User:Drew R. Smith/Templates Archive

Template:Convert
Hi Drew,

I was just wondering what your eventual intention is for Template:Convert - I see you've been creating a lot of subtemplates for it. How will it eventually work?

Please be sure to document it using TlDoc once you've finished working on it, including a list of all subtemplates, and then add it to the list at CZ:Templates.

Also, I noticed that you've created a couple of odd pages in different languages, such as Pt:Predefinição:Convert/to(-)‎, which seem to be related to this template - for one thing, we don't have templates (or anything else) in languages other than English at present, and for another, if this page is related to the template it should be in the Template namespace.

I realise you're still working on this, so sorry for coming in in the middle... I'm just interested in what you're doing, as one of the people who currently does most template work/maintenance here.

Thanks! Caesar Schinas 07:10, 13 June 2009 (UTC)


 * The template will convert units of measurement from one to the other. Take a look at the article Gobioides broussonnetii to see the markup for using it, and you'll see what I mean. For the most part I am doing a bit of cut and paste from the wikipedia version of the templates. I am intending to change things up, especially as some of the syntax doesn't seem to be taking well here. I didn't notice any similar templates anywhere on CZ, so I figured no one would mind much.Drew R. Smith 07:20, 13 June 2009 (UTC)


 * Okay. No, no-one will mind so long as you document the template well, including all subtemplates, add it to CZ:Templates, and clean up after yourself by putting  on any templates/pages which you created and then eventually don't use. Especially the pages like the Portuguese one I mentioned above.
 * I also notice that you've copied several other Wikipedia templates - Template:Mbox, Template:Pp-meta‎, Template:Pp-template‎, and Template:Documentation‎ (there may be others I haven't noticed...).
 * Please bear in mind that we already have our own equivalent of some of these templates such as Template:Documentation, and others quite possibly have no place here - for example we do not use notices which display on the article page itself, other than speedydelete. I'm not sure what Template:Mbox, Template:Pp-meta, and Template:Pp-template‎, are - but please do look through the templates which we already have before adding more, and consider whether there is a real need for them. In general, we're trying to cut down on the number of templates rather than create more.
 * But If you reckon those templates are necessary, by all means go ahead. just be sure to document them well, using TlDoc.
 * Caesar Schinas 07:32, 13 June 2009 (UTC)
 * I'm not entirely sure how to do the documentation, but I will figure it out when I'm done with the convert template. The PP templates, and Mbox templates are actually pertaining to page protection, something I don't think we really need here, so I will speedy them when I have completed everything. I didn't realise thats what they were until I was done with it.Drew R. Smith 07:38, 13 June 2009 (UTC)
 * The documentation one is neccessary, but since you already have an equivalent, I'll just use that one. Do you now off hand what the name of it is?Drew R. Smith 07:38, 13 June 2009 (UTC)
 * Yes, it's TlDoc. You just put the whole contents of the template in  tags, then add   at the end. If you create your new templates using the form at CZ:Templates, this is all done automatically.
 * Caesar Schinas

<---Sorry, I was talking about the CZ equivalent of the Template:Documentation that I made.Drew R. Smith 07:45, 13 June 2009 (UTC)
 * Well, isn't that it? If not, what is Template:Documentation for? Caesar Schinas 07:49, 13 June 2009 (UTC)
 * You know what? I think that is it. Just a fancier version that adds a nice header to the documentation subpage... I'll speedy this one now, so I don't forget...Drew R. Smith 07:56, 13 June 2009 (UTC)

Drew, please see my experiment with the system I was talking about for this at User:Caesar Schinas/Template:Convert. There are a couple of examples of its use at the top of User:Caesar Schinas/sandbox at present. It currently only works for converting some imperial units to some metric ones, but it would be very easy to expand. Caesar Schinas 10:51, 14 June 2009 (UTC)


 * Also, another experiment which splits it up into subpages for better maintainability - User:Caesar Schinas/Template:Conv and its subpages, also currently with examples at the top of User:Caesar Schinas/sandbox. Caesar Schinas 14:04, 14 June 2009 (UTC)

Be careful!
Drew, I urge you to be very careful when editing high-use templates such as ! - your edit broke it by introducing a newline after the pipe.

Also, you are creating a vast number of templates which frankly I think are hardly ever going to be used - wouldn't it be better to wait until there is a demand rather than create them just because WP has them? Caesar Schinas 09:59, 13 June 2009 (UTC)
 * I understand that I am introducing a high number, however they are all tied together. As for demand, there were already pages that were attempting to use the convert template before I came along.
 * The point of the convert template is to simplify life for authors and editors so that instead of having to do the calculations themselves, they can simply use this template to auto convert the units.
 * I garuantee I will clean up after myself, and the end result will be that CZ is just a litte bit easier to use. Also, keep in mind that this is a wiki, not paper, so there is no need to worry that I'll "use up all the space".
 * I had no idea that I broke the pipe template. All I was trying to do was give the template a documentation so people can know what it is used for. Can you show me exactly what went wrong, and how it should have been done, so I can avoid this kind of problem in the future?Drew R. Smith 10:05, 13 June 2009 (UTC)
 * Ok, I looked at the history, and see what you changed to fix it, however I don't understand what difference that makes. Other templates add the noinclude tags on the same line, what makes that one different?Drew R. Smith 10:07, 13 June 2009 (UTC)


 * Of course, I realise that you didn't mean to break it... :-) I'm not blaming you at all; we all make mistakes - just saying be very careful on this sort of template. I usually test templates in my sandbox after editing them unless I'm certain that nothing could have gone wrong.
 * The problem was that when you added the noinclude tags and TlDoc, you introduced a newline after the pipe character and before the noinclude. I have removed this (and also put the pipe character in includeonly tags so that it doesn't show up on the template page, since there is documentation now. Please see this diff for the change I made to fix it.
 * Doh! Now I see it. Wow, that one little thing really screwed up a lot of stuff...Drew R. Smith 10:24, 13 June 2009 (UTC)
 * I realise what the convert template is for - I had actually been going to create it myself sometime, but hadn't got round to it yet. I do think that there might be simpler ways of going about it... but since I'm not sure exactly how you're doing it, I'll keep well clear of it until you've finished!
 * I don't know what most of the other templates you've created are for - they all have rather cryptic names - but in response to your point that some articles already try to use templates we haven't got; remember that this is othen because those articles are copied from WP. We usually just remove those template calls, unless we think such templates are going to be widely used.
 * Anyway, I'll try no to interfere any more until you've finished what you're doing...
 * Caesar Schinas 10:16, 13 June 2009 (UTC)


 * No no, by all means, if you have concerns, tell me. I'd rather hear them, and possibly save myself some trouble, or better yet save you some trouble, than to "go about my work peacefully". Seriously, lack of constructive criticism was one of the reasons I was looking for something other than wikipedia. They usually have pretty good work, but most users are too into there own projects to give any pointers. Unless you broke something, and then the admins are down your throat.


 * Sorry about the rant. Anyway, point being, I want all the feedback I can get. If you bring up a good point as to why I shouldn't make some templates, or why I should scrap the project, or do it another way, I'll listen. Drew R. Smith 10:22, 13 June 2009 (UTC)

(unindent) Alright, well what I had been going to suggest for convert was to use nested switches within the main template, and perhaps a couple of subpages with unit definitions, rather than subpages for each conversion. I don't know exactly how I'd go about it, but I might play around with this concept in my userspace later (I tend to develop templates in my userspace unless they're reasonably straightforward).

I hope my explanation about ! made sense. If you have any questions please feel free to ask. Caesar Schinas 10:29, 13 June 2009 (UTC)


 * I'm not sure what you mean by "nested", but everything else seemes to make sense. I wouldn't really know how to go about that either, which is why I'm just using wikipedia's design (it works for one) and tweak it once I've got it set up.
 * As for your explanation of the pipe template, you gave a good explanation, but I had to see the diff before it actually clicked.Drew R. Smith 10:34, 13 June 2009 (UTC)


 * By nested switches I mean switches inside other switches, so you might have a switch for the "from" unit and then for each possible value, a switch inside that for the "to" unit. Or something like that. But if you're happy with the way you're doing it - good! Caesar Schinas 10:39, 13 June 2009 (UTC)
 * (edit conflict)::Actually, to simplify similar templates down the road, it would be better to leave the switches out in the open. That way other templates that use similar functions can use the same switch, instead of each template having the switch burried inside it somewhere. This also makes it easier to go straight to the problem if something breaks, assuming the person looking for the problem has the syntax knowhow to know what is wrong. If something breaks, and the only repaireman doesn't have a clue, we're screwed with either system! Hopefully this helps.Drew R. Smith 10:41, 13 June 2009 (UTC)


 * Ok, my above post was a little different from what I assumed you meant by nested, but I think it still holds.Drew R. Smith 10:41, 13 June 2009 (UTC)


 * Hmmm... I think we're talking about slightly different things. I'm only talking about the actual code which is only used for that template, not stuff which is used in multiple templates. Parts which are used in many templates should, as you say, be in separate templates transcluded onto each template, so long as they will be used in enough different templates to make it worth it. But remember that the more template transclusion going on, the slower the page loads - we already have a bit of a problem with this at CZ due to the way the subpages template works. But don't let me distract you; carry on with your template and then I'll be able to see the final result! :-D Caesar Schinas 10:50, 13 June 2009 (UTC)

Break for ease of use
Actually, I am having a bit of trouble with some of the syntax. Take a look at the page I mentioned again, and you will see this:Template:Rnd/bExpression error: unrecognised word "expression" where a neat little conversion should be. I can't figure out what I did wrong, or if I missed anything. Do you know what causes a message like that?Drew R. Smith 10:55, 13 June 2009 (UTC)


 * Well, its caused by an invalid expression in an  parser function somewhere, but I couldn't say where without studying all of your new templates in depth... which would take a long time! It might be because one of the WP templates you imported relied on another which you haven't imported. This is a problem with WP templates; the tend to be so interdependent that it's hard to copy one without copying loads. I tend to start from scratch rather than copying WP templates directly, though of course I study the WP ones first to see how they work and so forth.
 * Sorry I can't be more helpful... Caesar Schinas 11:03, 13 June 2009 (UTC)
 * I figured as much, which is why I just kept plugging along hoping I would finally hit that magic template that makes the conversion pop into place. Thanks for all the help and advice.Drew R. Smith 11:05, 13 June 2009 (UTC)

I'm finally hitting some of the magic templates. Celsius, and feet work, inches works only in some instances. Its a start!Drew R. Smith 12:03, 13 June 2009 (UTC)
 * Ok, I can't go on any longer tongiht. I gotta get some sleep. I'll be back at it tommorow. The following are notes on my progress, and are more for my personal use: I have isolated the problem to a rounding/fraction issue, however the actual problem isn't located in the Template:Rnd series. WP has close to 2000 subpages for the Template:Convert series. I'm going to try to knock out as many of the actual units of measurement conversions so I can find which function templates I missed in the series.
 * One other note, I only wanted to make some key conversions, however I can see now that I will have to make every unit right from the start.Drew R. Smith 14:35, 13 June 2009 (UTC)

Conversion of units
Drew, I came to the conclusion quite a while ago that it was more difficult to import WP templates for conversion than just doing the conversions myself. I suggest that you look at these CZ articles I wrote: U.S. customary units and Fahrenheit and Rankine temperatures. For metric units, see SI. The U.S. and Belize are the only countries that have not converted to the metric system of units. In fact, there are many high school students in other countries who have never heard of the inch, the foot, Fahrenheit temperatures, etc. Milton Beychok 17:57, 13 June 2009 (UTC)
 * I'm not too worried about the difficulty in importing it. I'm already at least halfway done, and I really don't mind doing it.


 * Im not too sure what the usage of one unit over the other really has to do with it. The U.S. and Belize may be the only ones, but make up a signifcant portion of our readers (US in particular), while the only (native) english speakers who use metric would be England and some other smaller countries. I think having both units would be particularly useful.


 * It may be easier to convert it your self than to import the WP conversion templates, but conversions are a repeating phenomina while importing the templates is a singularity. I really dont mind taking on this enormous task when the outcome creates a much easeir to use CZ. I'm also importing all the documentations and instructions on how to use it, so it's not like it won't be used.


 * Cheers! Drew R. Smith 02:03, 14 June 2009 (UTC)

-- Answered your message on my talk page. Caesar Schinas 08:11, 14 June 2009 (UTC)


 * Please be cautious about inserting conversion templates when, variously, a reference is deliberately approximate, such as "roughly 100 Feet by 100 Feet", or where there may be specialized customary usage, as in many nautical movements. When I "roughly", it was my intention not to go to multiple significant figures. A conversion with two decimal places, "(30.48 metres by 30.48 metres)" simply doesn't fit the situation.


 * From sad experience at The Other Place &mdash; and I know you haven't done this here &mdash; there are places where a customary unit is used in a treaty language (e.g., 200 mile Exclusive Economic Zone), or in a nautical unit such as a nautical mile or a deadweight ton, which has additional constraints that are not expressed in a conversion. A nautical mile maps literally to angular measurement. Howard C. Berkowitz 08:05, 15 June 2009 (UTC)
 * All your nautical speak is leaving me horribly lost! However I can change it to show no decimals if that is what is needed. The way it was showing up was a big expression error, so even if the context wasn't quite right I think it still looks better than before.Drew R. Smith 08:10, 15 June 2009 (UTC)


 * Just be cautious when inserting conversion templates into military or nautical text. There may be specific reasons not to convert. A gun caliber may not be just a measurement, but a name. For example, there are articles on various types of 5 inch guns. These are not 127mm guns. In like manner, a 152mm howitzer is not spoken of as a 6 inch. Howard C. Berkowitz 08:24, 15 June 2009 (UTC)


 * In like manner, when the text speaks of "approximately" or "generally", and no decimals are used, do not add decimals.

Obviously not for the guns. That would just be silly. I've only been going through and replacing convert with a template that works. As for the specific instance where the measurement was an aproximation, I will remove the decimals. For future reference, for you or anyone else that reads this, to remove the decimals simply change "precision=x" to "precision=0".Drew R. Smith 08:31, 15 June 2009 (UTC)


 * I have fixed the problemDrew R. Smith 08:44, 15 June 2009 (UTC)


 * Drew, I've been thinking about this. First, I have never used the convert template, so, while it's possible someone else substituted it, it was never in something I wrote.


 * It didn't look better to me; it wasn't a matter of decimals or not. In the particular example, I spoke of 100 feet square as an approximation. I'd no more metricate an American football field length than I'd express a 1500 meter dash in yards.


 * Now, I freely admit I'm sensitive about this subject, to the point that it was one of the reasons that I left WP: people who would metricate as a matter of seeming religion, rather than looking at the way something was used in an article and if there might be reasons for not metricating or metricating in a footnote, using approximations, etc. As you know, guns of a given country may only use one system or the other. Even within a given country, conventions apply: while a .38 Special and a .357 Magnum might seem different diameters, they really are the same; a .357 Magnum revolver can fire both cartridges. Metricating .357 and .38 would lead to confusion.


 * In treaties, when only a metric or traditional unit is given, I use the language of the treaty, although I may put the conversion in a footnote. The reality is that people worldwide speak of 12 mile territorial limits and 200 mile Exclusive Economic Zones. There are also reasons why one does not convert traditional nautical units such as nautical miles and knots, because they are part of broader navigational systems that relate to latitude and longitude; those relationships are lost with km unless one also changes the angular measurement.


 * As it was pointed out with heat, it may sometimes be worth checking the author before making changes. I would ask that before putting conversion templates into my military and communications articles, you at least ask on the talk page. If there is no reason to stay traditional, I'll be more than happy to change. I think, however, you will find that I fairly commonly metricate, or use both systems, when I believe it to be appropriate. Howard C. Berkowitz 13:09, 18 June 2009 (UTC)


 * If you are speaking of RIM 2 Terrier, I did ask you on your talk page, and only made the actual changes in my sandbox. If that isn't what you are talking about, I'm not sure what you are talking about. After our original conversation about the guns, I didn't change any of your articles.Drew R. Smith 13:14, 18 June 2009 (UTC)


 * No, COBRA JUDY radar. Howard C. Berkowitz 13:28, 18 June 2009 (UTC)


 * Ah, that was part of the original discussion if I recall. Anyway, it was already using convert, but it was using a parameter from WP that the CZ version doesn't support. That is all I did, is remove that parameter, and when you explained that it was supposed to be a rough conversion, I changed it to reflect that by removing the decimals.Drew R. Smith 13:33, 18 June 2009 (UTC)


 * My apologies if I missed the template when I imported from WP; there were other substantial conversions but I may have missed that. In general, I avoid the use of conversion templates, at least in military and engineering, preferring to do appropriate conversions by hand. I can understand your changing a template; I would just ask that templates not be inserted without agreement, as with the Terrier. In the latter case, I'm not sure what problem it solves since I used both metric and American units, although they may well be rounded approximations rather than direct conversions. Howard C. Berkowitz 13:41, 18 June 2009 (UTC)


 * There was no problem. The only real visual difference between your hand conversions (besides being rounded) was the use of parinthesis around the second conversion. As I said in my message on your talkpage, if you wanted an exact conversion you can simply change the last parameter to 2 instead of 0. But if you prefer to do it by hand, by all means, I won't interfere.Drew R. Smith 13:47, 18 June 2009 (UTC)


 * Just to explain, the parenthesis was deliberate. If the original specification was in one unit and not converted in the primary document, I'll usually parenthesize the conversion, because it may not be official. Howard C. Berkowitz 13:52, 18 June 2009 (UTC)

If I remember correctly, your's wasn't in parinthesis. The template added them.Drew R. Smith 14:08, 18 June 2009 (UTC)

Ombox
Hi Drew,

I see you imported the WP Ombox template. Unless you object, I am going to move it to Template:Message box - at CZ we try not to use cryptic names.

I have actually been standardising the message boxes across CZ templates, with the aim of eventually introducing a template for them, so I hope Ombox is compativle with what I've been doing - I'd been going to start from scratch, and I'd still rather do so.

Also, you should check that all the documentation is applicable to CZ before importingit - the "We are deploying!" section is a case in point... :-p

Caesar Schinas 09:00, 15 June 2009 (UTC)


 * Eek. Actually Ombox was supposed to be used for the intricate template. It also has a parameter for an image. It probably won't be compatible, at least not without significant changes. Of course, "significant" is misleading, as there really isn't a whole lot of code behind it. If you want the message boxes to be standard, and without icons, I would just speedy the thing and start from scratch. If you do decide to adapt it to your needs, most of the code is actuall at ombox/core. As for the name change, I couldn't care either way. Usually cryptic names aren't an attempt to disuise the contents, but rather a byproduct of having a lot of similar templates. For instance, wp has ombox, mbox, and several other box templates that all do pretty much the same thing, except in different namespaces. Since we want message boxes to be the same across all of CZ, "ombox" should be changed to something a little easier to identify.Drew R. Smith 09:11, 15 June 2009 (UTC)


 * Alright; I might just speedydelete it and start from scratch, as you say.
 * I do understand the reasons for the cryptic names at WP - they just have too many templates. But here we try to have less. I might just call it Template:Box, and then we can have a parameter which makes it a notice box or a warning box or whatever if we want. Caesar Schinas 09:21, 15 June 2009 (UTC)

Speedydeleting Convert templates
Don't bother putting speedydelete on all those; if you can confirm that everything in Category:Subtemplates_of_Template_Convert wants deleting I'll just do it all at once with a bot. Caesar Schinas 10:58, 15 June 2009 (UTC)
 * Yeah, Everything there needs deleting. Same with Rnd and Scinote. Once your bot kills the bulk, I'll go get any stragglers (templates not covered by a category) and speedydelete.Drew R. Smith 11:00, 15 June 2009 (UTC)
 * Alright; I'll go ahead. Caesar Schinas 11:00, 15 June 2009 (UTC)
 * Sorry about all the trouble.Drew R. Smith 11:11, 15 June 2009 (UTC)
 * Okay. I think I've done all I can with the bot; speedy anything I've left. Caesar Schinas 11:19, 15 June 2009 (UTC)
 * Theres still Category:Subtemplates of Template Rnd and Category:Subtemplates of Template Scinote. I've been looking through my contribs, and I think everything else would be pretty easy to speedy.Drew R. Smith 11:22, 15 June 2009 (UTC)
 * Right; I've done the first. The second doesn't exist... Caesar Schinas 11:26, 15 June 2009 (UTC)
 * Sorry, Category:Subtemplates of template scinote. What a difference a capitalization makes.Drew R. Smith 11:29, 15 June 2009 (UTC)
 * Done that and a few others I found. Going offline now, but will be back in a couple of hours. Caesar Schinas 11:33, 15 June 2009 (UTC)
 * Ok. Again, sorry for the trouble. And thats a pretty neat little toy (your bot). I'm not even going to ask how to get one, because I already know the answer. "You'll put someones eye out!"Drew R. Smith 11:35, 15 June 2009 (UTC)

Template:Convert/doc
I've copied the old contents of Template:Convert/doc to your userspace at User:Drew R. Smith/Template:Convert/doc in case you find it useful when creating the new documentation. Caesar Schinas 13:29, 15 June 2009 (UTC)
 * Definitly. I was actually going to use it. I didn't think you were going to delete the old one though, so I was just going to edit it directly. But your way works just as well. Good night.Drew R. Smith 13:33, 15 June 2009 (UTC)

Infoboxes
Drew, Infoboxes should all use the Infobox template unless there is a compelling reason not to. (Also, there seems to be a general consensus to only include basic details in them on CZ - we use them in a very different way to WP. Not having looked in detail at the ones you've created, I don't know how much detail there is in them, but I thought I'd point this out in case you're just copying WP infoboxes.) Caesar Schinas 13:44, 18 June 2009 (UTC)
 * I think I did use the infobox template... As for the details, I did remove alot of minor crap that WP used, but if you think I should take more off, I will.Drew R. Smith 13:50, 18 June 2009 (UTC)
 * I was referring to Template:Infobox Bible Translations, in which you have not used the infobox template. I am aware that you did use it in Template:Infobox Writing system (which, by the way, should be called Template:Infobox Writing System...).
 * I'll leave it up to you what details to include; I just thought I'd let you know that we use infoboxes differently to WP, since you're new here. If you were already aware of this, forgive me.
 * Caesar Schinas 13:54, 18 June 2009 (UTC)
 * I wasn't aware, but I do hate how WP uses so many useless details in their infoboxes. You should see their article English bible. Thats the kind of thing that'll give you nightmares...Drew R. Smith 14:10, 18 June 2009 (UTC)

CZ attribution template on WP
Hi Drew, thanks for the Cz-cc-by-sa template at WP. I made this adjustment on the Template:Citizendium. If you would double check to make sure it's correct. TIA! D. Matt Innis 01:08, 20 June 2009 (UTC)
 * Yeah, that looks fine to me. I'm glad someone actually noticed the template!Drew R. Smith 04:29, 20 June 2009 (UTC)
 * Good news. It was actually brought to my attention on the constable mailbox and I had just put the cz-gfdl template on it the day before.  When I got word that there was a new template I went to put it on, and low and behold, you had been there!  For a minute, I thought I had the wrong site, but when I saw the "R." I knew it had to be you :)  D. Matt Innis 04:54, 20 June 2009 (UTC)
 * Heh, am I already that well known around here?Drew R. Smith 05:05, 20 June 2009 (UTC)
 * Sure, everybody knows you! And your the one that I had to move your account to the one with the R. and then blamed you for someone elses mistake :) I still owe you one! D. Matt Innis 05:23, 20 June 2009 (UTC)
 * Ah, I see. Well it's always nice to know someone appreciates my work. I've been on WP for quite a while longer than I've been on CZ and it seems like nobody has any idea who I am, despite frequent postings to AN/I, EAR, and the Refdesks. It's a little disconcerting (in a good way) to find out that "everbody knows me". I hope I'm well known more for my good conributions than my bad ones though.Drew R. Smith 05:30, 20 June 2009 (UTC)
 * Your work is very much appreciated here. You've caught on quickly and always seem to have such a good attitude, which far outweighs any bad contribution!  D. Matt Innis 13:28, 20 June 2009 (UTC)
 * Thanks for changing the template following my query in the forums. John Stephenson 03:34, 21 June 2009 (UTC)