This file contains 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
finish() { | |
rm ${HOME}/.xterm-bash/$PPID | |
} | |
trap finish EXIT | |
echo -en $$ > ${HOME}/.xterm-bash/$PPID |
This file contains 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
// Apple: | |
var body = document.getElementByTagName('body') | |
body.addEventListener('touchstart', function(evt){ | |
// should be either "stylus" or "direct" | |
console.log(evt.touches[0].touchType) | |
}) | |
// Chrome & Edge: | |
if (window.PointerEvent) { | |
// Pointer events are supported. |
This file contains 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
~/wasmllvm/bin/clang++ -emit-llvm -fno-builtin -fshort-wchar --compile --sysroot=/root/wasmsysroot/ --target=wasm32-unknown-unknown-wasm client/main.cpp --optimize=3 -o client/app.bc && ~/wasmllvm/bin/llc -mtriple=wasm32-unknown-unknown-elf -filetype=asm -asm-verbose=false -o client/app.s client/app.bc && ~/binaryen/s2wasm client/app.s > client/app.wat && ~/wabt/wat2wasm client/app.wat -o client/app.wasm |
This file contains 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
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <math.h> | |
unsigned int countBits(unsigned int number) | |
{ | |
return (int)log2(number) + 1; | |
} |
This file contains 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
class TuffString { | |
public: | |
template <typename T, size_t Size> | |
TuffString (const T (&ptr) [Size]) : ptr(ptr), len(Size - 1) { | |
// _dev_logA("Pre-computed length\n"); | |
} | |
TuffString (const void* pString) : ptr((const char*)pString) { |
This file contains 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
https://en.wikipedia.org/wiki/Fold_(higher-order_function)#Folds_as_structural_transformations |
This file contains 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
# include <stdio.h> | |
bool memory[12] = { | |
0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, | |
// 0 1 0 1 0 1 0 1 0 1 0 1 | |
// 0 0 1 1 0 0 1 1 0 0 1 1 | |
// 0 0 0 0 1 1 1 1 0 0 0 0 | |
// 0 0 0 0 0 0 0 0 1 1 1 1 | |
}; | |
bool current_instruction[12] = { 0 }; |
This file contains 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
const deviceMachine = Machine({ | |
id: 'device', | |
initial: 'powered_off', | |
states: { | |
powered_on: { | |
type: 'parallel', | |
on: { |
This file contains 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains 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
#set_property DONT_TOUCH true [get_cells { evt1/mem1/srlatch_with_ands }] | |
#set_property DONT_TOUCH true [get_cells { evt1/pulse1/not1 }] | |
#set_property DONT_TOUCH true [get_cells { evt1/pulse1/xnor1 }] | |
#set_property DONT_TOUCH true [get_cells { evt1 }] | |
set_property SEVERITY {Warning} [get_drc_checks LUTLP-1] | |
#set_property ALLOW_COMBINATORIAL_LOOPS TRUE [get_nets evt1/feedback] | |
#set_property ALLOW_COMBINATORIAL_LOOPS TRUE [get_nets evt1/mem1/in0] | |
#set_property ALLOW_COMBINATORIAL_LOOPS TRUE [get_nets s1/evt1/mem1/OUTPUT_EDGE] |