This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Simulator for depth comparison error (i.e. z-fighting) | |
| # Nathan Reed, June 2015 | |
| # Written for Python 3.4; requires numpy | |
| import math | |
| import numpy as np | |
| import optparse | |
| # Parse command-line options | |
| parser = optparse.OptionParser() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """This tool queries undefined symbols in a lib, then queries defined | |
| symbols, and then diffs the two sets so we know what the actual | |
| externals for the purpose of the lib are.""" | |
| import os | |
| import re | |
| import subprocess | |
| libname = 'libbink2.a' # command line parsing? please. | |
| def parse_def_sym(str): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Delta Compression by Glenn Fiedler. | |
| This source code is placed in the public domain. | |
| http://gafferongames.com/2015/03/14/the-networked-physics-data-compression-challenge/ | |
| */ | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <assert.h> | |
| #include <string.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE HTML> | |
| <html lang="en"> | |
| <head> | |
| <title>Listing 2-2, Load Shaders From DOM</title> | |
| <meta charset="utf-8"> | |
| <script id="shader-vs" type="x-shader/x-vertex"> | |
| attribute vec3 aVertexPosition; | |
| void main() { | |
| gl_Position = vec4(aVertexPosition, 1.0); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // C/C++ tips for using printf-style functions | |
| // Lots of manipulation can be expressed simply and fast with printf-style formatting | |
| // Also helps reducing the number of temporaries, memory allocations or copies | |
| // ( If you are looking for a simple C++ string class that is printf-friendly and not heap-abusive, | |
| // I've been using this one: https://github.com/ocornut/Str ) | |
| // If you are interested in a FASTER implementation of sprintf functions, see stb_sprintf.h | |
| // https://github.com/nothings/stb/blob/master/stb_sprintf.h | |
| // How to concatenate non-zero terminated strings |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defun dbg-watch (expression) | |
| (interactive "sExpression: ") | |
| (dbg-mi-command (list 'dbg-watch-handler expression) "-var-create - @ %s" (prin1-to-string expression))) | |
| (defun dbg-watch-handler (status result expression) | |
| (case status | |
| ((done) | |
| (push (cons (cons 'expression expression) result) dbg-watches))) | |
| (dbg-render-watches)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (require 'cl) | |
| (require 'peg) | |
| (defcustom dbg-mi-process-name "dbg-mi" "") | |
| (defcustom dbg-mi-buffer-name "*dbg-mi*" "") | |
| (defvar dbg-mi-process nil) | |
| (defvar dbg-mi-buffer nil) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ////////////////////////////////////////////////////////////////////////////////// | |
| // console.log to screen | |
| ////////////////////////////////////////////////////////////////////////////////// | |
| ;(function(){ | |
| var container = document.createElement('div') | |
| container.dataset.name = 'consoleLogOnScreen' | |
| container.style.width = '100%'; | |
| container.style.height = '100%'; | |
| container.style.position = 'absolute'; | |
| container.style.fontSize = '100%'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // Uses pycgen: https://github.com/Celtoys/pycgen | |
| // Generates code for C, HLSL, CUDA and OpenCL | |
| // | |
| void SH_Y2(float3 n, cmp_out float y[9]) | |
| { | |
| /*$pycgen | |
| from math import pi | |
| from math import sqrt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.highlight = function(text, sample) { | |
| var escapedSample = sample.replace(/[-\/\\^$*+?.()|[\]{}]/g, '\\$&'); | |
| var reSample = new RegExp(escapedSample, 'g'); | |
| var args = ['']; | |
| var highlightedText = text.replace(reSample, function(match) { | |
| args.push('background-color: #ffc', 'background-color: none'); | |
| return '%c' + match + '%c'; | |
| }); | |
| args[0] = highlightedText; | |
| console.log.apply(console, args); |