User talk:Petelomax: Difference between revisions

m
 
(23 intermediate revisions by 5 users not shown)
Line 225:
real 0m44,996s
</pre>
: Note sure what to make of "mean power". All I did to test mine was save the last thing found, then use gmp to independently generate that power of 6 and prove that final digit string did indeed occur somewhere in it. I transpiled it to JavaScript (am actively working on that technology and have not yet released it) and that took 13mins 10s for the 10,000,000 run, 35s for a 1,000,000 run. AH: have you just fixed this now? --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 16:35, 9 April 2021 (UTC)
::Hello Pete,<BR>now I understand, how you solved the task.Your version of PHIX takes 1m14s on my computer.<BR>I translate the principle into pascal with a small optimization to jump over the first already found numbers.Especially for many digits it brings a speedup.11s downto 9s for 10,000,000 aka 7 decimal digits
 
==congrats==
 
Congratulations on singlehandedly occupying the top slot in Rank Languages by Popularity - I raise a metaphorical glass to you. :-)
 
:Thanks!
 
Also thank you for pointing out my typo in Self Hosting Compiler #Quackery.
 
I noticed that in Josephus problem, you listed Quackery amongst the unclassified. FYI, I would classify it as "sliding queue". [[User:GordonCharlton|GordonCharlton]] ([[User talk:GordonCharlton|talk]]) 07:39, 6 June 2021 (UTC)
 
:Have reclassified it, thanks. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 12:47, 9 June 2021 (UTC)
==example for LiveCode==
Hello, Pete. I’m Dick.
 
While making my first wiki contribution, I mistakenly deleted the LUA entry. I apologize for causing you work, and thank you for doing it.
 
I meant to delete the previous code for LiveCode because it does not address the task at hand. The old code fails to apply pattern matching beyond just exactly matching the file’s extension.
 
Talk:Walk a directory/Recursively contains a restatement of the task:
 
Walk a given directory tree, calling a function for every filename which matches a given wildcard, UNIX glob, or regex pattern (whichever is easiest for the given language).
 
The old code therefor adds noise to Rosetta Code, reducing the signal-to-noise ratio, degrading rather than enhancing the value of the site.
 
But my concern seems to me to be way below the thoughts of the contributors to the Talk. It hasn’t been updated since 2017. Do you still advise me to seek counsel there about this edit?
 
:No problem, everyone has to start somewhere. First, you can safely assume that if you reply on your talk page then whoever wrote a message there has that page on their watchlist and will get an email notification, just as you will when I post this reply (unless you unchecked "Watch this page" when you made this post). Also, all updates appear on [[Special:RecentChanges]] so I, and any moderators, would see any change to the talk page alongside changes to the task page, and of course that is how I spotted yours. It is not a case of "getting permission" or usually even agreement, but a statement of "why I did it" (brief being better). Please pay attention to the "Summary:" when you edit. You left it as <nowiki>‎{{header|LiveCode}}</nowiki> which is not any kind of crime but often not any kind of help either (that '''and''' five more words being best). When such an explanation will not fit in the summary and does not belong being left permanently on the task page, it belongs on the talk page, even unread. Not every change needs all that, but when I delete someone elses code it is only being civil to explain myself. It is quite helpful to show the output, so when you do update [[Walk a directory/Recursively]] I'll expect to see that. I'll add that the above attempt does not actually explain to me what you fixed, different output probably would. Lastly you need to learn to sign your comments by adding <nowiki>--~~~~</nowiki>. Any further questions? --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 14:18, 17 November 2021 (UTC)
thanks for the advice, Pete. My every attempt to edit the Summary failed to produce a lasting result. What's the trick?
<nowiki>--~~~~</nowiki>
:The summary only ever appears on the History/Recent Changes reports and are fine for [[Walk a directory/Recursively]]. Also I used <nowiki><</nowiki>nowiki<nowiki>></nowiki> to show you what <nowiki>--~~~~</nowiki> should look like when you type it, but you should only key the 2+4 characters shown and omit the nowiki tags. --[[User:Petelomax|Pete Lomax]] ([[User talk:Petelomax|talk]]) 17:57, 30 November 2021 (UTC)
Thanks again, Pete. Is there a basic training document you recommend? --Dick Kriesel 23:23, 30 November 2021 (UTC)
 
==Update to D for Bézier intersections==
You might like to know there was a bug in the translated-from D code that I kind of knew about but it actually shows up if you merely divide the tol by 10. It previously appeared in the Modula-2 code (which is similar to the D) and I used the same crude remedy. I figure crude remedies probably are best, anyway, when you are working in floating point. --[[User:Chemoelectric|Chemoelectric]] ([[User talk:Chemoelectric|talk]]) 12:33, 7 June 2023 (UTC)
 
If one really, really, really wanted to isolate the intersections BTW, go about it this way: implicitize one curve in exact arithmetic. Plug in the other in exact arithmetic. Break the quartic into square-free polynomials, in exact arithmetic. Now you can isolate the roots into intervals, exactly, and also know their multiplicities. :) --[[User:Chemoelectric|Chemoelectric]] ([[User talk:Chemoelectric|talk]]) 12:38, 7 June 2023 (UTC)
 
==I wrote a Phix==
I wrote a second implementation of [[Bézier_curves/Intersections]] in Phix. It uses "unique" in a way I think will function correctly enough but about which it will do no harm if you come up with a more "fuzzy" alternative. :) (I’m thinking of writing a Scheme implementation that does essentially what the "unique" does but does it by making endpoint checks a separate matter. [If two floating point numbers are equal, for instance because copied from the same source, they are equal, no matter what talking heads say!] Also adding an absolute tolerance besides the flatness tolerance. And then moving on to Bézier clipping, because I’ve never completed an implementation of intersections using that. Or implementing my algorithm but for cubics, as a side project.) --[[User:Chemoelectric|Chemoelectric]] ([[User talk:Chemoelectric|talk]]) 11:38, 12 June 2023 (UTC)
:Yes, unique() only eliminates binary-exact [nested/all] floats, so I'd just write any such "fuzzy" filtering like this:
sequence t_pairs = unique (find_intersections (p, q, flatness_tolerance))
for i=length(tpairs) to 2 by -1 do
if fuzzy(tpairs[i],tpairs[i-1]) then t_pairs[i..i] = {} end if
end for
:<small>(Obviously the "by -1" ensures that deleting t_pairs[i] does not mess up any subsequent indexing.)</small><br>
:Note there may also be some cases where the natural sort order (on which unique is based) is not good enough, such as {{0.51,0.71}, {0.515,800}, {0.52,0.71}} where the first and last are "fuzzy-same" but the middle one clearly ain't. Rounding things before throwing them at unique() might perhaps prove better, or a full inner "j=i-1 to 1 by -1" might be needed, or maybe even replace unique() with a couple of sorts, first eliminating t_pairs sorted by X then doing the same sorted by Y. --[[User:Petelomax|Petelomax]] ([[User talk:Petelomax|talk]]) 16:41, 12 June 2023 (UTC)
::Since you have clearly now actually used Phix, there is a semi-related short [https://docs.google.com/forms/d/e/1FAIpQLSecar5T7_wDKkn2oG1yTPC3twBM6G5FtkR2BrMjOWlUUcdDyw/viewform survey] (as announced to me on [https://openeuphoria.org/forum/137884.wc?last_id=137926 this thread]) I thought I might invite you to fill out if interested, no worries if not. --[[User:Petelomax|Petelomax]] ([[User talk:Petelomax|talk]]) 03:37, 15 June 2023 (UTC)
 
==Legacy view==
I've just switched back to the 14-year-old legacy view, what a relvelation! The final trigger point was that stupid ''(really stupid)'' thing it does with the sidebar, whereby as you scroll (mousewheel) down and it hits the bottom, it scrolls the right panel a smidge and jumps the side panel all the way back up to match it, ''very annoying''. With the old style it all works so much more smoothly. Anyway, happy new year! --[[User:Petelomax|Petelomax]] ([[User talk:Petelomax|talk]]) 23:56, 1 January 2024 (UTC)
7,794

edits