Skip to content

Instantly share code, notes, and snippets.

View district10's full-sized avatar
πŸ˜€
good good study, day day up

TANG ZhiXiong district10

πŸ˜€
good good study, day day up
View GitHub Profile
@district10
district10 / lts_2021_11_02.patch
Created May 24, 2022 02:20
abseil QNX build, based on lts_2021_11_02 (commit: 215105818)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 750a475..110a1b5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -21,6 +21,16 @@
# and then issuing `yum install cmake3` on the command line.
cmake_minimum_required(VERSION 3.5)
+set(CMAKE_CXX_STANDARD 11)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
@district10
district10 / concave_hulls.ipynb
Created March 9, 2023 05:14 — forked from dwyerk/concave_hulls.ipynb
concave hulls using shapely and scipy
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@district10
district10 / cheap-ruler.py
Created July 12, 2023 08:19
cheap-ruler: Fast approximations for common geodesic measurements 🌐 (python version)
import numpy as np
def cheap_ruler_k(latitude: float) -> np.ndarray:
'''
in meters
'''
# based on https://github.com/mapbox/cheap-ruler-cpp
RE = 6378.137
FE = 1.0 / 298.257223563
E2 = FE * (2 - FE)
@district10
district10 / hilbert_curve.py
Created February 3, 2026 02:32 — forked from mdickinson/hilbert_curve.py
Code to create the third-order approximation to a 3d space-filling Hilbert curve
import numpy
def hilbert():
"""
Return NumPy array of shape (512, 3) containing successive coordinates
for a third-order three-dimensional Hilbert curve.
"""
a,b,c=numpy.indices((8,)*3).reshape(3,-1)
d=c[:8];r=abs(d-3>>1);g=(d^d>>1)*73;f=g[abs(d-1)&6]