User talk:TimToady: Difference between revisions

m
added a header section to the talk page.
(→‎Multiplication Table Output glitch: Nearly-there glitches are a pain!)
m (added a header section to the talk page.)
 
(21 intermediate revisions by 8 users not shown)
Line 1:
==welcome==
{{User:Short Circuit/new user greeting}} --[[User:Short Circuit|Michael Mol]] 00:23, 26 August 2010 (UTC)
 
Line 17 ⟶ 18:
 
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. --[[User:Paddy3118|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. --[[User:Paddy3118|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). --[[User:Rdm|Rdm]] 16:49, 31 August 2010 (UTC)
:: Give me some CSS that fixes the problem and I'll add it to the sitewide load. --[[User:Short Circuit|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... --[[User:Rdm|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? --[[User:Short Circuit|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 [http://unifoundry.com/unifont.html unifont] looks plausible, though I have not specifically checked its line drawing characters. --[[User:Rdm|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? --[[User:Paddy3118|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: [http://paddy3118.blogspot.com/2011/03/that-goes-without-saying-or-does-it-it.html "That Goes Without Saying (or Does It)". It didn't!]. --[[User:Paddy3118|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, '''<tt>f&.g</tt>''' means "do '''<tt>g</tt>''', followed by '''<tt>f</tt>''', then undo '''<tt>g</tt>'''". 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 '''<tt>&.</tt>''' to express this as '''<tt>buy_milk&.walk_to_store</tt>''' .
: 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 [[j:Essays/Under|computational examples]] are available on the J wiki.
: The anesthesia example suggests a name for this operation: "'''operate<tt>&.</tt>anethesia'''" reads "'''operate <ins>under</ins> anesthesia'''". Analogously, J's RMS algorithm, '''<tt>(+/ % #)&.:*:</tt>''', may be read '''average <ins>under</ins> square''' . And, by the way, the [[Averages/Pythagorean_means#J|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 ;)
: --[[User:DanBron|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. [[User:Markhobley|Markhobley]] 22:57, 23 February 2013 (UTC)
 
== [[IBAN]] ==
 
Hello,
 
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.--[[User:Grondilu|Grondilu]] ([[User talk: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;
}</lang>
:I'll let you decide if it's worth using in this task.--[[User:Grondilu|Grondilu]] ([[User talk:Grondilu|talk]]) 01:14, 19 April 2013 (UTC)
 
== Deleting spam pages ==
 
Why don't you, as most admins do on hitchwiki.org, 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... [[User:Prino|Prino]] ([[User talk:Prino|talk]]) 21:36, 7 November 2013 (UTC)
 
:I tend to do that for just that reason myself. --[[User:Paddy3118|Paddy3118]] ([[User talk: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. --[[User:TimToady|TimToady]] ([[User talk: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. [[User:Prino|Prino]] ([[User talk:Prino|talk]]) 15:33, 10 November 2013 (UTC)