View shuffle_fisher_yates.js
/**
* Shuffle array
* Fisher-Yates (aka Knuth) Shuffle
*/
let shuffle = (array) => {
var currentIndex = array.length, temporaryValue, randomIndex;
while (0 !== currentIndex) {
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex -= 1;
temporaryValue = array[currentIndex];
View random_arbitrary.js
/**
* Returns a random number between min (inclusive) and max (exclusive)
*/
let getRandomArbitrary => (min, max, fixed) {
fixed=fixed=10;
return (Math.random() * (max - min) + min).toFixed(fixed);
}
View blazegraph_sparql_explain.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text&#47;html;charset=UTF-8">
<title>blazegraph&trade; by SYSTAP</title>
</head>
<body<h1>Query</h1>
<h2>SPARQL</h2>
<pre>SELECT DISTINCT ?music_track ?music_trackLabel ?artist ?artistLabel ?album ?albumLabel ?publication_date WHERE {
View blazegraph_performance_table.txt
Name Averages Current
Minutes Hours Days
/ JVM / Memory / DirectBufferPool / default ...
/ JVM / Memory / DirectBufferPool / default / acquired 1,066
/ JVM / Memory / DirectBufferPool / default / bufferCapacity 1,048,576
/ JVM / Memory / DirectBufferPool / default / bytesUsed 1,145,044,992
/ JVM / Memory / DirectBufferPool / default / leaked 0
/ JVM / Memory / DirectBufferPool / default / poolCapacity 2,147,483,647
/ JVM / Memory / DirectBufferPool / default / poolSize 1,092
/ JVM / Memory / DirectBufferPool ...
View ocr_screenshot_index.sh
#!/bin/bash
set -e
for f in "$@"
do
contents=$(/usr/local/bin/tesseract -c language_model_penalty_non_dict_word=0.8 --tessdata-dir /usr/local/share/ "$f" stdout -l eng | /usr/local/bin/xml esc)
hex=$((cat <<EOF
<?xml version="1.0" encoding="UTF-8"?>
View blob_read_write.js
/**
* Save or open HTML 5 Blob Object-URL
* @see https://stackoverflow.com/questions/22724070/prompt-file-download-with-xmlhttprequest
* @param blob Blob
* @param fileBName String
*/
function saveOrOpenBlob(blob, fileName) {
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(window.TEMPORARY, 1024 * 1024, function (fs) {
fs.root.getFile(fileName, { create: true }, function (fileEntry) {
View get_available_gpus.py
from tensorflow.python.client import device_lib
def get_available_gpus():
local_device_protos = device_lib.list_local_devices()
return [x.name for x in local_device_protos if x.device_type == 'GPU']
get_available_gpus()
View disk_status.sh
#!/bin/bash
FOLD=$1 || $(pwd)
du -d 1 -h $FOLD
df -k $FOLD
View blazegraph_sparql_status.txt
Name Averages Current
Minutes Hours Days
/ JVM / Memory / DirectBufferPool / default ...
/ JVM / Memory / DirectBufferPool / default / acquired 1,001
/ JVM / Memory / DirectBufferPool / default / bufferCapacity 1,048,576
/ JVM / Memory / DirectBufferPool / default / bytesUsed 1,050,673,152
/ JVM / Memory / DirectBufferPool / default / leaked 0
/ JVM / Memory / DirectBufferPool / default / poolCapacity 2,147,483,647
/ JVM / Memory / DirectBufferPool / default / poolSize 1,002
/ JVM / Memory / DirectBufferPool ...
View node_exit_handler.js
/**
* Efficient Exit Handler
* @author Loreto Parisi (loretoparisi at gmail dot com)
* @2018 Loreto Parisi
*/
var addExitHandler = function (params, exitCallback) {
var self = this;
var options={
ignoreUncaughtException: false
};