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
==> Downloading http://www.swi-prolog.org/download/stable/src/pl-5.10.4.tar.gz | |
File already downloaded in /Users/michael/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/michael/Library/Caches/Homebrew/swi-prolog-5.10.4.tar.gz | |
==> ./configure --prefix=/usr/local/Cellar/swi-prolog/5.10.4 --mandir=/usr/local/Cellar/swi-prolog/5.10.4/share/man --with-world | |
./configure --prefix=/usr/local/Cellar/swi-prolog/5.10.4 --mandir=/usr/local/Cellar/swi-prolog/5.10.4/share/man --with-world | |
checking builddir... src | |
checking for gcc... /usr/bin/gcc-4.2 | |
checking whether the C compiler works... yes | |
checking for C compiler default output file name... a.out | |
checking for suffix of executables... |
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
-- executes IO actions trying to maintain the rate of 'pace' seconds | |
-- per action | |
pacedSequence :: Double -> [IO ()] -> IO () | |
pacedSequence paceSeconds ios = do | |
now <- getCurrentTime | |
pacedSequence' pace ios now 0 | |
where | |
pace = fromRational $ toRational paceSeconds | |
pacedSequence' :: NominalDiffTime -> [IO ()] -> UTCTime -> Int -> IO () |
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
==> Downloading http://www.swi-prolog.org/download/stable/src/pl-5.10.5.tar.gz | |
File already downloaded in /Users/michael/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/michael/Library/Caches/Homebrew/swi-prolog-5.10.5.tar.gz | |
==> ./configure --prefix=/usr/local/Cellar/swi-prolog/5.10.5 --mandir=/usr/local/Cellar/swi-prolog/5.10.5/share/man --with-world | |
./configure --prefix=/usr/local/Cellar/swi-prolog/5.10.5 --mandir=/usr/local/Cellar/swi-prolog/5.10.5/share/man --with-world | |
checking builddir... src | |
checking for gcc... /usr/bin/gcc-4.2 | |
checking whether the C compiler works... yes | |
checking for C compiler default output file name... a.out | |
checking for suffix of executables... |
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
string GetDebugLogName() | |
{ | |
char pszFile[MAX_PATH+100]; | |
GetDataDir(pszFile); | |
strlcat(pszFile, "/debug.log", sizeof(pszFile)); | |
return pszFile; | |
} |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use feature qw( say switch ); | |
use autodie qw( system open unlink ); | |
use Digest::SHA1 qw( sha1_hex ); | |
use File::Copy; | |
use Perl6::Slurp; | |
sub darcs; |
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 add_to(start, others) { | |
for(var i=0; i<others.length; i++) { | |
start += others[i] | |
} | |
return start; | |
} |
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
map _ [] = [] | |
map f (x:xs) = f x : map f xs |
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
append([], Ys, Ys). | |
append([X|Xs], Ys, [X|Zs]) :- append(Xs, Ys, Zs). |
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 real_roots(a, b, c) { | |
var A2 = a*2; | |
var D = b*b - A2*c*2; | |
if (D<0) return []; | |
if (D==0) return [-b/A2]; | |
var xs = plus_minus( -b, Math.sqrt(D) ); | |
return [ (xs[0])/A2, (xs[1])/A2 ]; | |
} | |
function plus_minus(x,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
real_roots(A,B,C) = Roots :- | |
( D<0 -> Roots=[] | |
; D=0 -> Roots=[-B/A2] | |
; plus_minus(-B,sqrt(D), X0, X1), | |
Roots=[X0/A2,X1/A2] | |
), | |
D = B*B - A2*C*2, | |
A2 = A*2. | |
plus_minus(X,Y) = [X+Y,X-Y]. |