This file contains hidden or 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
❯ # MacOS Mojave 10.14.4 | |
❯ rm -rf ~/.stack | |
❯ PATH=$HOME/.local/bin:/usr/bin:/bin:/usr/sbin stack setup -v | |
Version 2.1.1, Git revision f612ea85316bbc327a64e4ad8d9f0b150dc12d4b (7648 commits) x86_64 hpack-0.31.2 | |
2019-06-30 12:52:45.476934: [debug] Checking for project config at: /Users/lauzi/Projects/check-amazon/stack.yaml | |
2019-06-30 12:52:45.477196: [debug] Loading project config file stack.yaml | |
2019-06-30 12:52:45.499053: [debug] Migration executed: CREATE TABLE "config_cache"("id" INTEGER PRIMARY KEY,"directory" VARCHAR NOT NULL DEFAULT (hex(randomblob(16))),"type" VARCHAR NOT NULL,"pkg_src" VARCHAR NOT NULL,"active" BOOLEAN NOT NULL,"path_env_var" VARCHAR NOT NULL,"haddock" BOOLEAN NOT NULL DEFAULT 0,CONSTRAINT "unique_config_cache" UNIQUE ("directory","type")) | |
2019-06-30 12:52:45.499201: [debug] Migration executed: CREATE TABLE "config_cache_dir_option"("id" INTEGER PRIMARY KEY,"config_cache_id" INTEGER NOT NULL REFERENCES "config_cache","index" INTEGER NOT NULL,"option" VARCHAR NOT NULL,CONSTRAINT "uniqu |
This file contains hidden or 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/usr/zsh | |
alias clearfucks="FUCKSGIVEN=0" | |
fucksgiven () { | |
if [ $FUCKSGIVEN = ]; then | |
export FUCKSGIVEN=0 | |
fi | |
echo $FUCKSGIVEN fucks given | |
} |
This file contains hidden or 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
f :: (Int, [Int]) -> Int | |
f (t, xs) = maximum $ zipWith (-) (drop t ys) ys | |
where ys = scanl (+) 0 xs | |
main = interact $ show . f . p . lines | |
where p (hd:tl) = (read . head $ words hd, map read tl) |
This file contains hidden or 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
-- 1 | |
main = interact $ show . sum . map read . tail . lines | |
-- 2 | |
f [a, b, c] = if a <= b then 0 else (a-b)*c | |
main = interact $ show . sum . map (f . map read . words) . tail . lines | |
-- 3 | |
import Control.DeepSeq |
This file contains hidden or 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 <bits/stdc++.h> | |
using namespace std; | |
const int MAXN = 19; | |
bool line_used[8][MAXN*3+3]; | |
int idxs[MAXN][MAXN][8]; | |
void init() { |
This file contains hidden or 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
struct GG { | |
int qq[2]; | |
GG (int n=0, int b=0) { qq[0] = n, qq[1] = b; } | |
}; | |
std::vector<GG> vec; | |
unsigned pushback(int nxt, int b) { | |
vec.push_back(GG(nxt, b)); | |
return vec.size()-1; |
This file contains hidden or 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 <cstdio> | |
#include <vector> | |
using namespace std; | |
typedef long long LL; | |
const int MAXV = 100001; | |
const LL MOD = 1000000007; |
This file contains hidden or 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 Data.List | |
import Data.Maybe (maybeToList) | |
import Data.Functor ((<$>)) | |
import Data.Function (on) | |
import Control.Monad (when) | |
import qualified Data.Array.Unboxed as U | |
import qualified Data.Array.ST as ST | |
import qualified Data.ByteString.Char8 as B hiding (minimum) | |
getPows :: Int -> Int -> Int |
This file contains hidden or 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
SELECT G.gamename, S.points | |
FROM (SELECT game, SUM(CASE WHEN rank = 'A' THEN 3 | |
WHEN rank = 'B' THEN 2 | |
WHEN rank = 'C' THEN 1 | |
ELSE 0 END) AS points | |
FROM povgroups | |
WHERE pov = 28 | |
GROUP BY game | |
ORDER BY points DESC LIMIT 21) S | |
INNER JOIN gamelist G |