This file contains hidden or 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.List | |
import Text.Printf | |
choose :: Int -> [a] -> [[a]] | |
choose 0 _ = [[]] | |
choose _ [] = [] | |
choose n (x:xs) = map (x :) (choose (n - 1) xs) ++ choose n xs | |
perm :: Int -> [a] -> [[a]] | |
perm n = concatMap permutations . choose n |
This file contains hidden or 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 Main where | |
import Control.Monad | |
import Data.List (foldl') | |
data Operator | |
= Add | |
| Sub | |
| Mult | |
| Div |
This file contains hidden or 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
CC='/sim/dev/sdz/tools/bin/gcc' \ | |
CXX='/sim/dev/sdz/tools/bin/g++' \ | |
./configure --prefix=/sim/dev/sdz/tools --enable-cxx |
This file contains hidden or 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
wget ftp://gcc.gnu.org/pub/gcc/releases/gcc-4.7.3/gcc-4.7.3.tar.bz2 | |
tar xjf gcc-4.7.3.tar.bz2 | |
cd gcc-4.7.3 | |
./contrib/download_prerequisites | |
cd .. | |
mkdir build | |
cd build | |
export PREFIX=/sim/dev/sdz/tools |