Skip to content

Instantly share code, notes, and snippets.

View yohm's full-sized avatar

Yohsuke Murase yohm

View GitHub Profile
@yohm
yohm / ParallelSystem.x10
Created January 23, 2015 08:52
GLBで並列に外部コマンドを実行するサンプル
import x10.util.ArrayList;
import x10.glb.ArrayListTaskBag;
import x10.glb.TaskQueue;
import x10.glb.TaskBag;
import x10.glb.GLBParameters;
import x10.glb.GLB;
import x10.util.Team;
import x10.glb.Context;
import x10.glb.ContextI;
import x10.glb.GLBResult;
@yohm
yohm / StaticTasks.x10
Last active August 29, 2015 14:13
minimum GLB
import x10.util.ArrayList;
import x10.glb.ArrayListTaskBag;
import x10.glb.TaskQueue;
import x10.glb.TaskBag;
import x10.glb.GLBParameters;
import x10.glb.GLB;
import x10.util.Team;
import x10.glb.Context;
import x10.glb.ContextI;
import x10.glb.GLBResult;
@yohm
yohm / private.xml
Created January 14, 2015 03:22
My private.xml of Karabiner
<?xml version="1.0"?>
<root>
<appdef>
<appname>iTERM2</appname>
<equal>com.googlecode.iterm2</equal>
</appdef>
<appdef>
<appname>MACVIM</appname>
<equal>org.vim.MacVim</equal>
</appdef>
import x10.glb.ArrayListTaskBag;
import x10.glb.TaskQueue;
import x10.glb.TaskBag;
import x10.glb.GLBParameters;
import x10.glb.GLB;
import x10.util.Team;
import x10.glb.Context;
import x10.glb.ContextI; // ContextI : Interface for Context
import x10.glb.GLBResult;
@yohm
yohm / count_word.rb
Last active August 29, 2015 13:57
count_word
str = "no ruby, no life!"
h = {}
str.scan(/\w+/).each do |word| h[word] = h[word].to_i + 1 end
h
@yohm
yohm / sample_feature_spec.rb
Last active December 17, 2015 05:48
capybaraを使ってfeature specを書いてみた。
require 'spec_helper'
describe "simulators pages", js: false do
before(:each) do
@sim = FactoryGirl.create(:simulator,
parameter_sets_count: 1,
runs_count: 3,
analyzers_count: 0
)
@yohm
yohm / gist:3104565
Created July 13, 2012 12:06
first F# fizzbuzz code
let list1 = [1..100]
let to_str i =
if (i%15) = 0 then "fizzbuzz"
else if (i%5) = 0 then "buzz"
else if (i%3) = 0 then "fizz"
else (string) i
let list2 = List.map to_str list1
require 'rspec'
# ------- OK case ----------
describe "env X=1" do
before(:all) do
ENV['X'] = '1'
end
after(:all) do
@yohm
yohm / epsplot.rb
Last active September 26, 2015 21:48
convert GNUPLOT .plt file into eps
#!/usr/bin/env ruby
require 'fileutils'
require 'optparse'
if ARGV.size == 0
raise "Usage epsplot plot1.plt (Specify gnuplot files)"
end
def thicken_lines( filename, bl=5, pl=3,point_size=51.5)
@yohm
yohm / performance_arithmetical.cpp
Created August 23, 2011 02:20
performance measurement of basic arithmetical operations
#include <iostream>
#include <ctime>
#include <cmath>
// ----------------------------------------------
size_t CountUpInteger( size_t nMax) {
size_t nSum = 0;
for( size_t i=0; i<nMax; i++) {
nSum += i;