Skip to content

Instantly share code, notes, and snippets.

View Delors's full-sized avatar

Michael Eichberg Delors

  • DHBW Mannheim
  • Germany
  • 04:21 (UTC +01:00)
View GitHub Profile
@Delors
Delors / ArrayList.java
Last active April 17, 2024 18:52
A very simple template of a simple array based list for teaching purposes.
import java.util.function.BiFunction;
import java.util.function.Function;
public class FunctionalList<E> {
private E[] elements;
private int size;
@SuppressWarnings("unchecked")
public FunctionalList(int capacity) {
@Delors
Delors / DoublyLinkedList.java
Last active April 17, 2024 18:48
A very basic implementation of a doubly linked list.
package code;
public class DoublyLinkedList<E> {
private static class Node<E> {
E value;
Node<E> next;
Node<E> previous;
}
@Delors
Delors / xpath_evaluator.js
Created May 16, 2024 12:08
Evaluate XPath Expressions with NodeJs and XPath
/*
# Intro
Evaluates a set of XPath expressions against an XML file.
Usage: node xpaths_evaluator.js <spec.json>
The specification document is a JSON file with the specified JSON schema (see `specSchema` below).
@Delors
Delors / demo.xml
Created June 4, 2024 09:22
A simple XML file using namespaces
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<lehrveranstaltungen
status="akkreditiert"
xmlns="http://dhbw-mannheim.de"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- Modul muss überarbeitet werden... -->
<modul>
<vorlesung id="191"
xlink:type="simple"
xlink:href="https://www.dhbw-mannheim.de/web_entwicklung">
@Delors
Delors / demo.xpaths.json
Created June 4, 2024 09:24
Specification of a couple of XPath expressions against the demo.xml file.
{
"source": "demo.xml",
"namespaces": {
"xlink": "http://www.w3.org/1999/xlink",
"dhbw": "http://dhbw-mannheim.de"
},
"xpaths" : [
{
"expr": "//comment()"
},{