Skip to content

Instantly share code, notes, and snippets.

View shiumachi's full-sized avatar

Sho Shimauchi shiumachi

View GitHub Profile
@shiumachi
shiumachi / hive_error
Created April 10, 2013 14:13
Hiveテスト時のエラー
2013-04-10 07:08:57,564 ERROR metastore.RetryingHMSHandler (RetryingHMSHandler.java:invoke(134)) - NoSuchObjectException(message:default.src table not found)
at org.apache.hadoop.hive.metastore.HiveMetaStore$HMSHandler.get_table(HiveMetaStore.java:1369)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.hadoop.hive.metastore.RetryingHMSHandler.invoke(RetryingHMSHandler.java:102)
at com.sun.proxy.$Proxy10.get_table(Unknown Source)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.getTable(HiveMetaStoreClient.java:838)
at org.apache.hadoop.hive.metastore.HiveMetaStoreClient.dropTable(HiveMetaStoreClient.java:639)
@shiumachi
shiumachi / gist:5356006
Created April 10, 2013 16:08
Hive のテスト時のエラー(2)
[junit] Running: diff -a /Users/sho/src/apache/hive/build/ql/test/logs/clientpositive/udf_unix_timestamp.q.out /Users/sho/src/apache/hive/ql/src/test/results/clientpositive/udf_unix_timestamp.q.out
[junit] 67c67
[junit] < 2009 Mar 20 11:30:01 am NULL
[junit] ---
[junit] > 2009 Mar 20 11:30:01 am 1237573801
@shiumachi
shiumachi / Sphinx による API ドキュメント HTML の作成から、Github Pages にプッシュするまで
Last active December 17, 2015 00:39
Sphinx による API ドキュメント HTML の作成から、Github Pages にプッシュするまでの一連の流れ。あまりイケてない方法なのでそのまま真似るのは推奨しません。むしろもっとエレガントな方法があったら教えてください。
# 注: スクリプトはダミーです。実行しても動きません
# ソースを管理するディレクトリ
SRC_DIR=/path/to/src
# python コードのあるディレクトリ
PROJECT_DIR=hoge
# hoge プロジェクトの github URL
PROJECT_GITHUB_URL=git://github/url/to/hoge
@shiumachi
shiumachi / kaa_compile_error
Created June 16, 2013 12:45
kaa コンパイルエラー
(py3)sho@sho-mbp ~/src/kaa % python setup.py install 42233 21:43
running install
running bdist_egg
running egg_info
creating kaa.egg-info
writing requirements to kaa.egg-info/requires.txt
writing entry points to kaa.egg-info/entry_points.txt
writing top-level names to kaa.egg-info/top_level.txt
writing dependency_links to kaa.egg-info/dependency_links.txt
writing kaa.egg-info/PKG-INFO
@shiumachi
shiumachi / virtualbox.txt
Created July 26, 2013 15:00
VirtualBoxのインストール方法
https://www.virtualbox.org/wiki/Downloads
ここからDLする。
- VirtualBox 4.2.16 for OS X hosts
DL して dmg 開いて pkg ダブルクリックする。
- VirtualBox 4.2.16 Oracle VM VirtualBox Extension Pack
「Virtualbox」-> 「環境設定」-> 「機能拡張」-> 変なマークを押してパッケージを追加。
@shiumachi
shiumachi / lambda_fizzbuzz
Created August 24, 2013 14:12
FizzBuzz, lambda 版
def function_fizbuzz(x):
fizz = lambda x: x[1](x[0])
buzz = lambda x: (x, lambda y: "fizzbuzz" if y % 3 == 0 else "buzz") if x % 5 == 0 else (x, lambda y: "fizz" if y % 3 == 0 else y)
return fizz(buzz(x))
[print(function_fizbuzz(x)) for x in xrange(1,100)]
@shiumachi
shiumachi / Goでmecabを使う
Last active December 25, 2015 11:59
#gocon 2013 Autumn での成果物。
* go のコンパイル
brew のインストールファイルにはファイルが欠けているものがあるので、ソースから go をビルドする必要がある
ソースは以下のコマンドでとってこれる。
$ hg clone -u release https://code.google.com/p/go
GOROOTの変更を忘れずに。
@shiumachi
shiumachi / gist:7422686
Created November 11, 2013 23:47
当たりが1つしかないくじ引きの確率
def f(num, max_num):
"""
num: くじを引く回数
max_num: くじの総数
"""
p = 1.0
for i in xrange(num):
p = p * (float(max_num - i - 1) / (max_num - i))
return p
@shiumachi
shiumachi / gist:7519841
Created November 17, 2013 23:37
Cloudera Manager + Parcel 環境における、Hue のアプリケーション管理の仕方 (app_reg.py の使い方)
[sho@demo]/opt/cloudera/parcels/CDH/share/hue% export HUE_APP_REG_DIR=/opt/cloudera/parcels/CDH/share/hue
[sho@demo]/opt/cloudera/parcels/CDH/share/hue% tools/app_reg/app_reg.py --list
Name Version Author Path
------------------ ------- --------------- -----------------------------------
about 2.5.0 Hue ./apps/about
beeswax 2.5.0 Hue ./apps/beeswax
filebrowser 2.5.0 Hue ./apps/filebrowser
hbase 2.5.0 Hue ./apps/hbase
help 2.5.0 Hue ./apps/help
impala 2.5.0 Hue ./apps/impala
@shiumachi
shiumachi / gist:8157792
Created December 28, 2013 09:42
kaa を起動するとエラーを吐く
% kaa
Traceback (most recent call last):
File "/Users/sho/.virtualenvs/py3/bin/kaa", line 9, in <module>
load_entry_point('kaaedit==0.26.1', 'console_scripts', 'kaa')()
File "/Users/sho/.virtualenvs/py3/lib/python3.3/site-packages/pkg_resources.py", line 352, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/Users/sho/.virtualenvs/py3/lib/python3.3/site-packages/pkg_resources.py", line 2307, in load_entry_point
return ep.load()
File "/Users/sho/.virtualenvs/py3/lib/python3.3/site-packages/pkg_resources.py", line 2021, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])