Skip to content

Instantly share code, notes, and snippets.

View jrcarl624's full-sized avatar
♠️
Spadix

Joshua Carlson jrcarl624

♠️
Spadix
  • NEOREVA LLC
  • US East
  • 03:58 (UTC -05:00)
View GitHub Profile
@mfuerstenau
mfuerstenau / zigzag-encoding.README
Last active September 1, 2025 13:16
ZigZag encoding/decoding explained
ZigZag-Encoding
---------------
Maps negative values to positive values while going back and
forth (0 = 0, -1 = 1, 1 = 2, -2 = 3, 2 = 4, -3 = 5, 3 = 6 ...)
(i >> bitlength-1) ^ (i << 1)
with "i" being the number to be encoded, "^" being
XOR-operation and ">>" would be arithemtic shifting-operation
@codecontemplator
codecontemplator / gausselimination.js
Created May 30, 2015 14:13
Example implementation of gauss elimination in javascript
function print(M, msg) {
console.log("======" + msg + "=========")
for(var k=0; k<M.length; ++k) {
console.log(M[k]);
}
console.log("==========================")
}
function diagonalize(M) {
var m = M.length;