Skip to content

Instantly share code, notes, and snippets.

@tbrosman
tbrosman / vector-quaternion-frame-example.md
Created May 9, 2020 19:46
Vector-Quaternion Frame Example

Vector Quaternion Frame Example

The following is a concrete example of what happens when you concatenate two vector-quaternion "frames" (rigid body transformations). For the purpose of making this comprehensible, I'm leaving out a lot of the gritty details of quaternion multiplication.

Frame notation: <Rotation operator, Translation operator>.

Input frames:

@tbrosman
tbrosman / .gitignore
Last active November 10, 2019 00:39
Dummy Haxe Library C
/.haxelib
/bin
@tbrosman
tbrosman / haxelib.json
Last active November 10, 2019 00:10
Dummy Haxe Library B
{
"name" : "dummy-haxe-library-b",
"url" : "https://gist.github.com/tbrosman/228302fc7eda9dc0b3f7f3f7d365b8e8",
"license" : "MIT",
"description" : "Dummy Haxe Library B",
"version" : "0.0.1",
"releasenote" : "",
"contributors" : ["tbrosman"],
"dependencies" : {
"dummy-haxe-library-a" : "git:https://gist.github.com/tbrosman/fa733e78442af62abfb50a9c458677a1.git#56ef121dfe88e8b10c2d0f643134927358f6f002"
@tbrosman
tbrosman / haxelib.json
Last active November 9, 2019 23:30
Dummy Haxe Library A
{
"name" : "dummy-haxe-library-a",
"url" : "https://gist.github.com/tbrosman/fa733e78442af62abfb50a9c458677a1",
"license" : "MIT",
"description" : "Dummy Haxe Library A",
"version" : "0.0.1",
"releasenote" : "",
"contributors" : ["tbrosman"],
"dependencies" : { }
}
@tbrosman
tbrosman / index.html
Last active August 25, 2019 03:24
Heaps Javascript target index.html boilerplate
<!DOCTYPE html>
<html lang="en">
<body style="margin: 0px; position: fixed;">
<div>
<canvas id="webgl" style="width: 100vw; height: 100vh; display: block; "></canvas>
<script type="text/javascript" src="app.js"></script>
</div>
</body>
</html>
@tbrosman
tbrosman / libSimpleExample_readelf_output.txt
Created March 27, 2019 06:03
libSimpleExample.so readelf output
Symbol table '.dynsym' contains 41 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 FUNC GLOBAL DEFAULT UND __cxa_atexit@LIBC (2)
2: 00000000 0 FUNC GLOBAL DEFAULT UND __cxa_finalize@LIBC (2)
3: 00000000 0 FUNC GLOBAL DEFAULT UND SDL_ClearError
4: 00000000 0 FUNC GLOBAL DEFAULT UND SDL_CreateRenderer
5: 00000000 0 FUNC GLOBAL DEFAULT UND SDL_CreateTextureFromSurface
6: 00000000 0 FUNC GLOBAL DEFAULT UND SDL_CreateWindow
7: 00000000 0 FUNC GLOBAL DEFAULT UND SDL_Delay
@tbrosman
tbrosman / year32_inefficient_spiral.asm
Last active September 10, 2018 03:00
An amusing and inefficient solution for 7 Billion Humans Year 32
-- 7 Billion Humans (2087) --
-- 32: Creative Writhing --
--
-- Causes the humans to write datacubes one column at a time starting with the middle column. Because the humans are not all aligned
-- to the same side of their line at the start, all three humans visit all three columns.
-- column 2, moving south
a:
step s
if s == wall:
@tbrosman
tbrosman / troubleshooting_msvc_path_issues_hxcpp.md
Last active August 19, 2016 06:42
Troubleshooting MSVC path issues (hxcpp)

Started with: fatal error C1083: Cannot open include file: 'stddef.h': No such file or directory

Found http://community.openfl.org/t/openfl-to-windows-fatal-error-cannot-open-typeinfo-h/7930/3 but the solution didn't work.

Searched around more, saw that the msvc toolchain bat file is what sets up the paths (D:\HaxeToolkit_3_2_0\haxe\lib\hxcpp\3,2,205\toolchain\msvc-setup.bat). It gets called every time compilation happens and it calls the vc vars setup script (on my machine: 'C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools....\VC\bin\x86_amd64\vcvarsx86_amd64.bat'). Some notes on how the MSVC toolchain works for Visual Studio 2015 (which I am using in this case): http://community.openfl.org/t/visual-studio-2015/5839

Running vcvarsx86_amd64.bat directly produced the error ERROR: Cannot determine the location of the VS Common Tools folder. Digging around/reading the bat script revealed this value comes from the registry. Related: https://schrievkrom.wordpress.com/2011/01/25/error-cann

@tbrosman
tbrosman / TypedReturns.hx
Last active August 29, 2015 14:26
Version: Haxe 3.2.0 release. Desc: In JS, Haxe essentially reifies the type for generic functions and the following code will work without issue and output "1" three times.
class Holder
{
public var components = new Array<Dynamic>();
public function new() {}
public function getFirst<T>():T
{
return cast components[0];
}
}
@tbrosman
tbrosman / haxe gc crash debug version startup from OS
Created June 2, 2015 05:06
Crash in the hxcpp GC when starting a debug build from the Android OS (instead of from the command line). Versions used: lime 2.3.0 + openfl 2.1.8
I/ActivityManager( 516): START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.vacuumTubeGames.myGame/.MainActivity} from pid 866
D/audio_hw_primary( 181): start_output_stream: enter: usecase(1: low-latency-playback) devices(0x2)
D/audio_hw_primary( 181): select_devices: out_snd_device(3: speaker-reverse) in_snd_device(0: none)
D/audio_hw_primary( 181): enable_snd_device: sending audio calibration for snd_device(3) acdb_id(14)
D/ACDB-LOADER( 181): ACDB -> send_afe_cal
D/audio_hw_primary( 181): enable_snd_device: snd_device(3: speaker-reverse)
D/audio_hw_primary( 181): enable_audio_route: apply mixer path: low-latency-playback
D/audio_hw_primary( 181): start_output_stream: exit
D/dalvikvm( 516): GC_CONCURRENT freed 3069K, 32% free 22311K/32704K, paused 4ms+8ms, total 115ms
D/dalvikvm( 516): WAIT_FOR_CONCURRENT_GC blocked 111ms