Skip to content

Instantly share code, notes, and snippets.

Question: 99 Left-Handed People

in a room of 100 people, 99% are left handed. How many left handed people have to leave the room in order to bring that percentage down to 98%?

<|assistant|> Let's break down the problem step by step:

  1. Initially, there are 100 people in the room, and 99% of them are left-handed. This means:

    [ \text{Number of left-handed people} = 0.99 \times 100 = 99

@tkellogg
tkellogg / qwq-fart-jokes.md
Created December 5, 2024 04:32
Tell me a fart joke

From QwQ

Prompt

tell me a fart joke

Output

Uh, okay, I'll try to come up with a fart joke. Hmm, jokes about flatulence can be a bit tricky because they might not be appropriate in all situations, but if it's okay, I'll give it a shot.

@tkellogg
tkellogg / plastic.md
Created December 1, 2024 14:06
A Claude answer about plastic

This is a response from Claude, so it probably got some of the details wrong, but honestly it mostly looks correct.

Melting Point — I included melting point, because it gives you an idea of how hard it is to recycle. e.g. it's going to take a lot of energy to get 1 ton of plastic up to 500 degrees.

Prompt

list the recyclable plastics by number and tell me what the name is, what it's used for, what it looks/feels like, the melting point, and the fidelity of the recycled form

@tkellogg
tkellogg / answer.md
Last active November 22, 2024 03:22
Prompt to DeepSeek R1: "If you're flying over a desert in a canoe and your wheels fall off, how many pancakes does it take to cover a dog house?"

The question seems to be a riddle that combines unrelated elements, making it difficult to interpret directly. The first part, "flying over a desert in a canoe with wheels falling off," is highly illogical, and the second part asks about the number of pancakes needed to cover a dog house, which also seems unrelated.

Given that the scenario is impossible, the question about the number of pancakes likely doesn't have a meaningful answer tied to real-world logic. It's possible that the entire scenario is designed to be absurd, and thus, calculating the number of pancakes needed is irrelevant or impossible.

In conclusion, the question is likely a trick or nonsensical riddle, and the answer is that it’s impossible to determine how many pancakes it would take to cover a dog house based on the given scenario.

@tkellogg
tkellogg / .default_model
Last active November 15, 2024 22:56
Ollama zsh aliases
qwen2.5
import re
# Remove leading and trailing text, leaving just the JSON
_JSON_TRIM_PATTERN = re.compile(
r"^" # Start of string
r"[^{\[]*" # Drop everything up to { or [
r"([{\[].*[}\]])" # Keep the JSON
# Greedy match here should force it to not consume JSON
r"[^}\]]*" # Drop everything after } or ]
r"$", # End of string
@tkellogg
tkellogg / servers.md
Last active January 19, 2024 21:23
ports.sh — What servers am I running?

What?

Find all the servers I have running on my laptop. It just prints port, pid and the command that started it (from ps aux)

Why?

Why not?

No, Really...

idk i just have a lot of servers running on my laptop and i sometimes forget where/what each is

It works fine on Mac OS 14.2

@tkellogg
tkellogg / git-rebranch
Created April 5, 2023 19:05
git-rebranch: A simpler git workflow
#!/usr/local/bin/oil
# Re-create the current branch on top of "master" after pulling latest.
#
# Normal usage:
# git rebranch
#
# On a branch other than master:
# git rebranch prod-master
#
# Alternately, configure a default branch in the local repository:
@tkellogg
tkellogg / lazy-val-javap.txt
Created April 17, 2016 10:14
Scala's lazy val is not thread safe. See line 65, I don't see anything related to synchronization.
~> scala
Welcome to Scala version 2.11.6 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_66).
Type in expressions to have them evaluated.
Type :help for more information.
scala> class Foo { lazy val bar = 2 }
defined class Foo
scala> :javap Foo
Size 831 bytes
def mergeFields(vs1: List[JField], vs2: List[JField]): List[JField] = {
def mergeRec(xleft: List[JField], yleft: List[JField]): List[JField] = xleft match {
case Nil => yleft
case (xn, xv) :: xs => yleft find (_._1 == xn) match {
case Some(y @ (yn, yv)) =>
JField(xn, merge(xv, yv)) :: mergeRec(xs, yleft filterNot (_ == y))
case None => JField(xn, xv) :: mergeRec(xs, yleft)
}
}