Talk:Ordered words: Difference between revisions

→‎No Dictionary?: possible solution
m (→‎A bug (which was not really a bug) in Rexx solution: correct misspelling of exhausts. -- ~~~~)
(→‎No Dictionary?: possible solution)
 
(10 intermediate revisions by 4 users not shown)
Line 96:
I dare not change your program.
 
: The misspelling wasn't in the program, but the REXX language entry section header.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 23:06, 13 August 2016 (UTC)
: I had programmed the REXX example to expect a lexicographical ordered word list. I corrected the error. -- [[User:Gerard Schildberger|Gerard Schildberger]] 06:42, 14 July 2012 (UTC)
 
Line 230 ⟶ 231:
 
I don't like to use words like ''mere'' which preloads a judgement.
30% of an 20 hour run is an extra ¼&nbsp; <sup>'''1</sup>/<sub>4'''</sub> &nbsp; day (this would be in regards to that 82 million record "database").
 
I took your program ''as is'' and ran it on my isolated computer (no internet connection, no active anti-virus protection programs running, etc, it's a 3.20 GHz box and is running all four processors with five 100%-CPU-bound unrelated programs on below-normal priority), and the results are:
Line 260 ⟶ 261:
* a repetition of both invocations to eliminate snowplowing
* use of FOR instead of TO in DO loops for faster execution
* disallowing the cacheingcaching effect for "small" loops
* made invocations unique by using unique passed arguments
* eliminating piggy-backing by not using the same variables
Line 344 ⟶ 345:
These are the results for REXX exact vs. regular comparisons as per Walter's request.
 
<br>I no longer have the original ''regular compare'' vs. ''exact compare'' REXX benchmarkingbench-marking programs,
<br>but I took the (above) existing code and ripped its guts out (er, disembowelleddisemboweled it), and made a
<br>simple benchmark test out of it.
 
I soon discovered that the two versions of the '''if''' statement was being drawfeddwarfed by the
<br>overhead of the '''do''' loop, so I unrolled the '''if''' statements.
 
Just for grins, I reversed the order of the compares on every other compare, and I was
<br>somewhat surprised that more CPU time was consummedconsumed.
<br>I left that modification in the benchmark program.
 
Line 358 ⟶ 359:
<br>installed on my two computers, plus an o-o REXX interpreter:
 
::* &nbsp; R4
::* &nbsp; ROO
::* &nbsp; Regina
::* &nbsp; Personal REXX
 
<lang rexx>/*REXX*/ parse version _; say 'version:' _; say
Line 455 ⟶ 456:
<br>As with most benchmarks, I often feel that I'm leading a horse to water ...
<br> -- [[User:Gerard Schildberger|Gerard Schildberger]] 23:32, 16 July 2012 (UTC)
 
 
P.S.: &nbsp; I benchmarked the programs on an air-gap computer. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 07:02, 15 August 2018 (UTC)
 
-----
 
ooRexx Results for the above 2 programs thar surprised me (a little):
<pre>
Line 468 ⟶ 473:
</pre>
--[[User:Walterpachl|Walterpachl]] 05:16, 17 July 2012 (UTC)
 
==Ruby Golfing?==
It looks as if the last Ruby example is just a "Code golf" solution and is not idiomatic Ruby. If so then it probably shouldn't be on RC.
 
What do you think?<br>
--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 09:08, 14 August 2015 (UTC)
 
It's pretty idiomatic (would add a couple more spaces and use full words instead of chars for variables), but I agree that it ventures closer to that realm. So, I deleted it.
 
I was comparing my solution to the "short local version" of the python code. I would argue that my one line of ruby code (which I pulled) is more idiomatic than the python code for the "short local version". The python code fails to use variable names (uses single char variable names), and it leaves a dangling filehandle in the way the file is opened (should use a with..as context manager). Also, given that python is at version 3.4, the use of 2.X print statement syntax is outdated (should be a print function). In other words, I think an argument could be made that my one liner is more idiomatic ruby than the python "short local version". Perhaps that one should be updated in a similar fashion? [I don't really care, I'm just bringing it up for the sake of consistency].
 
--[[User:Jtprince|Jtprince]] ([[User talk:Jtprince|talk]]) 15:52, 14 August 2015 (UTC)
 
==No Dictionary?==
At this moment, the URL for the dictionary (http://www.puzzlers.org/pub/wordlists/unixdict.txt) is returning a 401. Is any action required to remedy this?
 
--[[User:Balrog|Balrog]] ([[User talk:Balrog|talk]]) 20:20, 14 August 2018 (UTC)
 
: Yes, it would be nice to have a (stable) version of the &nbsp; '''unixdict.txt''' &nbsp; stored somewhere on Rosetta Code, &nbsp; that way, &nbsp; any new computer programming examples would be consistent with those entered before the latest updates or changes that might have been made to the original (dictionary) file. &nbsp; Plus it would eliminate the possibility of any 401 and 404 errors, &nbsp; and the possibility of added cookies from the original host site mentioned above. &nbsp; -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 22:50, 14 August 2018 (UTC)
 
::I started to look into it, but have to stop, myself. I got as far as [http://www.puzzlers.org/word-lists this page] which states that '''some''' of the lists may be open-source. If someone finds that we could site the list here then we might then try and get a copy re-hosted; but it would have to be the exact same page or saved as a latin_1 encoded text file. (We would not want a copy to cause problems with existing code).
 
:::I successfully accessed the wordlist using the "Wayback Machine" with this URL ==> https://web.archive.org/web/20180611003215/http://www.puzzlers.org/pub/wordlists/unixdict.txt
:::I'll edit that URL into the page. If that's a mistake feel free to back out my change.
:::--[[User:Balrog|Balrog]] ([[User talk:Balrog|talk]]) 19:16, 7 June 2019 (UTC)
Anonymous user