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 | |
resolve = nixPath: defaultUrl: | |
let | |
resolvedNixPath = builtins.tryEval nixPath; | |
in | |
if resolvedNixPath.success then | |
import resolvedNixPath.value | |
else | |
builtins.fetchTarball defaultUrl | |
; |
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
{ lib | |
, fetchFromGitHub | |
, buildGoModule | |
, go-md2man | |
, podman | |
}: | |
buildGoModule rec { | |
pname = "toolbox"; | |
version = "0.0.92"; |
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
{ stdenv, fetchFromGitHub, cmake, pkg-config, git, bzip2, libusb1, libzip, openssl }: | |
stdenv.mkDerivation rec { | |
pname = "uuu"; | |
version = "1.3.191"; | |
src = fetchFromGitHub { | |
owner = "NXPMicro"; | |
repo = "mfgtools"; | |
rev = "uuu_${version}"; | |
sha256 = "196blmd7nf5kamvay22rvnkds2v6h7ab8lyl10dknxgy8i8siqq9"; | |
}; |
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/hilite.satyh b/hilite.satyh | |
index 4a7c33b..69179bc 100644 | |
--- a/hilite.satyh | |
+++ b/hilite.satyh | |
@@ -1,4 +1,5 @@ | |
% Syntax Highlighting, Lite Edition. | |
+@require: pervasives | |
@require: list | |
@require: color | |
@require: gr |
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 OverloadedStrings #-} | |
import Control.Monad ((<=<)) | |
import Control.Monad.Trans (liftIO) | |
import Control.Monad.Trans.Maybe | |
import System.Taffybar | |
import System.Taffybar.SimpleConfig | |
import qualified System.Taffybar.Information.CPU as C | |
import qualified System.Taffybar.Widget.SimpleClock as S | |
import qualified System.Taffybar.Widget.Windows as Win | |
import qualified System.Taffybar.Widget.Workspaces as Work |
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
import "u256" | |
let popcount (n: u32): i32 = | |
loop ret = 0 for i in 0..<32 do | |
ret + u32.get_bit i n | |
let main: []u256.t = | |
map (\x -> | |
map (\y -> popcount (x ^ y) >= 4) (0..<2**10) | |
|> u256.pack |
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
import numpy as np | |
from u256 import u256 | |
max_value = 2**256 - 1 | |
min_value = 0 | |
mask = 2**32 - 1 | |
o = u256() | |
def encode(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
$ futhark pyopencl --library --safe u256.fut && python reproduce.py | |
/nix/store/zfnva27rkm8lb9b793qqw48yzbp7v7qn-python3.7-pyopencl-2018.2.3/lib/python3.7/site-packages/pyopencl/__init__.py:232: CompilerWarning: Non-empty compiler output encountered. Set the environment variable PYOPENCL_COMPILER_OUTPUT=1 to see more. | |
"to see more.", CompilerWarning) | |
input [1, 0, 0, 0, 0, 0, 0, 0] 1 | |
output [1, 1, 0, 0, 0, 0, 0, 0] 4294967297 | |
Traceback (most recent call last): | |
File "reproduce.py", line 44, in <module> | |
test_pack_unpack_roundtrip(1) | |
File "reproduce.py", line 41, in test_pack_unpack_roundtrip | |
assert call1(o.pack_unpack_roundtrip, a) == a |
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
$ futhark python --library --safe u256.fut && python reproduce.py | |
input [1, 0, 0, 0, 0, 0, 0, 0] 1 | |
output [257, 0, 0, 0, 0, 0, 0, 0] 257 | |
Traceback (most recent call last): | |
File "reproduce.py", line 44, in <module> | |
test_pack_unpack_roundtrip(1) | |
File "reproduce.py", line 41, in test_pack_unpack_roundtrip | |
assert call1(o.pack_unpack_roundtrip, a) == a | |
AssertionError |
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
from hypothesis import given, reproduce_failure, settings | |
from hypothesis.strategies import integers | |
import numpy as np | |
from u256 import u256 | |
import unittest | |
max_value = 2**256 - 1 | |
min_value = 0 | |
mask = 2**32 - 1 |
NewerOlder