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
<?php | |
function path() | |
{ | |
// Determine if we are one windows, And get our path parts | |
$IsWindows = strtoupper( substr( PHP_OS, 0, 3 ) ) === "WIN"; | |
$args = func_get_args(); | |
$parts = array(); | |
// Trim our paths to remove spaces and new lines |
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 resourcepool; | |
import std.traits; | |
public final class Pool( TClass ) if( !is( TClass == struct ) && !( isIntegral!TClass || isFloatingPoint!TClass ) && !is( TClass == bool ) && !isSomeChar!TClass ) | |
{ | |
private alias void delegate( TClass ) Action; | |
private alias bool delegate( TClass ) Predicate; | |
private alias TClass delegate() Func; | |
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 priorityqueue; | |
private import std.array : front, popFront; | |
public class PriorityQueue( _ElemType ) | |
{ | |
public alias _ElemType ElementType; | |
public enum SortMode : ubyte | |
{ |
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
<?php | |
/** | |
This interpreter is largely a port of | |
this Python implementation: http://norvig.com/lispy.html | |
with several added features and a more object-oriented | |
approach with a focus on embedding in other scripts | |
rather than being a standalone script. | |
This is currently a prototype/proof-of-concept |
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
using System; | |
public static class Format | |
{ | |
public static string HumanSize( int size, int places = 2, bool lower = false ) | |
{ | |
return Format.HumanSize( Convert.ToDecimal( size ), places, lower ); | |
} | |
public static string HumanSize( long size, int places = 2, bool lower = false ) |
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
#Call with `python.exe bomb_size.py --noc` | |
#to suppress the thousands separator. | |
from sys import argv | |
suppressComma = len( argv ) >= 2 and argv[1] == "--noc" | |
def humanSize( size, places = 2, lower = False ): | |
units = ( "B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB" ) | |
index = 0 | |
newSize = size |
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 eventhandler; | |
/+ | |
EventHandler implementation. | |
+/ | |
struct EventHandler( TArgs... ) | |
{ | |
private import std.algorithm; | |
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 util; | |
bool contains( T )( T[] a, T item ) | |
{ | |
foreach( x; a ) | |
if( x == item ) | |
return true; | |
return false; | |
} |
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
/+ | |
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 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 | |
{ |
OlderNewer