Skip to content

Instantly share code, notes, and snippets.

View ShigekiKarita's full-sized avatar
🌴
I may be slow to respond.

Shigeki Karita ShigekiKarita

🌴
I may be slow to respond.
View GitHub Profile
gistup
gistup
gistup
#include "share/atspre_define.hats"
#include "share/atspre_staload.hats"
datatype list0 (a:t@ype) =
| list0_nil (a) of ()
| list0_cons (a) of (a, list0 a)
#define :: list0_cons
fun{a: t@ype}{b: t@ype}
@ShigekiKarita
ShigekiKarita / install.sh
Created October 9, 2015 19:11
How to install CUDA7.5 on Ubuntu 14.04
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get --purge remove "nvidia*"
sudo apt-get --purge remove "cuda*"
wget http://developer.download.nvidia.com/compute/cuda/7.5/Prod/local_installers/cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1404-7-5-local_7.5-18_amd64.deb
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install cuda
@ShigekiKarita
ShigekiKarita / lambda.cu
Created October 10, 2015 05:42
Lambda expr in CUDA 7.5 (nvcc lambda.cu -std=c++11 --expt-extended-lambda)
// fork : https://github.com/thrust/thrust/blob/master/examples/lambda.cu
#include <thrust/device_vector.h>
#include <thrust/functional.h>
#include <thrust/transform.h>
// allows us to use "_1" instead of "thrust::placeholders::_1"
using namespace thrust::placeholders;
@ShigekiKarita
ShigekiKarita / State.hs
Created January 8, 2016 11:01
有名な型クラスのメモ
{-# LANGUAGE InstanceSigs #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
import Prelude hiding (Functor, fmap,
Applicative, (<*>), (<$>), pure,
Monad, return, (>>=), (>>), fail, join
)
-- 型クラス
@ShigekiKarita
ShigekiKarita / .zshenv
Last active January 13, 2016 10:12
titan (lab server)
#########
# Torch #
#########
source /opt/torch/install/bin/torch-activate
#######
# C++ #
# setup zsh (asks passwd)
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
wget https://gist.githubusercontent.com/ShigekiKarita/06338298b0e0833e39ea/raw/6a6b774dd70f040bf9bfdb5226409d5a51b7e661/.zshenv
# setup python (pythonz & virtualenv)
PY_VER=2.7.11 # set latest
VENV=py${PY_VER}
import h5py
import numpy
dataset_path = "./dataset.hdf5"
def save_h5py(name, data):
f = h5py.File(dataset_path)
f.create_dataset(name, data=data, compression="gzip")
f.close()