Skip to content

Instantly share code, notes, and snippets.

@herrhotzenplotz
herrhotzenplotz / output.txt
Last active April 8, 2020 23:42
KGBotka stack init
$ stack init
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- ./
Selecting the best among 17 snapshots...
* Rejected lts-15.7
ghc-8.8.3 cannot be used for these packages:
- kgbotka
@herrhotzenplotz
herrhotzenplotz / Interpolation.hs
Created April 9, 2020 08:51
Numerical interpolation
module Main where
import Plotting
skipNthElement :: Int -> [a] -> [a]
skipNthElement d ys = take d ys <> drop (d + 1) ys
lagrangePolynome :: [Double] -> Int -> Double -> Double
lagrangePolynome xs i x = product $ skipNthElement i $ map pn [0 .. n - 1]
where
---- 1 ---- 1.5000000000000000000000000000000000000000000000000000000000000000
-------------------------------------------------------------
system name = FreeBSD
node name = henricus
release = 13.0-CURRENT
version = FreeBSD 13.0-CURRENT #0 r362037: Thu Jun 11 09:24:02 UTC 2020 [email protected]:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC
machine = arm64
page size = 4096
avail memory = 973385728
@herrhotzenplotz
herrhotzenplotz / Name.hs
Created August 7, 2020 20:37
Word jumbler
module Main where
import System.Random
import System.Environment
import Control.Monad
import Data.Array.IO
main :: IO ()
main = do
[name, num] <- getArgs
@herrhotzenplotz
herrhotzenplotz / Makefile
Last active September 13, 2020 10:47
FM Demodulation
CC= /usr/bin/cc
PKGS= fftw3
LDFLAGS=`pkg-config --libs $(PKGS)` -lm
CFLAGS= -std=c99 -g -pedantic -Wall -Wextra `pkg-config --cflags $(PKGS)`
PROG= main
MK_MAN= no
.include <bsd.prog.mk>
@herrhotzenplotz
herrhotzenplotz / curl-7.80.0.compile.003.log
Last active November 15, 2021 14:12
curl 7.80.0 w/ OpenSSL 3.0 on i386-minix
Making all in lib
gmake[1]: Entering directory '/usr/opt/sn/src/curl-7.80.0/lib'
gmake all-am
gmake[2]: Entering directory '/usr/opt/sn/src/curl-7.80.0/lib'
/bin/sh ../libtool --tag=CC --mode=compile cc -DHAVE_CONFIG_H -I../include -I../lib -I../lib -DBUILDING_LIBCURL -DCURL_HIDDEN_SYMBOLS -isystem /usr/opt/sn/include -isystem /usr/opt/sn//include -DOPENSSL_SUPPRESS_DEPRECATED -fvisibility=hidden -Qunused-arguments -Os -MT libcurl_la-altsvc.lo -MD -MP -MF .deps/libcurl_la-altsvc.Tpo -c -o libcurl_la-altsvc.lo `test -f 'altsvc.c' || echo './'`altsvc.c
libtool: compile: cc -DHAVE_CONFIG_H -I../include -I../lib -I../lib -DBUILDING_LIBCURL -DCURL_HIDDEN_SYMBOLS -isystem /usr/opt/sn/include -isystem /usr/opt/sn//include -DOPENSSL_SUPPRESS_DEPRECATED -fvisibility=hidden -Qunused-arguments -Os -MT libcurl_la-altsvc.lo -MD -MP -MF .deps/libcurl_la-altsvc.Tpo -c altsvc.c -fPIC -DPIC -o .libs/libcurl_la-altsvc.o
libtool: compile: cc -DHAVE_CONFIG_H -I../include -I../lib -I../lib -DBUILDING_LIBCURL -DCURL_H
@herrhotzenplotz
herrhotzenplotz / x11-contour.shar
Last active December 11, 2021 09:29
contour fbsd port
# This is a shell archive. Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file". Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
# ./Makefile
# ./distinfo
# ./files/patch-src_terminal__renderer_CMakeLists.txt
@herrhotzenplotz
herrhotzenplotz / gdb.txt
Created March 25, 2022 14:42
ghcli paste
This file has been truncated, but you can view the full file.
Starting program: /usr/home/nico/src/contour/build/src/contour/contour
[New LWP 103166 of process 16412]
[New LWP 103167 of process 16412]
[Detaching after fork from child process 16624]
[Detaching after fork from child process 16838]
[New LWP 103168 of process 16412]
[New LWP 103169 of process 16412]
[New LWP 103170 of process 16412]
[New LWP 103171 of process 16412]
[New LWP 103172 of process 16412]
WARNING: ThreadSanitizer: data race (pid=97164)
Write of size 8 at 0x7b1000000068 by main thread:
#0 memcpy /usr/src/contrib/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc:808:5 (debug+0x25f9c9)
#1 sn_q_nq /usr/home/nico/src/libsn/src/q.c:146:5 (debug+0x2b67eb)
#2 main /usr/home/nico/src/libsn/examples/debug.c:115:13 (debug+0x2b31d6)
Previous read of size 8 at 0x7b1000000068 by thread T1:
#0 kernel /usr/home/nico/src/libsn/examples/debug.c:57:11 (debug+0x2b35a9)
#1 sn_q_worker_task /usr/home/nico/src/libsn/src/q.c:76:9 (debug+0x2b642b)
@herrhotzenplotz
herrhotzenplotz / ndless FreeBSD Patch
Created January 21, 2023 16:03
Patch to make ndless sort of build on FreeBSD (gdb is still broken however)
diff --git a/ndless-sdk/bin/arm-none-eabi-ld.gold b/ndless-sdk/bin/arm-none-eabi-ld.gold
index ae0dd67..c8cb7f4 100755
--- a/ndless-sdk/bin/arm-none-eabi-ld.gold
+++ b/ndless-sdk/bin/arm-none-eabi-ld.gold
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# New ld which produces ELF binaries for use with genzehn
# It is invoked instead of "arm-none-eabi-ld" (or the default linker of the ARM toolchain) to replace the default crt* with ndless compatible ones and also adds some more libs