Talk:Price list behind API: Difference between revisions

From Rosetta Code
Content added Content deleted
 
mNo edit summary
 
(4 intermediate revisions by 3 users not shown)
Line 4: Line 4:


--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 12:12, 25 November 2020 (UTC)
--[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 12:12, 25 November 2020 (UTC)

==Border case==
What would non overlapping look like if there were, say, 8000 items with the same price
(random would allow for this)? --~~
<br><br>(Please fix signing of above, thanks).

:I forgot how to do that Walter

:Nice corner case. The original Python generates a lot ff increasing x to x+1, zero count ranges and would likely end by skipping items and printing Whoops.

:I have added/will add a Python assertion to fail on the first zero count range foundas it's better to fail early.

:Thanks. --[[User:Paddy3118|Paddy3118]] ([[User talk:Paddy3118|talk]]) 06:40, 30 November 2020 (UTC)

==Very poor name==
What is the significance of them being prices? What is the significance of them being "behind an API"? I can't see why either has '''any''' meaning to the task. Yeah, yeah, Stackoverflow question, yada, yada, yada. Would probably be better something like "Bin by range" or some such. Also, what difference does it make if the units are specifically pounds? (No pence!) How about if they were [https://theoffice.fandom.com/wiki/Stanley_Nickel Stanley nickels]? How would that change the problem? --[[User:Thundergnat|Thundergnat]] ([[User talk:Thundergnat|talk]]) 12:32, 29 November 2020 (UTC)

Latest revision as of 09:14, 30 November 2020

Inspiration

Adapted from this Stack Overflow question.

--Paddy3118 (talk) 12:12, 25 November 2020 (UTC)

Border case

What would non overlapping look like if there were, say, 8000 items with the same price (random would allow for this)? --~~

(Please fix signing of above, thanks).

I forgot how to do that Walter
Nice corner case. The original Python generates a lot ff increasing x to x+1, zero count ranges and would likely end by skipping items and printing Whoops.
I have added/will add a Python assertion to fail on the first zero count range foundas it's better to fail early.
Thanks. --Paddy3118 (talk) 06:40, 30 November 2020 (UTC)

Very poor name

What is the significance of them being prices? What is the significance of them being "behind an API"? I can't see why either has any meaning to the task. Yeah, yeah, Stackoverflow question, yada, yada, yada. Would probably be better something like "Bin by range" or some such. Also, what difference does it make if the units are specifically pounds? (No pence!) How about if they were Stanley nickels? How would that change the problem? --Thundergnat (talk) 12:32, 29 November 2020 (UTC)