Skip to content

Instantly share code, notes, and snippets.

View lannybroo's full-sized avatar

Alan Brooks lannybroo

View GitHub Profile
@xulman
xulman / gist:31e8d251e0c4f4334968faf63c8507cf
Last active March 4, 2024 14:39
testing new folder-DnD in ImageJ2/Fiji
================================================================================================
variant for
a) near future (when image-legacy master makes it into scijava/parent-pom)
b) for apps that harvest an image their own way (here somehow from a given folder)
================================================================================================
git clone [email protected]:xulman/imagej-legacy.git
cd imagej-legacy
mvn -Dmaven.test.skip=true clean install
cd ..
@All4Gis
All4Gis / QgsMultiplexorGs
Last active October 18, 2024 16:25
Python code for muxing klv and video (MISB) #STANAG #MISB #UAV
# -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
import os
import gi
# Author : Fran Raga , 2021
# proof of concept to ingest KLV telemetry into a video. Multiplexer concept to create a MISB Video.
# Related with : https://github.com/All4Gis/QGISFMV/blob/master/code/manager/QgsMultiplexor.py
# Get Video width/Height
@mutterer
mutterer / googly_eyes_Tool.ijm
Last active January 19, 2021 08:45
Googly eyes tool
// this example uses the Toolbar.setIcon(toolName,icon) method
// added in v1.53h, to dynamically update its icon.
macro "Left Eye Action Tool - N44 C000 o00nn" {
setTool("Googly Eyes Tool")
}
macro "Right Eye Action Tool - N44 C000 o00nn" {
setTool("Googly Eyes Tool")
}
// Unscaled values for kOpsinAbsorbanceBias
const kB0 = 0.96723368009523958;
const kB1 = kB0;
const kB2 = kB0;
const kScale = 255.0;
const kScaleR = 1.0;
const kScaleG = 1.0;
const kInvScaleR = 1.0;
const kInvScaleG = 1.0;

Quick Tips for Fast Code on the JVM

I was talking to a coworker recently about general techniques that almost always form the core of any effort to write very fast, down-to-the-metal hot path code on the JVM, and they pointed out that there really isn't a particularly good place to go for this information. It occurred to me that, really, I had more or less picked up all of it by word of mouth and experience, and there just aren't any good reference sources on the topic. So… here's my word of mouth.

This is by no means a comprehensive gist. It's also important to understand that the techniques that I outline in here are not 100% absolute either. Performance on the JVM is an incredibly complicated subject, and while there are rules that almost always hold true, the "almost" remains very salient. Also, for many or even most applications, there will be other techniques that I'm not mentioning which will have a greater impact. JMH, Java Flight Recorder, and a good profiler are your very best friend! Mea

@sgillies
sgillies / advanced_rasterio_features.ipynb
Last active October 19, 2024 17:20
Advanced Rasterio features notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sgillies
sgillies / latency.txt
Created October 19, 2016 11:54 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
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
<a href="javascript:void(d=document);void(el=d.getElementsByTagName('link'));void(g=false);for(i=0;i<el.length;i++){if(el[i].getAttribute('rel').indexOf('alternate')!=-1){ty=el[i].getAttribute('type');if(ty.indexOf('application/rss+xml')!=-1||ty.indexOf('text/xml')!=-1||ty.indexOf('application/atom+xml')!=-1){g=true;h=el[i].getAttribute('href');a=document.createElement('a');a.href=h;void(location.href='https://feedbin.com?subscribe='+a.href);}}};if(!g){window.alert('No Feed Found');};">Subscribe In Feedbin</a>
@Arie
Arie / gist:25b260cc02d04a67d282
Last active October 22, 2020 21:37
Installing flent on OS/X with homebrew
`pip install flent matplotlib`
`brew install fping`
Netperf in homebrew is installed without demo mode by default, so we need to edit the recipe slightly, also demo mode fails to build under OS/X, requiring a tiny patch to netlib.c ( http://www.netperf.org/pipermail/netperf-talk/2013-December/001162.html ). The following recipe changes the URL to a prepatched version that I host and changes the configure line to enable demo mode.
`brew edit netperf`
```
class Netperf < Formula
desc "Benchmarks performance of many different types of networking"
@emily-pesce
emily-pesce / NestScript.gs
Last active June 26, 2023 07:12
Nest Thermostat Data Collection in Google Sheets for Upstairs/Downstairs Setups
// CREDIT TO BEEZLY for a lot of this, I just adapted it a bit and added more documentation :)
// --> BEEZLY's work: https://gist.github.com/beezly/9b2de3749d687fdbff3f
// To make this work:
// 1) create a new Google Sheet (name it whatever you'd like, e.g., "Nest Data")
// 2) on the menu bar click Tools -> Script Editor... to open Script Editor (new window)
// 3) in Script Editor delete all the default scripts/files, and create a new one (I called it "NestScript.gs")
// 4) cut and paste this entire file into NestScript.gs, then SAVE THE SCRIPT
// 5) on the menu bar click Publish -> Deploy as Web App
// select "Execute the App as Me"