This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns rainbowfish.jena | |
(:require [clojure.java.io :as io] | |
[rainbowfish.config :as config]) | |
(:import [org.apache.jena.fuseki.main FusekiServer] | |
[org.apache.jena.system Txn] | |
[org.apache.jena.query DatasetFactory QueryExecutionFactory ResultSetFormatter] | |
[org.apache.jena.rdf.model Model ModelFactory])) | |
(defonce | |
^{:doc "Instance of the Jena server for the lifetime of the program."} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns rainbowfish.uri-resolver | |
"Extends Saxon's standard URI resolver to open BaseX documents when an | |
URI has the `basex://` scheme." | |
(:gen-class | |
:name rainbowfish.UriResolver | |
:extends net.sf.saxon.lib.StandardURIResolver | |
:exposes-methods {resolve resolveSuper}) | |
(:require [clojure.string :as str] | |
[rainbowfish.xmldb :as xmldb]) | |
(:import java.io.ByteArrayInputStream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Applying this mask shaves off any floating point components of the numbers. | |
const MASK32 = 4294967295; // = Math.pow(2, 32) - 1, or 32 ones. | |
function formatBits(num: number) { | |
const out : string[] = []; | |
for (let bit = 31; bit >= 0; bit--) { | |
out.push(num & (1 << bit) ? "1" : "0"); | |
if (bit % 8 === 0) out.push(" "); | |
} | |
out.push(` : ${num & MASK32}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "3.1"; | |
declare namespace sd = 'http://eoga.dev/sdoc'; | |
declare function sd:read-string($path as xs:string) as xs:string { | |
convert:binary-to-string(db:retrieve("rainbowfish", $path), 'UTF-8') | |
}; | |
declare function sd:read-xml($path as xs:string) as item() { | |
fn:parse-xml(sd:read-string($path)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns anillo.core | |
(:require [ring.adapter.jetty :refer :all] | |
[ring.middleware.session :refer :all] | |
[ring.util.response :refer :all])) | |
(defn handler [{session :session}] | |
(let [n (session :n 1)] | |
(-> (response (str "You have visited " n " times")) | |
(assoc-in [:session :n] (inc n))))) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns minibench.core | |
(:import | |
java.util.Random | |
[org.basex BaseXServer] | |
[org.basex.api.client ClientSession])) | |
(defonce server (BaseXServer. (make-array String 0))) | |
(def running (atom true)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:paths | |
["src" "test" "target" "resources"] | |
:mvn/repos | |
{"bintray" {:url "https://dl.bintray.com/labra/maven/"}} | |
:deps | |
{; Clojure | |
org.clojure/clojure {:mvn/version "1.10.1"} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
datatypes xsd = "http://www.w3.org/2001/XMLSchema-datatypes" | |
namespace sdoc = "https://eoga.dev/sdoc" | |
default namespace = "https://eoga.dev/sdoc" | |
# Helper to allow any markup in specific areas. | |
# For instance, could be used to embed SVG or other formats. | |
any-markup = (text | element * - sdoc:* { attribute * { text }*, any-markup* })* | |
start = sdoc-element-topic |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package sardina; | |
import com.thaiopensource.util.PropertyMapBuilder; | |
import com.thaiopensource.validate.Flag; | |
import com.thaiopensource.validate.ValidateProperty; | |
import com.thaiopensource.validate.ValidationDriver; | |
import com.thaiopensource.validate.prop.rng.RngProperty; | |
import com.thaiopensource.validate.rng.CompactSchemaReader; | |
import org.xml.sax.ErrorHandler; | |
import org.xml.sax.InputSource; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const fs = require('fs'); | |
const data = JSON.parse(fs.readFileSync('results.json')); | |
const results = {}; | |
const langs = {}; | |
for (const obj of data.test_metadata) { |