Skip to content

Instantly share code, notes, and snippets.

View shibacow's full-sized avatar

shibacow shibacow

View GitHub Profile
@shibacow
shibacow / VercheckEx_main.ex
Last active September 25, 2022 19:58
http://qiita.com/HirofumiTamori/items/06ab8e85c25f118f8e72 を試してみる。ubuntu 14.04,Elixir1.0.5で確認。
defmodule VercheckEx do
use Application
require HTTPoison
require Floki
require Timex
use Timex
def fetch_content() do
IO.puts("fetch_content")
receive do
{caller,url,type,i} ->
@shibacow
shibacow / VercheckEx_task.ex
Created August 29, 2015 18:08
http://qiita.com/HirofumiTamori/items/ed131104494f4bd2f695 を真似してみる。ubuntu 14.05 Elixir1.0.5で確認。
defmodule VercheckEx do
use Application
use GenServer
require HTTPoison
require Floki
require Timex
use Timex
def fetch_content(params) do
{{url,type},i} = params
ret = HTTPoison.get!( url ) # urlで指定されるページのデータを取得
select count(*) from [nicodata_test.comment_data];
select
STRFTIME_UTC_USEC(date, '%Y-%m') AS dt,
count(*)
FROM [nicodata_test.comment_data]
GROUP BY dt ORDER BY dt DESC;
@shibacow
shibacow / mix.exs
Created September 11, 2015 10:24
elixirプロセステスト
defmodule TestProcess.Mixfile do
use Mix.Project
def project do
[app: :test_process,
version: "0.0.1",
elixir: "~> 1.0",
build_embedded: Mix.env == :prod,
start_permanent: Mix.env == :prod,
escript: escript,
@shibacow
shibacow / prosess_test.ex
Last active September 23, 2015 16:11
マルチコア環境下でelxirでどの程度マルチコアを利用するか評価する。こちらに記事を書いた。 http://qiita.com/shibacow/items/8f2e8aaff0febb70b934
require Logger
defmodule KV do
def start_link do
Task.start_link(fn -> loop(%{}) end)
end
defp loop(map) do
receive do
{:get,key,caller} ->
send caller,{:get,:ok,Map.get(map,key)}
loop(map)
@shibacow
shibacow / many_process.ex
Created November 3, 2015 13:01
erlang elixir 軽量プロセス生成テスト
defmodule ManyProcess do
def start_link(id) do
{:ok,spawn_link(fn -> loop(id,%{}) end)}
end
def loop(id,map) do
receive do
{:get,key,caller}->
IO.puts "send id=#{id} key=#{key}"
send caller,Map.get(map,key)
loop(id,map)
@shibacow
shibacow / LINPACK BENCH on osx mac book pro
Last active November 13, 2015 11:39
LINPACKを走らせてみる。
2015年 11月13日 金曜日 20時21分05秒 JST
Intel(R) Optimized LINPACK Benchmark data
Current date/time: Fri Nov 13 20:21:05 2015
CPU frequency: 3.091 GHz
Number of CPUs: 1
Number of cores: 2
Number of threads: 4
@shibacow
shibacow / LINPACK BENCH on aws c4.8xlarge ubuntu
Last active November 13, 2015 11:45
LINPACK BENCH executed on AWS c4.8xlarge Ubuntu 14.04
ubuntu@ip-*-*-*-*:~/l_mklb_p_11.3.1.002/benchmarks_11.3.1/linux/mkl/benchmarks/linpack$ ./runme_xeon64
This is a SAMPLE run script for SMP LINPACK. Change it to reflect
the correct number of CPUs/threads, problem input files, etc..
./runme_xeon64: 37: [: -gt: unexpected operator
Fri Nov 13 11:26:24 UTC 2015
Intel(R) Optimized LINPACK Benchmark data
Current date/time: Fri Nov 13 11:26:24 2015
CPU frequency: 3.126 GHz
@shibacow
shibacow / .bashrc
Last active September 24, 2019 07:21
HPL execute
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:/opt/intel/compilers_and_libraries/linux/lib/intel64:/home/ec2-use
r/prog/hpl-2.0_FERMI_v15/src/cuda:/usr/lib64/openmpi/lib