Skip to content

Instantly share code, notes, and snippets.

View Calvin-L's full-sized avatar

Calvin Loncaric Calvin-L

View GitHub Profile
@Calvin-L
Calvin-L / entityfixer.py
Last active July 5, 2024 01:23
Rewriter to fix malformed XML generated by the "SMS Backup & Restore" app
# Copyright (c) 2018, 2023 Calvin Loncaric
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
@Calvin-L
Calvin-L / DiskQueueBenachmark-1579313387-293b755.json
Created January 18, 2020 23:16
TLA+ interval size calculation change benchmark results
[
{
"jmhVersion" : "1.21",
"benchmark" : "tlc2.tool.queue.DiskQueueBenachmark.g02",
"mode" : "thrpt",
"threads" : 2,
"forks" : 1,
"jvm" : "/Library/Java/JavaVirtualMachines/jdk-12.0.1.jdk/Contents/Home/bin/java",
"jvmArgs" : [
"-ea",
@Calvin-L
Calvin-L / Main.java
Created January 18, 2020 23:22
TLA+ interval size microbenchmark
import tlc2.value.impl.IntervalValue;
import java.util.Random;
import java.util.concurrent.atomic.AtomicLong;
public class Main {
public static void benchmark(Random r, AtomicLong out) {
IntervalValue v = new IntervalValue(r.nextInt(), r.nextInt());
try {
@Calvin-L
Calvin-L / log.txt
Created March 28, 2020 18:40
Stack LTS-7.24 alex+happy build log
$ bash repro.sh
Cabal file warning in/Users/loncaric/sources/playground/stack-failure/please-install-alex.cabal@0:0: A package using section syntax must specify at least
'cabal-version: >= 1.2'.
alex > configure
alex > [1 of 2] Compiling Main ( /private/var/folders/d4/n6djsq8x5dv0jfx84hzl0v000000gn/T/stack-8d950b202098b539/alex-3.1.7/Setup.lhs, /private/var/folders/d4/n6djsq8x5dv0jfx84hzl0v000000gn/T/stack-8d950b202098b539/alex-3.1.7/.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/setup/Main.o )
alex > [2 of 2] Compiling StackSetupShim ( /Users/loncaric/.stack/setup-exe-src/setup-shim-mPHDZzAJ.hs, /private/var/folders/d4/n6djsq8x5dv0jfx84hzl0v000000gn/T/stack-8d950b202098b539/alex-3.1.7/.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/setup/StackSetupShim.o )
alex > Linking /private/var/folders/d4/n6djsq8x5dv0jfx84hzl0v000000gn/T/stack-8d950b202098b539/alex-3.1.7/.stack-work/dist/x86_64-osx/Cabal-1.24.0.0/setup/setup ...
alex >
alex
@Calvin-L
Calvin-L / FcnRcdValue.tla
Last active November 16, 2021 23:00
Demonstration of FcnRcdValue bug
---- MODULE FcnRcdValue ----
\* This spec demonstrates a bug in the `indexTbl` field of TLC's FcnRcdValue
\* class [1], circa mid-2021.
\*
\* In particular:
\* - With one thread, FcnRcdValue behaves correctly.
\* - With two or more threads, FcnRcdValue.select() may spuriously return
\* null.
\*