Skip to content

Instantly share code, notes, and snippets.

View Darkdragon84's full-sized avatar

Valentin Stauber Darkdragon84

  • Vienna, Austria
View GitHub Profile
@Darkdragon84
Darkdragon84 / transform_table_infos.py
Created July 29, 2022 10:04
transform TableInfo json representations from the old format (TableIdentifier part of other attributes) to new format (TableIdentifier in separate "identifier" field)
import json
from dataclasses import fields
from pathlib import Path
from iris_pdf.parser.table_info import TableIdentifier
JSON_IN = Path("/path/to/folder/with/table_info_json_files")
JSON_OUT = JSON_IN.parent / f"{JSON_IN.name}_new"
JSON_OUT.mkdir(exist_ok=True)
KEYS = [field.name for field in fields(TableIdentifier)]
@Darkdragon84
Darkdragon84 / arpack_test_c.cpp
Last active December 24, 2015 01:59
arpack_test_c
/** program to test an interface to the arpack library
*
* Task: to calculate the eigenvalue of largest real part and the corresponding eigenvector
* of a real, nonsymmetric matrix A for which it is guaranteed that this eigenvalue is real and positive.
*
* to build:
* 1. Have an installation of arpack-ng, lapack and blas, have fortran and C++ compiler (C++11 capable)
* 2. Download Armadillo library http://arma.sourceforge.net/ (no installation, only include folder needed)
* 3. build using (where CC is e.g. g++ or icpc): CC -g -m64 -I/home/valentin/armadillo/include/ -std=c++0x -o arpack_test_c arpack_test_c.cpp -lblas -llapack -larpack
* 4. to run (where N*N is the total matrix dimension of A): ./arpack_test_c N