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://downloads.sourceforge.net/project/fontforge/fontforge-source/fontforge_full-20110222.tar.bz2 | |
File already downloaded in /Users/tomasi/Library/Caches/Homebrew | |
/usr/bin/tar xf /Users/tomasi/Library/Caches/Homebrew/fontforge-20110222.tar.bz2 | |
==> ./configure --prefix=/usr/local/Cellar/fontforge/20110222 --enable-double --without-freetype-bytecode | |
./configure --prefix=/usr/local/Cellar/fontforge/20110222 --enable-double --without-freetype-bytecode | |
checking for gcc... /usr/bin/cc | |
checking whether the C compiler works... yes | |
checking for C compiler default output file name... a.out | |
checking for suffix of executables... | |
checking whether we are cross compiling... no |
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
Your OS X is ripe for brewing. | |
Any troubles you may be experiencing are likely purely psychosomatic. |
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
let fast_fact = | |
let rec fact n = if n > 1 then n * fact (n - 1) else 1 | |
in Array.map fact [|0; 1; 2; 3; 4; 5; 6; 7; 8; 9|];; | |
let digits num = | |
let rec helper num result = | |
if num < 10 then num :: result else helper (num / 10) ((num mod 10) :: result) | |
in helper num [];; | |
let test_number num = |
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
import Data.Char (digitToInt) | |
main = print (sum ([x | x <- [10..100000], x == sum (map (\n -> product [1..n]) (map (digitToInt) (show x)))])) |
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
(defn fact | |
"Return n!." | |
[^Integer n] | |
(if (< n 2) | |
1 | |
(apply * (range 2 (+ n 1))))) | |
(def fast-fact | |
; This is a faster version of "fact", using a dictionary to return the | |
; factorial for any number between 0 and 9 (the only kind of number for which |
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
def fact (n): | |
"Return n!." | |
if n < 2: | |
return 1 | |
else: | |
result = 1 | |
for i in xrange (2, n + 1): | |
result = result * i | |
return result |
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
double | |
doubleThis(double x) | |
{ | |
return x * 2; | |
} |
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
__Z11doubleThisd: | |
pushq %rbp | |
movq %rsp, %rbp | |
movsd %xmm0, -8(%rbp) | |
movsd -8(%rbp), %xmm0 # Directly copy the parameter into the FP register | |
addsd %xmm0, %xmm0 # Calculate x+x instead of 2x | |
leave | |
ret |
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
double | |
doubleThis(double & x) | |
{ | |
return x * 2; | |
} |
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
__Z24doubleThisRd: | |
pushq %rbp | |
movq %rsp, %rbp | |
movq %rdi, -8(%rbp) | |
movq -8(%rbp), %rax | |
movsd (%rax), %xmm0 # Put in xmm0 the value pointed by RAX | |
addsd %xmm0, %xmm0 # Calculate x+x instead of 2x | |
leave | |
ret |
OlderNewer