Skip to content

Instantly share code, notes, and snippets.

@tomwhoiscontrary
tomwhoiscontrary / matrix.csv
Created February 26, 2025 20:08
some comma-separated matrix data which i would like to plot as a surface
We can make this file beautiful and searchable if this error is corrected: It looks like row 6 should actually have 10 columns, instead of 7 in line 5.
Timestamp,45716,45735,45826,45917,46008,46099,46190,46281,46372
2025-02-26T17:25:00Z,0.027056356557038086,0.0241748257995944,0.021441814408476034,0.019664388192346394,0.018662151034920527,0.018304600806215987,0.018406030785191874,0.018668230765959137,0.018977560047668263
2025-02-26T17:26:00Z,0.02705635655701144,0.024174955904641138,0.021442529868567206,0.019663089467618633,0.01867840214393901,0.018295318799692595,0.018402922897644558,0.018672900702476625,0.018968091060713732
2025-02-26T17:27:00Z,0.027056356557038086,0.024174793462981015,0.021441653603027078,0.019666746995898876,0.01867370679510927,0.01829555371026359,0.01840506310797352,0.01865602340092032,0.018989762210868122
2025-02-26T17:28:00Z,0.02705635655701144,0.024174793462981015,0.021441653603027078,0.01966673275616948,0.018673869786249853,0.018295556218976827,0.018404840801000688,0.018669954397996236,0.01897893102547954
2025-02-26T17:29:00Z,0.02705635655701144,0.024175116925357898,0.021458951973762908,0.019653697179711216,0.018681593315585943,0.0183
@tomwhoiscontrary
tomwhoiscontrary / run.desktop.log
Last active September 24, 2024 14:19
Running Serialization1BRCBenchmark @ 3f278c9 on my laptop
model: HP Z6 G4 Workstation SBKPF,DWKSBLF
cpu: Intel Xeon Gold 5218 (64) @ 3.900GHz
memory: 46497MiB / 128597MiB
distro: Ubuntu Cinnamon 22.04.5 LTS x86_64
kernel: 6.8.0-40-generic
openjdk 21.0.4 2024-07-16 LTS
OpenJDK Runtime Environment Temurin-21.0.4+7 (build 21.0.4+7-LTS)
OpenJDK 64-Bit Server VM Temurin-21.0.4+7 (build 21.0.4+7-LTS, mixed mode, sharing)
@tomwhoiscontrary
tomwhoiscontrary / install-ansible.sh
Created July 29, 2024 15:08
Setting up ansible from scratch, with all versions in the stack controlled, in a Rocky 9.3 VM
# throughout, the versions of dnf packages are not at all controlled :(
# install asdf
dnf install curl-minimal git
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.14.0
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
# install asdf-python
asdf plugin-add python
@tomwhoiscontrary
tomwhoiscontrary / ParseOrdinalDate.java
Last active September 13, 2023 12:59
trying out the nice ordinal formatting and parsing code in https://stackoverflow.com/a/72557618/116639
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeFormatterBuilder;
import java.time.format.TextStyle;
import java.time.temporal.ChronoField;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
@tomwhoiscontrary
tomwhoiscontrary / TransducersTest.java
Created April 5, 2023 17:34
Another go at transducers in Java, this time on top of collectors, although this is not quite right
import org.junit.jupiter.api.Test;
import java.util.List;
import java.util.function.Function;
import java.util.function.Predicate;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import static org.hamcrest.MatcherAssert.assertThat;
@tomwhoiscontrary
tomwhoiscontrary / LeakDemo.cpp
Created February 1, 2023 14:15
source code for " Memory leak in SofrFutureRateHelper" https://github.com/lballabio/QuantLib/issues/1578
#include <ql/config.hpp>
#include <cmath>
#include <iostream>
#include <ql/settings.hpp>
#include <ql/termstructures/yield/overnightindexfutureratehelper.hpp>
#include <ql/time/date.hpp>
#include <ql/time/frequency.hpp>
import java.util.Arrays;
import java.util.Random;
public class CalculateStandardArray {
private static final Random RANDOM = new Random();
public static void main(String[] args) {
int numStats = 12;
int numTrials = 10_000_000;
@tomwhoiscontrary
tomwhoiscontrary / ostream_state.cpp
Last active January 16, 2023 19:42
Class to save and restore ostream state in C++, to make floating point format management a bit saner
class ostream_state {
std::ostream::fmtflags flags;
std::streamsize precision = 6;
public:
class Save {
friend ostream_state;
friend std::ostream& operator<<(std::ostream& out, const Save& save) {
save.save(out);
@tomwhoiscontrary
tomwhoiscontrary / tabs.html
Created November 17, 2022 17:59
Pure CSS tabs
<html>
<head>
<style>
.tabs {
/* make this a horizontal flexbox, and make it capable of wrapping */
display: flex;
flex-wrap: wrap;
}
2022-07-10T20:59:32+0100 rife systemd[2415]: Started dbus-:[email protected].
░░ Subject: A start job for unit UNIT has finished successfully
░░ Defined-By: systemd
░░ Support: https://lists.freedesktop.org/mailman/listinfo/systemd-devel
░░
░░ A start job for unit UNIT has finished successfully.
░░
░░ The job identifier is 617.
2022-07-10T20:59:32+0100 rife cinnamon-screensaver[66385]: CsNotificationWatcher: Could not add match rule to bus - GDBus.Error:org.freedesktop.DBus.Error.MatchRuleInvalid: Invalid match rule
2022-07-10T20:59:32+0100 rife /usr/libexec/gdm-x-session[2529]: cinnamon-session[2529]: WARNING: t+169917.09334s: Detected that screensaver has appeared on the bus