Skip to content

Instantly share code, notes, and snippets.

View jreuben11's full-sized avatar

Josh Reuben jreuben11

View GitHub Profile
@jreuben11
jreuben11 / README.md
Created February 1, 2021 11:02 — forked from danisla/README.md
GKE GPU Sharing Daemonset

GPU Sharing on GKE DaemonSet

NOTE: This is not a Google supported product.

Example Usage

  1. Create a GKE cluster with a GPU node pool:
gcloud container clusters create gpu-sharing-demo --zone us-central1-c
@jreuben11
jreuben11 / README.md
Created April 21, 2019 08:54 — forked from subfuzion/README.md
vim/neovim configuration

I recently switched over to neovim (see my screenshots at the bottom). Below is my updated config file.

It's currently synchronized with my .vimrc config except for a block of neovim-specific terminal key mappings.

This is still a work in progress (everyone's own config is always a labor of love), but I'm already extremely pleased with how well this is working for me with neovim. While terminal mode isn't enough to make me stop using tmux, it is quite good and I like having it since it simplifies my documentation workflow for yanking terminal output to paste in a markdown buffer.

These days I primarily develop in Go. I'm super thrilled and grateful for fatih/vim-go,

@jreuben11
jreuben11 / gcp_guidance.md
Last active November 13, 2018 03:09
GCP Cloud Architecture

Core

IaaS / PaaS

@jreuben11
jreuben11 / graph_theory_concepts.md
Created October 24, 2018 09:34
Graph Theory Concepts

Graph Theory Concepts

@jreuben11
jreuben11 / skleanr_quickref.md
Created April 21, 2018 06:43
sklearn quickref

Scikit Learn

  • supports numpy array, scipy sparse matrix, pandas dataframe.
  • Estimator - learns from data: can be a classification, regression , clustering that extracts/filters useful features from raw data - implements set_params, fit(X,y), predict(T) , score (judge the quality of fit / predict), predict_proba (confidence level)
  • Transformer - transform (reduce dimensionality)/ inverse_transform, - clean (sklearn.preprocessing), reduce dimensions (sklearn.unsupervised _reduction), expand (sklearn.kernel_approximation) or generate feature representations (sklearn.feature_extraction).

sklearn.cluster

properties: labels_, cluster_centers_. distance metrics - maximize distance between samples in different classes, and minimizes it within each class: Euclidean distance (l2), Manhattan distance (l1) - good for sparse features, cosine distance - invariant to global scalings, or any precomputed affinity matrix.

  • dbscan - deterministicly separate areas of high density from
@jreuben11
jreuben11 / C++_quickref.md
Last active October 12, 2023 20:31
C++11 in a nutshell

C++11 in a nutshell

Modern C++ Coding Style

This post is based upon the standard - not supported with VC compiler ! Try these techniques using GCC / LLVM compilers and QtCreator / CLion IDEs

Avoid C programming style idioms

  • = rather than strcpy() for copying , == rather than strcmp() for comparing
  • use const , constexpr functions rather than #DEFINE, macros
  • Avoid void*, union, and raw casts (use static_cast instead)
  • use std:string instead of char*
private static void jCodeModelGen(Map<String, Class<?>> mapping, String className) {
try {
int version = 10;
JCodeModel codeModel = new JCodeModel();
JPackage codeModel_Package = codeModel._package("com.example.pb");
if (className == null || className.trim().length() == 0) {
className = "Generated" + String.valueOf(version);
}

#Redis Commands

##Generic Commands

  • DEL key [key …] - Delete a key
  • DUMP key - Return a serialized version of value stored at specified key
  • EXISTS key - Determine if a key exists
  • EXPIRE key seconds - Set a key's time to live in seconds
  • EXPIREAT key timestamp - Set expiration for a key as a UNIX timestamp
  • KEYS pattern - Find all keys matching given pattern
  • MIGRATE host port key destination-db timeout - Atomically transfer a key from a Redis instance to another one

#JIT Compiler Tuning

##Hotspot Compilation Mechanism Selection

  • -client - client compiler (C1) - begins compiling earlier -> optimize startup time. default for 32 bit OS, choose if heap < 3GB
  • -server - server compiler (C2)- better optimize perf for long-running apps. 2 subtypes: -server 32-bit: 5-20% faster, but total process size must be < 4GB -d64 64-bit: (DEFAULT on modern machines)
  • -XX:+TieredCompilation - tiered compilation (combines both client and server) - the best perf, but requires more native memory for extra compiled code. DEFAULT.

##Advanced JIT Tuning: