ReportWire

Category: Humor

Humor | ReportWire publishes the latest breaking U.S. and world news, trending topics and developing stories from around globe.

  • A Case of Conversion

    A Case of Conversion

    [ad_1]

    Mattijs‘s co-worker was responsible for an HTML-to-PDF converter that was used internally. While TRWTF is always going to be PDFs, there were some odd choices used in the converter, starting with the function named ConvertTagsToLowerCase.

    private static string ConvertTagsToLowerCase(string RichText)
    {
            
            char[] array = new char[RichText.Length];
            int arrayIndex = 0;
            bool inside = false;
            StringBuilder sb = new StringBuilder();
            for (int i = 0; i < RichText.Length; i++)
            {
                    char let = RichText[i];
                    if (let == '<')
                    {
                            inside = true;
                            
                            sb.Remove(0, sb.ToString().Length);
                            continue;
                    }
                    if (let == '>')
                    {
                            inside = false;
                           
                            array[arrayIndex] = '<';
                            arrayIndex++;
                            string HTMLInside = sb.ToString().ToLower();
                            for (int j = 0; j < HTMLInside.Length; j++)
                            {
                                    array[arrayIndex] = HTMLInside[j];
                                    arrayIndex++;
                            }
                            array[arrayIndex] = '>';
                            arrayIndex++;
                            continue;
                    }
                    if (!inside)
                    {
                            array[arrayIndex] = let;
                            arrayIndex++;
                    }
                    else
                    {
                            
                            sb.Append(let);
                    }
            }
            return new string(array, 0, arrayIndex);
    }
    

    So, the first question is: why do we need to do this? While HTML tags are by convention lower case, it doesn’t (and shouldn’t) really matter. But let’s set that aside, and walk through the code.

    It’s easiest to understand this code by going from the bottom up. If they’re “inside” (of an HTML tag), they append the character to a string builder. Otherwise, they copy the character into our output array.

    When we encounter an <, we are now “inside” an HTML tag, so we clear the string builder. We do this by Removeing every character out to its length, instead of using the Clear method, which is a strange choice clearly driven by not reading the docs.

    Finally, when we encounter an >, we are no longer inside an HTML tag. We turn the string builder into a string, and then lowercase it. Now, we copy all the text from that string back into our output array… one character at a time.

    And then, of course, as the cherry on top of this, is the misleading comment: remove any double tags which are not in supported tags. I assume this is meant to be marked as a TODO, but I have no idea. It certainly isn’t something happening here. Maybe it’s a prerequisite?

    What puzzles me about this code is that they use both a string builder and an array of characters. The obvious “solution” with their knowledge is to just convert the string to an array, modify each character in place, and then return the new string. That’s at least simpler.

    If this code is necessary at all, it’s because something they’re using to parse HTML is itself broken, and expecting a specific casing for tags. But the code itself is a terrible way to solve this problem.

    [Advertisement]
    Otter – Provision your servers automatically without ever needing to log-in to a command prompt. Get started today!

    [ad_2]

    Remy Porter

    Source link

  • Nature Explained: How Animals Survive In The Wild

    Nature Explained: How Animals Survive In The Wild

    [ad_1]

    While this is how vegans think animals die in the wild, the nature is actually quite brutal. Lions eat zebras, the zebras don’t care about other zebras, everyone cares only about their own butt. So… zebras are pretty much like humans.

    The post Nature Explained: How Animals Survive In The Wild first appeared on Crazy Funny Pictures.

    [ad_2]

    liver

    Source link

  • Sexy Forest: Gallery of Trees That Look Like Butts

    Sexy Forest: Gallery of Trees That Look Like Butts

    [ad_1]

    We spent thousands of hours and compiled the greatest collection of trees that look like butts. It’s a sexy forest made just for you to enjoy. We believe this is the greatest achievement of mankind since the invention of the wheel. Scroll down and enjoy and share it with your coworkers to win a free trip to the HR!

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butts.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    Sexy tree butt.

    [ad_2]

    liver

    Source link

  • CALL RON DESANTIS “GOVERNOR GROOMER” – John Thomas, Humor Times

    CALL RON DESANTIS “GOVERNOR GROOMER” – John Thomas, Humor Times

    [ad_1]

    CALL RON DESANTIS GOVERNOR GROOMER

    If you’re a big lefty liberal patriot like me,
    You probably watch way too much MSNBC.
    It’s not the shows or the hosts that I dislike,
    It’s MSNBC’s advertisers that make me gripe
    Lume ads have made MSNBC unwatchable.
    Demonstrating pussy deodorant applications
    Every 10 minutes on TV is f**king disgusting!
    LumeStarterPack.com is not the solution for
    Your swampy vagina discouraging inhalation
    Take a bath after your hourly masturbation!
    Speaking of stench-ridden Florida snatches,
    Republitarded racist Governor Ron DeSantis
    Is so stupid he said slavery gave job skills?!
    Like what?! How to rape slaves that you kill?
    Gov. Ron DeSantis (R-FL) is a sexual abuser
    Which is why he’s called Governor Groomer.
    Getting underage girls drunk all of the time,
    But Ron’s micropenis they still cannot find.

    Jake Pickering
    Arcata, CA, USA

    P.S. — You can find out more about me and my widely published writings by clicking on the link: https://muckrack.com/jake-pickering-1

    John Thomas
    Latest posts by John Thomas (see all)

    Signed: Jake Pickering

    [ad_2]

    Jake Pickering

    Source link

  • My Husband’s Unfortunate Encounter With A Flying Harness

    My Husband’s Unfortunate Encounter With A Flying Harness

    [ad_1]

    “This was taken just before we were attached to a steel cable and hurled through the Thai jungle (like a flying fox – the tour was called “Flight of the Gibbons.”) As you can see, my husband looks like he was quite excited about the tour.”

    (submitted by Peta)

    The post The Vacation Bunch appeared first on AwkwardFamilyPhotos.com.

    [ad_2]

    Team Awkward

    Source link

  • HumorFeed – Bending the News Until it Breaks

    HumorFeed – Bending the News Until it Breaks

    [ad_1]

    Florida Governor Ron DeSantis on Monday signed a bill stripping manatees of their state protections over reports of homosexual behavior.

    [ad_2]

    Merrick

    Source link

  • Family Fights Scheduled Into Vacation Itinerary

    Family Fights Scheduled Into Vacation Itinerary

    [ad_1]

    TAMPA, FL—In an effort to squeeze in all their usual activities during their annual visit to Tampa Bay, 43-year-old Ron Ortega told reporters Tuesday he had scheduled family fights into this year’s vacation itinerary. “We’re going to be pretty tired after going to the beach in the mornings, so setting aside a few blocks of time for blowout arguments in the afternoons will take the stress out of figuring out when to fight next,” said Ortega, adding that he had left some space after their museum visits for his family to squabble about where they were going to eat, and had budgeted a few hours halfway through the week for everyone to yell at everyone else about how they never get to do the thing they want to do on this trip. “Of course, these fights are all completely optional, so if my wife and son want to have a screaming match about buying souvenirs at the Busch Gardens gift shop, my daughter and I can either join them or head to the nearby Florida Aquarium. While we’d like to pack in as much as we can in Tampa Bay, we also need to be realistic and recognize that we may have to reschedule some of our bickering for the flight home.” At press time, the Ortegas had reportedly just arrived at their hotel and decided to multitask by yelling at each other about three different issues at once.

    [ad_2]

    Source link

  • Bike Thief Can’t Resist Stopping to Pet Dog

    Bike Thief Can’t Resist Stopping to Pet Dog

    [ad_1]

    If you’re planning a heist, charming the guard dog might be the way to go. In July, a low-level criminal was trying to make a quick steal when he fell victim to the cutest guard dog ever.

    The suspected San Diego bike burglar was caught on camera stealing a family’s electric bike from an open garage when the family’s ‘fearsome’ golden retriever popped in to investigate. The thief got away, but not before getting a few belly rubs in.

    [ad_2]

    Jackson

    Source link

  • A Good Doctor Is Always Ready To Help You Out

    A Good Doctor Is Always Ready To Help You Out

    [ad_1]

    How to know if you have a good doctor? If your conversation goes something like this. He’s always to help you… out.

    The post A Good Doctor Is Always Ready To Help You Out first appeared on Crazy Funny Pictures.

    [ad_2]

    liver

    Source link

  • Universal Catch

    Universal Catch

    [ad_1]

    A common pattern is “global error handlers”- functions you call in your catch block that do some task, usually logging, when an exception occurs. Given that exception handling frequently involves a fair bit of repeated code, centralizing that isn’t a terrible idea. So when Magnus found code like this in the codebase, he didn’t think much of it:

    public List<ErrandComboClass> GetErrandCombo()
    {
        List<ErrandComboClass> list = null;
        try
        {
            using (MyEntities my = new MyEntities())
            {
                list = my.Errand.Select(x => new ErrandComboClass { ID = (int)x.Id, Name = x.Dnr }).OrderBy(x => x.Name).ToList();
            }
        }
        catch (Exception ex)
        {
            ExceptionHelper.CatchError(ex);
        }
    
        return list;
    }
    

    I can’t say I love the naming conventions, but it’s a pretty straight forward C# Linq method, projecting and sorting data. I don’t think that the ToList should be there, because we could be leveraging lazy evaluation (or maybe we shouldn’t, I don’t know their access patterns, but at a guess, lazy would be better here). Anything goes wrong, we pass the error to our global exception handler.

    This exception handler was called everywhere. So what did it do?

    public static class ExceptionHelper
    {
        public static void CatchError(Exception ex)
        {
            string s = ex.ToString();
        }       
    }
    

    Oh, nothing. It does (basically) nothing. Presumably, once upon a time, this was meant to be an error handling framework that they’d hang a lot of functionality off of- but that never happened. This was their production code, and this was their error handling solution.

    [ad_2]

    Remy Porter

    Source link

  • Every Family In The 80’s Had To Have A Photo Like This

    Every Family In The 80’s Had To Have A Photo Like This

    [ad_1]

    “My husband, granny and sister-in-law at a Sears glamour portrait from the 80s.”

    (submitted by Penny)

    The post Ghost Town appeared first on AwkwardFamilyPhotos.com.

    [ad_2]

    Team Awkward

    Source link

  • I Grew Up On An Animal Rescue Farm

    I Grew Up On An Animal Rescue Farm

    [ad_1]

    “As a kid we had a rescue farm, and many weird animals came to live with us. I had a rescued crow that always sat on my head and here I am walking my pet snake.”

    (submitted by IG @naomi_images

    The post Animal Planet appeared first on AwkwardFamilyPhotos.com.

    [ad_2]

    Team Awkward

    Source link

  • Ripping the Headlines Today – Paul Lander, Humor Times

    Ripping the Headlines Today – Paul Lander, Humor Times

    [ad_1]

    Making fun of the headlines today, so you don’t have to

    The news, even that about Kylie Jenner, doesn’t need to be complicated and confusing; that’s what any new release from Microsoft is for. And, as in the case with anything from Microsoft, to keep the news from worrying our pretty little heads over, remember something new and equally indecipherable will come out soon:

    Really all you need to do is follow one simple rule: barely pay attention and jump to conclusions. So, here are some headlines today and my first thoughts:

    Kylie Jenner.

    Kylie Jenner is again facing backlash for denying she’s had plastic surgery

    It’s hard to tell if she’s lying with her face unable move.

    Trump’s been indicted three times

    … Next one comes with a medium fries and large drink.

    Musk threatens to sue researchers who documented the rise in hateful tweets

    … I think they’re not called Tweets, anymore, but XCrements.

    Hunter Biden: The struggles and scandals of the US president’s son

    Hunter Biden is the Roger Clinton of Billy Carters.

    Kim Kardashian’s dating history is genuinely full of plot twists

    That’s because she doesn’t have a life she has ‘continued next weeks.’

    William Shatner calls the U.S. government’s UFO hearings ‘ridiculous’

    In other words, ‘Star Dreck.’

    Leprosy cases surging in Central Florida: CDC

    DeSantis has taken the state so far backward, even the diseases are like Spain’s still in charge.

    Former porn performer pleads guilty to DUI

    She’ll be done with traffic school in no time if they have oral exams.

    US Economy added 187,000 jobs in July

    That’s actually six, if you readjust it for jobs not taken by Ryan Seacrest.

    Taylor Swift is on the ‘Era’s Tour’

    While Kid Rock is on the ‘Error’s Tour.’

    RFK Jr. complained about not getting Secret Service protection. The truth is very few candidates do

    Although, I do hear there’s a vaccine for that.

    Florida has “effectively” banned AP Psychology from being taught in schools, according to a statement from the College Board

    That’s crazy!

    Mexico’s president offers to buy US company’s coastal property for $375 million to end dispute

    Wall extra.

    Alan Dershowitz says Trump conviction will be overturned by the Supreme Court

    … Yeah, but he didn’t really mean it because he had on his underwear …

    Paul Lander
    Latest posts by Paul Lander (see all)
    Share

    [ad_2]

    Paul Lander

    Source link

  • normal decisive superficial

    normal decisive superficial

    [ad_1]

    When the euro banknotes were 1st designed in 2002, they featured fictional bridges, so as not to cause a row amongst EU member countries. Ten years later an architect for the Dutch town of Spijkenisse claimed them all for the Netherlands by building them ALL on a single waterway

    [ad_2]

    Source link

  • This I would have paid to watch.

    This I would have paid to watch.

    [ad_1]

    Tags: funny, soccer, sport

    5297 points, 886 comments.

    [ad_2]

    Source link

  • Twitter Blue Subscribers Now Allowed To Hide Blue Checks

    Twitter Blue Subscribers Now Allowed To Hide Blue Checks

    [ad_1]

    X, the site formerly known as Twitter, is now letting its Blue subscribers hide the once-coveted verification “blue check”—the status symbol they pay $8 a month for—on their account. What do you think?

    “All the best goods and services are too embarrassing to be shown publicly.”

    Jeffrey LaFontaine, Cousin Therapist

    “Just to be safe, I’m blocking everyone.”

    Melanie Adams, Systems Analyst

    “Now they’ll all wonder about the mystery man behind the reply ‘Hilarious, Elon!!!’”

    Dante Purwin, Lawn Advocate

    [ad_2]

    Source link