Skip to content

Instantly share code, notes, and snippets.

View martijnbastiaan's full-sized avatar

Martijn Bastiaan martijnbastiaan

View GitHub Profile
diff --git a/amcat/contrib/plugins/README.TXT b/amcat/contrib/plugins/README.TXT
index e69de29..c3c53ed 100644
--- a/amcat/contrib/plugins/README.TXT
+++ b/amcat/contrib/plugins/README.TXT
@@ -0,0 +1,29 @@
+Plugins are modular pieces of code which inherit from special classes, indicating
+their type. As of now, only "NLP" and "Article Upload" plugins are supported, but
+more types might be added in the future.
+
+== Adding plugins ==
#!/usr/bin/env python3
# Heaviliy influenced by: http://tinyurl.com/qe2ht4w
import operator
import collections
import numpy
from functools import partial
from string import ascii_lowercase as alpha
NORMALISED_FREQUENCIES = [
from itertools import ifilter, imap
def merge(sets):
set_map = {}
for s in ifilter(bool, imap(set, sets)):
# Where can we store it?
try:
el = set_map[next(ifilter(lambda x: x in set_map, s))]
el |= s
@martijnbastiaan
martijnbastiaan / fish_prompt.fish
Created February 7, 2016 15:47
/home/martijn/.config/fish/functions/fish_prompt.fish
# name: Terlar
# author: terlar - https://github.com/terlar
set -g fish_color_user magenta
set -g fish_color_host yellow
function fish_prompt --description 'Write out the prompt'
set -l last_status $status
# User
@martijnbastiaan
martijnbastiaan / __terlar_git_prompt.fish
Created February 7, 2016 15:47
/home/martijn/.config/fish/functions/__terlar_git_prompt.fish
set -g fish_color_git_clean green
set -g fish_color_git_staged yellow
set -g fish_color_git_dirty red
set -g fish_color_git_added green
set -g fish_color_git_modified blue
set -g fish_color_git_renamed magenta
set -g fish_color_git_copied magenta
set -g fish_color_git_deleted red
set -g fish_color_git_untracked yellow
#!/bin/bash
for arg in $@; do
echo ${arg}
done
case HashMap.lookup (nameOcc fun) normalized of
Just _ -> do
(_,Component compName compInps [snd -> compOutp] _) <- preserveVarEnv $ genComponent (nameOcc fun)
if length args == length compInps
then do argTys <- mapM (termType tcm) args
let dstId = Text.pack . name2String $ varName dst
(argExprs,argDecls) <- fmap (second concat . unzip) $! mapM (\(e,t) -> mkExpr False (Left dstId) t e) (zip args argTys)
(argExprs',argDecls') <- (second concat . unzip) <$> mapM (toSimpleVar dst) (zip argExprs argTys)
let inpAssigns = zipWith (\(i,t) e -> (Identifier i Nothing,In,t,e)) compInps argExprs'
$ rustc --target=mips-unknown-linux-gnu -C linker=mips-openwrt-linux-gcc hello.rs
error: linking with `mips-openwrt-linux-gcc` failed: exit code: 1
|
= note: "mips-openwrt-linux-gcc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-L" "/home/martijn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-gnu/lib" "hello.hello0.rust-cgu.o" "hello.hello1.rust-cgu.o" "-o" "hello" "hello.crate.allocator.rust-cgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/home/martijn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/martijn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-gnu/lib/libstd-827ddea93328ae2d.rlib" "/home/martijn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-gnu/lib/liballoc_system-751808ba756769d5.rlib" "/home/martijn/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/mips-unknown-linux-gnu/lib/librand-3d
martijn@deskei ~/code/clash-compiler-qbl master $ cabal new-run clash -- scratch/Mac.hs --vhdl -fclash-nocache -fclash-debug DebugFinal
Up to date
Loading dependencies took 0.754814242s
Parsing and compiling primitives took 0.068400107s
Compiling: MAC.topEntity
Ignoring .manifest files
MAC.topEntity8214565720323808422 before normalization:
λ(clk :: Clash.Signal.Internal.Clock
(Clash.Signal.Internal.Dom A 5000)
Up to date
Loading dependencies took 0.742528095s
Parsing and compiling primitives took 0.067847811s
Compiling: MAC.topEntity
Ignoring .manifest files
MAC.topEntity8214565720323808422 before normalization:
λ(clk :: Clash.Signal.Internal.Clock
(Clash.Signal.Internal.Dom A 5000)
Clash.Signal.Internal.Source) ->