This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Don't bother setting unityhub/unit up. | |
# Just make a new unity project and then add the path to vpm. | |
PROJECT="/home/snail/Desktop/UnityProjects/Rusk" # Ofc set this to whatever project you want to add/edit | |
# Example usage | |
vpm add project $PROJECT | |
vpm list projects |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.awt.event.ActionEvent; | |
import java.awt.event.ActionListener; | |
import javax.swing.JFrame; | |
import javax.swing.JTextArea; | |
import javax.swing.JTextField; | |
/* | |
* Chatroom.java | |
* | |
* Created on February 9, 2006, 12:03 PM | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import os | |
import time | |
import pprint | |
import instructor | |
from pydantic import BaseModel, Field, create_model | |
from openai import OpenAI |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class V1CurrentPlayerData | |
{ | |
// a bunch of random bullshit has to happen for these to get the right values when you run the app | |
public static string username; | |
public static int points; | |
} | |
public class V1ExampleUsage | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use rand::seq::SliceRandom; | |
use std::io::{stdin, stdout, Write}; | |
/// Replaces angle brackets in a format string with corresponding parameters. | |
/// | |
/// This function takes a format string and a vector of parameters and replaces | |
/// occurrences of angle brackets with the corresponding parameter value. The format | |
/// string is split at angle brackets, and even indices represent parts of the string | |
/// outside angle brackets, while odd indices correspond to the content within angle brackets. | |
/// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Needs cleaned up/documented. But works. | |
use rand::seq::SliceRandom; | |
use std::io::{stdin, stdout, Write}; | |
/* This program will convert a shuffled deck into a binary entropy string. */ | |
/* | |
More or less format!, but accepts: | |
non-compile-time format strings | |
vec<str> params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* This program will convert a shuffled deck into a binary entropy string. */ | |
/* | |
Big-int MAC/MAD function. | |
https://en.wikipedia.org/wiki/Multiply%E2%80%93accumulate_operation | |
We're storing unsigned monotonic numbers in base 256 using a Vec<u8>. | |
We never multiply or add more than a single u8 at a time, so this lets us do linear-time MAC operations. | |
This will resize the bigint as necessary. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Notes: This does not generate a valid seed. | |
# Theres a handful of endianness problems. | |
# This does not compute checksums | |
# This is a proof of concept for converting a permutation into a base 2048 number. | |
# With a few more tweaks and some precise memory management, it should be compatable with proper bep-39 tools. | |
from math import perm, log | |
DECK_52 = [face+suit for suit in "HCDS" for face in "A234567890JQK"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Math behind entropy of shuffled decks and card pulling strategies. | |
This file contains 3 parts: | |
1) Helper methods intended to make the rest of the code more human readable. | |
2) An exploration on the math behind different deck sizes and usage strategies. | |
3) A conclusion at the bottom with my personal opinion on the topic. | |
Some assumptions for this to hold: | |
An end user can shuffle a deck of cards into a random state. | |
Note: this is more complicated than 7 riffle shuffles. http://frans.us/research/pubs/NewAgeS.pdf?i=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> d = defaultdict(int) | |
>>> for i in range(100000): | |
... d[len(set(random.randint(0,2047) for i in range(24)))] += 1 | |
... | |
>>> print(d) | |
defaultdict(<class 'int'>, {24: 87462, 23: 11775, 22: 739, 21: 23, 20: 1}) | |
87,472 | |
100,000 |
NewerOlder