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 ScopedTypeVariables #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE TypeSynonymInstances #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE PolyKinds #-} |
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
#!/usr/bin/env python3 | |
""" | |
Compute link order | |
""" | |
import sys | |
from pathlib import Path | |
import typing | |
from typing import Set, NamedTuple |
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
#include <stdio.h> | |
#include <stdint.h> | |
#include <cstring> | |
#include <type_traits> | |
constexpr const uint16_t csum(const char* s, size_t n, size_t i, uint16_t sum1, uint16_t sum2) { | |
return (i <= n) ? csum(s, n, i+1, (sum1 + s[i]) % 255, (sum2 + sum1) % 255) : ((sum2 << 8) | sum1); | |
} | |
constexpr const uint16_t operator "" _csum(const char* s, size_t n) { |
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
{ pkgs, config, lib, ... }: | |
let | |
packet-block-storage = | |
pkgs.stdenv.mkDerivation { | |
name = "packet-block-storage"; | |
src = pkgs.fetchFromGitHub { | |
owner = "packethost"; | |
repo = "packet-block-storage"; | |
rev = "4be27cbca7a924b4de7af059d5ac30c2aa5c9e6f"; |
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
ulimit -n 32000 | |
_build/stage1/bin/ghc -O -threaded -rtsopts EchoServer.hs -debug | |
./EchoServer +RTS -N4 -s -DS -RTS & | |
echo 'GET http://localhost:3000/' | nix run nixpkgs.vegeta -c vegeta attack -rate 4000 -body Vagrantfile >out | |
kill %1 | |
nix run nixpkgs.vegeta -c vegeta report < out |
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
let | |
haskellNixSrc = builtins.fetchTarball https://github.com/input-output-hk/haskell.nix/archive/a823ba4b7126d11ca272ef70b842b0ea5523fcfd.tar.gz; | |
haskellNix = import haskellNixSrc {}; | |
nixpkgsSrc = haskellNix.sources.nixpkgs-2003; | |
nixpkgsArgs = haskellNix.nixpkgsArgs; | |
in | |
{ pkgs ? (import nixpkgsSrc nixpkgsArgs).pkgsCross.aarch64-multiplatform-musl | |
}: | |
let | |
hspkgs = pkgs.haskell-nix.stackProject { |
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
diff --git a/runstdtest/runstdtest.prl b/runstdtest/runstdtest.prl | |
index 4ac632f..fb12099 100644 | |
--- a/runstdtest/runstdtest.prl | |
+++ b/runstdtest/runstdtest.prl | |
@@ -209,7 +209,7 @@ if ($PostScript ne '') { | |
# OK, so we're gonna do the normal thing... | |
if ($Cachegrind eq 'yes') { | |
- $CachegrindPrefix = "valgrind --tool=cachegrind --log-fd=9 9>$CachegrindStats"; | |
+ $CachegrindPrefix = "valgrind --tool=cachegrind --dsymutil=no --log-fd=9 9>$CachegrindStats"; |
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
#include <stdint.h> | |
#include <fenv.h> | |
float hs_word2float32_old(uint64_t x) { | |
return (float)x; | |
} | |
float hs_word2float32_new(uint64_t x) { | |
int r = fegetround(); | |
fesetround(FE_TOWARDZERO); |
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
#!/bin/bash | |
cat >ftdi-test.cfg <<EOF | |
source [find interface/ftdi/dp_busblaster.cfg] | |
ftdi_layout_signal TCK -data 0x01 | |
ftdi_layout_signal TDI -data 0x02 | |
ftdi_layout_signal TDO -data 0x04 | |
ftdi_layout_signal TMS -data 0x08 | |
transport select jtag |
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
#include <string.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
/* | |
* See https://gitlab.haskell.org/ghc/ghc/wikis/commentary/compiler/symbol-names | |
*/ | |
/* | |
* Returns number of characters decoded including NULL-terminator or zero if |
NewerOlder