Skip to content

Instantly share code, notes, and snippets.

@hroptatyr
hroptatyr / sparql-shacl.sql
Created April 14, 2023 09:04
sparql mimicking shacl
PREFIX pav: <http://purl.org/pav/>
PREFIX : <http://example.com/test#>
CONSTRUCT {
:cons.underived.rpt
a sh:ValidationReport ;
sh:conforms false ;
sh:result [
a sh:ValidationResult ;
sh:focusNode ?this ;
@hroptatyr
hroptatyr / dualcomb.c
Created November 25, 2022 11:58
k-combinations iterator whose pairwise intersections contain no more than two elements
#include <stdio.h>
#define countof(x) (sizeof(x) / sizeof(*x))
#define MAX (70U)
#define K (8U)
static unsigned char comb[MAX][MAX];
/* 8-combinations */
static long unsigned int ncr[8U][70U] = {
@hroptatyr
hroptatyr / .gitignore
Created December 4, 2012 07:22
some snippets to watch directories
*.o
watchdir
watchdir-clo.[ch]
@hroptatyr
hroptatyr / fifoify.sh
Created November 28, 2012 09:33
fifoify -- replace every .xz file on the command line by a fifo with an xz process attached
#!/bin/sh
new_args="${1}"
shift
for arg; do
case "${arg}" in
(*".xz")
repl="${arg%.xz}"
if ! test -e "${repl}"; then
mkfifo "${repl}"