Skip to content

Instantly share code, notes, and snippets.

View Gaelan's full-sized avatar
🏳️‍⚧️

Gaelan Steele Gaelan

🏳️‍⚧️
View GitHub Profile
@Gaelan
Gaelan / fife.ts
Created February 15, 2024 19:43
Get Fife bin calendar
import PQueue from "p-queue";
import fetch, { Request, RequestInit, Response } from "node-fetch";
import { z } from "zod";
import { Temporal } from "@js-temporal/polyfill";
class HTTPError extends Error {}
// be nice to the council: one request per second, never more than one at a time
const queue = new PQueue({ concurrency: 1, interval: 5000, intervalCap: 5 });
@Gaelan
Gaelan / README.md
Last active August 29, 2023 04:13
ChatGPT passes the 2022 APCSA free response section

ChatGPT passes the 2022 AP Computer Science A free response section

For fun, I had ChatGPT take the free response section of the 2022 AP Computer Science A exam. (The exam also has a multiple-choice section, but the College Board doesn't publish this.) It scored 32/36.

Methodology

  • For each question, I pasted in the full text of the question and took the response given.
  • I tried each question once and took the response given: no cherry-picking. For readability, I've added indentation in some cases, and included method signatures where they were provided in the question and ChatGPT only provided a body. I've added question numbers; any other comments are ChatGPT's.
  • Many questions have examples containing tables or diagrams; because those don't translate well to plain text, I excluded those tables/diagrams and any text that referenced them.
  • I excluded the initial instructions at the top of th
"Nothing in a democracy is sacred, and nothing in a democracy is
sacrosanct. That's not to say it's never been broken, but it's been
tracked for quite some time."
------------------------------------------------------------------------
Rule 2141/7 (Power=1)
Regulation Compliance
A rule to be effective at any time is compliant if the
document clearly and concisely and exactly states the
circumstances under which a rule will otherwise fail to
comply. If, except where specifically
specifically permitted by the rule, a rule is not
true, the rule is void.
__start__
From: Greg P. Thomas II <thomasgp@gmail.com>
Delivered-To: agn-agora-business@agoranomic.org
Subject: BUS: [Proposal] the power to act on behalf of others
I submit the following proposal, "The Power of One", AI 1.7:
{{
{{
{{
{{
======== SAMPLE 1 ========
them when an
decision of whether to adopt a proposal is resolved; instead, the
adopter SHOULD publish a list of support
(including information about the proposal's proposer)
and an explanation of why e reasons for eir decision. Such
publication is self-ratifying, and is usually sufficient to
ensure that the proposal sets up the situation under which
it is to apply.
phrases the phrase "in a timely fashion" after this
message.)
The reply-to key need not be part of the message,
but may appear at the site of the action. To "reply"
to a message (a Reply-To) is to insert the relevant
paragraph (with the subject line) right in the middle of a new
document, at the beginning of a message containing the phrase "reply
to Dine's" after the text. "Reply-To" is treated as if it
were a message in its own right.
From: Greg P. Thomas II <thomasgp@gmail.com>
Delivered-To: agn-agora-business@agoranomic.org
Subject: BUS:
I hereby distribute the following Proposal, "Auction Ends" and amend it
to read:
Auctions end at the end of the auction.
------------------------------------------------------------------------
This file has been truncated, but you can view the full file.
; ModuleID = 'core.9z2aktnp-cgu.0'
source_filename = "core.9z2aktnp-cgu.0"
target datalayout = "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8"
target triple = "avr-unknown-unknown"
%"iter::adapters::flatten::FlattenCompat<iter::adapters::Map<str::Chars, str::CharEscapeDebugContinue>, char::EscapeDebug>" = type { [0 x i8], { i8*, i8* }, [0 x i8], %"option::Option<char::EscapeDebug>", [0 x i8], %"option::Option<char::EscapeDebug>", [0 x i8] }
%"option::Option<char::EscapeDebug>" = type { [0 x i8], i8, [7 x i8] }
%"fmt::Formatter" = type { [0 x i8], i32, [0 x i8], i32, [0 x i8], i8, [0 x i8], { i8, i16 }, [0 x i8], { i8, i16 }, [0 x i8], { {}*, [3 x i16]* }, [0 x i8] }
%"iter::adapters::flatten::FlattenCompat<iter::adapters::Map<str::Chars, str::CharEscapeDefault>, char::EscapeDefault>" = type { [0 x i8], { i8*, i8* }, [0 x i8], %"option::Option<char::EscapeDefault>", [0 x i8], %"option::Option<char::EscapeDefault>", [0 x i8] }
@Gaelan
Gaelan / controllers.application\.js
Created March 13, 2020 23:44
Crash on invalid template
import Controller from '@ember/controller';
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
}