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
-- Fill in the a, b, ps values from the quickhull-test failure message for the | |
-- 'partition' test below. Then start `cabal repl` and copy-paste this whole | |
-- thing in there. The output of the last command is what your 'partition' does | |
-- on this input. | |
import Data.Array.Accelerate.Interpreter | |
-- paste the printed values of a, b and ps here | |
a = (-454, -137) | |
b = (-286, -641) |
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
# -*- coding:utf-8 -*- | |
################################################################################ | |
# Copyright (C) 2023 Tom Smeding | |
# https://tomsmeding.com | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
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 TypeApplications #-} | |
module Main where | |
import Data.Proxy | |
import Test.QuickCheck | |
import Test.QuickCheck.Classes | |
-- Definition of the types in assignment 1 | |
data Tree a = Leaf a | Node (Tree a) (Tree 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
#!/usr/bin/env python3 | |
import sys, time | |
use_fast = len(sys.argv) >= 2 and sys.argv[1] == "fast" | |
def print_lsp(msg): | |
print("Content-Length: {}\r\n\r\n{}".format(len(msg), msg), end="") | |
sys.stdout.flush() | |
print_lsp('{"method": "initialize", "jsonrpc": "2.0", "id": 1, "params": {"initializationOptions": {}, "rootUri": "file:///home/tom", "capabilities": {"workspace": {"workspaceFolders": false, "configuration": false, "symbol": {"dynamicRegistration": false}, "applyEdit": false, "didChangeConfiguration": {"dynamicRegistration": false}}, "textDocument": {"documentSymbol": {"dynamicRegistration": false, "hierarchicalDocumentSymbolSupport": false}, "references": {"dynamicRegistration": false}, "publishDiagnostics": {"relatedInformation": true}, "rename": {"dynamicRegistration": false}, "completion": {"completionItem": {"snippetSupport": false, "commitCharactersSupport": false, "preselectSupport": false, "deprecatedSupport": false, "documentationFormat": ["plaintext"]}, "contextSupport": false, "dynamicRe |
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
To build everything, use 'make'. To build only datagen or only cpu, use 'make | |
datagen' or 'make cpu'. | |
For the GPU code, you might need to change the sm_61 in 'Makefile' to match | |
your NVIDIA GPU version. | |
To generate data, use './datagen 2000000 >data.txt' or similar. Format: one | |
line the number N, then a line with N random [0, 1] values, then another line | |
with N random [0, 1] values. First line is intended to be the x coordinates, | |
second line is the y coordinates. |
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
module A1 (astuff) where | |
import C -- no warning! | |
import B | |
astuff :: Int | |
astuff = 10 + bstuff + cstuff |
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 bash | |
# Written by Tom Smeding, released into the public domain. | |
# This produces the following directory structure: | |
# - $EXT/ | |
# - stack/ | |
# - stack # haskell stack executable | |
# - IHaskell/ # the IHaskell github repository clone | |
# - ihaskell # the ihaskell executable | |
EXT=/ih |
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 python | |
import weechat | |
import re | |
weechat.register( | |
"matrix-reply", | |
"Tom Smeding", | |
"0.1", | |
"MIT", | |
"Reply helper for weechat-matrix buffers", |
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 TemplateHaskell #-} | |
module Error ( somethfunc ) where | |
import Language.Haskell.TH hiding ( Unsafe ) | |
somethfunc :: Q Exp | |
somethfunc = [| glorifiedID |] | |
glorifiedID :: a -> a | |
glorifiedID = id |
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
module Main where | |
import Submod | |
main :: IO () | |
main = return () |
NewerOlder