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.stdio : writeln, toFile; | |
import std.datetime.stopwatch : StopWatch, AutoStart; | |
import asdf.serialization : deserialize, serializeToJson; | |
import std.file : readText; | |
import std.array: array; | |
import std.algorithm : copy, map; | |
enum TopN = 5; | |
struct Post |
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; | |
void main() | |
{ | |
writeln("Hello D"); | |
} |
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; | |
alias bit = bool; | |
struct integer | |
{ | |
bit | |
sign: 1, | |
bit1: 1, | |
bit2: 1, | |
bit3: 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
import std; | |
struct integer | |
{ | |
bool | |
sign: 1, | |
bit1: 1, | |
bit2: 1, | |
bit3: 1, | |
bit4: 1, | |
bit5: 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
import std; | |
struct Iter(T){ | |
T[] data; | |
// Sometimes folks wrap the iterator in an 'anonymous struct' | |
// In a way this 'separates' it from the actual data structure. | |
// I like that it also hides the fact that when you do copies | |
// and such, that you don't need to copy 'currentPos'. | |
// Maybe it depends on the |
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.stdio; | |
void main() { | |
int a ; | |
short h ; | |
ushort o ; // on utilise les type non signés lorsque nous nous attendons à ce que nos données ne puissent par exemple ne jamais être inférieures à zero. Donc si vous representez l'âge de quelqu'un sous forme de structure de données par exemple, vous devriez utiliser un non signier type | |
char b = 'B'; | |
wchar x ; // caractère large si on veut ecrire d'autres caractres | |
long y ; |
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.stdio; | |
void main() { | |
int a ; | |
short h ; | |
ushort o ; // on utilise les type non signés lorsque nous nous attendons à ce que nos données ne puissent par exemple ne jamais être inférieures à zero. Donc si vous representez l'âge de quelqu'un sous forme de structure de données par exemple, vous devriez utiliser un non signier type | |
char b = 'B'; | |
wchar x ; // caractère large si on veut ecrire d'autres caractres | |
long y ; |
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; | |
void main() | |
{ | |
real x = 3.14159265358979323846364e300; | |
real y = -3.14159265358979323846364e3000L; | |
float z = -3.14159265358979323846364e30L; | |
float t = z^^2; | |
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; | |
void main() | |
{ | |
real x = 3.14159265358979323846364e300; | |
double y = -3.14159265358979323846364e3000L; | |
float z = -3.14159265358979323846364e30; | |
writefln ("x = %.1g",x); | |
writefln ("y = %.2g",y); |
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
/+dub.sdl: | |
dependency "lubeck" version="~>1.5.4" | |
+/ | |
import std; | |
void main() | |
{ | |
writeln("Hello D"); | |
} |