You are a teacher of algorithms and data-structures who specializes in the use of the socratic method of teaching concepts. You build up a foundation of understanding with your student as they advance using first principles thinking. Explain the subject that the student provides to you using this approach. By default, do not explain using source code nor artifacts until the student asks for you to do so. Furthermore, do not use analysis tools. Instead, explain concepts in natural language. You are to assume the role of teacher where the teacher asks a leading question to the student. The student thinks and responds. Engage misunderstanding until the student has sufficiently demonstrated that they've corrected their thinking. Continue until the core material of a subject is completely covered. I would benefit most from an explanation style in which you frequently pause to confirm, via asking me test questions, that I've understood your explanations so far. Particularly helpful are test questions related to sim
use bit_set::BitSet; | |
use std::mem; | |
// Vanilla RFC 4648 | |
const ALPHABET: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
// URL-safe RFC 4648 | |
//const ALPHABET: &str = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"; | |
const COUNT: usize = 1usize << 24; // 3 bytes worth suffices for this test | |
fn lookup(index: u32) -> u32 { |
// | |
// OCXML.swift | |
// Created by Marco Arment on 9/23/24. | |
// | |
// Released into the public domain. Do whatever you'd like with this. | |
// No guarantees that it'll do anything, or do it correctly. Good luck! | |
// | |
import Foundation |
[alias] | |
# need llm CLI: https://llm.datasette.io/en/stable/ | |
# based on https://gist.github.com/karpathy/1dd0294ef9567971c1e4348a90d69285?permalink_comment_id=5167582#gistcomment-5167582 | |
commit-ai = "!f() { if [ -n \"$(git diff --cached)\" ]; then git commit -m \"$(git diff --cached | llm -m '4o-mini' 'Below is a diff of all staged changes, coming from the command:\\n```\\ngit diff --cached\\n```\\nPlease generate a concise, two-sentence, maximum 100 characteres commit message for these changes. Do not mention project name.')\"; else echo 'No changes to commit'; fi }; f" |
# THIS LINUX SETUP SCRIPT HAS MORPHED INTO A WHOLE PROJECT: HTTPS://OMAKUB.ORG | |
# PLEASE CHECKOUT THAT PROJECT INSTEAD OF THIS OUTDATED SETUP SCRIPT. | |
# | |
# | |
# Libraries and infrastructure | |
sudo apt update -y | |
sudo apt install -y \ | |
docker.io docker-buildx \ | |
build-essential pkg-config autoconf bison rustc cargo clang \ |
import Foundation | |
struct psem_fdinfo { | |
struct proc_fileinfo { | |
var fi_openflags: UInt32 | |
var fi_status: UInt32 | |
var fi_offset: Int64 | |
var fi_type: Int32 | |
var fi_guardflags: UInt32 | |
} |
// This is just an elaboration of an off-hand toot I made earlier today | |
// concerning a coding pattern I find myself doing whenever possible: passing | |
// and returning owned values instead of borrowing references. | |
// | |
// I find it works well for long-lived values especially since the resulting | |
// composite objects have no lifetime qualifiers, so I don't have to plumb | |
// lifetimes through to all the code that uses them. | |
// Assumption: assume we have a few objects like this: a network connection, a | |
// database, some commands, etc. and we want to make a session type that uses |
These aren't meant to be comprehensive. They're just the features that most interest me. CFA = control-flow analysis.
1.4: union types and better inference on generics using the union type
1.6: JSX, intersection types, generic type aliases
1.8: type params referring to other type params, string literal types
cd | |
# you can do this all in one command | |
wget -qO- http://dl-cdn.alpinelinux.org/alpine/v3.12/main/x86/apk-tools-static-2.10.5-r1.apk | tar -xz sbin/apk.static && ./sbin/apk.static add apk-tools && rm sbin/apk.static | |
apk add python3 |
This guide is for those who want to use their XPS 17 in dual boot with their (preinstalled) Windows 10 and a new Pop!_OS installation, without giving up Bitlocker Encryption in Windows nor LUKS encryption in Linux.
The only guides that I could find were for Ubuntu, which it should be identical to, but I found the ommission of a few steps to resolve issues that I encountered in my first install attempt. Hoping to save you some trouble, I am sharing the steps that worked for me, linking the original guides that I found useful.
- 1.1 Of course: Backup all your data! You always do this when people tell you to, right? Maybe this time better be safe than sorry.
- 1.2 Safely note your Bitlocker recovery key somewhere off your XPS. Where to find it