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; | |
interface Flying { | |
@property string flyingMessage(); | |
final void fly() { | |
writeln(flyingMessage); | |
} | |
} | |
interface Swimming { |
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; | |
@safe: | |
void main() { | |
Foo foo; | |
foo.Option.Val2 = "bye"; | |
myFun(foo); | |
foo.DoSomeDebugging(); | |
} |
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
/** | |
* Explaination comments taken from: | |
* http://wiki.openstreetmap.org/wiki/PBF_Format#Design | |
* | |
* This gives a very basic parsing of osm.pbf files. The purpose was several | |
* fold. | |
* | |
* - Read PBF files | |
* - Learn the file layout | |
* - Verify the bytes match |
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.process2; | |
import std.stdio, std.array; | |
void main(string[] args) { write(args.join("\0")); } | |
unittest | |
{ | |
import std.ascii; | |
auto x = executeShell("echo wyda"); | |
// @@@ This fails on wine |
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.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; |
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
// 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 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
version(Windows) { | |
pragma(lib, "lua51.lib"); | |
} else | |
pragma(lib, "liblua.a"); | |
import std.stdio; | |
import luad.all; |
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
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 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
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 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 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) |