My laptop was overheating, so I pulled a gallon ziploc bag of ice out of the freezer and set my laptop on top of it. The CPU temperature has since dropped by about 16 degrees Celsius, so I reckon it worked
There is an ancient exercise which used to be given to students to write a recursive function named pow which calculates things such as 3.433 raised to the 8th power.
I challenge you to write an implementation of pow which can accept input from many different data-types.
At its core, pow sometime...
I know CoffeeScript isn't that popular anymore, but it removes so much punctuation that translating my JS to CoffeeScript with idiomatic spacing is about the same size as running it through a minifier
@Bubbler I'm already having to compile C++ -> wasm and Sass -> CSS, so that isn't really a concern for me. I was moreso talking about ease of development, and CoffeeScript seems to address the two problems I was having (scope management and punctuation soup)
@ATaco damn, i dont think i ever had a closed challenge before, even my first one
tho my first challenge did have a load of comments saying how to improve my challenge lol
and it only got one answer lol
wait a fucking minute... was the tio link for that answer wrong the entire time??? i was just revisiting my first challenge and the one answer on it and then click the tio link... the code dont even match in the link
lemme put a comment in the guys answer real quick, how tf i didnt notice this before
what the hell is that example of a decorator why would it be some convoluted class instead of a bare function unless it needs to be stateful
why is there a __new__ instead of an __init__, why is the goddamn class name lowercase, where is there a callable that necessitates kallable, how the hell does the __getattr__ even not error (is instance supposed to be self?????)
like the challenge wasn't bad enough that code needs to be burned with fire
also just noticed
# many tuples nested
result = pow(((((5.21, 8)))))
@UnrelatedString well they have instance = super().__new__(cls) but i thought super() is supposed to refer to the parent class, yet class decorate isnt inheriting anything??
> __new__() is intended mainly to allow subclasses of immutable types (like int, str, or tuple) to customize instance creation. It is also commonly overridden in custom metaclasses in order to customize class creation.
No, in this case super is the class "object". You need it because if you override new it's impossible to actually create a instance of the object otherwise
Planning on getting the best of both worlds with Cuprous, which will be a slightly higher level (it'll slightly compromise low-level control in exchange for massive readability/writability advantages) language which transpiles to Rust
@ATaco How would foo be undefined in that case tho?
Oh wait nvm
But I do think it'd be unreasonable to assume map doesn't run more or less instantly
If you wanna break things, you could do much worse
I've worked on very large python projects with my company and they where all just as readable and refactorable or more so than C#/Java projects I've worked on
I won't be reading it, only Rydwolf, so it's basically like I got a free car somewhere and someone stole it rather than me making a copy of the car, right?
You are the sonar captain aboard an underwater submarine. The way sonar works is that every submarine sends out a ping at regular intervals. Each interval is a whole number of seconds. Each submarine has an identifying amplitude, that is no two submarines send out pings at the same amplitude. Th...
The main difficult part of implementing your own username/password system isn't even the password storage, it's things like password resets and requirements