View ocr mac.py
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
#!/Applications/Xcode.app/Contents/Developer/usr/bin/python3 | |
import config,json,os,subprocess,ocr2json | |
from tqdm import tqdm | |
from joblib import Parallel, delayed | |
import Quartz,Vision | |
from Cocoa import NSURL | |
from Foundation import NSDictionary | |
from wurlitzer import pipes # needed to capture system-level stderr |
View load-link-filter.js
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
async function _fetch(url) { | |
const rawResponse = await fetch(url, { | |
method: "get", | |
}).catch((err) => { | |
console.error(err); | |
}); | |
if (!rawResponse) { | |
console.log("ERROR: Could not retrieve data."); | |
return Promise.reject(); | |
} |
View Understanding-City-in-a-bottle.pde
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
//Original by Frank Force (KilledByAPixel) - https://twitter.com/KilledByAPixel/status/1517294627996545024. | |
//Observable by Daniel Darabos - https://observablehq.com/@darabos/decoding-a-city-in-a-bottle | |
//Processing version by Rick Companje as intermediate step to 8086 assembly language. | |
//this version currently lacks textures on the buildings. To be continued. | |
int w=72; | |
int h=50; | |
int t=0; | |
void setup() { |
View data.ttl
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
@prefix geo: <http://www.opengis.net/ont/geosparql#> . | |
@prefix def: <https://hetutrechtsarchief.nl/def/> . | |
@prefix hua: <https://hetutrechtsarchief.nl/id/> . | |
hua:D8884A3B2E6CA8F6E0538F04000A374B | |
a def:Adresvermelding ; | |
geo:asWKT "POINT (9.1825624999999995 45.4652869999999965)"^^geo:wktLiteral . |
View Mercury-Elevation-map-waterlevel.pde
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
//based on Mercury MESSENGER Global DEM 665m v2 | |
//https://web.archive.org/web/20210903191157/https://astrogeology.usgs.gov/search/map/Mercury/Topography/MESSENGER/Mercury_Messenger_USGS_DEM_Global_665m_v2 | |
PImage palette, heightmap, colormap, normalmap; | |
PShader shader; | |
float progress = 0; | |
void setup() { | |
size(2048, 1024, P3D); | |
shader = loadShader("shader.glsl"); |
View ExpressionParser.py
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
``` | |
# Expression Parser - Bauer-Samelson algorithm as described in BYTE magazine 1976-02 | |
# Python implementation: Rick Companje, 30 July 2022 | |
# usage: main("20+4*(5-(6-3))/8") | |
import math,re | |
def precedence_check(operators,c): | |
if not operators or operators[-1] == '(': | |
return True |
View straatnamen.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View fuzzy-matching.py
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
#!/usr/bin/env python3 | |
import json | |
from fuzzysearch import find_near_matches | |
from fuzzywuzzy import process | |
json_file = "A152153-pagina5tm20/page/NL-UtHUA_A152153_000005-f.json" | |
def fuzzy_extract(qs, ls, threshold): | |
'''fuzzy matches 'qs' in 'ls' and returns list of |
View 1-Kadaster-zoekschil-conversie.py
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
#!/usr/bin/env python3 | |
import csv,os | |
from collections import defaultdict | |
rows = [ row for row in csv.DictReader(open("kadaster.csv")) ] | |
# "id","gemeente","arrondissement","dvd_nr","dvd_code","soort","leggerart","begin","eind","begino","eindo","invnr","reeksdeel","Sectie","pad","filenaam","naam1","naam2" | |
file_paths = defaultdict(list) |
View Conway Game of Life.pde
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
/* | |
Rick Companje, 2022-06-09, MIT | |
Code Golf submission: Shortest Game of Life | |
289 bytes in Processing/Java | |
https://codegolf.stackexchange.com/questions/3434/shortest-game-of-life | |
grid 100x100 | |
grid wraps around | |
draw custom pattern with mouse | |
*/ |
NewerOlder