Skip to content

Instantly share code, notes, and snippets.

View mitmul's full-sized avatar

Shunta Saito mitmul

View GitHub Profile
@mitmul
mitmul / cma_es.rb
Created April 15, 2013 10:40
Implementation of CMA-ES (Covariance Matrix Adaptation - Evolution Strategy) by Ruby. It requires some gems, narray, gsl, gnuplot.
require "gnuplot"
require "./octavize"
require "./function"
class CmaEs
def initialize
@objective_function = Proc.new do |x|
rastrigin10 x
end
require 'formula'
# Documentation: https://github.com/mxcl/homebrew/wiki/Formula-Cookbook
# PLEASE REMOVE ALL GENERATED COMMENTS BEFORE SUBMITTING YOUR PULL REQUEST!
class Sge < Formula
homepage 'https://github.com/flibitijibibo/libSGE/'
url 'git://github.com/flibitijibibo/libSGE.git'
sha1 ''
version 'r030809'
CUDA_SOURCES = $$system(find . -name "*.cu")
SOURCES = $$system(find . -name "*.cpp")
CUDA_DIR = /usr/local/cuda
CUDA_CC = $$CUDA_DIR/bin/nvcc
message("nvcc resides in :" $$CUDA_CC)
INCLUDEPATH += $$CUDA_DIR/include
INCLUDEPATH += /Developer/NVIDIA/CUDA-5.0/include
QMAKE_LIBDIR += $$CUDA_DIR/lib
QMAKE_LIBDIR += /Developer/NVIDIA/CUDA-5.0/lib
LIBS += -rpath /usr/local/cuda/lib -lcudart -lcuda
@mitmul
mitmul / install_opencv.sh
Last active December 30, 2015 21:38
OpenCV install script
cmake -DBUILD_DOCS=OFF \
-DBUILD_EXAMPLE=OFF \
-DBUILD_JASPER=OFF \
-DBUILD_JPEG=OFF \
-DBUILD_OPENEXR=OFF \
-DBUILDPACKAGE=OFF \
-DBUILD_PERF_TESTS=OFF \
-DBUILD_PNG=OFF \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TBB=OFF \
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import copy
import numpy as np
import matplotlib.pyplot as plt
data1 = np.random.randn(100, 2)
data2 = np.random.randn(100, 2) + np.asarray([6, 2])
@mitmul
mitmul / install_CDH5.sh
Last active January 12, 2018 10:31
install CDH5 and setup hadoop, mahout development environment on CentOS 6.4 vagrant box (http://developer.nrel.gov/downloads/vagrant-boxes/CentOS-6.4-x86_64-v20130731.box)
# install CDH5
cd
sudo yum install -y java-1.7.0-openjdk-devel
wget http://archive.cloudera.com/cdh5/one-click-install/redhat/6/x86_64/cloudera-cdh-5-0.x86_64.rpm
sudo yum --nogpgcheck localinstall -y cloudera-cdh-5-0.x86_64.rpm
sudo rpm --import http://archive.cloudera.com/cdh5/redhat/6/x86_64/cdh/RPM-GPG-KEY-cloudera
sudo yum install -y hadoop-0.20-conf-pseudo
# add below lines to ~/.bashrc
echo 'pathtojava=$(readlink -e $(which javac))' >> ~/.bashrc
$ wget wget http://archive.apache.org/dist/mahout/0.8/mahout-distribution-0.8-src.tar.gz
$ tar zxvf mahout-distribution-0.8-src.tar.gz
$ cd mahout-distribution-0.8
$ mvn clean
$ mvn -DskipTests compile
$ mvn -DskipTests package

put your own project to examples/src/main/java/

@mitmul
mitmul / install_opencv2.4.8.sh
Last active November 24, 2024 21:24
install OpenCV 2.4.8 for CentOS 6.2
#! /bin/bash
sudo yum install -y gcc g++ gtk+-devel libjpeg-devel libtiff-devel jasper-devel libpng-devel zlib-devel cmake unzip
sudo yum install -y yum-priorities
wget http://ftp-srv2.kddilabs.jp/Linux/distributions/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum install -y eigen3-devel —enablerepo=epel
pip install numpy
wget http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.4.8/opencv-2.4.8.zip
unzip opencv-2.4.8
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.