Skip to content

Instantly share code, notes, and snippets.

View szhorvat's full-sized avatar

Szabolcs Horvát szhorvat

View GitHub Profile
@szhorvat
szhorvat / formatJSON.m
Created August 5, 2015 09:55
Format imported JSON for readability in Mathematica
formatJSON[json_] := formatRawJSON@rulesToAssociations[json]
rulesToAssociations[rules_] :=
Replace[rules, r : {__Rule} :> Association[r], {0, Infinity}]
basicTypeQ[_String | True | False | Null | (_?NumericQ)] = True;
basicTypeQ[_] = False;
formatRawJSON[json_] :=
@szhorvat
szhorvat / arpack-ng-bug-410.c
Created March 12, 2023 17:27
Demonstraton of bug #401 in ARPACK-NG 3.9.0
// See:
// https://github.com/opencollab/arpack-ng/issues/410
// https://github.com/opencollab/arpack-ng/issues/401
//
// Build ARPACK with ISO_C_BINDING to make arpack.h available, then compile this file as:
//
// cc prog.c -o prog -larpack
#include <stdbool.h>