Skip to content

Instantly share code, notes, and snippets.

while :; do clear; curl -skL https://bar.emf.camp/api/on-tap.json | jq -r 'keys[] as $k | ("--", ("\($k):"), (.[$k][] | "\(.manufacturer) \(.name) (\(.abv)%)@\(.price)\(if .remaining_pct|tonumber<5 then " (running out)" else "" end)"))' | column -t -s '@'; sleep 10; done
-- Is this a bug in Agda?
-- Try repro with latest agda sometime
module VarBug where
open import Agda.Builtin.Equality
open import Agda.Primitive
data Unit : Set where
tt : Unit
type n = Z | S of n
let rec gen_locals (local_ n) depth _ = local_
if depth = 0
then
S n
else
let s = S n in
let m = gen_locals s (depth - 1) (ref 42) in
let _ = gen_locals m (depth - 1) (ref 42) in
type alloc_count = { mutable total: float }
let allocs = { total = 0. }
let[@inline never] count txt =
let now = int_of_float (Gc.minor_words () -. allocs.total) in
Printf.printf "%20s: %d\n" txt now;
allocs.total <- Gc.minor_words ()
let v = Sys.opaque_identity (ref 42)
module F () =
struct
let v01 = ref 42
let v02 = ref 42
let v03 = ref 42
let v04 = ref 42
let v05 = ref 42
let v06 = ref 42
let v07 = ref 42
let v08 = ref 42
(**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* Pierre Chambart, OCamlPro *)
(* Mark Shinwell and Leo White, Jane Street Europe *)
(* *)
(* Copyright 2013--2016 OCamlPro SAS *)
(* Copyright 2014--2016 Jane Street Group LLC *)
(* *)
type bigstring = (char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t
let alloc_bigstring size = Bigarray.Array1.create Char Bigarray.c_layout size
external bigstring_refcount : bigstring -> int = "pinbuf_bigstring_refcount" [@@noalloc]
module Pinbuf (Size : sig val size : int end) : sig
type t = private bigstring
val alloc : unit -> t
val release : t -> unit
val count_buffers : unit -> int
module type T = sig
type t
end
module type S = sig
type t
module Map : Map.S with type key = t
module Set : Set.S with type elt = t
module Tbl : Hashtbl.S with type key = t
end
module type A = sig
module type A = sig
module type A = sig
module type A = sig
module type A = sig
module type A = sig
module type A = sig
module type A = sig
module type A = sig
module type A = sig
linux:
NULL pointer: si_signo=11, si_status=0, si_code=1, si_pid=0, si_uid=0, si_addr=0x0
Unmapped address: si_signo=11, si_status=0, si_code=1, si_pid=131072, si_uid=0, si_addr=0x20000
Readonly address: si_signo=11, si_status=0, si_code=2, si_pid=1896829136, si_uid=21917, si_addr=0x559d710f50d0
Non-canonical address: si_signo=11, si_status=0, si_code=128, si_pid=0, si_uid=0, si_addr=0x0
kill(getpid(),SIGSEGV): si_signo=11, si_status=0, si_code=0, si_pid=900131, si_uid=1000, si_addr=0x3e8000dbc23
subprocess kill: si_signo=11, si_status=0, si_code=0, si_pid=900132, si_uid=1000, si_addr=0x3e8000dbc24
(on linux, si_pid/si_uid overlap si_addr, so you must use si_code to determine which is valid)