IsOdd (and IsEven) as a Service
typicalprogrammer.com
typicalprogrammer.com
Oh, and remember to always wrap your isOdd requests in a retry loop with exponential backoff.
I read ??! as a trigram
try {
const isOdd = require('isOdd')({ apiKey: 'xxx', ...options });
}
catch (e) {
if (typeof e === 'IsOddAuthenticationException') {
console.log('Could not connect to issOdd service. Is your API key correct?');
}
else {
console.log(e);
}
}
try {
const is43Odd = await isOdd(43);
}
catch (e) {
console.log(e);
}
console.log(is43Odd ? '43 is odd!' : 'Sorry, 43 is not odd.The const should have been a var. Get off my lawn!
Hmm, if I saw an actual outside-joke pedantic quibble? I'd probably lose my mind and go on an hours long rant about the declining state of HN comment threads. Hahah. Or maybe...Shrug sigh and move on? Or maybe...I probably wouldn't even see it...it's such a part of the background noise here. Or maybe...I'd laugh and try to engage humorously with the poor soul.
Wait...was this a pedantic quibble, was that what you just did? o.O hahah
Also, Elixir and the actor model is such an obvious match for this problem space!
Definitely happy to put this tool in my tool belt.
There's suffient nuance and opportunity to be creative, while at the same time requiring some basic skills to set up (server, dns, https,and so on.)
Then for those more advanced there are creative extensions to implement - support any base, support text, in multiple languages, support formulas (is result odd or even) and so on.
Back in my university days we'd take trivial problems like this and "extend" them in creative ways faaar beyond the assignment. It both stretched or skills, and also taught us something about feature creep.
As in, sometimes it's OK not to build the perfectly generic, useful in all cases, megolith when a simple x % 2 == 1 will do.
(no wait %2 is slow, let's just &1 instead...)
Perhaps the next version will have ChatGPT enhancements?
it is instead, in fact, not a number
[0] - https://github.com/avinassh/gg-flip
[1] - https://avi.im/gg-flip/
FizzBuzz Enterprise Edition is a no-nonsense implementation of FizzBuzz made by serious businessmen for serious business purposes.
def isEven(x):
'''returns true if even''
return TrueAlmost half of the time, I need to know if a number is even. Why doesn't it provide an end point for that?! Don't even tell me about the 409 status code. Am I suppose to know it's an even number when it returns an odd number to me? I only recognize status code 200, all other are errors, don't make this so complicated!
IMHO it's missing a ChatGPT (or other LLM) integration