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 test; | |
template S(T) { struct S { alias P = T; alias ToInt = value-of!T.ToInt + 1; } } | |
struct Z { alias ToInt = 0; } | |
template ToType(alias T) { | |
static if (T > 0) { alias ToType=S!ToType!(T-1); } | |
else { alias ToType=Z; } | |
} | |
template Func2(T) { | |
alias Func2 = T[2] function(T[0], T[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 test; | |
template S(T) { struct S { alias P = T; alias ToInt = value-of!T.ToInt + 1; } } | |
struct Z { alias ToInt = 0; } | |
template ToType(alias T) { | |
static if (T > 0) { alias ToType=S!ToType!(T-1); } | |
else { alias ToType=Z; } | |
} | |
template Func2(T) { | |
alias Func2 = T[2] function(T[0], T[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
(last (set-orbit-cam | |
(vec3f 0.618383 6.087035 -8.772034) | |
(vec3f 0.539558 0.000000 -0.609656) | |
30.000000) | |
(last | |
(set world (new-world)) | |
(let (s (let | |
(sun (new-sun)) | |
(last (set | |
(: sun 'texgen) |
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 mspatest; | |
import std.string, sqlite3, std.boehm, std.zlib, std.http, std.util, std.file; | |
static import c.stdlib; | |
import std.fun, std.cgi; | |
import mspa; | |
alias FOURSTRING = (string, string, string, string); // small shortcut |
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 std.sound.threaded; // separate playback thread | |
import std.sound.base, std.thread, std.time, std.list; | |
class ThreadedOutput : SoundOutput { | |
ThreadPool tp; | |
SoundOutput sup; | |
int maxOutstandingSamples; | |
void init(SoundOutput sup) { | |
tp = new ThreadPool 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 mspatest; | |
import std.string, sqlite3, std.boehm, std.zlib, std.http, std.util, std.file; | |
static import c.stdlib; | |
import std.fun, std.cgi, std.process; | |
import mspa; | |
alias FOURSTRING = (string, string, string, string); // small shortcut |
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 sudoku; | |
import std.util, std.coroutine, std.string, std.fun; | |
auto solve(string puz){ | |
alias s=string,v=void delegate(s); | |
void S(s p,v y){ | |
if (auto i=p.find"0"){p=p.dup;for int k<-0..9 if!sum$(0..81).select(λ(int j)->(i%9==j%9||i/9==j/9||i/27==j/27&&(i%9)/3==(j%9)/3)) | |
.map(λ(int i)->(p[i]=="1"+k)).eval{p[i]="123456789"[k];p.S y;}}else y p;} | |
return setupCoIterator!s new λ(v y)->puz.S y; |
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
#!/bin/sh | |
BACKERS=data/core/backers.json | |
BACKUP=data/core/backers.bak.json | |
if [ ! -f "$BACKUP" ] | |
then | |
echo "Backing up backers.json.." | |
mv "$BACKERS" "$BACKUP" | |
fi | |
echo "Replacing backers.json.." | |
( |
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 trainsearch; | |
void main() { | |
int[][] paths; | |
// There are only six paths through the | |
// intersection that a train can take. | |
/* | |
paths ~= [2]; | |
paths ~= [3]; | |
paths ~= [4]; |
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
library ieee; | |
use ieee.std_logic_1164.all; | |
use ieee.numeric_std.all; | |
library altera; | |
use altera.altera_syn_attributes.all; | |
entity Counter is | |
generic (Size:Integer); | |
port ( | |
Step, Reset: in std_logic; |