Given J*JT * x = b, solve for x in linear time and space. | |
J is m by n | |
x is m by 1 | |
b is m by 1 | |
m < n | |
J is a rectangular matrix that represents a tree with equal and opposite entries. | |
For example: |
/* ======================================================================== | |
$File: tools/ctime/ctime.c $ | |
$Date: 2016/05/08 04:16:55PM $ | |
$Revision: 7 $ | |
$Creator: Casey Muratori $ | |
$Notice: | |
The author of this software MAKES NO WARRANTY as to the RELIABILITY, | |
SUITABILITY, or USABILITY of this software. USE IT AT YOUR OWN RISK. |
Binding to C Libraries with Nim
Before you continue, if you don't know what IMGUI is don't bother reading this post, just ignore it, don't write anything in comments section, etc. If you're curious about IMGUI see bottom of this post, otherwise continue whatever you were doing, this post it's not for you. Thanks!
If you know what IMGUI is, for context read following presentations and blog posts:
- Insomniac’s Web Tools Postmortem
The Gilbert–Johnson–Keerthi (GJK) distance algorithm is a method of determining the minimum distance between two convex sets. The algorithm's stability, speed which operates in near-constant time, and small storage footprint make it popular for realtime collision detection.
Unlike many other distance algorithms, it has no requirments on geometry data to be stored in any specific format, but instead relies solely on a support function to iteratively generate closer simplices to the correct answer using the Minkowski sum (CSO) of two convex shapes.
// generic A* pathfinding | |
// | |
// INTERFACE | |
// | |
// mandatory macros | |
#ifndef ASTAR_POS_TYPE | |
#error ASTAR_POS_TYPE should specify position type |
#define WIN32_LEAN_AND_MEAN | |
#include <winsock2.h> | |
#include <windows.h> | |
#define SECURITY_WIN32 | |
#include <security.h> | |
#include <schannel.h> | |
#include <shlwapi.h> | |
#include <assert.h> | |
#include <stdio.h> |
#!/usr/bin/env python3 | |
# packs multiple images (bmp/png/...) into ico file | |
# width and height of images must be <= 256 | |
# pixel format of images must be 32-bit RGBA | |
import argparse | |
import struct | |
import os | |
from PIL import Image # https://python-pillow.org/ |
-- Shallow copy a table | |
local function shallow_copy(t) | |
local copy = {} | |
for k, v in pairs(t) do | |
copy[k] = v | |
end | |
return copy | |
end | |
-- Escape reserved characters |