Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View chrispahm's full-sized avatar
🌻
https://fruchtfolge.agp.uni-bonn.de/

Christoph Pahmeyer chrispahm

🌻
https://fruchtfolge.agp.uni-bonn.de/
View GitHub Profile
const vscode = require('vscode');
module.exports = class RegexFoldingRangeProvider {
constructor(filters = {}, bufferTop = 0, bufferBottom = 0) {
const {more = [], less = []} = filters;
this.bufferBottom = bufferBottom;
this.bufferTop = bufferTop;
this.checkString = (str) => {
// Check if the string matches any of the regexes in the "more" array
<template>
<div class="">
<div class="container">
<div v-if="loading" style="z-index: 100;">
<div class="loading" />
<span style="position: absolute;margin-left: -10px">Lädt...</span>
</div>
<div id="geocoder" class="geocoder" />
<div class="break" />
import os
import sys
import types
PINLINED_DEFAULT_PACKAGE = 'formulaic'
PINLINER_MODULE_NAME = 'pinliner_loader'
loader_version = '0.2.1'
FORCE_EXC_HOOK = None
@chrispahm
chrispahm / stream_geojson_start_byte_end_byte.js
Created January 24, 2022 19:28
Stream GeoJSON file and get startByte and endByte of each JSON record in the file
import { open } from 'fs/promises'
import { Buffer } from 'buffer'
const HIGHWATERMARK = 64 * 1024 / 8
function getFeaturePositionsInFile(fd) {
return new Promise((resolve,reject) => {
const featurePositionsInFile = []
const stream = fd.createReadStream({highWaterMark: HIGHWATERMARK, autoClose: false});
// this RegEx will solely work with standard GeoJSON without any foreign members:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
// Source: https://stats.stackexchange.com/questions/83826/is-a-weighted-r2-in-robust-linear-model-meaningful-for-goodness-of-fit-analys/375752#375752
// Article: Willet and Singer (1988): https://gseacademic.harvard.edu/~willetjo/pdf%20files/Willett_Singer_AS88.pdf
function weightedRsquared(x, func, weights) {
if (!weights) weights = x.map(v => 1);
// Compute the weighted average y value for the actual
// data set in order to compute the
// _total sum of squares_
let sum = 0;
for (let i = 0; i < x.length; i++) {
sum += x[i][1] * weights[i];
{
"_id": "rfid_string::timestamp_iso8601::amountDiesel",
"rfid": "rfid_string",
"time": "timestamp_iso8601",
"amount": 420.24
}
This file has been truncated, but you can view the full file.
{"konventionell/integriert::Sommerackerbohnen - Körnergewinnung::wendend, gezogene Saatbettbereitung, Saat":[{"year":2019,"region":"Arnsberg","yield":39.7,"byPrdouctYield":0,"byProductPrice":0,"price":17.14,"revenue":680,"seeds":86,"fertilizer":58,"pesticides":125,"others":77,"sdb":335},{"year":2018,"region":"Arnsberg","yield":49.4,"byPrdouctYield":0,"byProductPrice":0,"price":15.64,"revenue":773,"seeds":100,"fertilizer":85,"pesticides":125,"others":95,"sdb":368},{"year":2017,"region":"Arnsberg","yield":48,"byPrdouctYield":0,"byProductPrice":0,"price":14.86,"revenue":714,"seeds":103,"fertilizer":75,"pesticides":124,"others":91,"sdb":321},{"year":2016,"region":"Arnsberg","yield":35.9,"byPrdouctYield":0,"byProductPrice":0,"price":15.05,"revenue":541,"seeds":125,"fertilizer":62,"pesticides":122,"others":69,"sdb":163},{"year":2015,"region":"Arnsberg","yield":47.4,"byPrdouctYield":0,"byProductPrice":0,"price":19.34,"revenue":917,"seeds":135,"fertilizer":87,"pesticides":122,"others":95,"sdb":479},{"year":2014,"regi