Skip to content

Instantly share code, notes, and snippets.

View bchapuis's full-sized avatar

Bertil Chapuis bchapuis

View GitHub Profile
@GavinRay97
GavinRay97 / readme.md
Last active August 22, 2024 01:23
Making Apache Calcite work in SQuirreL SQL Client

Making Apache Calcite work in SQuirreL SQL Client

Recently I wanted to test some Calcite functionality, and thought it might be nice to use a GUI instead of sqlline. It turns out, it is:

image

I figured you could just use something like SquirreL, which lets you import arbitrary JDBC drivers. This was less straightforward than I thought.

@lukasmartinelli
lukasmartinelli / tolerance_per_zoom.md
Last active October 3, 2024 10:56
ST_Simplify tolerance per zoom level
zoom_level tolerance
      0 |  78271.516953125
      1 | 39135.7584765625
      2 | 19567.8792382812
      3 | 9783.93961914062
      4 | 4891.96980957031
      5 | 2445.98490478516
      6 | 1222.99245239258

7 | 611.496226196289

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@jtblin
jtblin / udp-loader.go
Last active August 22, 2024 01:34
UDP server performance optimisation
package main
import (
"crypto/rand"
"flag"
"log"
mrand "math/rand"
"net"
"os"
"os/signal"
@thvasilo
thvasilo / TestNgrams.scala
Created March 23, 2015 11:09
Simple job to ensure LZO compressed Google Ngrams data can be read
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import scala.util.Random
import java.io._
import java.util.Properties
import org.apache.hadoop.fs._;
import org.apache.hadoop.conf._;
import org.apache.hadoop.io._;
@albi90
albi90 / how to
Last active November 24, 2022 21:31
Compiling node-webkit on raspberry pi
cd ~
mkdir .gyp
nano .gyp/include.gypi
paste the following
{
'variables': {
'linux_use_gold_binary' : 0,
'linux_use_gold_flags' : 0,
'target_arch': 'arm',
'disable_nacl': 1, # NaCL does not build for ARM.
@gre
gre / deploy.sh
Last active October 8, 2021 00:33
Super-small scripts for easy PlayFramework deployment
#!/bin/bash
REMOTE=play@SERVER_IP
REMOTE_APP=/home/play/PROJECT_NAME/
sbt stage || exit 1;
rsync -va target/ $REMOTE:$REMOTE_APP/target;
ssh $REMOTE "cd $REMOTE_APP; ./stop.sh";
ssh $REMOTE "cd $REMOTE_APP; ./start.sh";
@nitsanw
nitsanw / gist:5458216
Created April 25, 2013 08:02
JMH CSV output from UTF-8 run
$ java -DUtf8EncodingBenchmark.directBuffer=false -jar target/microbenchmarks.jar -wi 3 -i 3 -of csv ".*Utf8EncodingBenchmark.*"
Benchmark, Iteration, Score, Threads, Unit, Thread 1,
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.charsetEncoder, 1, "2.592", 1, ops/msec, "2.592",
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.charsetEncoder, 2, "2.509", 1, ops/msec, "2.509",
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.charsetEncoder, 3, "2.617", 1, ops/msec, "2.617",
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.customEncoder, 1, "4.329", 1, ops/msec, "4.329",
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.customEncoder, 2, "4.387", 1, ops/msec, "4.387",
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.customEncoder, 3, "4.404", 1, ops/msec, "4.404",
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.stringGetBytes, 1, "2.530", 1, ops/msec, "2.530",
psy.lob.saw.utf8.generated.throughput.Utf8EncodingBenchmark.string
@jboner
jboner / latency.txt
Last active May 9, 2025 06:12
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@aolshevskiy
aolshevskiy / build.gradle
Created January 21, 2012 15:35
Hello World Netty Http Server
apply plugin: "java"
apply plugin: "eclipse"
repositories {
mavenCentral()
}
dependencies {
compile (
"org.jboss.netty:netty:latest.integration",