Consider the following program:
@safe:
char[] formatInPlace(T)(char[] buf, T value);
void main()
{
char[1024] buffer;
formatInPlace(buffer[], 28.625);
import std.stdio, core.sync.mutex; | |
import std.traits : lvalueOf; | |
struct Resource(T) | |
{ | |
struct Payload | |
{ | |
Mutex mtx; | |
int refCount; | |
T value; |
/++ dub.sdl: | |
name "pegged_logic" | |
dependency "pegged" version="~>0.4.2" | |
+/ | |
import std.json; | |
struct Text | |
{ | |
string name; |
void main() | |
{ | |
import std.algorithm : map, max; | |
import std.datetime : benchmark, to, TickDuration; | |
import std.meta : aliasSeqOf, I = Alias; | |
import std.range : array, iota, roundRobin; | |
import std.random : uniform; | |
import std.stdio : File, writefln; | |
enum evnSizes = [2, 8, 16, 32, 64, 128, 256, 512, 1024, 2 << 12, 2 << 14, 2 << 20]; // , 2 << 22, 2 << 24]; |
Consider the following program:
@safe:
char[] formatInPlace(T)(char[] buf, T value);
void main()
{
char[1024] buffer;
formatInPlace(buffer[], 28.625);
// http://forum.dlang.org/post/oxxydengmzzefjxjqgma@forum.dlang.org | |
/+ CTRNG | |
Proof-Of-Concept Compile-Time Random Number Generator. | |
Please never actually use this or anything like it. | |
While doing some metaprogramming tomfoolery, I stumbled into an | |
interesting scenario. It occurred to me that with some work, I could | |
probably turn what I had into a functioning compile-time random | |
number generator, despite D's restrictions on metaprogramming intended |
size_t bsearch(alias pred, uint start, uint end)() | |
{ | |
static if (end <= start) | |
static assert (0); | |
else static if (start + 1 == end && pred!start) | |
return start; | |
else | |
{ |
vibe-d | |
sociomantic-tsunami/ocean | |
dlang/dub | |
higgsjs/Higgs | |
rejectedsoftware/ddox | |
BlackEdder/ggplotd | |
eBay/tsv-utils-dlang | |
dlang-community/D-Scanner | |
dlang-tour/core | |
d-widget-toolkit/dwt |
import std.array : appender; | |
import std.regex : regex, replaceAll; | |
import std.string : format, indexOf, toUpper; | |
import std.stdio : writeln; | |
string getVariable(string var) | |
{ | |
return "<%s>".format(var.toUpper); | |
} |
import core.sys.posix.sys.types : mode_t, pid_t; | |
import core.sys.posix.signal : sigset_t; | |
import core.sys.posix.sched : sched_param; | |
import core.stdc.stdio : perror, printf; | |
import core.stdc.errno : errno; | |
import core.stdc.stdlib : exit, EXIT_FAILURE; | |
void checkErrno(int err, const char* msg) | |
{ | |
if (!err) return; |
module | bare import time |
---|---|
std.regex | 1.04s |
std.net.curl | 0.29s |
std.zip | 0.19s |
std.path | 0.15s |
std.socket | 0.15s |
std.file | 0.14s |
std.mmfile | 0.14s |
std.datetime | 0.14s |