Denise was supervising a developer who encountered a difficult problem: string handling in C. It’s not particularly fun to work with strings in C, but it’s certainly feasible.
One of the key issues for strings is that you need to know how large the string is going to be so you can allocate a buffer for it. And while there’s a strlen, there is no intlen, so when you want to turn a number into a string, you’re faced with a branching path.
The first path, would be to simply remember your logarithms from high school and know that the log10 of a number tells you how many digits (in base 10) it holds.
The second path would be to learn how to use the printf family of functions, and let the C standard solve that problem for you.
The third path would be to do this:
unsignedintdigits_count(unsignedint x) {
if (x >= 100000000) return9;
if (x >= 10000000) return8;
if (x >= 1000000) return7;
if (x >= 100000) return6;
if (x >= 10000) return5;
if (x >= 1000) return4;
if (x >= 100) return3;
if (x >= 10) return2;
return1;
}
So here we have a TDWTF classic: a useless function that reinvents a wheel which didn’t need reinventing in the first place. But it has a bonus of also being wrong.
The largest value in an unsigned int on this platform is 4,294,967,295, which has 10 digits. This function would helpfully tell you that it only has 9 digits, introducing a fun little off by one error that I’m sure won’t surprise anybody in ugly ways at some point.
[Advertisement]
Continuously monitor your servers for configuration changes, and report when there’s configuration drift. Get started with Otter today!
Good morning listeners nationwide. Is it a good morning? Definitely not. Today on the show my guests are Donald & Melania Trump. Ex-President Donald Trump is a twice-impeached, insurrectionist and convicted sex abuser. His wife Melania is a former model and mail order bride.
Donald & Melania Trump, in better days (for them).
PRESIDENT DONALD TRUMP
You forgot to mention I was indicted in Manhattan. I’m a stable genius.
JERRY
Yeah. Falsifying business records in order to conceal damaging information before the 2016 election.
TRUMP
I’m the most honest person you’ll ever know. Just ask my wife.
MELANIA TRUMP
Not this wife. Maybe Marla Marbles. He cheat when I pregnant.
JERRY
Is that why you wear black?
MELANIA
Yes. I rehearsing for husband funeral.
TRUMP
What?! I’m going to die?
MELANIA
(nods in the affirmative) Yes. You eat bucket of Kentucky Fried Chicken and McDonald’s double cheeseburgers every day. Fat tummy explode.
You may have to compete with Jean Carroll and Stormy Daniels.
MELANIA
Jean old lady. Stormy big boob.
TRUMP
Never heard of either one. They sound nasty.
JERRY
Let me refresh your memory. What’s left of it. You sexually abused Jean Carroll in a dressing room at Bergdorf Goodman department store. A jury of nine found you guilty in a Manhattan courtroom.
TRUMP
For your information, Bergdorf Goodman are my accountants. There are very fine people on both sides.
JERRY
Are you on drugs, Trumpster?
MELANIA
He sniff glue, Duncan. I call him Chunky Junkie.
JERRY
You paid off Stormy Daniels to cover up the sex while you were married to Melania.
TRUMP
Hold that thought. Can’t figure out if I cheated on Stormy or Melania.
JERRY
Melania.
TRUMP
You’re wrong. It was both.
JERRY
You recently held a CNN Town Hall in New Hampshire hosted by Kaitlan Collins. You still lie about the 2020 election being rigged.
TRUMP
Hey. It gets laughs.
TRUMP
That Kaitlan is a lightweight. I steam rolled her and sucked the oxygen out of the room. Her botox lips were moving, but nothing came out. Though I did detect a smelly fart.
JERRY
I need to stop the interview. Your former Vice President Mike Pence is on the line.
TRUMP
Is Mike calling from heaven? I think the Proud Boys hung him on January 6, 2021.
VICE PRESIDENT MIKE PENCE
The Lord is my salvation. I am well hung, not hung.
TRUMP
You’re weak, Mike. You should have certified the election for me. I won.
PENCE
Return to the Lord your God, for He is gracious and merciful. Slow to anger.
TRUMP
Your wife is not my type.
PENCE
God will roar from Zion and utter His voice from Jerusalem.
TRUMP
The only reason I chose you for Vice President is so no one would assassinate me.
PENCE
And Abraham saddled his ass and rode out of town.
JERRY
The perfect segway. Time to shove that bible up your rear, Veep. Donald Trump, Melania Trump and Mike Pence everyone. See you tomorrow.
The Jerry Duncan Show (c) Dean B. Kaner
Dean B. Kaner is a playwright and screenwriter, having co-produced and co-written plays for the stage with performances in New York City, Chicago, Minneapolis, Los Angeles, Boston, Detroit, Phoenix and Memphis. Check out The Jerry Duncan Show on YouTube, as well as on Instagram, and the sketch comedy A Bit of Biden (on Instagram) and at @abitofbiden on TikTok.
HOUSTON—Stressing that all she wanted for the holiday was for her son to be happy, local mom Beverly Higgins reportedly mailed her son Conner a Mother’s Day gift Sunday, according to sources. “Just a little something to show how much I love you on my special day,” read the card, which accompanied a brand-new Nintendo Switch, several pairs of wool socks, and a $25 gift card to Chipotle meant “to thank [him]” for giving her the gift of being his mother. “I was at the mall near the hospital after getting a little operation—don’t worry, I’m fine!—and then saw the GameStop and thought of you. You’ve already done enough just by being born, so don’t you think of getting me anything in return, mister! And if you already did, just return it and keep the money and buy yourself something nice. You deserve it! Mothers often get all the credit for the work we do, but I think you deserve it more for being my sweet, special boy.” At press time, Conner Higgins had reportedly called his mother a “bitch” after the package embarrassed him in front of his roommates.
Nation’s Mothers Describe How Nice It Would Be If You Lived Closer
The latest rumor to come out of Big D (Dallas) is that Cowboys owner Jerry Jones, 80, allegedly engaged in an epic dance-off with two of his team cheerleaders.
According to Hollywood Innuendo reporter Sausalito Ole, the two brave dancers who dared to challenge Jones on the dance floor are Kelli Baffle, 24, and Tess Oakwood, 25.
Miss Baffle revealed that what started as a friendly tap on the shoulder quickly escalated into a full-blown dance extravaganza. Jones unleashed his hidden moves, busting out dance styles from the disco era, including the “Jerry Jones Hustle” and the “Cowboy Shuffle.”
Witnesses claim that the dance battle reached its peak when Jones and the cheerleaders synchronized their moves to perform a “Cowboy Conga Line,” with Jones leading the way in his signature cowboy hat.
Meanwhile, Jones has clarified that he was simply showcasing his dancing skills to the newest members of the renowned cheerleader squad. He claims the exaggerated story was fabricated in hopes of receiving some dance lessons from one of the most rhythmically gifted and stylish owners in the NFL. ■
In a groundbreaking move, the Treasury has unveiled the designs for the new £1 coin featuring the iconic face of none other than Dame Judi Dench, the ageless wonder of the silver screen.
Renowned for her ability to defy the laws of time and gravity, the 32-year-old Dame Judi has long been the envy of mortals everywhere with her syndrome X, a kind of Benjamin Button disorder that prevents a person from aging quickly.
Judi Dench will make history as the first woman-whatchamacallit to grace an official one-pound coin, other than the monarch, effortlessly overshadowing rival contender Annie Lennox’s aspiring campaign for official recognition on the widely circulated coin.
The decision, of course, is controversial and has provoked public outcry in some quarters about the Tory-loving Dench, who once held a stint as an official apple-polisher at the Parliament building. Some have alleged Dench has received preferential treatment – something the Prime Minister vehemently denies. The PM was pleading with the public to believe him.
Leaked Treasury blueprints reveal a delightful stroke of karma, as the image chosen for the coin is a long-lost mugshot from Dench’s notorious 1992 Little Cocker, London DUI scandal. At the time, the former circus performer found herself at the center of a gripping legal drama, ultimately pleading guilty and paying a victim surcharge of a mere three measly quid, a paltry sum that barely fit in her dainty pockets.
Meanwhile, Dench’s husband, the legend André the Giant, firmly denies any involvement in the incident, citing his inability to squeeze inside a Mini Cooper as evidence of his innocence. Truly, this is a tale that combines the gravitas of currency design with the whimsy of celebrity intrigue, forever immortalizing Dame Judi Dench as the eternal face of the mighty pound.
Long live the enigma of ageless glamour and the enigmatic allure of the coin of the realm!
The NCAA March Madness Rules & Policy Committee has just levied a hefty $40,000 fine on CSU of Valdosta, Georgia.
A spokesperson for March Madness told Buckaroo Kazoo, a writer with The Turnstile Review, that the reason for the fine was because Coach Archie Goobinwax of the CSU Peach Pickers had been warned about his players flipping off opposing players, cheerleaders, and fans in the stands.
While eight of the Peach Picker players swiftly heeded the warning and reluctantly lowered their fingers, forward Odell Paperbox and center Ollie Candycutt continued to proudly flip the bird, much to the amusement of some and the chagrin of others.
Now, thanks to the stubborn antics of Paperbox and Candycutt, Cracker State University finds itself burdened with a gargantuan fine that would make even the richest leprechaun weep with envy.
Meanwhile, the president of CSU, Cyrus Craig Canvas, has said that Paperbox and Candycutt will be sent on a journey of self-discovery and finger-flipping therapy with Dr. Flickerman, a renowned psychologist specializing in unconventional behaviors.
Dr. Flickerman will dive deep into their childhoods, searching for the root causes of their finger-flipping tendencies. From thumb-sucking mishaps to disastrous games of “Rock, Paper, Scissors,” Dr. Flickerman will leave no stone unturned and no Oedipus complex undiagnosed.
Like the candle at Queen Elizabeth’s funeral, blocking Mrs. Harry from the camera’s eye, the Coronation feather also blocked Harry from the camera’s eye.
However, on second thought, could The Spoof be so indelicate as to suggest that maybe the Coronation feather might have been a middle finger gesture? The feather stood straight up in a so-there, get-even sort of way, and with no apologies.
Wham—bang, thank you, sir! Ridicule the royal family and call us racists? Well, take that!
The royal household and public relations office refused to comment, saying it was just the usual kind of hat that Princess Anne always wears when playing tennis, at cocktail parties, riding a horse, or at any ceremony. No devious speculation is necessary. She has worn that same hat design since she was in the cradle.
Well, maybe. However, if Princess Anne had been wearing a bearskin cap as worn by members of the Coldstream Guards, it would have been a BINGO situation, indicating that she was definitely blocking Harry from view.
After the ceremony, Harry shot out of Westminster Abbey to catch a plane home.
However, the red feather on the hat of Princess Anne enjoyed a leisurely ride on a horse and back to Buckingham Palace.
And so, a King of England was crowned in a monarchy that has been around since 1066! The question of will Harry, or won’t Harry attend was finally answered. Harry attended.
KANSAS CITY, MO—Allowing for a brief, relaxing respite from an otherwise grueling schedule, Friday’s release of The Legend Of Zelda: Tears Of The Kingdom reportedly offered local man Nick Powell a much-needed escape from the monotonous grind of playing other video games. “When you spend eight or nine hours a day with a controller in your hand, slogging away at all these video games, it’s nice to relax and unwind with a different video game,” said Nick Powell, adding that he was looking forward to enjoying the new Zelda after a long, arduous week filled with nothing but Overwatch 2, Elden Ring, and Red Dead Redemption. “Day in, day out, I’m occupied with completing all my deliveries in Death Stranding and running an entire town in Animal Crossing. It gets pretty exhausting, so it’s important that I set aside time to reconnect, recharge, and just be myself—or Link, at least—while saving the land of Hyrule from the forces that seek to destroy it.” Twenty minutes into the game, Powell acknowledged that while he was grateful for the opportunity to escape into a virtual world that was separate from the other virtual worlds he spends time in, he was starting to get bored.
Calling All Chicago-Area Worms: I Started A Worm Club To Meet Other Worms
The Archbishop of Canterbury, Justin Wellbehold, has admitted that he has paid a fine after being caught speeding.
The event happened two days after he crowned King Charles III at Westminster Abbey.
The cleric told us, “To be honest, I was buzzing my nuts off after the Big Show last weekend, so I did a couple of lines of Whizz before I went home. But unfortunately, The Plod saw me chopping them out on my dashboard.“
The Rt Revd Wellbehold pleaded guilty and managed to avoid an embarrassing court appearance. However, Magistrate Mike Bangedtorights was less than impressed.
“The fact that he gets to wear a big pointy hat and swan around in an expensive frock doesn’t mean he can just snort crank at the least provocation,” said Magistrate Bangedtorights.
The police officer who apprehended him told the court, “I asked the Archbishop, ‘Did you know you were doing 60 in a 30 zone? I have reason to believe you’re taking drugs.’“
He continued, “Wellbehold said to me, and I quote, ‘You’re only saying I’m on drugs because you hate Vicars’. So I replied, ‘It has nothing to do with being a Vicar. Or an Archbishop.’“
Wellbehold started to get defiant and aggressive. “How do you know I’ve been snorting Bam then?’“
I told him, “You were doing 60 in a 30 zone, and you weren’t even in your sodding car.“
“1996, when my mom and two older sisters got glamour shots and I was apparently too young (8 years old) so my mom wouldn’t let me get them and I cried for two days.”
“The year was 1992 or 93, the place Olan Mills. I’m the one with glasses, braces and the mushroom cut. My sister and I were wearing matching dresses my grandmother made. There is so much going on in this picture, I don’t even know where to start…It’s cringeworthy all around!”
Title 42, the Covid-era public health emergency measure that allowed for the quick expulsion of migrants at the border and nearly halted the processing of asylum applications for more than three years, has expired, with tens of thousands of people who have been waiting in Mexico after fleeing from violence, poverty, and political instability expected to make their way to the border. What do you think?
“I have bad news for anyone immigrating to America to flee violence and poverty.”
Elizabeth Roper, Rubber Harvester
The Onion Reviews ‘When Harry Met Sally’
“It’ll be such a relief to go back to the pre-Covid way of discriminating against migrants.”
Diego Migues, Brand Consultant
“I’m confident we can figure out another reason to deny people asylum.”
SAN FRANCISCO—Emphasizing that she should get ready to have her mind absolutely blown, Elon Musk reportedly sat the new Twitter CEO Linda Yaccarino down on Friday and had her watch The Matrix as part of her onboarding process. “Buckle up, because this movie will tell you everything you need to know about working at Twitter, and also the world and our society at large,” said Musk, who opened up a laptop, pressed play on the 136-minute-long film, and began excitedly watching, commenting on, and reciting the lines of his favorite scenes over her shoulder. “Okay, so this is how it works when you’re CEO: you’re like Neo and I’m your Morpheus. The machines are trying to control our minds, but luckily, we know the truth. In order to be in charge of Twitter, you must take the blue pill or the red pill. What will you choose?” At press time, Elon Musk had switched the onboarding movie to Andrew Tate’s Hustlers University after discovering that the Wachowskis identified as female.
Things That Will Get You Permanently Banned From Elon Musk’s Twitter