Skip to content

Instantly share code, notes, and snippets.

Avatar

Benito van der Zander benibela

View GitHub Profile
@benibela
benibela / format-integer
Created Mar 14, 2016
Xidel can output large numbers, e.g.: format-integer(x:product(1 to 100000), "w")
View format-integer
This file has been truncated, but you can view the full file.
@benibela
benibela / bisect.sh
Created Dec 3, 2017
FPC/SVN bisection script
View bisect.sh
#!/bin/bash
testpath=/tmp/fpctest
records=$testpath/records
testsh=$testpath/testrevision.sh
while true; do
oldestfail=$(grep failed $records | grep -oE '^[0-9]+' | sort -n | head -1)
newestok=$(grep ok $records | grep -oE '^[0-9]+' | sort -n | tail -1)
((x=$oldestfail - $newestok))
View gist:fe74cc0370bf00b1c47c6e23696f69bf
5000 books
original:
I/VideLibri(22821): 2018-08-11:14:50:40:259 (1074753876): TESTING TIME: 9174
I/VideLibri(22821): 2018-08-11:14:50:56:704 (1074753876): TESTING TIME: 8211
I/VideLibri(22821): 2018-08-11:14:50:48:491 (1074753876): TESTING TIME: 8231
I/VideLibri(22821): 2018-08-11:14:51:05:039 (1074753876): TESTING TIME: 8335
I/VideLibri(22821): 2018-08-11:14:51:29:757 (1074753876): TESTING TIME: 8252
@benibela
benibela / benchmark.lpr
Created Mar 28, 2020
Case vs. hashset benchmark
View benchmark.lpr
program benchmark;
{$mode objfpc}{$H+}
uses
{$IFDEF UNIX}{$IFDEF UseCThreads}
cthreads,
{$ENDIF}{$ENDIF}
Classes, xquery.internals.common, bbutils, bbdebugtools,htmlInformation, SysUtils
{ you can add units after this };
@benibela
benibela / json-xml.xqm
Last active Sep 29, 2020 — forked from joewiz/json-xml.xqm
An implementation of XQuery 3.1's fn:json-to-xml and fn:xml-to-json functions
View json-xml.xqm
xquery version "3.1";
(:~
: An implementation of XQuery 3.1"s fn:json-to-xml and fn:xml-to-json functions for eXist, which does not support them natively as of 4.3.0, and Xidel.
:
: @author Joe Wicentowski, Benito van der Zander
: @version 0.6
: @see http://www.w3.org/TR/xpath-functions-31/#json
:)
module namespace jx = "http://joewiz.org/ns/xquery/json-xml";
@benibela
benibela / makeall.sh
Created Oct 25, 2020
How to install FreePascal
View makeall.sh
#!/bin/bash
#fpcmake -Tall
if [ -f /usr/lib/fpc/3.0.4/ppcx64 ]; then localpath=/usr/lib/fpc/3.0.4;
else if [ -f /usr/local/lib/fpc/3.0.4/ppcx64 ]; then localpath=/usr/local/lib/fpc/3.0.4;
else if [ -f /usr/lib64/fpc/3.0.4/ppcx64 ]; then localpath=/usr/lib64/fpc/3.0.4;
else if [ -f /usr/local/lib64/fpc/3.0.4/ppcx64 ]; then localpath=/usr/local/lib64/fpc/3.0.4;
else if [ -f /usr/lib/fpc/3.0.0/ppcx64 ]; then localpath=/usr/lib/fpc/3.0.0;
else if [ -f /usr/local/lib/fpc/3.0.0/ppcx64 ]; then localpath=/usr/local/lib/fpc/3.0.0;