User talk:Paddy3118
From Rosetta Code
[edit] RC_vanity_search.py
Sad, but I like to see how my tasks are faring over time:
Archived to User talk:Paddy3118/Vanity Search
[edit] 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 ...
[edit] 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)
[edit] 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)
- http://www.stumbleupon.com/url/rosettacode.org/wiki/Ethiopian_Multiplication --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)
- 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)
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!
RANK VIEWS +/- TITLE 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)
[edit] Strange?
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)
[edit] 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 note...is 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)
- 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)
- 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)
- 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)
[edit] 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)
[edit] 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
[edit] 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)
[edit] 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:
- separating two complements of "is" ("multi-line" and "verbose"), and
- 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)
- 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:
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)
[edit] 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)
[edit] 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)
[edit] 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)
[edit] 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)
[edit] Timsort
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)
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/listsort.py 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)
[edit] 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"]andb = ["Jim", "Mary", "John", "Jim", "Bob"]should produce the result of just two strings:["Serena", "Jim"], in any order.
- 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
- 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)

