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
Hi I'm trying to ressurect this code: | |
https://www.schoolofhaskell.com/user/edwardk/cellular-automata/part-1 | |
I have resolved everything except this bit: | |
grid :: [[Bool]] -> Diagram SVG R2 | |
grid = cat unitY . reverse . map (hcat . map cell) where | |
cell b = unitSquare D.# fc (if b then black else white) |
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
• Couldn't match type ‘svg-builder-0.1.1:Graphics.Svg.Core.Element’ | |
with ‘blaze-markup-0.8.2.2:Text.Blaze.Internal.MarkupM ()’ | |
Expected type: QDiagram SVG V2 Double Any | |
-> blaze-markup-0.8.2.2:Text.Blaze.Internal.Markup | |
Actual type: QDiagram SVG V2 Double Any -> Result SVG V2 Double | |
• In the second argument of ‘(.)’, namely | |
‘renderDia SVG (SVGOptions (mkWidth 400) Nothing "" [] True)’ | |
In the second argument of ‘(.)’, namely | |
‘renderSvg | |
. renderDia SVG (SVGOptions (mkWidth 400) Nothing "" [] True)’ |
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
I'm trying to bring up the code in Ed Kmett's excellent blog post: | |
https://www.schoolofhaskell.com/user/edwardk/cellular-automata/part-1 | |
But I get this error: | |
• Expected kind ‘((* -> *) -> Constraint) -> *’, | |
but ‘Diagram SVG’ has kind ‘*’ | |
• In the type signature: grid :: [[Bool]] -> Diagram SVG R2 | |
| |
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
git config --global user.name "Michael Gough" | |
git config --global user.email innovative.engineer@gmail.com | |
git init | |
git add . | |
git commit | |
curl -u 'fragamus' https://api.github.com/user/repos -d '{"name":"tokamak"}' | |
enter password |
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
{-# LANGUAGE GADTs #-} | |
import Data.Some | |
data ZeroOneTwo a where | |
Zero :: ZeroOneTwo () | |
One :: Int -> ZeroOneTwo Int | |
Two :: (Int,Int) -> ZeroOneTwo Int | |
getSome :: Some ZeroOneTwo |
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.Some | |
asdf :: forall a. Maybe a -> Bool | |
asdf (Just _) = True | |
asdf Nothing = False | |
test1 = withSome (This (Just 5)) asdf | |
test2 = withSome (This Nothing) asdf |
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
{-# LANGUAGE TemplateHaskell #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
{-# LANGUAGE ExplicitForAll #-} | |
{-# LANGUAGE OverloadedStrings #-} | |
{-# LANGUAGE DeriveGeneric #-} | |
{-# LANGUAGE DeriveAnyClass #-} | |
import Data.Aeson | |
import Data.Text | |
import Control.Applicative |
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
-- I want to make this code nice and crisp for teaching purposes | |
list_of_lists_of_tack_on_functions = (fmap (\x->(++[x]))) <$> | |
(["0","1","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"]!!) <$> | |
(\x->(read [x])::Int) <$> | |
"4742836" | |
foldl (\list_of_names list_of_tack_on_functions -> list_of_tack_on_functions <*> list_of_names) | |
[""] | |
list_of_lists_of_tack_on_functions |
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
I need to patchelf this pre-built binary to run on my 64 bit intel nixos machine: | |
$ file foo | |
ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.0.0, stripped | |
$ readelf -d foo | |
Dynamic section at offset 0x128f8 contains 21 entries: | |
Tag Type Name/Value | |
0x00000001 (NEEDED) Shared library: [libm.so.6] |
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
$ ls -l /root/scipoptsuite-5.0.1/hmetis-1.5-linux/hmetis | |
-rwxrwxrwx 1 2504 2504 79636 Mar 7 2002 /root/scipoptsuite-5.0.1/hmetis-1.5-linux/hmetis | |
$ /root/scipoptsuite-5.0.1/hmetis-1.5-linux/hmetis | |
bash: /root/scipoptsuite-5.0.1/hmetis-1.5-linux/hmetis: No such file or directory | |
I DISCOVERED THAT THE EXECUTABLE IS 32 BIT: | |
$ file /root/scipoptsuite-5.0.1/hmetis-1.5-linux/hmetis | |
/root/scipoptsuite-5.0.1/hmetis-1.5-linux/hmetis: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.0.0, stripped |