User talk:TimToady

From Rosetta Code


Welcome to Rosetta Code! I'm Mike, and I noticed you created an account.

Some quick things you should be aware of:

Template:Mylang Helps you show what languages you're familiar with, and helps us become aware of skills with languages we haven't seen.
Category:Unimplemented tasks by language A place to find tasks missing solutions in various languages.
Blogs, twitter, facebook... We have them, and are interested in yours.
Special:Webchat Logs you into #rosettacode on the Freenode IRC channel. Not usually the most active communications medium, but occasionally helpful. It's logged at
Rosetta Code:Village Pump A general Q/A and discussion area.
Rosetta Code:Finances For most of Rosetta Code's history, expenses have been paid out of my pocket. I can't afford that much longer, and so you can see the state of Rosetta Code's finances, and how you may help. If you enjoy or are excited about the site, please consider reading through it.

Sorry for the boilerplate; it can be a bit difficult giving an individual greeting to each person. If you post information about your technical interests and background, I'll probably read it. If you already have put that kind of information on your user page, I probably already have; I'm always interested in how people do and can benefit from Rosetta Code. --Michael Mol 00:23, 26 August 2010 (UTC)

Multiplication Table Output glitch

You might want to check this output. The axis '+' is off. --Paddy3118 03:50, 27 August 2010 (UTC)

Hi Tim, i see you've made an edit, but the problem persists. I'll go into it a little more:
I see the following:
<lang> x┃ 1 2 3 4 5 6 7 8 9 10 11 12
  1┃   1   2   3   4   5   6   7   8   9  10  11  12</lang>
When I think it should be:
<lang> x┃ 1 2 3 4 5 6 7 8 9 10 11 12
  1┃   1   2   3   4   5   6   7   8   9  10  11  12</lang> 
I think you may have a field width off by one or two too many? --Paddy3118 04:06, 27 August 2010 (UTC)

Hi again, I see you made another edit. I checked the Python entry which uses Unicode characters for the table but shows the output under the lang tag. I temporarily edited the Perl 6 output to show what happens when the output uses lang python, and it still looked 'off'. All I can suggest is to look at the output of the Python or other examples that seem to have the output you are after and compare the outputs character-by-character to find out what is happening. --Paddy3118 05:55, 27 August 2010 (UTC)

I don't think my output is off. It works fine in my browser, and in my constant width terminal screens from which pasted the output. $width is 3, and that's how many ━ characters it is supposed to be putting out, and that's how many it is putting out before the ╋. I wonder if your font widths are off somehow in your browser. --Larry

Hi again. What I have found is that on both IE8 and Mozilla 3.6.8 on Windows XP I find the dash that you use to much longer than the space or any other character as they are supposed to be displayed in a mono-spaced font, and indeed, the body of the table is indeed correctly and equally mono-spaced. The dash you use shows up as too long. The non-ASCII dash used in the Python example is of the correct and equal size??? I'll copy this to the appropriate talk page for other input. --Paddy3118 18:39, 27 August 2010 (UTC)

I agree that this is a style issue (or perhaps a character selection issue). When I copy and paste your first example, above, into a fixed with editor window (one that can deal with unicode characters), the formatting looks right (even though it looks wrong in my browser). --Rdm 16:49, 31 August 2010 (UTC)
Give me some CSS that fixes the problem and I'll add it to the sitewide load. --Michael Mol 16:59, 31 August 2010 (UTC)
I do not know how to write the css that would fix this problem. That said, perhaps the issue could be avoided by using the "normal" line drawing characters instead of the "bold" line drawing characters. In other words, using unicode 9472 instead of unicode 9473, 9532 instead of 9547, 9474 instead of 9475, and so on... --Rdm 17:23, 31 August 2010 (UTC)
Shouldn't monospace fonts be the same cell size regardless of weight and oblique properties? Is there a good monospace font out there (of appropriate license) I could use as a webfont? --Michael Mol 18:04, 31 August 2010 (UTC)
There are a lot of issues here (with browsers I think you pick a default font and the browser might use a different font for characters not available in the default font). Anyways unifont looks plausible, though I have not specifically checked its line drawing characters. --Rdm 18:38, 31 August 2010 (UTC)

Suggest Tasks Favourable To Perl 6?

Hi Larry, after writing so many Perl 6 examples, I wondered if you had any suggestions for new tasks that might round out the tasks available on RC? --Paddy3118 16:04, 31 August 2010 (UTC)

On "That Goes Without Saying (or Does It)"

I liked the use of RC. Not much the language comparisons made (especially against Python ;-), although it was good to see how Perl 6 did things. A longer review is here: "That Goes Without Saying (or Does It)". It didn't!. --Paddy3118 07:37, 12 March 2011 (UTC)

I also enjoyed the presentation (which I found through Paddy's blog). In the spirit of your talk, I thought it might be worth pointing out that one of the things that J "doesn't make you say" is how to clean up after yourself. Which is one of the reasons (among others) that J's RMS algorithm is so much shorter than Perl6's.
In effect, f&.g means "do g, followed by f, then undo g". For example: "fetch some milk" means "walk to the store, buy some milk, and unwalk to the store", except the return trip is implied. In J, we would use &. to express this as buy_milk&.walk_to_store .
This pattern is ubiquitous in real life and in computing. To lay pipe, you dig a trench, lay the pipe, and fill the trench. To wash the dishes, you fill the sink, apply soap, scrub, rinse off the soap, and empty the sink. To perform surgery, you anesthetize the patient, cut him open, fiddle his bits, sew the cuts, and wake him up. To become a Perl programmer, you're born, you learn Perl, and you die. Some computational examples are available on the J wiki.
The anesthesia example suggests a name for this operation: "operate&.anethesia" reads "operate under anesthesia". Analogously, J's RMS algorithm, (+/ % #)&.:*:, may be read average under square . And, by the way, the harmonic mean is "average under reciprocal" and the geometric mean is "average under log".
So perhaps Goldilocks should consider throwing off her blankets, crossing the room, and getting under the covers with us J guys :) (Or maybe you should implement &. in Perl6. You stole all our other good ideas anyway ;)
--DanBron 23:43, 6 November 2012 (UTC)

coercive/generic string comparisons

Hi Tim. It might be that my brain is busted tonight, but I am not getting that coercive/generic stuff. Could you provide an example of each? Don't worry if not, I will keep searching. Cheers, Mark. Markhobley 22:57, 23 February 2013 (UTC)



I've seen your change on IBAN and I wondered if it was possible to define it as a SubSet of Str. I don't know much about SubSet but I thought it might be a nice use-case, as a IBAN could be entered as a string literal and be considered as an IBAN kind of automatically.--Grondilu (talk) 00:13, 19 April 2013 (UTC)

Hi. Me again. I've just realized it's actually easy to do:
<lang perl6>subset IBAN of Str where -> Str $iban is copy {
   my %len = <
       AD 24 AE 23 AL 28 AT 20 AZ 28 BA 20 BE 16 BG 22 BH 22 BR 29 CH 21
       CR 21 CY 28 CZ 24 DE 22 DK 18 DO 28 EE 20 ES 24 FI 18 FO 18 FR 27
       GB 22 GE 22 GI 23 GL 18 GR 27 GT 28 HR 21 HU 28 IE 22 IL 23 IS 26
       IT 27 KW 30 KZ 20 LB 28 LI 21 LT 20 LU 20 LV 21 MC 27 MD 24 ME 22
       MK 19 MR 27 MT 31 MU 30 NL 18 NO 15 PK 24 PL 28 PS 29 PT 25 RO 24
       RS 22 SA 24 SE 24 SI 19 SK 24 SM 27 TN 24 TR 26 VG 24
   $iban ~~ s:g/\s//;
   return False if $iban ~~ m/<-[ 0..9 A..Z a..z ]>/;
   my $country = $iban.substr(0,2).uc;
   return False unless %len{$country} and $iban.chars == %len{$country};
   $iban ~~ s/(.**4)(.+)/$1$0/;
   return $iban.subst(:g, /\D/, { :36(~$_) }) % 97 == 1;


for 'GB82 WEST 1234 5698 7654 32',

   'gb82 west 1234 5698 7654 32',
   'GB82 TEST 1234 5698 7654 32'


   say $_ ~~ IBAN;


I'll let you decide if it's worth using in this task.--Grondilu (talk) 01:14, 19 April 2013 (UTC)

Deleting spam pages

Why don't you, as most admins do on, replace the "Content was" with just one word, "Spam" to stop links still appearing on the site in the "Recent Changes" page?

My €0.02... Prino (talk) 21:36, 7 November 2013 (UTC)

I tend to do that for just that reason myself. --Paddy3118 (talk) 22:37, 7 November 2013 (UTC)
Well, I asked about that very thing a year or two ago on IRC, and was told those links aren't a problem due to the way the robots worked. But if that is not the case (or is no longer the case), I can certainly be more careful. --TimToady (talk) 08:30, 8 November 2013 (UTC)
Also, about spammers, you might want to start blocking them pro-actively, there may come a moment that you will suddenly be flooded with spam from morons that registered six months ago, on hitchwiki we have (OK, the boss has) also installed the "Cleanup Recent Changes" plugin that allows you to flip the "bot"-bit, turning the removal of spam pages and the blocking (together with registration) of (potential) spammers into bot-edit that no longer show up in the "Recent Changes" page, making it a lot more useful. Prino (talk) 15:33, 10 November 2013 (UTC)