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 ouro.util.invokeImpl.X86_Windows.cdecl; | |
/** | |
Invokes the given function pointer. | |
Params: | |
fp = Function pointer. | |
ss = Size of argument stack. | |
sp = Pointer to bottom of argument stack. | |
eax = Pointer to storage for result eax register. |
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
# | |
# Minecraft World Translater | |
# Copyright (C) 2010, Daniel Keep. | |
# Licensed under the BSD <http://www.opensource.org/licenses/bsd-license.php> | |
# Canonical URL: https://gist.github.com/706617 | |
# | |
# Usage: mctranslate.py X-OFFSET Z-OFFSET | |
# | |
# Translates a Minecraft world by (X-OFFSET,Z-OFFSET) chunks and places the | |
# result in the "translated" directory. |
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
# | |
# Minecraft Resizer (for Windows) | |
# Copyright (C) 2010, Daniel Keep. | |
# Licensed under the BSD <http://www.opensource.org/licenses/bsd-license.php> | |
# Canonical URL: https://gist.github.com/675096 | |
# | |
# Changelog: | |
# | |
# 2010-11-13: |
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
" | |
Function to compute DPI from diagonal screen length | |
and pixel dimensions. | |
Written in MathEval: http://github.com/DanielKeep/MathEval | |
" | |
let dpi(phD, pxW, pxH) = pxW / (phD / sqrt((pxH/pxW)**2 + 1)) |
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 reprog_ssort; | |
/** | |
* Selection sort. | |
* | |
* This time actually writing out the various invariants and conditions. | |
* We're being FORMAL now, bitches. | |
* | |
* Compile with the 'paranoid' debug identifier to turn on all the various | |
* checks. |
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
/* | |
That's 'binary search', not 'cow excrement' I'll have you know... | |
Written for http://reprog.wordpress.com/2010/04/19/are-you-one-of-the-10-percent/ | |
Sadly, there IS a bug in the original, unmodified version of the search due | |
entirely to me trying to be clever. | |
To compile and run this (using dmd), use: |
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
/** | |
* Collatz graph generator (inspired by http://www.xkcd.com/710/) | |
* Written by Daniel Keep; released to the Public Domain. | |
* | |
* To use this, compile and either dump the output to a file, or feed it | |
* directly into GraphViz like so: | |
* | |
* ----- | |
* collatz 100 | dot -Ocollatz_100.svg -Tsvg | |
* ----- |
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
/// Parses the storage class for function arguments. | |
/// Authors: Daniel Keep | |
/// Copyright: Copyright © 2009 Daniel Keep | |
/// License: BSD v2 <http://www.opensource.org/licenses/bsd-license.php> | |
module argparse; | |
enum ParamSemantics | |
{ | |
None = 0b0000, | |
In = 0b0001, |
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
/** | |
* Contains functions that operate on functions and delegates. | |
* | |
* Copyright: Copyright © 2009, Daniel Keep. | |
* License: BSD v2 <http://www.opensource.org/licenses/bsd-license.php> | |
* Authors: Daniel Keep | |
*/ | |
module tangox.util.Func; | |
import tango.core.Traits; |
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
/* | |
Demonstration of a library-level Property implementation. | |
*/ | |
import std.stdio; | |
const DefaultGetter = ""; | |
const DefaultSetter = DefaultGetter; |