User talk:Paddy3118

From Rosetta Code
Revision as of 18:53, 30 June 2012 by Walterpachl (talk | contribs)

Sad, but I like to see how my tasks are faring over time:

Archived to User talk:Paddy3118/Vanity Search

Vanity Search Updated

After the 4th of July RC updates, My RC Vanity Searcher needed to be updated due to HTML changes. I decided to add a modification, that shows the movement between the order a page was created in, vs the max views order called +/-.

Moved to User talk:Paddy3118/Vanity Search Updated ...

Yet more Vanity searches

Forgive me for I have sinned. It has been many months since posted my Vanity search data due to a site update causing my script to need updating, and I just couldn't be *rsed.

Poly thanks

Thanks but if you needed you see the example to get it clearer... it means the pseudocode is not too much clear:D More over, implemeting Octave solution, I've discovered it's more convenient to keep the higher power first (in the "vectors"), so likely I am going to rewrite the pseudocode ;) ... --ShinTakezou 16:31, 18 June 2009 (UTC)

Ethiopian Multiplication

Chalk one up to your vanity search; Ethiopian Multiplication has been the single biggest landing page for Sunday and Monday this week. There's been a huge influx of traffic to it via StumbleUpon. --Short Circuit 02:13, 25 August 2009 (UTC)

Yah!! (I hope the traffic is OK on your servers though)?
Lets hope some stay for a browse around the whole site... --Paddy3118 03:48, 25 August 2009 (UTC)
According to the analytics the bounce rate for stumbleupon referrals for the last three days is about 70%. So some did stay to look around. --Mwn3d 18:32, 25 August 2009 (UTC)

It is great that people are staying to look around, but I am puzzled? I can't find what is sending people to the Ethiopian Multiplication page on the Web. Any links? --Paddy3118 18:21, 26 August 2009 (UTC) --Mwn3d 18:22, 26 August 2009 (UTC)
That one mention means so many hits? Wow. I thought only /. and reddit had that kind of affect. --Paddy3118 18:48, 26 August 2009 (UTC)
Well that link is from a while ago. Someone else must have found it and put a link to that SU link somewhere else. I'm not sure how to figure out where though. --Mwn3d 18:56, 26 August 2009 (UTC)
It wasn't slashdot, digg or front-page-reddit level. Those would have resulted in tens of thousands of visits over a day. Peak traffic so far was Monday, where Google Analytics claims as much as 7.7 page views per minute. (Which is actually a bit off, as GA won't register raw, json or css page requests, so the requests would have been much more clumped, or bot edits, which it wouldn't see at all.) There were 368% more visits Monday(3,768) than the previous Monday(804). Each visit monday averaged 1.79 pages/visit, while the previous Monday averaged 3.56. These wouldn't be hard loads for most setups, but we've been riding close to the limits of the Slice under bursty loads for quite a while. I've got an offer to be pretty much the sole occupant of a 4-core Xeon box with 16GB of RAM, but It'll be a gradual transition, if it goes through at all; I won't have root, and I'm uncertain about the current admin's reaction time. Otherwise, I need to find an income source for RC. My number one desire would be to sell content-derived books, but selling t-shirts and the like, even at $5 markup each, would easily make the site pay for itself as it currently sits; Five t-shirts a month would do it. The next most likely option is a donation link, but I hate asking for handouts. And I hate banner ads even more. --Short Circuit 21:22, 26 August 2009 (UTC)

Um... I have just seen one of the last pages I created jump to the HEAD of my vanity list, and by a huge margin! After seeing the figures (below), I'm gob-smacked!

   22   7261 +31 Ethiopian Multiplication
   71   3276 +11 Knapsack Problem
   90   2910  -1 Monty Hall simulation
  104   2698  +4 Conway's Game of Life
  121   2350  +0 Anagrams
  197   1486  +1 One dimensional cellular automata
  206   1388  -4 Web Scraping
  209   1317  -2 Max Licenses In Use
  220   1263  -8 Spiral
  235   1112 +10 Y combinator
  260    994  +3 Yuletide Holiday
  261    989  -8 Sequence of Non-squares
  262    983  -2 Column Aligner
  272    928  +5 First-class functions
  288    836  -6 Data Munging
  297    814  -6 Data Munging 2
  300    803  -5 Probabilistic Choice
  304    794  +7 Bulls and Cows
  306    783  -1 Command Line Interpreter
  310    772  +4 Mutual Recursion
  338    682  +0 Functional Composition
  371    605  -5 Integer literals
  386    554  -8 Common number base formatting
  395    533  -1 Look-and-say sequence
  418    473  -9 Octal
  443    428  -4 Exceptions Through Nested Calls
  466    344  +2 Average/Simple moving average
  490    298  -2 Testing a Function
  492    297  -1 Sort stability
  524    249  -3 Select
  529    244  -1 Send an email
  562    199  -1 Topological (dependency) sort
  666    118  +3 Simple Random Distribution Checker
  678    103  +0 First-class Numbers
  680    101  +0 Seven-dice from Five-dice
  685     87  +1 List Flattening
 99999      0  -4 Russian Peasant Multiplication

--Paddy3118 04:28, 25 August 2009 (UTC)


Ethiopian Multiplication jumps to be the most popular page behind the Main Page, and I can find no evidence of a 'buzz' around it. No blog entries, no group discussions. I would have expected something more? --Paddy3118 06:55, 1 September 2009 (UTC)

It's all coming through StumbleUpon. I'd like to write a blog post on exactly what I think happened, but it's going to take a while, and I need to look into it more. A simplified explanation would be that a SU user discovered the page, liked it or reviewed it, leading to both his subscribers (and their subscribers) to see it, as well as increasing the page's general ranking in SU's page selection algorithm. This would be made easier to show if I could identify a trend around the phrase "ethiopian multiplication" in blogs and searches over the last month. The functionality is there in Google's advanced search, but it requires time and opportunity. --Short Circuit 14:33, 1 September 2009 (UTC)

Ethiopian Multiplication: Missing function names

What's the problem with the SNOBOL4? It works (I just tested it!). Is it because the half/double/even functions aren't there? I didn't write it, mind. I could tweak it to suit, but then it makes it less terse, less efficient, less SNOBOL4. --Axtens 04:32, 25 February 2010 (UTC) And can you point out where the half/double and even are in the SNUSP version? --Axtens 04:39, 25 February 2010 (UTC)

The halve add and double functions in the SNUSP example are actually where it says "halve", "add", and "double". Other languages have had to conform to the separate function requirement, so I don't think we should allow a special case for SNOBOL4. --Mwn3d 04:47, 25 February 2010 (UTC)
I purposefully turn a blind eye to the SNUSP] versions' idiosyncrasies, but that is because I treat it and Brainf*ck as like the Monster Raving Loony party in British elections - it is there, it can be a good laugh, but taking them seriously would lead to a happy dementia :-)
The problem with the SNOBOL4 is that it doesn't use the function names for functionality as expressed in the task description and followed by the other 'language' examples. --Paddy3118 05:10, 25 February 2010 (UTC)
Okay, then, I'll have a go at the SNOBOL4, unless the original author gets there first. As for SNUSP ... hmmm, show's how good I am with esolangs :\ . --Axtens 06:11, 25 February 2010 (UTC)
On a slightly related there a particular reason to insist on "function" when "routine" couple be appropriate? Take assembler languages, for example. The type of code structure offered by functions is available in any language with goto, but without explicit language support for arguments and return values. --Michael Mol 14:22, 25 February 2010 (UTC)
Hi Michael, The task refers to "functions/methods/procedures/subroutines" I guess I could have followed it by three dots: ..., but I thought most languages would be able to work out what was needed, and the problem seems to be with their omission when the language does have those facilities. I think if I point out the omission, Someone could say that their is no such construct in their language that is normally used, but I don't think it will come to that, except maybe with calculator languages that might not have named subroutines? --Paddy3118 17:46, 25 February 2010 (UTC)
I think the inclusion of incorrect code is better than no code at all, so long as there is an explicit understanding of why the code is marked incorrect, and suggestions are made for how it can be corrected. With simple removal, the unobservant and rushed (and I must count myself among these) might just see a lack or unexplained removal of code, and make the same mistake that the original contributor did. Worse, the original contributor might see the code has been removed, without understanding why. See the mess around the editing of the Proof task, for an extreme example. (I saw the creator of that task say he wished he'd never created the task in the first place, because nobody "got" the task enough to give a correct response. I'd rather avoid that degree of despondency and cynicism happening to frequent contributors.)
What it boils down to is that my reasoning isn't technical or linguistic, but rather done from the perspective of how contributors will interact with the resulting circumstances in the future. Well, that, and trying to maintain the utility of the spirit of the task without getting too focused on particular language features. Does that make sense? --Michael Mol 19:10, 25 February 2010 (UTC)
How about flagging code as incorrect and deleting it after say a month of inactivity? You give a reasonable time for corrections to be made, but eventually don't litter the page with abandoned, buggy code. --Paddy3118 21:01, 25 February 2010 (UTC)
I like the idea, but wouldn't know how to effectively automate the cleanup (or, at least, a maintain a listing of pages that require urgent cleanup). If it could be done right, though, it could be incorporated into the Unimpl page template such that "needs attention within a week" and "needs attention within two weeks" could be placed higher in the page than the general Unimpl, ENA and Omit sections. (I suppose a lot of the pain could be dealt with by having epoch deadlines, such as End-of-[Jan-Dec], and setting the deadline for each required correction to end-of-next-month. That way, we would only need twelve categories for tracking deadlines, rather than finding and parsing arbitrary timestamps.) If code goes uncorrected, it could be marked as Omitted (with an explanation given in the omit usage), or removed entirely, with a placeholder HTML comment for the next person to come along. --Michael Mol 22:03, 25 February 2010 (UTC)

Note from a HS math instructor

I forwarded you an email I got from a math instructor who was pleased to see a task that fit into his CS-into-HS-math curriculum ideas. At least, I think I forwarded it to you; I don't remember how that email address wound up in my contacts list, but it looked correct from my recollection. :) --Michael Mol 17:52, 17 April 2010 (UTC)

Michael, Thanks for forwarding it - it's great to get positive feedback from a lecturer. (Maybe the site needs a "visitors book")? --Paddy3118 01:18, 18 April 2010 (UTC)

Evolutionary algorithm

I've had the dreaded Flu the past week, and am still getting over it. To test my faculties I took a look at what tasks were requested and took on Weasel algorithm.

I wasn't quite happy with the results, and wrote that up in a blog entry. One of the commenters there, (thanks Steve), used the phrase 'evolutionary algorithm', which turned out to fit a WP page, that re-introduced me to all the proper nomenclature. I decided that a re-write using the proper terms, would then make a better RC task.

I tried to word the RC task so that people could experiment and slot in different algorithms for things like the fitness and mutation functions and I'm pleased to see that already the C language solution has done just that. (I do like the way the C is coded too; very nice).

After the coding, what gets me is the amount of controversy that was caused by such programs, especially the original quoted in a book by Richard Dawkins (that I have not read). It seems so little to be controversial about, but then I guess RD's delivery might inflame some.

--Paddy3118 04:28, 7 October 2009 (UTC)

Great little task you added here. rldrenth 7-oct-2009

Sorting Using a Custom Comparator - C# incorrect

By that measure, the ADA solution would also be incorrect? Sorting Using a Custom Comparator#Custom_Comparator.adb

Thanks, I've tried to point that out now. --Paddy3118 06:45, 20 November 2009 (UTC)

Series out of control

In reply to [1]: see [2] (ugh, what a horrific URL!). I'm not gonna change it back, because that would feel too much like edit-warring to me (and heaven forbid I should edit-war over grammar), but I think most professional editors would prefer my version. —Underscore (Talk) 20:53, 16 December 2009 (UTC)

I thought I was taught that A, B, C, and D; was to be preferred over A and B and C and D. My partner concurs? P.S. I do try to be cautious over edits, but I thought i was on solid ground. Is this possibly an English vs American English thing? --Paddy3118 21:08, 16 December 2009 (UTC)
You're quite right that "A, B, C, and D" is in general better than "A and B and C and D", but that's not the issue here. Look closer at the explication I linked to and at your own sentence. Here's the latter with the irrelevant parts removed:
This regexp is multi-line, verbose and uses named groups.
Clearly, this is equivalent to:
This regexp is multi-line. This regexp is verbose. This regexp is uses named groups.
So you see, without noticing it, you're making "and" perform two functions at once:
  1. separating two complements of "is" ("multi-line" and "verbose"), and
  2. separating two predicates of "This regexp" ("is multi-line and verbose" and "uses named groups").
This is a no-no because it leads to nonsensical implications such as the "is uses" above. (P.S. I'm American; dunno about you.) —Underscore (Talk) 23:56, 16 December 2009 (UTC)

Thanks Underscore for pointing out my error. Mea culpa. I did try your reference before, but the google book search did not show the details for some reason. I have now done my own search with your term "series out of control" and got that full explanation. I will of course change the edit. --Paddy3118 03:28, 17 December 2009 (UTC)

Edited! --Paddy3118 03:32, 17 December 2009 (UTC)
Any time. :) —Underscore (Talk) 23:43, 17 December 2009 (UTC)

Hi Paddy, I'm Wolf

Sorry to approach you like this, if I would know your preferred way of communication, I would use it. You may remember me from 19.May 2010, you send me (within minutes of my posting of inferior code) a note pointing out the problem.

I might be totally off track here, but who do you recommend to involve in a discussion about a faulty code? An AHK forum user has discovered a "misleading" pseudo-code regarding CombSort Algorithm, and I want to help fix that. My first steps were starting a discussion on Comb_sort, then posting to Village_Pump. In over a week, there was no answer, no hints for me what to do, so I decided to ask someone who keeps an eye on quality (such as yourself).

Could you please check out my example of numbers-to-be-sorted with the Python code that is posted, and kick me hard if I deserve it. I am a fairly new member here, and try to cause as little upset as possible. But there should be a procedure (informal or otherwise) to ensure a certain level of quality.

BTW, the pseudo-code is (maybe) copied from wikipedia, where it is also wrong (if I am right).

--Wolf 21:00, 26 May 2010 (UTC)

Hi Wolf, my own, sorry, excuse was that I do have some areas of algorithms that don't excite me to contribute and sorting algorithms is on the edge of that as only a few (of the many, many) sorting routines have interested me of late; and mainly because of their close links to other things that I am more interested in. I took a look and gave a tech. reply on the Talk:Sorting algorithms/Comb sort page. --Paddy3118 05:35, 27 May 2010 (UTC)

Averages/Root mean square

Regarding the edit here: What exactly does that paragraph add to the page? Isn't the final size of the executable rather irrelevant? And if it only works with a specific compiler version, there is always {{works with}}. Or am I missing something here? —Johannes Rössel 18:18, 23 June 2010 (UTC)

Sorry Johannes, I just did a minor edit of removing a single space. It's not my text. --Paddy3118 19:55, 23 June 2010 (UTC)
Argh, sorry. I'm reading too many diffs a day and MediaWiki automatically marking compete paragraphs red if only a single byte changed is a bit confusing. Apologies. —Johannes Rössel 22:57, 23 June 2010 (UTC)

The XML link

The XML link at the top of XML/Output comes from it (technically) being a subpage of XML. I looked for a bit on the MediaWiki help sites but couldn't find a way to remove it for a single page. They can be turned off for the whole site, but sometimes they're useful. --Mwn3d 01:27, 7 August 2010 (UTC)

Thanks. I'll ignore it then. --Paddy3118 01:28, 7 August 2010 (UTC)

More privs.

Use them sparingly and wisely. :) --Michael Mol 20:33, 7 August 2010 (UTC)

You must have noted my anger :-)
Thanks, I'l use them as advised. --Paddy3118 20:48, 7 August 2010 (UTC)


Have you heard of this craziness? It says Python uses it. I can't find a non-long-winded explanation of the algorithm though. --Mwn3d 21:12, 8 August 2010 (UTC)

This seems easy enough to follow. I read through it a few weeks ago. This reads easier, though. --Michael Mol 22:16, 8 August 2010 (UTC)
Hi. Yep, I remember the buzz when Tim Peters introduced it. I don't have the time to google in comp.lang.python to find the first threads after its release, but rest assured, it was heavily tested when it was released, as well as when it was adopted as the sort routine for Jython (which I could find). I have heard that it will be added as the Java sort routine too. I never did go fully into the algorithm though as sort routines give me only a little algorithm "buzz".
Another link --Paddy3118 08:26, 9 August 2010 (UTC)
I saw a link that said it was added to openjdk, but obviously that code has so much extra stuff going on to keep track of other stuff in the JRE that the algorithm kind of gets lost. Did you see something saying it would be added to the Sun JRE? --Mwn3d 12:52, 9 August 2010 (UTC)
That must have been what I saw too as I would not have known the difference. I did find this though which makes me think that it has not been ratified as yet (but neither does it seem to have been rejected). --Paddy3118 13:08, 9 August 2010 (UTC)

I have tracked down a version of timsort written in subset of Python called RPython and used for the PyPy project. I am not sure of the license but you can view it for reference by downloading from here and extracting file pypy-1.3/pypy/rlib/ out of file pypy-1.3-src.tar.bz2.

It doesn't seem like a simple sort algorithm and, no doubt, will be sensitive to small changes. --Paddy3118 11:16, 10 August 2010 (UTC)

You might contrast the Python with this Java implementation. --Paddy3118 11:20, 10 August 2010 (UTC)

The original thread (Pointing to an informative msg not at the head of the thread. --Paddy3118 13:27, 10 August 2010 (UTC)

Symmetric Difference for MATLAB

I don't understand the error you found with the MATLAB solution to the problem. It gives the proper output given an arbitrary input for sets containing arbitrary members of arbitrary types. Also, is the problem with the first example or the second?Cferri 22:40, 10 August 2010 (UTC)

Hi Cferri, its your second example and how it would work with the info in the note:
Note: If your code uses lists of items to represent sets then ensure duplicate items in lists are correctly handled. For example two lists representing sets of a = ["John", "Serena", "Bob", "Mary", "Serena"] and b = ["Jim", "Mary", "John", "Jim", "Bob"] should produce the result of just two strings: ["Serena", "Jim"], in any order.
I haven't run your ccode but you need to make sure it would give the right answer if their were these type of duplications if you are indeed implementing the behaviour on top of lists/tuples rather than a set type. --Paddy3118 02:56, 11 August 2010 (UTC)
Oh, Ok. I'll check that. Cferri 04:27, 11 August 2010 (UTC)

Filling out Rosetta Code:Add a Task

Could I get you, Rdm and Rdm to give Rosetta Code:Add a Task a thorough treatment of examination, debate and filling? Of the cross section of current users, I think you three are probably the most likely to be familiar with the general pattern and concerns of creating tasks. I added a bunch of my own thoughts in HTML comments in-line, and left a note in the talk page. --Michael Mol 17:15, 21 September 2010 (UTC)

Variations on a theme

I noticed you removed the pipe-based PowerShell solution to Ethiopian multiplication. Is that really necessary? Near as I could see, the relevant example had the necessary code, and only lacked functions demarcating the separate processes. Marking the task with Template:Incorrect might have been more appropriate, in that case. --Michael Mol 18:18, 1 November 2010 (UTC)

Umm, you're right. I was too harsh. I can do that now. I see that changes have already been made. --Paddy3118 19:44, 1 November 2010 (UTC)
Thanks for helping RC keep a positive tone. :) --Michael Mol 20:59, 1 November 2010 (UTC)

Ordered words

Please see Talk:Ordered words#Output. —Kevin Reid 18:37, 1 February 2011 (UTC)

N-Queens Edit

You edited down my (clearly overboard) output for the N-Queens problem. I'm not sure where the cutoff is but several hundred lines was obviously way too much. Sorry. I was very slightly annoyed that you completely eliminated my N=8 output, since that is the prototypical case, an 8x8 chessboard. OTOH I could have avoided the problem in the first place by showing some restraint, so I'm more annoyed at me.

In any case, I added additional code to winnow the solution sets and also to cut down the output on the largest case. The result is some what larger than your edit but still under 50 lines total, much shorter than the programs themselves. I also re-added the scrollbar to avoid taking up too much vertical real estate. Is this reasonable? --Balrog 19:57, 20 March 2011 (UTC)

Hi Balrog, sorry about not getting the edits right, I should have taken a bit more time. Instead I decided to show some of the smaller cases and the summary of the last. I had a look at your current edits and they seem fine to me. I hope this won't stop you editing - I'm still learning too! --Paddy3118 22:00, 20 March 2011 (UTC)
In general (for me at least) moving an example to a new page or adding output isn't a matter of the number of lines (we have the scrollbars to deal with that), it's about a number of bytes. We don't have super-servers here and anything we can do to lighten the load on them is good. There shouldn't be any problem with storing lots of data, but there might be problems with retrieving and sending lots of data at once. When one example starts to get into the 10KB range I usually consider shortening it or breaking it out into a new page. Like most things here, though, it's a little touchy-feely. --Mwn3d 22:18, 20 March 2011 (UTC)
Servers are fine, as is my available bandwidth. I'd be more concerned about page load times for slow and/or congested end-user connections. Similar concerns apply, of course. --Michael Mol 12:23, 21 March 2011 (UTC)

Y Combinator

Sorry if I write in a wrong place. I'm Trap D. I notice that you removed my contribution to the task Y combinator. I send a mail to U. Neumerkel to know his opinion about the reasons you gave me. If you look at my code and the code written on this page it's not exactly the same. I deduce what I think is the Y combinator of the code written on "page 106".User:Trap D 20:31 11 April 2011

I read your answer, Ok. I'm waiting for the reply of U. Neumerkel before posting my contribution again. User:Trap D 23:15 11 April 2011

My mail :


First I apologize for my bad English.

I'm fond of Prolog and I recently found this page : where you explain how to improve high order programming in Prolog with your implementation of lambda.

I was very interested by that :

lists_mod(Member, List) :-

   Me =     \X^L^R^ ( L = [X|_]
                    ; L = [_|Xs], call(R, X, Xs, R)
   Member = Me +\Xr1^Lr1^ call(Me, Xr1, Lr1, Me),
   Li     = \Lr1^P^Rr1^ ( Lr1 = []
                        ; Lr1 = [X|Xs], call(P,X), call(Rr1,Xs,P,Rr1)
   List   = Li +\Lr2^Pr1^call(Li,Lr2,Pr1,Li).

main_list(Xss) :-


main_list2(Xss) :-


I extract this code that I think it could be a Prolog Y combinator.

- use_module(lambda).

y_combinator(P, Arg, R) :-

   Pred = P +\In^Out^call(P,In,Out,P),
   call(Pred, Arg, R).

test_y_combinator :-

   Fib   = \NFib^RFib^RFibr1^(NFib < 2 ->
                    RFib = NFib
                    NFib1 is NFib - 1,
                    NFib2 is NFib - 2,
                    RFib is RFib1 + RFib2
   y_combinator(Fib, 10, FR),
   format('Fib(~w) = ~w~n', [10, FR]),
   Fact =  \NFact^RFact^RFactr1^(NFact = 1 ->
                       RFact = NFact
                       NFact1 is NFact - 1,
                       RFact is NFact * RFact1
   y-combinator(Fact, 10, FF),
   format('Fact(~w) = ~w~n', [10, FF]).

with output :

?- test_y_combinator.

Fib(10) = 55 Fact(10) = 3628800 true.

Do you agree with my interpretation ?

I publish this code on this site : It is a site about tasks to solve using languages. I solve few tasks with Prolog and I thought that I could publish this code to solve the task about the Y combinator. Of course, I gave your name for the module lambda and the link to the page above. I thought I could do that because there was a link to the code of the module lambda. This site RosettaCode decides to remove my contribution arguing that the site where is the page ( is not "non-profit", and I have not your permisssion.

Are they right ? Do you mind if I publish this code ?

Thanks anyway for your answer.

Best regards.

Joel Foutelet.

Here is the answer of Ulrich Neumerkel :

I essentially agree with you.

However, please note that I *only* transcribed the code which was originally written by Hermenengildo et al. Please refer to Reference 6.

Cordialement, Ulrich

So, I'll published my contribution with the notes of U. Neumerkel User:Trap D 14:10 12 April 2011

Ela (Y combinator)

I am not sure why you added this comment to Ela sample: "This example is incorrect. fac and fib seem to be directly recursive functions without the use (or definition), of the Y combinator. Please fix the code and remove this message."

fac and fib are clearly not directly recursive functions and use fix-point combinator which code is provided at the end of the sample. --Disregard, I misread the task.


If you really intend to mark all (hundreds of) entries that don't give output, you might consider creating a new template for that purpose. {{Incomplete}} is ill-suited.

CRGreathouse 23:24, 7 May 2011 (UTC)

Thanks CRGreathouse,
I have created a new "output?" template that looks like the following, (missing the first parameter which would be the language name):
This example does not show the output mentioned in the task description on this page (or a page linked to from here). <Optional explanatory text>. Please ensure that it meets all task requirements and remove this message.
Note that phrases in task descriptions such as "print and display" and "print and show" for example, indicate that (reasonable length) output be a part of a language's solution.

This is my first template so I read a little, then shamelessly copied from template incomplete! --Paddy3118 11:13, 8 May 2011 (UTC)
It looks good. It has already ameliorated some of my (unfortunately misdirected) anger. :)
CRGreathouse 06:20, 9 May 2011 (UTC)

In the future, it will save a lot of eyerolling if people could run some examples on codepad if they do print the output but the author just didn't add it to the example. It doesn't support every language, but it could help a little bit. --Mwn3d 20:41, 22 June 2011 (UTC)

Why Permutations/Derangements?

I wanted some info on permutations and went first to Mathworld rather than wikipedia, where the word 'deranged' stuck out and just had to be followed up!

The wp articles generalizations section mentioned anagrams which then lead to me creating Anagrams/Deranged anagrams. --Paddy3118 21:00, 14 May 2011 (UTC)

It is an awesome name for a task subject. When I saw it in the RSS feed, it caught my attention and I shared it with a couple people in the room. :) --Michael Mol 11:47, 15 May 2011 (UTC)
Who says mathematicians don't have a sense of humour :-)
--Paddy3118 11:54, 15 May 2011 (UTC)

Quaternion type


The task said "If your language has built-in support for quaternions then use it.". And I see nowhere in the task that it is required to use the form (a,b,c,d). However, the implementation in gap is incomplete : I didn't write -q, q1+q2, etc. which are trivial. But I will, I swear :o)

Toucan 08:20, 13 June 2011 (UTC)


For case 3 the function is built-in. Do you mean I have to rewrite it ? Well, why not... Toucan 09:09, 13 June 2011 (UTC)

Hi Toucan, a note explaining that it is built-in then use your built-in function would suffice. (It's amazing what languages can have in their libraries). --Paddy3118 13:21, 13 June 2011 (UTC)
I made {{eff note}} for just this occasion. --Mwn3d 13:43, 13 June 2011 (UTC)
GAP is very very good at algebra and combinatorics, so it's not too surprising to find it here. It has a huge library for almost everything about discrete mathematics. On the other hand, floating-point support is almost absent, as well as networking, and many things one would like to see in a general purpose language (which it is not, of course). See for explanations on what it really is. I *love* it for quick programs for recreational mathematics ;-)

Python discousion with now Tonyjv

You had approached me about Python code. Now I am registered. --Tonyjv 22:41, 13 June 2011 (UTC)

It's going back someways, but I think you replaced Pythons REPL input with the same code but as if it were in a file. Thereby losing the notion that the example was easy enough to develop/display output in the Python shell. In a comparison of languages, Pythons shell can be a good plus point. --Paddy3118 23:18, 13 June 2011 (UTC)

It is true, that shell is nice, but you also be carefull with difference of behaviour the IDE environment brings. You should never forget to prepare ready program to file and run it properly from OS prompt/File manager.

My expertise which brought me here for visit is anagram generation, which I used as training project for learning Python. It still makes me wonder that trying the Go language by coding my anagram program (based on fast enough philosphy), the psyco version was completely unbeatable and pypy is also terrible in file IO. Anagram result from those programs: Go

>timeit anagrams.exe "tonyveijalainen"
Name tonyveijalainen
352 candidate words found.

Version Number:   Windows NT 5.1 (Build 2600)
Exit Time:        6:29 pm, Friday, June 17 2011
Elapsed Time:     0:00:03.234
Process Time:     0:00:03.093
System Calls:     26551
Context Switches: 6836
Page Faults:      1785
Bytes Read:       1131190
Bytes Written:    173240
Bytes Other:      134532

pe 17.06.2011 18:29:01,76 C:\Go\programs

Python2.6 psyco:

>timeit c:\python26\python.exe "tonyveijalainen" >nul:

Version Number:   Windows NT 5.1 (Build 2600)
Exit Time:        6:31 pm, Friday, June 17 2011
Elapsed Time:     0:00:00.718
Process Time:     0:00:00.718
System Calls:     8946
Context Switches: 2060
Page Faults:      3696
Bytes Read:       1494996
Bytes Written:    40407
Bytes Other:      40078

pe 17.06.2011 18:31:56,20 C:\Go\programs
Hi Tonyjv, I regularly write, use, then toss away small programs written at Pythons command line shell. Especially when I am exploring other stuff and the Python is there as the support. When I need to be innovative elsewhere and keep that other train of thought. Most of the time, I make the correct call and can recall code used if I want to re-use it. Its just one point on the surface of ways of using Python - from calculator to tested, packaged, logged, configuration-managed large application. --Paddy3118 06:02, 19 June 2011 (UTC)
I agree with you on not underestimating Python speed. I have replaced a C++ application by what turned out to be a faster version in pure Python - Pythons in-built datastructures are very fast and compiled languages can't make up for bad algorithm choices. --Paddy3118 06:02, 19 June 2011 (UTC)

Minor edits

Ok, I didn't think of that ;-) Toucan 19:28, 1 July 2011 (UTC)


RC sets out to be a comparison site for whatever tools users apply the effort of comparing. One of the earliest pages I created tried to document typical invocation of a C compiler. I can't find it, now, though. --Michael Mol 11:45, 6 September 2011 (UTC)

Hi Michael, does this apply to my comment on preferably not adding detailed timings to solo program runs? If so, then maybe we need a Rosetta Code:Village Pump/Run times on examples? page to evolve some consensus? I, as you probably know, am a bit wary as you need to specify a huge amount of probably obscure information to get repeatable timings from different people and would prefer a maximum of:
  • Not mentioning stand-alone program timings that are less than two minutes and making other comments vague such as approx 5, 10 20 minutes or aprox 0.5/1/2/5 hours
  • When there are two or more solutions in the one language then mentioning just a rounded comparison i.e. X is approx. 1/2/5/10/100/1000/... times as fast as Y.
  • Discouraging timing comparisons between different languages.
  • Allowing detailed timings, if someone wants to; in the talk pages.
We don't have the infrastructure of The Computer Language Benchmarks Game, which is one of the best sites for comparing language run times, and even they tell users don't jump to conclusions.
Yeah, I jumped the gun by responding without seeing the context of your original discussion (I misunderstood it to refer to, e.g. different compilers' run-time support libraries). I agree 100%. --Michael Mol 12:45, 6 September 2011 (UTC)

Hi, thanks for the feedback! Yeah it entirely makes sense what you wrote on my talk page. Was that in reference to Hamming_numbers#Alternative_version? I only edited that section to add remarks about memory usage, and left the timing remark in, that was already there before me - it compared I thought with the subsection above it for the same language, that talks about "couple of seconds". Or was it something else? Could you give me a pointer please so I could fix it. Thanks.

OTOH I like using for testing; I think its timings could reasonably be mentioned as it's a uniform platform. Wouldn't it be neat if all code snippets added to RC had a requirement of actually running on Ideone, and be run there automatically by the system and show its produced output and times on RC pages, automatically? Say, requiring of a posting user to provide a runnable link into Ideone entry and show its text on RC, instead of plain textual posting that it is now? The code that won't run wouldn't get accepted, for one. All kinds of comparative reports could be then automatically produced via its API (it has one), etc. Just a vague thought. :) WillNess 01:05, 7 September 2011 (UTC)

RC supports several hundred lanaguages. We've got links to codepad (for a few languages), and I've got an invite from CodeEval (for a few languages) to try having them execute code by proxy. Given enough time, I can automate just about anything serverside. However, I would be shocked and awed if there were an online site like CodeEval, IdeaOne or CodePad which could handle all the languages RC has, and would add more as they show up on RC. That said, comparative performance measurement is hard and rightly criticized for technique, and I really don't expect to see it automated any time in the near future. --Michael Mol 01:30, 7 September 2011 (UTC)
Comparative performance measurement is not my primary motivation here. Mainly it would make sure the code posted on RC conforms to the task spec, and output is shown (if specified in task description). But showing times automatically is also nice, and also knowing they are all tested on same platform so the OS/PC specs/ etc. differences are taken out of the picture. The languages that aren't supported would be postable as they are today, as text source not executable source. The execution platform for every executable code snippet would be clearly identified, so if one runs on Codepad and another on Ideone, that would be clearly seen by anybody.
When testing different solutions in the same language it would indeed let us compare algorithms performance. For an example take a look at this, at the bottom. I've ran all the tests for all the code snippets in there manually at that entry, and manually gradually inserted the timings back into the source comments; to have this kind of thing done automatically would be awsome and ensure all timings are true and current. There is a tool in Haskell that would run (client-side) tests and take statistical measurements automatically, but I can't remember how it's called right now. :) WillNess 10:03, 7 September 2011 (UTC)
Hi WillNess, apart from the need to support a vast array of languages, I think comparative timings would skew the examples to produce faster code as a kind of unwritten extra task requirement. Fast code is often un-idiomatic for a language and we hardly ever state what is fast enough in tasks which is very important when timing code. Being the fastest is pretty meaningless in itself - The fastest may not be fast enough; the fastest could be too fast, if the system expects to wait a certain time for a component to finish; the fastest might be too hard to maintain; the fastest might take to long to develop... --Paddy3118 11:46, 7 September 2011 (UTC)
If you'd like to compare algorithmic efficiency, there are probably better ways to do it that clock time. For example, have key, regularly repeated aspects performed by a function which pokes an accumulator, and count how many times the function was called. That puts focus on the algorithm, and not on shortcuts and optimizations that detract from code clarity. --Michael Mol 13:42, 7 September 2011 (UTC)
As for showing output, as I noted, CodeEval has offered to provide an execution environment for at least some of the code snippets. I will eventually get that working in an automated fashion, and I hope to define and implement some kind of API to allow any language community to offer an execution environment for RC's use. --Michael Mol 13:42, 7 September 2011 (UTC)
I hope to define and implement some kind of API to allow any language community to offer an execution environment for RC's use
Oooh! I like the sound of the API route. You can get timings if you want; but they don't have to appear by default. Mind you, People love to optimise for runtime for some reason, so it will always be hard to control - Maybe a warning about the normal optimisation being for idiomatic code whenever you select to generate run times...? --Paddy3118 15:36, 7 September 2011 (UTC)
"You can get timings if you want; but they don't have to appear by default. " Cool. This could be done also with kind of collapsable sections. Users would click on "Show" to actually show what is there. The contents could be cached so each user's click wouldn't cause the actual run each time, but only say once a month or after a change was made. WillNess 12:40, 9 September 2011 (UTC)
(I don't have a pony in this race, but already has an API, or so they say.) Yes, there is a danger of the race for speed, but I think naturally we'd just end up with several versions for same task/language combo. The more the merrier. :) Kinda like Hamming_numbers#Haskell which now has three versions - nicest, simplest and fastest. I prefer to know more, not less, to have more information, not less information. If it's misleading, then we'd need to expound some more on that in each specific case. And if someone views this as a competition between languages, it's their choice. But if not to compete, then at least to compare, right? It may not be as clearcut as comparing timings, but timings are still a part of comparison. If some task is 10 times slower on language X, I want to know about it, and if it's 100 times shorter and faster to develop I want to know about that too. WillNess 17:21, 7 September 2011 (UTC)

Overwrote my responses.

You overwrote my responses on User talk: Please fix, so we don't have an edit conflict again? --Michael Mol 19:27, 20 September 2011 (UTC)

Yea, I just posted the fix and got your message. Sorry. Should be OK now. --Paddy3118 19:30, 20 September 2011 (UTC)


I see that you're a 'crat; would you delete this file?

I inadvertently uploaded it with a typo. The correct version is at File:Langton-pari.png.

CRGreathouse 02:04, 28 November 2011 (UTC)

It's gone :-)
--Paddy3118 05:00, 28 November 2011 (UTC)
Thanks! CRGreathouse 18:55, 28 November 2011 (UTC)


"If you're ever looking for a template, try Category:Example attention templates and Category:RCTemplates first."

- Thanks -Mwn3d

There's this nifty page too. --Mwn3d 20:06, 5 December 2011 (UTC)


Just wanted to say thanks for being hot on dealing with spam. At this point, I have to think RC is a specific target by spammers. I'll find time to deal with it, it's just slow going right now. --Michael Mol 20:17, 23 May 2012 (UTC)

You're welcome. They're not! --Paddy3118 21:41, 23 May 2012 (UTC)

Empty Program Thanks for fixing --Walterpachl 18:53, 30 June 2012 (UTC)