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
enum timingSetup = q{ | |
import std.datetime.stopwatch : AutoStart, StopWatch; | |
import std.stdio : writeln; | |
import std.conv : to; | |
auto sw = StopWatch(AutoStart.yes); | |
size_t lastLine = __LINE__; | |
}; | |
template timingCheckpoint(size_t l) | |
{ |
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
#!/bin/bash | |
# This was glued together based on research collected here: | |
# https://github.com/flozz/rivalcfg/pull/43 | |
WHEEL_RED='\x16' | |
WHEEL_GREEN='\x16' | |
WHEEL_BLUE='\xff' | |
LOGO__RED='\x16' | |
LOGO__GREEN='\x16' |
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
http://www.keyboard-layout-editor.com/##@@=Esc&_x:1%3B&=F1&=F2&=F3&=F4&_x:1.5%3B&=F5&=F6&=F7&=F8&_x:1.5%3B&=F9&=F10&=F11&=F12&_x:3.5%3B&=PrtSc&=Scroll%20Lock&=Pause%0ABreak%3B&@_y:0.5%3B&=~%0A%60&=!%0A1&=%2F@%0A2&=%23%0A3&=$%0A4&=%25%0A5&=%5E%0A6&_x:0.5%3B&=Num%20Lock&=%2F%2F&=*&=-&_x:0.75%3B&=%2F&%0A7&=*%0A8&=(%0A9&=)%0A0&=%2F_%0A-&=+%0A%2F=&_w:2%3B&=Backspace&_x:0.25%3B&=Insert&=Home&=PgUp%3B&@_w:1.5%3B&=Tab&=Q&=W&=E&=R&=T&_x:1%3B&=7%0AHome&=8%0A%E2%86%91&=9%0APgUp&_h:2%3B&=+&_x:0.25%3B&=Y&=U&=I&=O&=P&=%7B%0A%5B&=%7D%0A%5D&_w:1.5%3B&=%7C%0A%5C&_x:0.25%3B&=Delete&=End&=PgDn%3B&@_w:1.75%3B&=Caps%20Lock&=A&=S&=D&=F&=G&_x:0.75%3B&=4%0A%E2%86%90&=5&=6%0A%E2%86%92&_x:1.5%3B&=H&=J&=K&=L&=%2F:%0A%2F%3B&=%22%0A%27&_w:2.25%3B&=Enter%3B&@_w:2.25%3B&=Shift&=Z&=X&=C&=V&=B&_x:0.25%3B&=1%0AEnd&=2%0A%E2%86%93&=3%0APgDn&_h:2%3B&=Enter&_x:1%3B&=N&=M&=%3C%0A,&=%3E%0A.&=%3F%0A%2F%2F&_w:2.75%3B&=Shift&_x:1.25%3B&=%E2%86%91%3B&@_w:1.25%3B&=Ctrl&_w:1.25%3B&=Win&_w:1.25%3B&=Alt&_w:3.5%3B&=&_x:0.25&w:2%3B&=0%0AIns&=.%0ADel&_x:1.25% |
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
import std.container.rbtree; | |
struct Node | |
{ | |
int opCmp(ref const Node other) const | |
{ | |
if (other.key > this.key) | |
return -1; | |
if (other.key < this.key) | |
return 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
import std.range.primitives : isInputRange, isOutputRange, ElementType; | |
import std.meta : ApplyLeft, allSatisfy, staticMap; | |
import std.functional : unaryFun; | |
import std.traits : Unqual; | |
/** | |
* Copy values from an input range to one of several output ranges based | |
* on a routing function. | |
* | |
* The function must return an integer between 0 and the number of outputs. |
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
template StorageAttributes(Store) | |
{ | |
enum hasInsertMethod = Store.insert; | |
enum hasFullSlice = Store.init[]; | |
} | |
struct ValidSparseDataStore(DataT) | |
{ | |
DataT insert() | |
{ | |
correctedInsert!(false); |
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
module dparse.stack_buffer; | |
import std.traits; | |
// version = debug_stack_allocator) | |
struct StackBuffer | |
{ | |
bool put(T)(T t) | |
{ |
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
{ | |
GC1 | |
Memcheck:Cond | |
fun:_D2gc* | |
} | |
{ | |
GC2 | |
Memcheck:Value4 | |
fun:_D2gc2gc* | |
} |
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
module vector_sort; | |
private enum byteSortCode = `asm | |
{ | |
mov R8, p; | |
movdqu XMM0, [R8]; | |
mov R9, 0x0607040502030001; | |
movq XMM14, R9; | |
mov R9, 0x0e0f0c0d0a0b0809; |
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
ubyte[4] _mm_ctvtps_pi8(float[4] input) | |
{ | |
ubyte[4] result; | |
size_t a = cast(size_t) input.ptr; | |
size_t b = cast(size_t) result.ptr; | |
asm | |
{ | |
mov R8, a; | |
mov R9, b; | |
movdqu XMM0, [R8]; |
NewerOlder