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
/** | |
* This code comes from a D newsgroup discussion by Max Samukha | |
* and Simen kjaeraas: http://thread.gmane.org/gmane.comp.lang.d.general/43408/focus=43476 | |
* | |
* The intent is to provide a safe way to mutate some data in a const method. | |
* | |
* The rules to achieve this are: | |
* * Only mutable data can be assigned to a Mutable | |
* * Referenced fields can be modified (inner class fields, pointer target) | |
* * Value types can be modified if the encapsulating class |
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
/* | |
* Original Go: http://www.mprescient.com/journal/2011/1/9/concurrency-in-go-a-call-center-tutorial.html | |
*/ | |
module main; | |
import core.thread, | |
std.array, | |
std.concurrency, | |
std.conv, |
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 main; | |
import core.thread; | |
import std.algorithm; | |
import std.conv; | |
import std.datetime; | |
import std.parallelism; | |
import std.random; | |
import std.range; | |
import std.stdio; |
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 csvRange; | |
import std.stdio; | |
void main() { | |
} | |
unittest { |
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 csv; | |
import std.file; | |
void main() { | |
auto data = readText("sample.csv"); | |
//auto records = csvText!Layout(data); | |
auto records = csvText!Layout(data, ["a", "b", "c", "d", "e"]); | |
foreach(r; records) |
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 filerange; | |
import std.algorithm; | |
import std.array; | |
import std.conv; | |
import std.exception; | |
import std.file; | |
import std.range; | |
import std.stdio; |
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 csv; | |
import std.algorithm; | |
import std.array; | |
import std.range; | |
import std.conv; | |
import std.traits; | |
import std.stdio; | |
void main() { |
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
version(Windows) { | |
pragma(lib, "lua51.lib"); | |
} else | |
pragma(lib, "liblua.a"); | |
import std.stdio; | |
import luad.all; |
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
// Written in the D programming language. | |
/** | |
* $(RED Deprecated. It will be removed in February 2012. | |
* Please use std.datetime instead.) | |
* | |
* dateparse module. | |
* | |
* Copyright: Copyright Digital Mars 2000 - 2009. | |
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>. |
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.random; | |
import std.range; | |
auto randomCover2(Range,Rnd)(Range arr, ref Rnd random) { | |
return RandomCover2!(Range,Rnd)(arr,&random); | |
} | |
struct RandomCover2(Range, Random) | |
{ | |
private Range _input; |
OlderNewer