News for hackers. Stuff that matters.
Re:Is-even-ai – Check if a number is even using the power of AI by iamthemonster on Monday May 19, 2025 @09:48PM (#44036975)
This is pretty useless to be honest. It's good for telling whether a number is even, but in our industry we need more powerful functionality. We also need to know whether a number is odd.
Re:Is-even-ai – Check if a number is even using the power of AI by charles_f on Monday May 19, 2025 @09:56PM (#44037028)
RTFM, it's not only implementing isOdd but also a large set of rarely used advance operations such as isEqual, or isGreaterThan

Trully AI is astonishing

Re:Is-even-ai – Check if a number is even using the power of AI by whynotmaybe on Monday May 19, 2025 @10:00PM (#44037046)
Why a specific function ?

With a few lines of code, you can just create a list with all the numbers that are even and when you need to check if a number is odd, you simply have to check if it's in the list.

Re:Is-even-ai – Check if a number is even using the power of AI by turnsout on Monday May 19, 2025 @10:45PM (#44037268)
Yes, this is what we do as a RAG workflow. We created a list of all 32bit unsigned integers and whether they were even or odd, and we pass that into the context. The future is amazing!
Re:Is-even-ai – Check if a number is even using the power of AI by MikeTheGreat on Tuesday May 20, 2025 @12:00AM (#44037660)
I'm new to RAG and have a question: how do you get all the numbers into the context window?

Does the RAG part look up just the needed number?

I think that Gemini has a million token window (yes?) - do you have access to a model with a larger window?

Regardless, I find your ideas intriguing and wish to subscribe to your Substack.

Re:Is-even-ai – Check if a number is even using the power of AI by turnsout on Tuesday May 20, 2025 @08:58AM (#44041059)
We have an agentic system that looks up the context size, and then summarizes the even/odd table if necessary. We lose a little bit of accuracy, but now we can handle any model. Be sure to like & subscribe!
Re:Is-even-ai – Check if a number is even using the power of AI by Charon77 on Monday May 19, 2025 @11:40PM (#44037569)
I.. can't tell if you're joking or not. Pretty sure someone out there is unironically doing something as stupid as this in production
Re:Is-even-ai – Check if a number is even using the power of AI by ryanpandya on Tuesday May 20, 2025 @04:21AM (#44039119)
The good news is they're definitely joking. The bad news is that indeed, there's definitely someone out there doing this unironically.
Re:Is-even-ai – Check if a number is even using the power of AI by whynotmaybe on Tuesday May 20, 2025 @07:01AM (#44040095)
Yes, there is.

A former co-worker had to print 5 lines of text. Sometimes, some of the lines were empty but he didn't want to print an empty line.

So he did the usual, use 'if', a lot of 'if'. He handled all the possible cases of empty VS not empty lines.

Re:Is-even-ai – Check if a number is even using the power of AI by int_19h on Tuesday May 20, 2025 @04:01AM (#44038987)
Have you tried quantizing them down to 4 bits to save on RAM?
Re:Is-even-ai – Check if a number is even using the power of AI by justsid on Tuesday May 20, 2025 @11:05AM (#44042464)
I have found that even 2 bit quantization works, but you have to make sure you only discard the LABs (that’s what we are calling the Left Aligned Bits internally). I have no idea why it works so well but it has cut our costs significantly.
Re:Is-even-ai – Check if a number is even using the power of AI by sureIy on Monday May 19, 2025 @10:11PM (#44037111)
Do we have enough spaces in the ALL_NUMBERS array or do we want to group them by thousands?

ALL_NUMBERS_00001

ALL_NUMBERS_00002

Re:Is-even-ai – Check if a number is even using the power of AI by kaibee on Tuesday May 20, 2025 @01:20AM (#44038045)
Yeah, some of the bigger numbers were a problem, so we switched to using a horizontally scaling db cluster so that we could cover all of the (useful) numbers. When we encounter a new number, it gets routed to the appropriate db where the results of the function are cached after being calculated. We're thinking of spinning it off as an API service actually if there's any interest.
Re:Is-even-ai – Check if a number is even using the power of AI by iamthemonster on Monday May 19, 2025 @10:45PM (#44037266)
we fired all our junior devs so we can't write code any more
Re:Is-even-ai – Check if a number is even using the power of AI by briansm on Monday May 19, 2025 @11:47PM (#44037605)
"This is pretty useless to be honest."

I remember saying that about Bitcoin 15 years ago.

Re:Is-even-ai – Check if a number is even using the power of AI by crubier on Monday May 19, 2025 @10:02PM (#44037056)
You can achieve this super simply this by prompting the OpenAI API to call this tool and reverse the output.
Re:Is-even-ai – Check if a number is even using the power of AI by SamBam on Monday May 19, 2025 @10:04PM (#44037065)
I tried that, but I kept getting "eurt" and "eslaf" and I'm not sure what to do with those. Do I need to send it back to the AI?
Re:Is-even-ai – Check if a number is even using the power of AI by nbittich on Tuesday May 20, 2025 @02:23AM (#44038371)
you might need to upgrade your vercel plan
Re:Is-even-ai – Check if a number is even using the power of AI by YokoZar on Monday May 19, 2025 @09:59PM (#44037043)
Great news! The package includes an isOdd function as well!
Re:Is-even-ai – Check if a number is even using the power of AI by nbittich on Tuesday May 20, 2025 @02:24AM (#44038385)
isn't it breaking the one package one responsibility principle?uncle bob wouldn't be happy, it doesn't seem clean
Re:Is-even-ai – Check if a number is even using the power of AI by Cerium on Monday May 19, 2025 @10:16PM (#44037134)
Simply add one to the number and then test it again.
Re:Is-even-ai – Check if a number is even using the power of AI by avandekleut on Monday May 19, 2025 @09:51PM (#44036996)
Someone should implement this using tool calls.