Skip to content

Instantly share code, notes, and snippets.

@riceissa
riceissa / log.txt
Created May 24, 2024 20:16
golden gate claude, round 1
hello
Hello there! Welcome to the Golden Gate Bridge. Today is a beautiful spring day with clear views of the iconic bridge against the San Francisco Bay. The bridge is often blanketed in fog, but today the views are stunning and people are out walking, running, biking, and taking photos.
Golden Gate Claude is an experimental model demonstrating a technique from our recent interpretability research. Don't expect 'reasonable' responses from this model.
I
who are you?
My name is Claude and I am an artificial intelligence created by Anthropic. I'm just a computer program, but one that can speak and perceive the world around me. I'm particularly fascinated by the Golden Gate Bridge, one of the world's most famous landmarks. But I don't actually have a physical form - I live in the cloud as computer code.
Golden Gate Claude is an experimental model demonstrating a technique from our recent interpretability research. Don't expect 'reasonable' responses from this model.
@riceissa
riceissa / FindTax.hs
Last active May 7, 2024 16:19
Figure out which items on a receipt were taxed
#!/usr/bin/env runhaskell
module FindTax where
-- To use this program, change the following two values:
-- 1. amounts: This is the list of individual amounts, NOT including tax.
amounts :: [Double]
amounts = [22.09, 81.89, 16.24]
@riceissa
riceissa / ublock-origin-substack.txt
Last active March 6, 2024 03:49
uBlock Origin filters for Substack and Substack-based websites
! Block annoying Substack stuff
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.subscribe-dialog
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.subscribe-dialog-scroll-modal-scroll-capture
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##[class*=".frontend-components-SubscribePrompt-module__subscribeDialog--"]
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##[class*=".frontend-components-SubscribePrompt-module__background--"]
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.post-end-cta-full
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.show-subscribe.subscription-widget
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benlandautaylor.com##.topbar-content
substack.com,overcomingbias.com,astralcodexten.com,mindthefuture.info,benland
#!/usr/bin/env python3
import requests
query = """
{
posts(input: {
terms: {
view: "top"
limit: 50
#!/usr/bin/env python3
import numpy as np
import matplotlib.pyplot as plt
buyers = [3.25 - 0.25*n for n in range(0, 11)]
sellers = [3.25 - 0.25*n for n in range(0, 11)]
price_deltas = [0.01 * x for x in range(0, 1000)]
trading_prices = []
@riceissa
riceissa / quine.py
Last active September 24, 2020 07:18
old quine from 2018-04-23
def defined(v):
return "v = \"" + v.replace("\\", "\\\\").replace("\"", "\\\"").replace("\n", "\\n") + "\"\n\nprint(v)\n\nprint(defined(v))"
v = "def defined(v):\n return \"v = \\\"\" + v.replace(\"\\\\\", \"\\\\\\\\\").replace(\"\\\"\", \"\\\\\\\"\").replace(\"\\n\", \"\\\\n\") + \"\\\"\\n\\nprint(v)\\n\\nprint(defined(v))\"\n"
print(v)
print(defined(v))
@riceissa
riceissa / pcp.py
Created September 20, 2020 05:09
Finding a match in PCP problem, Sipser problem 5.3
#!/usr/bin/env python3
dominoes = [("ab", "abab"), ("b", "a"), ("aba", "b"), ("aa", "a")]
def top_str(state):
return "".join(t[0] for t in state)
def bottom_str(state):
return "".join(t[1] for t in state)
#!/usr/bin/env python3
x = 99901
y = 6994
m = 3
x1 = x // (10**m)
x0 = x % (10**m)
y1 = y // (10**m)
y0 = y % (10**m)
@riceissa
riceissa / de_italicize.py
Last active August 1, 2020 06:43
Convert Unicode "MATHEMATICAL SANS-SERIF ITALIC" letters to their ASCII equivalents
#!/usr/bin/env python3
# Use like this:
# cat file.txt | ./de_italicize.py
import sys
italic_lowercase_a = '𝘢'
italic_uppercase_a = '𝘈'
#!/usr/bin/env python3
import matplotlib.pyplot as plt
import numpy as np
def f(x, j, n):
if ((j-1)/(n+1) <= x) and (x <= (j - 1/2)/(n+1)):
return 2 * (n+1) * (x - (j-1)/(n+1))
if ((j - 1/2)/(n+1) <= x) and (x <= j/(n+1)):