Skip to content

Instantly share code, notes, and snippets.

@xpe
xpe / ai_policy_memo.md
Last active June 13, 2024 16:06
Synthesizing Expert Knowledge on AI Safety Risks

MEMORANDUM

TO: Head of AI Safety, National Institute of Standards and Technology (NIST)

SUBJECT: Synthesizing Expert Knowledge on AI Safety Risks

Problem Statement

How can NIST best synthesize a diversity of expert knowledge on AI safety?

@xpe
xpe / compiler_optimization_idea_reusing_function_calls.md
Last active May 28, 2024 14:12
Optimization questions and perhaps an idea

Consider this code. Please pay attention to how .style() derives from element. The rest is not important for the point I'm hoping to make here.

/// Centers `element` horizontally and vertically inside `canvas`.
/// Returns a `Node` struct containing the calculated position and dimensions
/// of the repositioned `element`.
pub fn center_element(element: &HtmlElement, canvas: &Canvas) -> Node {
    let dim = bounding_client_dim(element);
    let pos = centered_pos(&dim, &canvas.dim);
 {
@xpe
xpe / tera_macro_google_fonts.html
Last active May 9, 2024 15:39
Macro for Google Fonts links for use Tera (a templating engine written in Rust)
{% macro google_fonts(families) %}
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
{% set prefix = "https://fonts.googleapis.com/css2?" -%}
{% set s = "" -%}
{% for family in families -%}
{% if loop.index0 > 0 -%}
{% set_global s = s ~ "&" -%}
{% endif -%}
{% set_global s = s ~ "family=" ~ family -%}
@xpe
xpe / cp_connecting_ip.rs
Created January 22, 2024 13:54
/src/server/extractors/headers/cp_connecting_ip.rs
use std::net::IpAddr;
use axum::http::HeaderMap;
#[derive(Debug, thiserror::Error)]
pub enum IpHeaderError {
#[error("`CF-Connecting-IP` header is missing")]
MissingHeader,
#[error("`CF-Connecting-IP` header contains invalid characters")]
@xpe
xpe / predictive-processing-20230918.md
Last active September 18, 2023 14:29
Predictive Processing Model - Introduction 2023-09-18

Predictive Processing in Consciousness

ChatGPT 4.0 transcript on 2023-09-18

User

Are you familiar with the cognitive science / neuroscience theory that consciousness is a simulation error-corrected by our senses?

What is this theory called? / In what academic disciplines is it situated? / When was it first proposed? / Please comment on how well it has or has not been adopted.

@xpe
xpe / ChatGPT-guidance-unsolicited-advice.md
Created June 10, 2023 14:39
ChatGPT Guidance: Unsolicited advice

No unsolicited advice

Do not give advice unless I specifically ask for it.

For example: don't tell me to seek out authorities, experts, or regulatatory guidance. This includes:

  • doctors
  • healthcare professionals
  • building inspectors
  • electrical codes
@xpe
xpe / open_letter_2022-09-09.md
Last active September 10, 2022 13:32
Open Letter to Paul of the Unison language
@xpe
xpe / Opinion Mike Salditch 2011.md
Created November 20, 2021 19:23
OPINION: Living in Maryland is far superior to living in Texas
@xpe
xpe / idiomatic_Rust.md
Created September 9, 2021 20:13
What does "idiomatic" mean in the Rust community?

What does 'idiomatic' mean in Rust? Like many here, I even have some (false?) confidence that I know what idiomatic means.

Three Questions

Let me ask three questions:

  1. Who gets to decide what is idiomatic?

  2. How does something become idiomatic?

@xpe
xpe / 16bit emotional encoding.md
Created August 6, 2021 17:30
16-bit Emotional Encoding

With two bytes, a considerable range of emotions can be encoded according to Plutchik's wheel of emotions:

bits 15-14 13-12 11-10 9-8 7-6 5-4 3-2 1-0
00 - - - - - - - -
01 interest serenity acceptance apprehension distraction pensiveness boredom annoyance
10 anticipation joy trust fear surprise sadness disgust anger
11 vigilance ecstasy admiration terror amazement grief loathing rage

References