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 grep; | |
private: | |
import std.stdio; | |
import std.regex; | |
import std.getopt; | |
import std.range; | |
import std.file; | |
import std.path; |
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
final struct Callback( TRet = void, TArgs ... ) | |
{ | |
public alias TRet delegate( TArgs ) DelegateType; | |
public alias TRet function( TArgs ) FunctionType; | |
private DelegateType dg; | |
private FunctionType fn; | |
public this( DelegateType dg ) { this.dg = dg; } | |
public this( FunctionType fn ) { this.fn = fn; } |
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 lines; | |
import std.file; | |
import std.path; | |
import std.stdio; | |
import std.regex; | |
import std.getopt; | |
import std.string; | |
import std.traits; | |
import std.algorithm; |
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
public struct NotNull<T> where T : class | |
{ | |
private T mValue; | |
public T Value | |
{ | |
get { return this.mValue; } | |
set | |
{ | |
if( value == null ) | |
throw new ArgumentNullException( "value" ); |
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 envy; | |
version( Windows ): | |
private { | |
import std.windows.registry; | |
} | |
private enum ENV_KEY = "Environment"; |
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 annotations; | |
private { | |
import std.string; | |
import std.traits; | |
import std.array; | |
} | |
private template TargetInfo( alias target ) | |
{ |
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
//Compile with: csc /nologo /r:System.Drawing.dll imgconv.cs | |
using System; | |
using System.IO; | |
using System.Drawing; | |
using System.Reflection; | |
using System.Drawing.Imaging; | |
static class Program | |
{ |
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
/+ | |
Compile with: | |
dmd pack.d | |
Options: | |
Flag Type Required Default Description | |
--------------------------------------------------------- | |
--out string yes <none> The name of the .ui file to output. | |
--dir string yes <none> The source directory to pack. | |
--width uint yes <none> Window client size width. |
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 util; | |
bool contains( T )( T[] a, T item ) | |
{ | |
foreach( x; a ) | |
if( x == item ) | |
return true; | |
return false; | |
} |
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 eventhandler; | |
/+ | |
EventHandler implementation. | |
+/ | |
struct EventHandler( TArgs... ) | |
{ | |
private import std.algorithm; | |