Skip to content

Instantly share code, notes, and snippets.

@roelj
roelj / point-reduction.c
Created September 6, 2014 15:20
Point reduction filter for InklingReader
#include "point-reduction.h"
#include "../datatypes/coordinate.h"
#include "../datatypes/element.h"
static int
opt_in_between (dt_coordinate* first, dt_coordinate* second, dt_coordinate* third)
{
int crossproduct =
(third->y - first->y) * (second->x - first->x) -
(third->x - first->x) * (second->y - first->y);
@roelj
roelj / dependencies.sh
Created August 31, 2015 20:19
Create a graph from a map file
#!/bin/bash
mapFile="$1"
dotFile="$2"
##### DO NOT EDIT BELOW ########
# Write the graph to a file in DOT format.
function write_to_file
{
@roelj
roelj / bdb-test.py
Created January 29, 2024 13:51
RDFLib BerkeleyDB deletion problem.
from datetime import datetime
from rdflib import Dataset
from rdflib.plugins.stores import sparqlstore
import shutil
db_directory = "/tmp/bdb-test"
dataset = Dataset("BerkeleyDB")
dataset.open (db_directory, create=True)
if not isinstance (dataset, Dataset):
print ("Failed to setup BerkeleyDB store.")