Skip to content

Instantly share code, notes, and snippets.

Sun May 17 15:23 2020 Time and Allocation Profiling Report (Final)
stanford-algorithms-exe +RTS -N -p -RTS
total time = 2.70 secs (10815 ticks @ 1000 us, 4 processors)
total alloc = 1,665,817,824 bytes (excludes profiling overheads)
COST CENTRE MODULE SRC %time %alloc
foldl' Course4.Week1 src/Course4/Week1.hs:130:93-224 78.4 47.0
Sun May 17 15:12 2020 Time and Allocation Profiling Report (Final)
stanford-algorithms-exe +RTS -N -p -RTS
total time = 2.71 secs (10860 ticks @ 1000 us, 4 processors)
total alloc = 1,665,818,880 bytes (excludes profiling overheads)
COST CENTRE MODULE SRC %time %alloc
foldl' Course4.Week1 src/Course4/Week1.hs:130:70-177 82.3 47.0
Sun May 17 14:42 2020 Time and Allocation Profiling Report (Final)
stanford-algorithms-exe +RTS -N -p -RTS
total time = 3.02 secs (12100 ticks @ 1000 us, 4 processors)
total alloc = 9,296,011,352 bytes (excludes profiling overheads)
COST CENTRE MODULE SRC %time %alloc
bellmanFord.findMin Course4.Week1 src/Course4/Week1.hs:131:5-117 63.1 82.9
1000 47978
1 8 36
1 33 29
1 38 18
1 63 25
1 76 39
1 100 26
1 105 41
1 120 20
1 131 34
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Sequence as Seq
import qualified Data.Array as Array
import qualified Data.Maybe as Maybe
import qualified Control.Monad.ST as ST
import qualified Control.Monad as CM
import qualified Data.PQueue.Prio.Min as MinHeap
@harfangk
harfangk / knapsack.hs
Created October 26, 2019 15:53
Knapsack algorithm
import qualified Data.Array.IArray as IArray
import qualified Control.Monad.ST as ST
import qualified Data.HashTable.Class as HT
import qualified Data.HashTable.ST.Cuckoo as Cuckoo
type HashTable s k v = Cuckoo.HashTable s k v
knapsack :: IArray.Array Int (Int,Int) -> (Int, Int) -> Int
knapsack items (i,x) = ST.runST $
do ht <- HT.new :: ST.ST s (HashTable s (Int,Int) Int)
@harfangk
harfangk / kosaraju.hs
Created April 28, 2019 09:31
Naive implementation of Kosaraju's algorithm in Haskell
module Kosaraju where
import qualified Data.Set as Set
import qualified Data.Map as Map
import qualified Data.List as List
type Graph = Map.Map Int [Int]
sccMain :: IO ()
sccMain = do
➜ syntax-highlighting git:(master) ✗ bin/folding_test [91/1864]
********* Start testing of FoldingTest *********
Config: Using QtTest library 5.10.0, Qt 5.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
PASS : FoldingTest::initTestCase()
PASS : FoldingTest::testFolding(Dockerfile)
PASS : FoldingTest::testFolding(Doxyfile.example)
PASS : FoldingTest::testFolding(Kconfig)
PASS : FoldingTest::testFolding(Makefile)
PASS : FoldingTest::testFolding(adblock.txt)
PASS : FoldingTest::testFolding(apache.conf)
@harfangk
harfangk / gist:2aca21664c5e0ada40c9833db00085f4
Created April 5, 2019 14:05
error log for TestHighlighterTest
➜ syntax-highlighting git:(master) ✗ bin/testhighlighter_test
********* Start testing of TestHighlighterTest *********
Config: Using QtTest library 5.10.0, Qt 5.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
PASS : TestHighlighterTest::initTestCase()
QDEBUG : TestHighlighterTest::testHighlight(Dockerfile) Using syntax "Dockerfile"
PASS : TestHighlighterTest::testHighlight(Dockerfile)
QDEBUG : TestHighlighterTest::testHighlight(Doxyfile.example) Using syntax "Doxyfile"
PASS : TestHighlighterTest::testHighlight(Doxyfile.example)
QDEBUG : TestHighlighterTest::testHighlight(Kconfig) Using syntax "Kconfig"
PASS : TestHighlighterTest::testHighlight(Kconfig)
@harfangk
harfangk / gist:a87189e8365efe3630d2ec9c683cb49c
Created April 5, 2019 14:02
error log for HTMLHighlighterTest
➜ syntax-highlighting git:(master) ✗ bin/htmlhighlighter_test [91/1992]
********* Start testing of HTMLHighlighterTest *********
Config: Using QtTest library 5.10.0, Qt 5.10.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.1 20160406 (Red Hat 5.3.1-6))
PASS : HTMLHighlighterTest::initTestCase()
PASS : HTMLHighlighterTest::testHighlight(Dockerfile)
PASS : HTMLHighlighterTest::testHighlight(Doxyfile.example)
PASS : HTMLHighlighterTest::testHighlight(Kconfig)
PASS : HTMLHighlighterTest::testHighlight(Makefile)
PASS : HTMLHighlighterTest::testHighlight(adblock.txt)
PASS : HTMLHighlighterTest::testHighlight(apache.conf)