Skip to content

Instantly share code, notes, and snippets.

View dmj's full-sized avatar

David Maus dmj

View GitHub Profile
(defun dmaus:make-number-set (list)
(when list
(let ((first (car list))
(index (car list)))
(while (and (cadr list) (= (incf index) (cadr list)))
(setq list (cdr list)))
(cond
((= first (car list))
(cons (format "%d" first) (dmaus:make-number-set (cdr list))))
((= (1+ first) (decf index))
@dmj
dmj / dvlinks.rnc
Last active August 29, 2015 14:02
Schema für DFG-Viewer Rechte- und Linkinformationen, METS-Anwendungsprofil Version 2.1
@dmj
dmj / QueryChain.php
Created January 8, 2014 14:28
VF2 QueryChain
<?php
/**
* This file is part of HABfind.
*
* HABfind is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@dmj
dmj / example.pp
Last active December 26, 2015 07:39

001A 02012:18-04-12
001B 02012:04-05-12t16:13:28.000
001D 02012:31-08-98
001U 0utf8
001X 00
002@ 0Tuv1
003@ 0034034986
003U ahttp://d-nb.info/gnd/4510065-2
004B awit
@dmj
dmj / gist:6403133
Created September 1, 2013 08:39
ANTLR4 grammer for PICA+ records
/* ANTLR4 Grammar for PICA+ records */
grammar PicaRecord ;
file : record ('\n' record)* ;
record : field+ ;
field : tag ' ' subfield+ '\u001e';
tag : FIELD_TAG ;
subfield : SUBFIELD ;
<?php
/**
* This file is part of HABfind.
*
* HABfind is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
<?xml version="1.0" encoding="utf-8"?>
<xsl:transform version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:pica="info:srw/schema/5/picaXML-v1.0">
<xsl:output method="xml" indent="no"/>
<xsl:strip-space elements="*"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
@dmj
dmj / output
Created November 17, 2012 11:14
YAML parsers vs. VuFind search specs
============================================================================
HORDE
Array
(
[AllFields] => Array
(
[Variant_1] => Array
(
[series] => Array
@dmj
dmj / example
Created November 3, 2012 07:36
Proof of concept: XDebug trace parser
((return t)
(body ((call (depth 1)
(time "0.0008")
(memory "772760")
(function "main")
(parameter-list "")
(location "/var/www/workshop/wdb_copy/wdb.php:0")
(return "1")
(body ((call (depth 2)
(time "0.0008")
@dmj
dmj / dnb-split.lisp
Created November 2, 2012 09:01
Split the German National Library's authority file in single entities
;;;
;; Split the German National Library's authority file in single entities
;;
;; The German National Library (DNB) published their authority file
;; under a CC0 license as one huge Turtle file. In order to work with
;; the data e.g. as training material for a machine learning based NER
;; of person names we need to split the file in the separate entities
;; (subjects).
;;
;; Number of single records: 9,493,986