• 0 Posts
  • 13 Comments
Joined 1 year ago
cake
Cake day: September 27th, 2023

help-circle
  • Mirodir@discuss.tchncs.detoProgrammer Humor@programming.devSus
    link
    fedilink
    arrow-up
    107
    ·
    edit-2
    2 months ago

    Sure. You have to solve it from inside out:

    • not()…See comment below for this one, I was tricked is a base function that negates what’s inside (turning True to False and vice versa) giving it no parameter returns “True” (because no parameter counts as False)
    • str(x) turns x into a string, in this case it turns the boolean True into the text string ‘True’
    • min(x) returns the minimal element of an iterable. In this case the character ‘T’ because capital letters come before non-capital letters, otherwise it would return ‘e’ (I’m not entirely sure if it uses unicode, ascii or something else to compare characters, but usually capitals have a lower value than non-capitals and otherwise in alphabetical order ascending)
    • ord(x) returns the unicode number of x, in this case turning ‘T’ into the integer 84
    • range(x) creates an iterable from 0 to x (non-inclusive), in this case you can think of it as the list [0, 1, 2, …82, 83] (it’s technically an object of type range but details…)
    • sum(x) sums up all elements of a list, summing all numbers between 0 and 84 (non-inclusive) is 3486
    • chr(x) is the inverse of ord(x) and returns the character at position x, which, you guessed it, is ‘ඞ’ at position 3486.

    The huge coincidental part is that ඞ lies at a position that can be reached by a cumulative sum of integers between 0 and a given integer. From there on it’s only a question of finding a way to feed that integer into chr(sum(range(x)))




  • Reading this comment gave me the idea to get Gemini’s “opinion”. Ironically, it turns out Google might’ve actually done better if they did that.

    AI conversation

    Prompt:

    I design ads for Google as a living and was charged with writing an ad for you (Gemini) to be aired during ad breaks at the Olympics .
    My current idea is as follows:
    A father wants to help his daughter write a letter to her idol, Olympic track star Sydney McLaughlin-Levrone. In a voiceover, the dad says his daughter “might even be the world’s No. 1 Sydney fan.” In the add he will ask you, Gemini, to “help my daughter write a letter telling Sydney how inspiring she is and be sure to mention that my daughter plans on breaking her world record one day. (She says sorry, not sorry.)”
    What do you think of this idea?

    Gemini output (emphasis mine):

    Evaluation of the Ad Idea
    The concept of using Gemini to help a young fan write a letter to her idol is heartwarming and relatable. It aligns well with the aspirational and inspiring tone of the Olympics.
    However, there are a few points to consider:
    Potential Issues
    Overemphasis on competition: The line “She says sorry, not sorry” might come across as overly competitive, which could potentially alienate viewers.
    Dependence on AI: While showcasing Gemini’s capabilities, it’s important to maintain a balance. Over-reliance on AI to write the letter might diminish the authenticity and emotional impact of the story.
    Target audience: Consider the target audience for the Olympics. While the story is heartwarming, it might resonate more with a family audience than with core sports fans.
    Suggestions
    Focus on inspiration: Instead of emphasizing competition, focus on the inspiring qualities of Sydney McLaughlin-Levrone and how she motivates the young girl.
    Highlight human connection: Emphasize the bond between the father and daughter and how they are using Gemini as a tool to connect with their idol.
    Visual storytelling: Use strong visuals to capture the emotion and excitement of the story. Show the girl’s admiration for Sydney, the father’s support, and the magic of Gemini helping them craft the perfect letter.
    Overall, the idea has potential, but refining the focus and execution can elevate the ad’s impact.
    Would you like to explore some alternative approaches or focus on developing the concept further?







  • I think the humor is meant to be in the juxtaposition between “reference” in media contexts (e.g. “I am your father”) and “reference” in programming contexts and applying the latter context to the former one.

    What does “I’m your father” mean if the movie is jaws?

    I think the absurdity of that question is part of said humor. That being said, I didn’t find it funny either.


  • That was a response I got from ChatGPT with the following prompt:

    Please write a one sentence answer someone would write on a forum in a response to the following two posts:
    post 1: “You sure? If it’s another bot at the other end, yeah, but a real person, you recognize ChatGPT in 2 sentences.”
    post 2: “I was going to disagree with you by using AI to generate my response, but the generated response was easily recognizable as non-human. You may be onto something lol”

    It’s does indeed have an AI vibe, but I’ve seen scammers fall for more obvious pranks than this one, so I think it’d be good enough. I hope it fooled at least a minority of people for a second or made them do a double take.



  • I’m not really sure how to describe it other than when I read a function to determine what it does then go to the next part of the code I’ve already forgotten how the function transforms the data

    This sounds to me like you could benefit from mentally using the information hiding principle for your functions. In other words: Outside of the function, the only thing that matters is “what goes in?” and “what comes out?”. The implementation details should not be important once you’re working on code outside of that function.

    To achieve this, maybe you could write a short comment right at the start of every function. One to two sentences detailing only the inputs/output of that function. e.g. “Accepts an image and a color and returns a mask that shows where that color is present.” if you later forget what the function does, all you need to do is read that one sentence to remember. If it’s too convoluted to write in one or two sentences, your function is likely trying to achieve too much at once and could (arguably “should”) be split up.

    Also on a different note: Don’t sell your ability to “cludge something together” short. If you ever plan to do this professionally or educationally, you will sadly inevitably run into situations where you have no choice but to deliver a quick and dirty solution over a clean and well thought out one.

    Edit: typos