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
defmodule VercheckEx do | |
# requireで使用するライブラリを指定 | |
require HTTPoison | |
require Floki | |
require Timex | |
use Timex | |
def fetch_content(url, type) do | |
ret = HTTPoison.get!( url ) # urlで指定されるページのデータを取得 | |
%HTTPoison.Response{status_code: 200, body: body} = ret | |
# HTML bodyを取得する |
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
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
from impala.dbapi import connect | |
import gevent | |
from impala.error import * | |
import time | |
def fetch(sql,func): |
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
#!/usr/bin/python | |
# -*- coding:utf-8 -*- | |
import numpy as np | |
import doctest | |
def gini_coefficient(src): | |
""" | |
>>> gini_coefficient([245,362,826]) | |
0.40544312630844381 |
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
defmodule VercheckEx do | |
# requireで使用するライブラリを指定 | |
require HTTPoison | |
require Floki | |
require Timex | |
use Timex | |
def fetch_content() do | |
IO.puts("fetch_content") | |
receive do | |
{caller,url,type,i} -> |
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
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で指定されるページのデータを取得 |
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
select count(*) from [nicodata_test.comment_data]; |
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
select | |
STRFTIME_UTC_USEC(date, '%Y-%m') AS dt, | |
count(*) | |
FROM [nicodata_test.comment_data] | |
GROUP BY dt ORDER BY dt DESC; |
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
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, |
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
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) |
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
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 |
OlderNewer