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
void reference_dgemm (int N, double ALPHA, double* A, double* B, double* C) | |
{ | |
int M = N; | |
int K = N; | |
double BETA = 1.; | |
int LDA = N; | |
int LDB = N; | |
int LDC = N; | |
#ifdef LOCAL | |
cblas_dgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC); |
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
foo [] = [] | |
foo ('/':xs) = '/': foo (dropWhile (== '/') xs) | |
foo (x:xs) = x:foo xs |
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 Text.Parsec | |
import Text.Parsec.String | |
foo [] = [] | |
foo ('/':xs) = '/': foo (dropWhile (== '/') xs) | |
foo (x:xs) = x:foo xs | |
partP :: Parser String | |
partP = do | |
many1 (char '/') |
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
(defun sbrg:base64-decode-image (arg) | |
"Treats the currently selected region as a base64 encoded png, decodes it, | |
saves it to /tmp/first_5_chars_of_base64.png. | |
If the current major mode is org-mode, the selected region is also replaced | |
with a link to the image, and the image is displayed inline using | |
`org-display-inline-images'." | |
(interactive "P") | |
(let (encoded filename) | |
(setq encoded (buffer-substring (region-beginning) (region-end))) |
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
cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with | |
Cabal. Use the flag --package-db to specify a package database (it can be used | |
multiple times). | |
ghc-mod: readCreateProcess: cabal "configure" "--with-ghc=ghc" (exit 1): failed |
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
~/programming/haskell/tenten $ ghc-mod check Main.hs | |
cabal: At least the following dependencies are missing: | |
MonadRandom -any, gloss -any | |
ghc-mod: readCreateProcess: cabal "configure" "--with-ghc=ghc" (exit 1): failed | |
~/programming/haskell/tenten $ stack exec ghc-mod check Main.hs | |
cabal: Use of GHC's environment variable GHC_PACKAGE_PATH is incompatible with | |
Cabal. Use the flag --package-db to specify a package database (it can be used | |
multiple times). | |
ghc-mod: readCreateProcess: cabal "configure" "--with-ghc=ghc" (exit 1): failed |
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
def permute(list): | |
j = len(list) - 2 | |
while list[j] > list[j + 1]: | |
j -= 1 | |
k = len(list) - 1 | |
while list[j] > list[k]: | |
k -= 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
i = 0 | |
j = 0 | |
for i in range(0, 10): | |
print((i % 2) * " ", end=" ") | |
for j in range(0, 4 - i % 2): | |
print((i % 2 + j * 2, 4 + j - i // 2), end=" ") | |
print() | |
# (0, 4) (2, 5) (4, 6) (6, 7) | |
# (1, 4) (3, 5) (5, 6) |
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
function newtemplate { | |
filename=$(basename "$(pwd)") | |
if [[ $1 != "" ]]; then | |
filename=$1 | |
fi | |
filename="$filename.tex" | |
if [[ -a $filename ]]; then | |
echo "File $filename exists already, quitting." | |
return 1 | |
fi |
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
{-# LANGUAGE OverloadedStrings #-} | |
module MonadBot.Plugins.Darchoods | |
( plugin | |
) where | |
import Data.Map.Strict (Map) | |
import qualified Data.Map.Strict as M | |
import System.Directory | |
import qualified Data.Text as T |