Skip to content

Instantly share code, notes, and snippets.

View AKB428's full-sized avatar
🥳
Out sick

AKB428 AKB428

🥳
Out sick
View GitHub Profile
@AKB428
AKB428 / gist:42fe15f99ddcbf302d2b
Created January 26, 2015 08:29
hadoop2.6 YARN
YARN
Haoopは大規模データに対するバッチ処理の道具としては十分な機能を持っている
ただしエンタープライズ用途で利用するときの課題が残っていた
処理性能
可能性
運用
セキュリティ
@AKB428
AKB428 / gist:fec25ab2faf49fde2c8c
Last active August 29, 2015 14:14
一週間前のフォロワーを取得する
SELECT * FROM twitter_status_histories WHERE
bases_id >= 124 AND bases_id <= 153 AND
get_date
between date_add(date(now()), interval -6 day) and date_format(now(), '%Y.%m.%d') order by id LIMIT 30;
SELECT * FROM twitter_status_histories WHERE
bases_id >= 124 AND bases_id <= 153 AND
get_date
between date_add(date(now()), interval -168 hour) and date_format(now(), '%Y.%m.%d') order by id LIMIT 30;
@AKB428
AKB428 / repopo.md
Last active August 29, 2015 14:14
『HBase徹底入門 Hadoopクラスタによる高速データベースの実現』 刊行記念セミナー 
@AKB428
AKB428 / twVideo.json
Created February 7, 2015 18:31
Twitter Video JSON
{
"contributors": null,
"text": "ツイッター動画投稿テスト http://t.co/y9hjEfABw1",
"geo": null,
"retweeted": false,
"in_reply_to_screen_name": null,
"possibly_sensitive": false,
"truncated": false,
"lang": "ja",
"entities": {
@AKB428
AKB428 / video_tweet.json
Created February 7, 2015 18:44
Twitterの動画投稿機能(video.twimg.com)で投稿した動画のURLをJSONから取得できるようになりました ref: http://qiita.com/AKB428/items/369a04d5d71faaac11a9
{
"contributors": null,
"text": "ツイッター動画投稿テスト http://t.co/y9hjEfABw1",
"geo": null,
"retweeted": false,
"in_reply_to_screen_name": null,
"possibly_sensitive": false,
"truncated": false,
"lang": "ja",
"entities": {
@AKB428
AKB428 / GetUserTimeLineTweetSample.java
Last active August 29, 2015 14:15
Twitterの新機能である動画投稿のツイートからの動画URLをJSONから抽出し、動画をじゃぶじゃぶダウンロードする ref: http://qiita.com/AKB428/items/f61f2e87e652eb1690d9
Twitter twitter = new TwitterFactory(cb.build()).getInstance();
twitter.setOAuthConsumer(twitterModel.getConsumerKey(), twitterModel.getConsumerSecret());
twitter.setOAuthAccessToken(new AccessToken(twitterModel.getAccessToken(), twitterModel.getAccessToken_secret()));
List<Status> statuses = twitter.getUserTimeline(args[0]);
System.out.println("Showing home timeline.");
for (Status status : statuses) {
System.out.println(status.getUser().getName() + ":" + status.getText());
String rawJSON = DataObjectFactory.getRawJSON(status);
System.out.println(rawJSON);
@AKB428
AKB428 / gist:e6c353b25bc7720fbaab
Created February 9, 2015 12:46
iphone etc/hosts 書き換えられないので Mac+Bindを使う
* Macとiphoneを同一Wifiに用意
* MacにBindをインストール (brew install bind)
*MacのBindを設定する
*MacでNginxをたてる
iphoneでWifiに接続
iphoneのWifi設定でDNSサーバーをMacのIPにする
Safariでアクセスする
@AKB428
AKB428 / memo
Created February 10, 2015 16:48
LargeObject ref
http://blog.bit-isle.jp/bird/2013/06/35
@AKB428
AKB428 / OptimizeForLoop.java
Created February 20, 2015 13:19
Javaのfor最適化は意味あるか否か
public class OptimizeForLoop {
public static void main(String[] args) {
noOptimize(args);
optimize(args);
}
public static void noOptimize(String[] args) {
@AKB428
AKB428 / javap_output
Created February 20, 2015 13:21
Javaのfor最適化は意味あるか否か classfile -> javap
C:\pleiades\workspace\MyCodeBox\src>javap -c OptimizeForLoop.class
Compiled from "OptimizeForLoop.java"
public class OptimizeForLoop {
public OptimizeForLoop();
Code:
0: aload_0
1: invokespecial #1 // Method java/lang/Object."<init>":()V
4: return
public static void main(java.lang.String[]);