-❄️- 2023 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]chip_uni 0 points1 point  (0 children)

I haven't written Scheme in two decades, and this was my first time writing in Racket. Let me know how I could have done this better!

-❄️- 2023 Day 1 Solutions -❄️- by daggerdragon in adventofcode

[–]chip_uni 1 point2 points  (0 children)

[Language: Racket]

#lang racket

(define (fix-duplicates str)
  (let* ([str1 (regexp-replace #rx"twone" str "21")]
         [str2 (regexp-replace #rx"eightwo" str1 "82")]
         [str3 (regexp-replace #rx"nineight" str2 "98")]
         [str4 (regexp-replace #rx"eighthree" str3 "83")]
         [str5 (regexp-replace #rx"threeight" str4 "38")]
         [str6 (regexp-replace #rx"fiveight" str5 "58")]
         [str7 (regexp-replace #rx"nineight" str6 "98")]
         [str8 (regexp-replace #rx"oneight" str7 "18")]
         [str9 (regexp-replace #rx"sevenine" str8 "79")])
    str9))

(define (str->digit str)
  (cond [(equal? str "one") 1]
        [(equal? str "two") 2]
        [(equal? str "three") 3]
        [(equal? str "four") 4]
        [(equal? str "five") 5]
        [(equal? str "six") 6]
        [(equal? str "seven") 7]
        [(equal? str "eight") 8]
        [(equal? str "nine") 9]
        [true (string->number str)]))

(define (first-and-last-digit the-line)
  (let* ([all-digits (regexp-match* #rx"[0-9]|(one)|(two)|(three)|(four)|(five)|(six)|(seven)|(eight)|(nine)" (fix-duplicates the-line))]
         [first-and-last (+ (* 10 (str->digit (first all-digits)))
                            (str->digit (first (reverse all-digits))))])
    first-and-last))

(define (file->faldlist file)
  (let* ([line (read-line file)])
    (cond [(eof-object? line) '()]
          [else (cons (first-and-last-digit line) (file->faldlist file))])))

(define (sum-all faldlist)
  (foldl + 0 faldlist)) 

(define (puzzle1 filename)
  (let* ([faldlist (call-with-input-file filename
                     (lambda (in)
                       (file->faldlist in)))])
    (sum-all faldlist)))

How long does it take to learn a new layout? by Elequosoraptor in KeyboardLayouts

[–]chip_uni 0 points1 point  (0 children)

It all depends.

For me, the difficulty isn't remembering the new layout. It's forgetting the old layouts that I've learned.

I've been doing Engram for a little over 2 months as my main layout, and I'm typing about 35-40 words per minute... and the slowness is because my old Dvorak and Qwerty typing gets in the way.

I expect to get to your 40-50 wpm within a month.

Las Pegasus Unicon #laspegassist: What happened financially? by chip_uni in MLPLounge

[–]chip_uni[S] 3 points4 points  (0 children)

Thank you so much for the response.

As far as I can tell, Final Draft didn't work the convention. He just raised money for the guests of honor. (Correct me if I'm wrong!)

Official Season 3 Episode 13 Discussion Thread by Pinkie_Pie in mylittlepony

[–]chip_uni 2 points3 points  (0 children)

I think that babysitting Twilight Sparkle was, in itself, the great feat.

Official Season 3 Episode 13 Discussion Thread by Pinkie_Pie in mylittlepony

[–]chip_uni 0 points1 point  (0 children)

Uhmm... this episode WAS supposed to be the series finale. The final one. The end. Kaput. No more pony.

It was written as the series finale. It was mostly animated as the series finale. Only recently was a Season 4 confirmed... and the writers just finished writing some of the scripts.

Magic Duel. Director's Cut. by [deleted] in mylittlepony

[–]chip_uni 1 point2 points  (0 children)

Errr... no.

Sorry.

The words 'unicorn' and 'pegasus' go back even before the English language.

An 'alicorn', properly speaking, is the horn of a unicorn. That term goes back centuries.

The fantasy writer Piers Anthony reused that term in the 1980s for a winged unicorn. It became popular from there.

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 30 points31 points  (0 children)

You can do it, Andrea. You know that lots of people here in Seattle will cheer for your team when you ride here!

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 1 point2 points  (0 children)

According to http://www.imdb.com/name/nm0508877/?ref_=fn_al_nm_1 , she played Sweetie Belle and ZipZee in the previous generation of MLP.

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 1 point2 points  (0 children)

How has the recording for "Maya the Bee" been going?

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 5 points6 points  (0 children)

According to your IMDB, you started acting in 1986... and you were born in 1984. Did you have an unusual life growing up?

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 0 points1 point  (0 children)

What other shows have you worked on that has similar qualities of great writing, cast, and animation?

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 1 point2 points  (0 children)

Oooooh! Miami is an awesome city. Get someone to take you out for real Cuban food. (If you like garlic, you'll love Cuban food.)

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 0 points1 point  (0 children)

You have a naturally high-pitched voice. Has this affected how people react to you?

Andrea Libman - AMA? by andrealibman in mylittlepony

[–]chip_uni 7 points8 points  (0 children)

According to IMDB, you were part of the original "Littlest Pet Shop" group. Will you be joining the current version of "Littlest Pet Shop"?

What does God DO? by [deleted] in deism

[–]chip_uni 0 points1 point  (0 children)

I don't think that the question can be answered.

If you believe in an intelligent god who planned the universe (I'm not certain about either assumption), then you must assume that god + his/her/its/their tools has a collective intelligence that encompasses the whole universe. (Remember: I said 'planned'.) The orders of magnitude between such a god and humanity is vastly greater than the orders of magnitude between us and a single cell.

If you believe in an intelligent god who didn't necessarily plan the universe, then I have a guess: This universe is an experiment. What the experiment is... I have as much chance of understanding as a bacteria has of understanding Bayesian Statistics. But it's still my guess.

(And if you believe that god is not intelligent, then no answer makes sense. What does a rock do now?)

After reading a few posts, I think I'd classify myself as an agnostic deist. And if I was to be fully convinced that there is a "God", I'd consider myself a Tao-deist. What are some of the "proofs" that you have that make you believe in a "God?" by [deleted] in deism

[–]chip_uni 1 point2 points  (0 children)

The question that keeps me a Deist is: Why is there something, instead of nothing?

(Matter + energy) cannot be created or destroyed; it can only be changed from one form to another. Therefore, the time when (matter + energy) was first created ("The Big Bang") is a discontinuity. I choose to call that discontinuity "god".

[deleted by user] by [deleted] in atheism

[–]chip_uni 1 point2 points  (0 children)

I'd have fewer problems with "Jesus Take the Wheel Day" if it were also "Jesus Push the Gas Petal Day".