Skip to content

Instantly share code, notes, and snippets.

View phlummox's full-sized avatar

phlummox phlummox

View GitHub Profile
@phlummox
phlummox / part.hs
Last active November 16, 2016 07:57
calculate count of integer partitions of a number, in Haskell
{-# LANGUAGE BangPatterns #-}
import Control.Monad (when, forM_, forM)
import Data.STRef
import Control.Monad.ST
import qualified Data.Vector.Generic.Mutable as GM
import Data.Vector.Generic.Mutable ( write )
import qualified Data.Vector.Mutable as VM
@phlummox
phlummox / BlahutArimoto.m
Created April 17, 2017 13:33 — forked from Piyush3dB/BlahutArimoto.m
Blahut-Arimoto algorithm implementation in Matlab
function [C r] = BlahutArimoto(p)
disp('BlahutArimoto')
% Capacity of discrete memoryless channel
% Blahut-Arimoto algorithm
% Input
% p: m x n matrix
% p is the transition matrix for a channel with m inputs and n outputs
@phlummox
phlummox / gist:364827ced4257c45b66a8b9a369802f2
Created December 8, 2017 05:25
output of stack --verbose --resolver=lts-6.35 install http2
Version 1.6.1, Git revision f25811329bbc40b0c21053a8160c56f923e1201b (5435 commits) x86_64 hpack-0.20.0
2017-12-08 05:11:57.012604: [debug] Checking for project config at: /home/dev2/HUP2/stack.yaml
@(Stack/Config.hs:842:9)
2017-12-08 05:11:57.014162: [debug] Checking for project config at: /home/dev2/stack.yaml
@(Stack/Config.hs:842:9)
2017-12-08 05:11:57.014389: [debug] Checking for project config at: /home/stack.yaml
@(Stack/Config.hs:842:9)
2017-12-08 05:11:57.014640: [debug] Checking for project config at: /stack.yaml
@(Stack/Config.hs:842:9)
2017-12-08 05:11:57.014867: [debug] No project config file found, using defaults.
@phlummox
phlummox / man.java
Created December 10, 2018 07:07
Slightly tidied code for Voronoi applet using Manhattan distance metric (original at http://www.nirarebakun.com/voro/eman.html)
//includeawt(s)
import java.awt.Graphics;
import java.applet.Applet;
import java.awt.Color;
public class man extends Applet{
final static Color BLACK_COL=Color.black;
final static Color GREEN_COL=Color.green;
final static Color BLUE_COL=Color.blue;
@phlummox
phlummox / predicat.md
Created July 7, 2019 15:20
Predicative and Impredicative Definitions -- Internet Encyclopedia of Philosophy
lang title
en-US
Predicative and Impredicative Definitions -- Internet Encyclopedia of Philosophy

Predicative and Impredicative Definitions

@phlummox
phlummox / libreoffice-base-sqlite-odbc-osx.md
Created July 17, 2019 08:07
Use LibreOffice Base as a GUI for an SQLite database in OS X

author: Andrew Heiss description: | Connect LibreOffice to an SQLite database to take advantage of SQLite's ubiquitousness and LibreOffice's form-based GUI. keywords: 'osx, sqlite, databases' lang: en title: | Use LibreOffice Base as a GUI for an SQLite database in OS X date: Wednesday, February 10, 2016

@phlummox
phlummox / haskell-IDEs.md
Last active December 15, 2019 17:42
Haskell "IDEs"

Back-ends

Usually, these will work with multiple front-end editor/IDEs, via an editor/IDE plug-in of some sort. e.g., Intero has plugin-ins for Emacs, Vim, and various others.

ghc-mod

  • not compatible with recent versions of ghc (>=7.6 && <8.2)
  • not compatible with recent stack LTEs
  • had troulbe installing, even using cabal rather than stack
@phlummox
phlummox / happy-lts-3-output.txt
Created April 6, 2020 08:50
Output from stack 2.1.3 of building "happy" using lts-3
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
2020-04-06 08:38:56.821358: [debug] Checking for project config at: /home/user/stack.yaml
2020-04-06 08:38:56.821604: [debug] Checking for project config at: /home/stack.yaml
2020-04-06 08:38:56.867740: [debug] Checking for project config at: /stack.yaml
2020-04-06 08:38:56.867866: [debug] No project config file found, using defaults.
2020-04-06 08:38:56.873067: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2020-04-05 08:38:56.873015 UTC]
2020-04-06 08:38:56.873644: [debug] Using resolver: lts-3 specified on command line
2020-04-06 08:38:56.874043: [debug] Downloading snapshot versions file from https://s3.amazonaws.com/haddock.stackage.org/snapshots.json
2020-04-06 08:38:58.449314: [debug] Done downloading and parsing snapshot versions file
2020-04-06 08:38:58.449453: [info] Selected resolver: lts-3.22
@phlummox
phlummox / happy-lts-8-output.txt
Created April 6, 2020 09:07
Output from stack 2.1.3 of building "happy" using lts-8
Version 2.1.3, Git revision 0fa51b9925decd937e4a993ad90cb686f88fa282 (7739 commits) x86_64 hpack-0.31.2
2020-04-06 09:05:05.947782: [debug] Checking for project config at: /home/user/stack.yaml
2020-04-06 09:05:05.948083: [debug] Checking for project config at: /home/stack.yaml
2020-04-06 09:05:05.948171: [debug] Checking for project config at: /stack.yaml
2020-04-06 09:05:05.990297: [debug] No project config file found, using defaults.
2020-04-06 09:05:06.025452: [debug] SELECT COUNT(*) FROM "last_performed" WHERE ("action"=?) AND ("timestamp">=?); [PersistInt64 1,PersistUTCTime 2020-04-05 09:05:06.025401 UTC]
2020-04-06 09:05:06.026078: [debug] Using resolver: lts-8 specified on command line
2020-04-06 09:05:06.026544: [debug] Downloading snapshot versions file from https://s3.amazonaws.com/haddock.stackage.org/snapshots.json
2020-04-06 09:05:07.831620: [debug] Done downloading and parsing snapshot versions file
2020-04-06 09:05:07.831754: [info] Selected resolver: lts-8.24
@phlummox
phlummox / output.txt
Created April 13, 2020 15:49
stack-2.1.3-agda-build-output
++stack --resolver lts-3 --no-terminal --install-ghc install --only-dependencies Agda-2.4.2.4
Selected resolver: lts-3.22
data-hash > configure
data-hash > Configuring data-hash-0.2.0.1...
data-hash > build
data-hash > Building data-hash-0.2.0.1...
data-hash > Preprocessing library data-hash-0.2.0.1...
data-hash > [1 of 4] Compiling Data.Hash.Base ( src/Data/Hash/Base.hs, .stack-work/dist/x86_64-linux/Cabal-1.22.4.0/build/Data/Hash/Base.o )
data-hash > 
data-hash > /tmp/stack4826/data-hash-0.2.0.1/src/Data/Hash/Base.hs:61:14: Warning: