Skip to content

Instantly share code, notes, and snippets.

JervenBolleman

Block or report user

Report or block JervenBolleman

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@JervenBolleman
JervenBolleman / gist:60cc9dd13614c05fe9743519cd6ef5aa
Created Dec 4, 2018
Let virtuoso discover all sparql endpoints in wikidata and use it to improve federations capabilities
View gist:60cc9dd13614c05fe9743519cd6ef5aa
for iri in $(wget -q --header "accept:text/csv" "https://query.wikidata.org/sparql?query=SELECT DISTINCT ?iri WHERE { [] wdt:P5305 ?iri }" -O -|grep -oP '^http[\S]+')
do
echo "isql $port $user $password exec='LOAD SERVICE <$iri> DATA;'";
done
@JervenBolleman
JervenBolleman / spinner.svg
Created Feb 22, 2017
Very small SVG to create a spinning image
View spinner.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@JervenBolleman
JervenBolleman / gist:63d8757cddee1e1d4594b9b42c127c71
Last active Feb 16, 2017
Fix illegal encoded high/low surrogate pairs.
View gist:63d8757cddee1e1d4594b9b42c127c71
StringBuilder f = new StringBuilder(w.length());
for (int i = 0; i < w.length(); i++)
{
char c = w.charAt(i);
if (c >= 0xD800 && c <= 0xD8FF)
{
int h = ((c - 0xD800) * 0x400);
int l = ((w.charAt(++i) - 0xDC00) + 0x10000);
f.append((char) (h + l));
}
@JervenBolleman
JervenBolleman / getServiceDescription.sh
Created Sep 8, 2014
Get a SPARQL 1.1 service description
View getServiceDescription.sh
wget -S "http://beta.sparql.uniprot.org/" --header "Accept:application/rdf+xml" -O - | less
@JervenBolleman
JervenBolleman / GC7.java
Created Aug 25, 2014
GC7 GC count using binary encoded nucleotides for speed (requires converting a fasta file first)
View GC7.java
package gc;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
@JervenBolleman
JervenBolleman / gc_ds_wholefile_tbl_parallel_size.c
Created Aug 12, 2014
GC count in c but allocating the correc file size
View gc_ds_wholefile_tbl_parallel_size.c
#include <stdio.h>
#include <stdlib.h>
#define MAXFLEN 2600000000 /* Larger than the file. */
#include <sys/stat.h>
int main()
{
char tablegc[256];
char tableat[256];
int gc=0;
@JervenBolleman
JervenBolleman / GC6.java
Created Aug 12, 2014
GC6 threaded GC count using table (is faster than bit fiddling
View GC6.java
package gc;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@JervenBolleman
JervenBolleman / GC5.java
Created Aug 12, 2014
GC 5 threaded GC count in java
View GC5.java
package gc;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@JervenBolleman
JervenBolleman / GC3
Created Aug 11, 2014
Mapped file, same branchless gc counting
View GC3
package gc;
import java.io.IOException;
import java.io.RandomAccessFile;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
public class GC3
@JervenBolleman
JervenBolleman / GC2
Created Aug 11, 2014
Java GC count trying to be branchless.
View GC2
package gc;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
public class GC2
{
You can’t perform that action at this time.