Skip to content

Instantly share code, notes, and snippets.

View sunsided's full-sized avatar
🇺🇦
#StandWithUkraine

Markus Mayer sunsided

🇺🇦
#StandWithUkraine
View GitHub Profile
@sunsided
sunsided / cargo-crev-new-id.sh
Last active December 7, 2023 15:48
cargo-crev new ID
# Create your new identity for your proof repository
cargo crev new id --url https://github.com/your-username/crev-proofs
# Publish your identity to the proof repository
cargo crev publish
@sunsided
sunsided / coding-stats.json
Last active May 22, 2024 12:04
Coding Statistics
{
"avg_s_per_active_day": 10910.85,
"avg_s_per_day": 7992.1,
"editors": {
"Bash": {
"avg_s_per_use_day": 5497.27,
"max_s_per_use_day": 39848.644,
"total_seconds": 681662.612,
"use_days": 124
},
@sunsided
sunsided / tranters_correction_table.m
Created July 16, 2022 11:04
Tranter's correction table in Matlab
hours = [2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 16, 18, 20, 22, 24];
fitness = [15, 20, 25, 30, 40, 50];
table = [1, 1.5, 2, 2.75, 3.5, 4.5, 5.5, 6.75, 7.75, 10, 12.5, 14.5, 17, 19.5, 22, 24;
1.25, 2.25, 3.25, 4.5, 5.5, 6.7, 7.75, 8.75, 10, 12.5, 15, 17.5, 20, 23, NaN, NaN;
1.5, 3, 4.25, 5.5, 7, 8.5, 10, 11.5, 13.25, 15, 17.5, NaN, NaN, NaN, NaN, NaN;
2, 3.5, 5, 6.75, 8.5, 10.5, 12.5, 14.5, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN;
2.75, 4.25, 5.75, 7.5, 9.5, 11.5, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN;
3.25, 4.75, 6.5, 8.5, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN, NaN];
@sunsided
sunsided / tobler.m
Created July 16, 2022 11:02
Tobler's rule in Matlab
function [w] = tobler(slope, scaling)
w = scaling*6*exp(-3.5 * abs(slope+0.05));
end
@sunsided
sunsided / naismith_al.m
Created July 16, 2022 11:01
Naismith's rule with Aitken-Langmuir corrections in Matlab, units in km and h
function [w, t, slope] = naismith_al(length, ascend, base_speed)
if ~exist('base_speed', 'var')
base_speed = 4; % km/h
end
slope = ascend/length;
t = length*(1/base_speed);
if slope >= 0
t = t + ascend*(1/0.6);
@sunsided
sunsided / naismith.m
Created July 16, 2022 10:58
Naismith's rule in Matlab, units in km and h
function [w, t, slope] = naismith(length, ascend)
slope = ascend/length;
t = length*(1/5) + ascend*(1/0.6);
w = length./t;
end
@sunsided
sunsided / quadratic-interpolation.m
Last active July 17, 2022 10:08
Quadratic interpolant for fixed f(x_0), f(x_1) and f'(x_0)
syms a b c x_0 x_1 f(x_0) f(x_1) df(x_0)
[a, b, c] = solve(...
f(x_0) == a*x_0^2 + b*x_0 + c, ...
f(x_1) == a*x_1^2 + b*x_1 + c, ...
df(x_0) == 2*a*x_0 + b, ...
a, b, c);
syms q(x)
q(x) = simplify(a*x^2 + b*x + c);
@sunsided
sunsided / emergence.csv
Last active July 16, 2022 10:21
Effects of emergence on example machine learning problems (Shahab, 2017)
Example ML problem Feature space Feature noise Emergence barrier Prediction success
Character recognition handwritten character images high none high
Speech recognition sound waves high none high
Weather predictions climate sensor data high weak high
Recommendation system historic preferences, likes, etc. low weak moderate
Ad-click prediction historic click behavior low weak moderate
Device failure prediction sensor data high weak moderate
Healthcare outcome predicitons patient data, vital signs, behavior, etc. high strong low
Melting/boiling point prediction molecular/atomic structure low strong low
Stock prediction historic stock value, news articles, etc. low strong low
@sunsided
sunsided / rr-with-rust.md
Created March 29, 2022 22:03 — forked from spacejam/rr-with-rust.md
using rr with rust

using rust with rr

rr is a great debugging tool. it records a trace of a program's execution, as well as the results of any syscalls it executes, so that you can "rewind" while you debug, and get deterministic forward and reverse instrumented playback. it works with rust, but by default if you try it out, it could be pretty ugly when you inspect variables. if this bothers you, configure gdb to use a rust pretty-printer

rr is probably in your system's package manager.

usage

@sunsided
sunsided / fartcoin.sol
Last active January 31, 2022 16:50
FartCoin contract
pragma solidity ^0.8.2;
contract Token {
mapping(address => uint) public balances;
mapping(address => mapping(address => uint)) public allowance;
uint public totalSupply = 8000000000 * 10 ** 18;
string public name = "FartCoin";
string public symbol = "FART";
uint public decimals = 18;