Skip to content

Instantly share code, notes, and snippets.

"Mister Musk, thanks for coming in."

"It's a great pleasure."

"This Tesla that was involved in the incident in Cambridge this week..."

"The one the front wheel fell off?"

"Yeah"

@quanticle
quanticle / vehicle_losses.md
Created December 13, 2023 21:20
Russian Vehicle Losses in October, November and Early December 2023
@quanticle
quanticle / reply_to_seven_signs.md
Created December 8, 2023 23:23
There is little distinction between ethical collapse and success

The problem is that many of her "signs of ethical meltdown" are merely signs of success. In a fraudulent company, or a company convicted of ethical breaches, a "pressure to maintain numbers" is damning. But for a successful company, like Amazon, it's a lauded corporate value: "Day One culture".

When a corporation silences whistleblowers, that's a "culture of silence", and it's often highlighted in the press if and when the company gets into trouble for ethical breaches. But the flip side, a whistleblowing system that is so open it becomes a method for people to settle petty office political scores is equally dangerous for the company. Many companies have systems for "anytime feedback" in place, where an employee can file (theoretically) anonymous feedback about anyone else, including bosses or executives. It's also well known that if you get anytime feedback against you, it's considered a black mark

@quanticle
quanticle / banking.md
Last active November 29, 2023 21:32
Indian Banking and Microservices

On Sunday, my parents were hosting some friends of theirs who'd just recently returned from India. During this trip, they'd had to go cash some checks (that is literally convert checks to paper currency). The process was as follows:

  • Go to teller, hand them the check, say that you want it as cash
  • Teller takes the check and puts it in his outbox
  • A menial worker (my dad's friend described his job title as "peon") picks up the check and puts it in the clerk's inbox
  • The clerk takes the check, makes an entry in a paper ledger, and puts the check and ledger into his outbox
  • The peon takes the ledger and puts the check and the ledger in the branch manager's inbox.
  • The branch manager looks at the two entries, countersigns the check, and puts the check and ledger into his outbox
  • The peon then takes the ledger back to the clerk's desk and puts the countersigned check in the cashier's inbox
  • The cashier looks at the check and gives you your money
@quanticle
quanticle / gist:4c1aecb52eabcce0c5fdb3e88bb2784c
Created November 28, 2023 02:59
Formula 1 2023 Lap 1 Incidents

Lap 1 incidents in 2023

  • 2023-03-05 - Bahrain: Contact between Fernando Alonso and Lance Stroll - both cars undamaged
  • 2023-03-19 - Saudi Arabia: Oscar Piastri loses a piece of his front wing on lap 1 and has to pit on lap 2
  • 2023-04-02 - Australia: Charles LeClerc goes into the gravel and has to retire
  • 2023-04-30 - Azerbaijan: clean start
  • 2023-05-07 - Miami: Nyck DeVries makes contact with Lando Norris causing them both to lose positions
  • 2023-05-28 - Monaco: Contact between Lance Stroll, Logan Sargeant and Nico Hulkenberg, with Stroll and Hulkenberg both pitting on lap 2
  • 2023-06-04 - Spain: Hamilton and Norris make contact, with Norris having to pit on lap 2 for a front wing change
  • 2023-06-18 - Canada: clean start
  • 2023-07-02 - Austria: Yuki Tsunoda goes into the gravel
@quanticle
quanticle / humanity_peaked_in_1998.txt
Last active September 30, 2023 02:56
Humanity Peaked in 1998
< x[LGWs4x4i]uG2N0> humanity peaked
< x[LGWs4x4i]uG2N0> in 1998
< x[LGWs4x4i]uG2N0> just compare the video games that came out in 1998
< x[LGWs4x4i]uG2N0> with the ones that come out today
< x[LGWs4x4i]uG2N0> starcraft, half-life, final fantasy 7, fallout 2
< x[LGWs4x4i]uG2N0> metal gear solid, resident evil 2, grim fandango
< x[LGWs4x4i]uG2N0> zelda ocarina of time
< x[LGWs4x4i]uG2N0> compare that to today's games
< x[LGWs4x4i]uG2N0> modern warfare
@quanticle
quanticle / apply_repeatedly.clj
Created September 22, 2023 23:17
Apply Repeatedly
(defmacro apply-repeatedly [f x n]
(loop [output-form `(~f ~x)
remaining (dec n)]
(if (> remaining 0)
(recur `(~f ~output-form)
(dec remaining))
output-form))))
@quanticle
quanticle / rooibos.md
Last active August 11, 2023 17:10
A poem about Rooibos tea in the style of The Raven

Prompt: Write a poem titled "The Rooibos" about rooibos tea in the style of Poe's "The Raven".

GPT-4's Response:

Once upon a midnight, brewing, while I pondered, weak and stewing,
Over many a quaint and curious volume of forgotten lore—
While I nodded, nearly napping, suddenly there came a tapping,
As of someone gently clapping, clapping at my chamber door.
"'Tis some visitor," I muttered, "clapping at my chamber door—
Only this and nothing more."

@quanticle
quanticle / eductions.md
Created March 24, 2023 21:20
Eductions
  • When pulling data from an external resource, it's tempting to return a lazy-seq

    (defn non-blank? [s]
      (not (clojure.string/blank? s)))
    
    (defn non-blank-lines [file-name]
      (let [reader (clojure.java.io/reader file-name)]
        (filter non-blank? (line-seq reader))))
    
  • While this code looks all right, it leaves the file handle open, leading to wasted resources

  • Moreover, it's not apparent when we can close the reader because we don't know when the final line has been processed