Field | Value |
---|---|
DIP: | (number/id -- assigned by DIP Manager) |
Review Count: | 0 (edited by DIP Manager) |
Author: | monkyyy, [email protected] |
Implementation: | (links to implementation PR if any) |
Status: | Draft |
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
auto ref weak(T,alias A)(){ | |
static if(is(T:typeof(A))){ | |
return A; | |
} else { | |
return T.init; | |
}} | |
auto ref weak(T,S)(auto ref S a){ | |
static if(is(T:S)){ | |
return a; | |
} else { |
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
#define dw digitalWrite | |
#define aw analogWrite | |
#define maxspeed 1000 | |
struct motor{ | |
int pins=0; | |
bool parity=0; | |
int lastspeed=1; | |
bool abovezero=1; |
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
#define NOTE_A2 110 | |
#define NOTE_B2 123 | |
#define NOTE_C3 131 | |
#define NOTE_D3 147 | |
#define NOTE_E3 165 | |
#define NOTE_F3 175 | |
#define NOTE_G3 196 | |
#define speaker 2 | |
#define keys 30 | |
#define play 6 |
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
import std; | |
struct opindexopdispatch{ | |
int i=0; | |
auto opIndex(T...)(T args){ | |
struct op{ | |
opindexopdispatch* parent; | |
T args; | |
auto opDispatch(string op:"isnull",S...)(S args2){ | |
//pragma(msg,op,T,S); | |
return (*parent).opopdispatch!(T,op)(args,args2); |
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
import core.stdc.stdio; | |
extern(C) void main(){ | |
string s="hello"; | |
printf("%s",&s[0]); | |
} | |
/* | |
dmd -c -betterC min.d | |
gcc min.o -o min | |
./min |
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
[ | |
[ | |
"Esc", | |
"~\n`", | |
"F1", | |
"F2", | |
"F3", | |
"F4", | |
"F5", | |
{ |
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
[Bindings] | |
launch=no | |
[Matching] | |
executable=true | |
[Icons] | |
show=true | |
scale=true |
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
#!/usr/bin/env -S sh -c 'dmd -run "$0" "$1" "$2" "$3" | ffmpeg -f rawvideo -pixel_format rgb24 -video_size $1x$2 -i pipe: -preset ultrafast $(basename "$0" .d).mp4' | |
import std; | |
enum pixels=32; | |
ubyte[3*pixels] pixels_; | |
int sentpixels; | |
pragma(inline): | |
//void pix(T,S,U)(T r,S b,U g){ | |
void pix(int r,int g,int b){ | |
sentpixels++; |
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
struct optassoarray(V, K) { | |
struct triple { | |
ulong index; | |
K key; | |
V value; | |
auto tuple(){ | |
import std.typecons:t=tuple; | |
return t(index,key,value); | |
} | |
} |