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 Prelude hiding (catch) | |
import Control.Applicative | |
import Control.Exception | |
import Control.Monad.State | |
import Data.List | |
import System.IO | |
import System.Random | |
import Options.Applicative |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
-- A nice collection of FizzBuzz implementations | |
-- GistID: 5313582 | |
module Main where | |
import Data.List | |
fb :: (Show a, Integral a) => a -> String | |
fb i | |
| i `rem` 15 == 0 = "FizzBuzz" |
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/sh | |
# GistID: 5163520 | |
usage () { | |
echo "Usage: $0 OPTION | |
Change multi-head display settings. | |
Options: | |
-a Do something reasonable | |
-0 Laptop | |
-1 Laptop + VGA |
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
// GistID: 4770251 | |
#ifndef THRUST_REPEAT_ITERATOR_H | |
#define THRUST_REPEAT_ITERATOR_H | |
/* Remove this header */ | |
#include <GNUC_47_compat.h> | |
#include <thrust/iterator/iterator_adaptor.h> |
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
// Header for compilation with GCC-4.7 | |
#if defined(__GNUC__) | |
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6) | |
#undef _GLIBCXX_ATOMIC_BUILTINS | |
#undef _GLIBCXX_USE_INT128 | |
#endif |
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
/* Generated by pandoc. */ | |
code { white-space: pre; } | |
table.sourceCode, tr.sourceCode, td.lineNumbers, td.sourceCode { | |
margin: 0; | |
padding: 0; | |
vertical-align: baseline; | |
border: none; | |
} | |
table.sourceCode { width: 100%; line-height: 100%; } | |
td.lineNumbers { |
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
# cython: infer_types=True | |
# Use the C math library to avoid Python overhead. | |
from libc cimport math | |
# For boundscheck below. | |
import cython | |
# We're lazy so we'll let Numpy handle our array memory management. | |
import numpy as np | |
# You would normally also import the Numpy pxd to get faster access to the Numpy | |
# API, but it requires some fancier compilation options so I'll leave it out for |
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 <stdlib.h> | |
#include <math.h> | |
#include <assert.h> | |
int main(int argc, char* argv[]) { | |
int idim = 3; | |
int jdim = 4; |
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
fun! pymode#Toggle(toggle, msg) "{{{ | |
let {a:toggle} = {a:toggle} ? 0 : 1 | |
if {a:toggle} | |
echomsg a:msg." enabled" | |
else | |
echomsg a:msg." disabled" | |
endif | |
endfunction "}}} |