Skip to content

Instantly share code, notes, and snippets.

View WorldSEnder's full-sized avatar

WorldSEnder

  • Worldwide
View GitHub Profile
@WorldSEnder
WorldSEnder / PKGBUILD
Created May 18, 2017 13:49
HyPro build scripts
pkgname=HyPro
pkgdesc="A C++ state set representation library for the analysis of hybrid systems"
url="https://github.com/hypro/hypro"
arch=("i686" "x86_64")
license=("mit")
depends=("gmp" "boost" "glpk" "carl")
makedepends=("make" "cmake")
conflicts=()
replaces=()
backup=()
@WorldSEnder
WorldSEnder / PKGBUILD
Created May 18, 2017 13:58
CaRL package build file
pkgname=carl
pkgdesc="An Open Source C++ Library for Computer Arithmetic and Logic"
url="https://github.com/smtrat/carl"
arch=("i686" "x86_64")
license=("mit")
depends=("gmp" "eigen3" "boost")
makedepends=("make" "cmake")
conflicts=()
replaces=()
backup=()
@WorldSEnder
WorldSEnder / main.cpp
Created October 29, 2017 15:26
C++ private member access
#include <iostream>
class Foo {
int bar = 0;
int foobar = 999;
static inline int zip;
public:
void print() {
std::cout << "Bar: " << bar << std::endl;
std::cout << "Zip: " << zip << std::endl;
@WorldSEnder
WorldSEnder / higher-kinded.ts
Last active January 9, 2023 21:37
Higher kinded types in typescript
// The two main components are the interfaces
// Generic<T, Context> and GenericArg<"identifier">
// Generic basically structurally replaces types in T that are GenericArg<S>
// for some `S extends keyof Context` with `Context[S]`
// See the test cases for specific uses.
// ====== TESTING
// Pass through for trivial types
type Test00 = Generic<number>;
@WorldSEnder
WorldSEnder / extract.py
Last active October 11, 2018 23:36
Decrypts your Monster Hunter world save data
import sys, errno, io
import struct
import base64
import blowfish
key = base64.b64decode(b'eGllWmpvZSNQMjEzNC0zem1hZ2hncHFvZTB6OCQzYXplcQ==')
cipher = blowfish.Cipher(key, byte_order="little")
if sys.version_info[0] == 3:
@WorldSEnder
WorldSEnder / ModularAutomata.agda
Last active June 19, 2019 21:17
Simulation modular automata
{-# OPTIONS --cubical #-}
module modularAutomata where
open import Data.Maybe
open import Cubical.Data.Prod
open import Cubical.Foundations.Everything
-- first, setup a type of infinite (coinductive) lists, we will need it later for simulation
record νList (A : Set) : Set where
@WorldSEnder
WorldSEnder / braunTree.agda
Last active January 31, 2020 10:08
Linear time? conversion of braun trees to lists
module braunTree where
open import Data.Nat renaming (_⊔_ to _⊔ℕ_)
open import Data.Empty
open import Data.List
open import Level
open import Function
data Tree {a} (A : Set a) : Set a where
{-# OPTIONS --cubical #-}
module UniverseSIP where
open import Cubical.Data.Prod
open import Cubical.Data.Sigma
open import Cubical.Data.Unit
open import Cubical.Core.Glue
@WorldSEnder
WorldSEnder / logic.agda
Last active April 26, 2020 15:57
Syntax experiment for propositional reasoning in cubical agda
{-# OPTIONS --cubical #-}
{-
This module shows a few syntactical additions, that, like Setoid reasoning in the standard library,
are supposed to make logical reasoning more readable. One of the goals is to avoid having to write
`PropositionalTruncation.rec squash` everywhere when "unpacking" a truncated datatype.
`obtain n ∶ A by prf - cont` does just that. It takes a "proof" producing a truncated ∥ A ∥ and
makes an untruncated A available in the context of cont. There is a special version for mere existance
of an element with a certain property making the property available as a "tactic":
{-# LANGUAGE FlexibleContexts, FlexibleInstances, FunctionalDependencies, PolyKinds, UndecidableSuperClasses #-}
{-# LANGUAGE Rank2Types, TypeApplications, QuantifiedConstraints #-}
module TaggingDefs
( Tagged(..)
, Untag
, Retag
, untag
, untag'
, retag
, retag'