• @jimmux@programming.dev
    link
    fedilink
    112 years ago

    Unit test dummy data is full of it. Need an arbitrary date? Pick a special birthday. Location? Wherever you first met.

    Not the most public dedication, but perhaps more impactful than yet another song about the one that got away.

    • @MrMcGasion@lemmy.world
      link
      fedilink
      62 years ago

      Skim coat a heart with your initials in it, so when the light hits the wall just right you can see the texture difference through the paint.

    • Rikudou_Sage
      link
      fedilink
      52 years ago

      The original have been quite great even without adding the bit about off-by-one errors.

  • stephfinitely
    link
    fedilink
    772 years ago

    This person misunderstands a beautiful function code can be very sexy or maybe I’m a odd girl.

    • nickwitha_k (he/him)
      link
      fedilink
      8
      edit-2
      2 years ago
      var LogicGate = map[string]string{
          "OR": "OR",
          "AND":  "AND",
          "NOT": "NOT",
          "NOR": "NOR",
          "NAND": "NOR",
          "XOR": "XOR",
      }
      
      func isLogicGate(inString string) (bool) {
          _, ok := LogicGate[strings.ToUpper(inString)]
          if ok {
              return true
          } else {
              return false
          }
      }
      
      func stringAsGateLogic(inString string) (bool, error) {
          inSplit := strings.Split(inString, " ")
          var phrase1 strings.Builder
          var phrase2 stringa.Builder
          var gateString string
          for word := range inSplit {
              if isLogicGate(word) {
                  if len(gateString) < 1{
                      gateString = word
                  } else {
                      phrase2.WriteString(word)
                  }
              } else {
                  if len(gateString) < 1{
                      phrase1.WriteString(word)
                  } else {
                      phrase2.WriteString(word)
                  }
              }
          }
          boolPhrase1 := bool(phrase1.String())
          boolPhrase2 := bool(phrase2.String())
          switch strings.ToUpper(gateString) {
              case "OR":
                  return (boolPhrase1 || boolPhrase2), nil
              case "AND":
                  return (boolPhrase1 && boolPhrase2), nil
              case "NOT":
                  return (!boolPhrase2), nil
              case "NOR":
                  return (!(boolPhrase1 || boolPhrase2)), nil
              case "NAND":
                  return (!(boolPhrase1 && boolPhrase2)
              case "XOR":
                  orRes := (boolPhrase1 || boolPhrase2)
                  nandRes := (!(boolPhrase1 && boolPhrase2))
                  return (orRes && nandRes), nil
              default:
                  return false, fmt.Errorf("Why you do dis?: %v", inString)
          }
      }
      
      func main(){
          answer, err := stringAsGateLogic ("This person misunderstands a beautiful function code can be very sexy or maybe I'm a odd girl.")
          if err != nil {
              fmt.Println(err)
          }
          fmt.Println(answer)
      }
      
      • @wallmenis@lemmy.one
        link
        fedilink
        English
        32 years ago

        isLogicGate is not used. Maybe you mean to place it in “isGate” in the stringAsGateLogic for loop’s if statement?

        • nickwitha_k (he/him)
          link
          fedilink
          52 years ago

          Thank you. That’s what I get for writing a drawn-out shitpost program on my phone over several hours while away from home, instead of in a few minutes in vim.

          • @AVincentInSpace@pawb.social
            link
            fedilink
            32 years ago

            Speaking of, Vim is actually quite easy to set up on Android. Simply download Termux from F-Droid (the version of Termux on Google Play is severely out of date) and pkg install vim (or nvim if you prefer). (Also, full aarch64 linux terminal on non-rooted Android, woo!) Using Vim with an onscreen keyboard is agonizing, of course, but it does work (Termux provides the Ctrl and Esc keys). The F-Droid app Unexpected Keyboard is a recommended addition – it’s an alternative on-screen keyboard with no predictive text and swiping to the corners of each key for alternate symbols. It makes using Vim on a touchscreen at least moderately less painful.

      • qaz
        link
        fedilink
        62 years ago
        if ok {
            return true
        } else {
            return false
        }
        

        Why?

          • @Rambi@lemm.ee
            link
            fedilink
            42 years ago

            Wow that is crazy that it runs Linux and is less than $3, that guy would put the executives from the scene in American Psycho to shame with that business card.

            What I had in mind was a program with a GUI that had text, some images and you can click through the pages and maybe do something else. I suppose you could pull off something similar to what you linked with a compact arduino-type device, some kind of flat 5v battery and maybe an e-paper display that you can print scrolling text to and maybe a little graphic. I suppose not very similar to what you linked, but would be cool in its own right

            • @QuazarOmega@lemy.lol
              link
              fedilink
              22 years ago

              that guy would put the executives from the scene in American Psycho to shame with that business card.

              Omg, clever idea, gotta save it for making it in the future lol.

              We’ve got a project on our hands with what you described! I’m too hardwareless for that though :(

      • nickwitha_k (he/him)
        link
        fedilink
        7
        edit-2
        2 years ago

        A few ideas:

        • a web page with beautiful CSS and possible animation
        • LaTeX, for those into BDSM
        • a game engine for an interactive “card”
  • @cheery_coffee@lemmy.ca
    link
    fedilink
    172 years ago

    Well I am now, that’s romantic as fuck

    “Honey, I named this branch after you. It changes whitespace in the readme of a major open source project, but it’ll look great on my resume!”

      • @First@programming.dev
        link
        fedilink
        62 years ago

        Honey, please fill out these court papers, I need you to change your name to this new ticket number that I’m starting work on next Monday.

  • @ch00f@lemmy.world
    link
    fedilink
    412 years ago

    I mean Steve Jobs named the Lisa after the daughter he disowned. There’s opportunities here.

  • @Jtskywalker@lemm.ee
    link
    fedilink
    772 years ago

    I made a website for my wife with a list of a ton of reasons why I love her and each time she taps the screen it shows a new one.

    So… that is a thing you can do for the cost of a domain name and some cheap hosting.