2016年3月23日水曜日

Functional Interface を意識した URLCon のライブラリを作成した

そのうち maven とかに登録した

眠い・・・

2015年3月24日火曜日

メンタリング

メンタリング本を中古でアマゾンで購入

 読んでいてずーと違和感があった

原因は何なのか?という事だが

 前提条件として、 

『企業は存続すべき事業内容を実施かつ組織である』
 『メンターとメンティーはそれぞれのロール実行能力を要する』 

を満たしていなければいけない 上の条件って、む、無理・・・結局、

 『問題の無いように事を進める』 または『事なかれ主義』

 に落ち着くのが現実なのだと思う 

これは、発祥は欧米なので一般的に日本(東洋)とは合わないと感じるのであった

 

2015年3月8日日曜日

HHKB 見せてもらおう、アフィリエイトとやら力を

キーボードを『HHKB Pro 黒 刻印あり』から『HHKB pro Type-S 白 刻印なし』にした、 このタイピングは!!後戻りはできない・・・・、家用が『HHKB Pro 黒』となったが、う、うるさい・・・ 今度は、FILCOとかを試したいと検討中ですね

JIRAの車窓から

JIRAは使いづいらい トレンドは上がっているが・・・・

<使いづらい点>

  • BackLogが増えると、カオスで把握しきれない
        
    • Epic,Component で分けれるが、分けたら分けたで余計全体が把握できない
    •   
    • WBSは有料plugin \(^o^)/
  • Agileのバックログ/スプリン画面の右に簡易の課題表示の編集がかゆいところに手が届かないようになってる
  • Agile,Kanban をちょっとでも知ってないと、石像になる人がでる(これで合点が多い場合は、日本は多分終わってる)

などなどですが、争点はこれではないので置いておいて、

[管理者]層のリテラシー、体質が追いつてない限り、[現場]の作業フローとか組織構成はなんの意味も持たないため、管理体制と作業フローの間での乖離が発生し、結果的に作業フローで使用している。JIRAなどのツールが使いづらいのでなないだろうか? という仮説があります。(イメージは下図)これを読んだ方どうでしょうか?


[元ネタ] 反復開発/アジャイル/スクラムの作業フロー
 ↓
[管理者] 経営者?冗長?日本の文化と合わない or 理解(リテラシー)がない
 ↓               ↓
[現場] JIRA使いづらい    自己組織化されない

[現場]レベルで導入しても、[管理者]が理解レベルが合わないと、かみ合わない歯車がグルグルとなるので、 早急に対応が必要となるが、[現場]から[管理者]に知識や勝手をインストールすることまで、余裕が取れる状況はどれくらいあるのだろうか? また、[管理者]がインストールに対して前向きである必要もあるので、文化の改変まで日本レベルでN十年かかるのだろうか・・・orz

海外での職場は普通に作業フローを実行できているのだろうか? ご存知の方いましたら、コメントをお願いします。 また、そういったフォーラムの掲示板をご存知の方も情報いただけると助かります。 英語ならギリ話せると思うので、海外サイトでも大丈夫です。

そもそも、日本ベースのしょうゆ味作業フローを考えないといけないかもしれませんね。(^^)

2014年6月13日金曜日

Docker01 Initialize

mac $ boot2docker init --disksize=50000 --memory=2048
mac $ boot2docker start

確認結果

mac $ boot2docker ssh
docker@boot2docker:~$ df -h
Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.8G    204.8M      1.6G  11% /
tmpfs                     1.8G    204.8M      1.6G  11% /
tmpfs                  1004.6M         0   1004.6M   0% /dev/shm
/dev/sda1                47.0G     68.9M     44.5G   0% /mnt/sda1
cgroup                 1004.6M         0   1004.6M   0% /sys/fs/cgroup
/dev/sda1                47.0G     68.9M     44.5G   0% /mnt/sda1/var/lib/docker/aufs
docker@boot2docker:~$ free
             total         used         free       shared      buffers
Mem:       2057440       271940      1785500            0         1348
-/+ buffers:             270592      1786848
Swap:       447972            0       447972
docker@boot2docker:~$ cat /proc/meminfo 
MemTotal:        2057440 kB

次は、web server, db をセットアップしよう

mac $ boot2docker stop

2012年8月10日金曜日

Google APIs Calnedar & OAuth2.0 (v3/v2)

はじめに

Google APIs を使うコマンドラインを書いてみました。自分のイベントとか見たい方は適当に改良してください。:-)

** かぶりネタですが興味のある方は読んでください。**


Usage

USAGE
      gapicalendarlist.sh  v2|v3

RESET SETTINGS
      remove 'v2.gapi.token' or 'v3.gapi.token'

DEPENDENCIES
      lynx, curl


解説のようなメモのような

簡単に認証と処理内容を書いてみました

認証の種類

Version 2 : using ClientLogin
  • OAuth
  • AuthSub
  • ClientLogin
Version 3 : using OAuth -> Devices

知識の足りなさ等の諸事情で Devices の方法を選択してます。

Installed Applicatoins の方式で、https://accounts.google.com/o/oauth2/auth にリクエストするとHTMLコンテンツがかえって来ます。これはシェルであれこれするのが面倒だったのでやめました。
Devices方式で、https://accounts.google.com/o/oauth2/device/code にリクエストをすると、JSONがかえってpiar毎に改行されているのでシェルで扱いやすいのでこちらを選択しました

  • OAuth
    • Login
    • Web Server Applications
    • Client-size Applications
    • Installled Applications (Winwdows, iOS, Android, Blackberry)
    • Devices
    • Service Accounts

処理内容

*** Google のサイトを見た方がいいと思ったので割愛します。 ***

 [ shell ]                  [ google ]
    |                            |
    |                            |
    +----- get user token -----> +  URL 1 
    |                            |
    | <------ user token --------+
    |     and other params       |
    |          JSON              |
    |                            |
    +----+                       |
    |    | save token            |
    |<---+                       |
    |         [ lynx ]           |
    |            |               |
    +-- verify ->|               |
    |    URL     +-- Sign in --> |
    |            |               |
    |            |<- user code --+
    |            |     form      |
    |            |               |
    |            +- user code -->|
    |            |               |
    |            |<- allow acces-+
    |            |  confirm page |
    |            |               |
    |            +-allow submit->|
    |            |               |
    |            |<- result page-+
    |            |               |
    |                            |
    |                            |
    |                            |
    |                            |
    +------ get access token --->+ URL 2 
    |                            |
    | <------ access token ------+
    |       and other params     |
    |           JSON             |
    |                            |
    +----+                       |
    |    | save token            |
    |<---+                       |
    |                            |
    |                            |
    +----- get calendar list --->+  URL 3
    |                            |
    | <----- calendar list ------+
    |         JSON               |
    |                            |
    |                            |


URL 1 https://accounts.google.com/o/oauth2/device/code
URL 2 https://accounts.google.com/o/oauth2/token
URL 3 https://www.googleapis.com/calendar/v3/users/me/calendarList

Reference Link

Google OAuth 2.0

Google APIs Calendar



Source & Screen cast


ttyplay


2012年4月25日水曜日

web server benchmark : apache lighttpd nodejs warp yesod tomcat jetty

結論

QCon 2012 で Warp+Yesod がいいと言っていたので、ベンチをとってみました。いいっぽいです

サーバーサイドのチューニングはデフォなので、スレッド数位は合わせてベンチマークをとりたいと思って下ります。 なんかサーセン

環境

Server

Ubuntu 11.10

Intel(R) Xeon(R) CPU 5160 @ 3.00GHz x 2

Memory 2 GiB

|

Switching Hub

corega Fast SW-8D

|

Client

Mac OS X 10.7.3

2.53 GHz Intel Core i5

Memory 8 GB 1067 MHz DDR3

計測の仕方

$ ab -n request_count -c 128 -r -g gnuplot_file_name   http://ubuntu.server:port/path   >& result.txt

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

計測したもの

Apache Lighttpd

Server Software:        Apache/2.2.20
Server Hostname:        xxx.xxx.xxx.xxx
Server Port:            80

Document Path:          /index.html
Document Length:        85 bytes

Server Software:        lighttpd/1.4.30
Server Hostname:        xxx.xxx.xxx.xxx
Server Port:            8123

Document Path:          /index.html
Document Length:        85 bytes

Node.js Warp + Yesod

version: 0.6.15


Server Software:        
Server Hostname:        xxx.xxx.xxx.xxx
Server Port:            8124

Document Path:          /
Document Length:        80 bytes

ghc: 7.0.3

warp: 1.2.0.1

yesod: 1.0.0.2


Server Software:        Warp/1.2.0.1
Server Hostname:        xxx.xxx.x.160
Server Port:            8123

Document Path:          /index
Document Length:        99 bytes
Tomcat Jetty

Server Software:        Apache-Coyote/1.1
Server Hostname:        xxx.xxx.xxx.xxx
Server Port:            8080

Document Path:          /sample/index.html
Document Length:        85 bytes


Server Software:        Jetty(8.1.2.v20120308)
Server Hostname:        xxx.xxx.xxx.xxx
Server Port:            8080

Document Path:          /sample/index.html
Document Length:        85 bytes

計測結果

wait time 分布図

30000 request

10000 request

wait time について => Between writing request and reading response

Source らしい(何となく怪しい) から一部抜粋

struct data {
#ifdef USE_SSL
    /* XXX insert timings for ssl */
#endif
    int read;                   /* number of bytes read */
    long starttime;             /* start time of connection in seconds since
                                 * Jan. 1, 1970 */
    long waittime;              /* Between writing request and reading response */
    long ctime;                 /* time in ms to connect */
    long time;                  /* time in ms for connection */
};

テスト時間 (sec)

apache, lighttpd はリクエスト数が多いとテストに時間がかかります。


result/apache-time.dat
request  1       2       3       4
  200    0.028   0.035   0.030   0.031
  500    0.081   0.087   0.078   0.069
 1500    0.187   0.172   0.187   0.185
10000   90.143 109.438 107.131 104.303
30000   18.995   3.584  32.986 327.660

result/lighttpd-time.dat
request  1       2       3       4
  200    0.025   0.025   0.027   0.026
  500    0.063   0.069   0.055   0.053
 1500    2.139   0.561   0.168   0.169
10000  50.097   52.646   2.285  34.739
30000 142.147    5.152 165.114 162.209

result/nodejs-time.dat
request  1      2        3       4
  200    0.034  0.039    0.034   0.032
  500    0.097  0.074    0.073   0.072
 1500    0.238  0.235    0.245   0.211
10000    1.560  1.610    5.101   1.505
30000    8.593 24.368   16.838  31.659

result/warp-time.dat
request  1      2        3       4
  200    0.071  0.093    0.074   0.070
  500    0.160  0.309    0.229   0.176
 1500    1.264  1.057    1.326   1.048
10000    3.115 10.991   11.347   5.078
30000   33.264 34.866   33.098  34.690

result/tomcat-time.dat
request  1      2        3       4
  200    0.021  0.024    0.025   0.080
  500    0.052  0.050    0.049   0.043
 1500    0.151  0.167    0.166   0.153
10000    9.062 10.112    6.957   0.965
30000   21.004 12.324   21.602  18.784

result/jetty-time.dat
request  1      2        3       4
  200    0.025  0.025    0.026   0.028
  500    0.087  0.104   14.926   0.059
 1500    1.127 22.815    1.244  14.990
10000   11.779 11.658   11.648  11.617
30000   36.141 36.806   36.773  36.225

2012年4月18日水曜日

組込み Tomcat と Jetty : Embedded in java

TomcatとJettyの組込みです バージョンは下記です
  • Tomcat 7.0.26
  • Jetty 8.1.12

Tomcat 参考サイト

embedding-tomcat

コマンド

起動は下の感じで、止めるのは Ctrl-C でお願いします
# tomcat
$ java -cp srv.jar:lib/* web.server.WebServer

# jetty
$ java -cp srv.jar:lib/* web.server.WebServer -jetty

# set port
$ java -cp srv.jar:lib/* web.server.WebServer server.port 8123

他のパラメータはソースを見てください
動かした感じ, jetty の後 tomcat 動かしてます










ソース

2012年4月11日水曜日

タネマキは使える

週末にフラッとタネマキに行ってきました。

混む時もあるそうですが、おおよそ使えるのでは無いでしょうか?

ここです!!タネマキ

2012年3月27日火曜日

CAEmitterCell のパクリネタ

ネタが無いので、パクリました。_( TxT)_

Emitting (発光 by Google 翻訳先生) のパクリネタ

本家を読んでくださいね。

パクリ元

UIKit Particle System in iOS 5 Tutorial

参考という名目のパクリ元

CAEmitterLayer and CAEmitterCellアップるぅぅぅの記事ですよね

その他ぽいの


プロパティの説明

CAEmitterCell
birthRate毎秒どれくらいオブジェクトを作るか
lifetimeセルのライフタイム
colortint 色合いを設定
contentsCGImageRef を設定


Layer は emitterShape と emitterPosition を設定するくらいでしょうか

CAEmitterLayer
emitterShapeオブジェクトの作成方法を設定

動かすとこんな感じ


使った適当な画像はこれです


ソース

ファイルのコメント的にはコピペはOKそうだったのですが。
問題ありましたらご指摘ください

2012年1月25日水曜日

続 NSURLConnectionDelegateで証明書(ry..方法

前回の記事が適当すぎたので、少ししっかり調べたーー

参考になると幸いです

結論

SSL周りのリリースノート、仕様書とかきちんとでてますか?

知っている方いたら教えてください

環境

  • iOS 5.0
  • tomcat 7.0.23 / 6.0.32
  • xcode 4.2.1

適当にする方法(改め)

- (void)connection:(NSURLConnection *)connection willSendRequestForAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
  NSURLProtectionSpace * protectionSpace = [challenge protectionSpace];
  NSURLCredential* credentail = [NSURLCredential credentialForTrust:[protectionSpace serverTrust]];
  [[challenge sender] useCredential:credentail forAuthenticationChallenge:challenge];
}

ハマった事

結論

RSAはOKでDSAはNG

ハマっている世界

iOS 5.0 は 証明書に MD5 を非サポートになったので、

keytool のデフォルト動作だと MD5withRSA なので

自己証明のSSL通信が軒並み エラーになると思っていた

SHA1withRSA とかkeystoreを作り直すと上のコード動いたと勘違いした。

安心したので,MD5の証明書でもやってみたら案の定動作したので、アレ?と思い

DSA で作成したら軒並みエラーなった。

--- 以上 ----

エラーの違い

xcode: Console

SHA1withRAS, MD5withRAS

SHA1withDAS

iPad : Safari : RSA

iPad : Safari : DSA

証明書一部

2012年1月23日月曜日

NSURLConnectionDelegateで証明書周りを適当にする方法

自己証明書だと、通信に失敗するでの軒並みOKにするには下のコードで行ける!!

おすすめはしない!!

※ コマンドラインでしか試してません ※


- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {
  return YES;
}

- (BOOL)connectionShouldUseCredentialStorage:(NSURLConnection *)connection {
  return YES;
}

- (void) connection:(NSURLConnection *)conn didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
  NSURLProtectionSpace * protectionSpace = [challenge protectionSpace];
  NSURLCredential* credentail = [NSURLCredential credentialForTrust:[protectionSpace serverTrust]];
  [[challenge sender] useCredential:credentail forAuthenticationChallenge:challenge];
}

リンク

参考またはこうすべきサイト

サンプルコード

2011年12月6日火曜日

USB Vender ID

USBのベンダーIDの取得方法

MAC

$ system_profiler SPUSBDataType
USB:

    USB High-Speed Bus:

      Host Controller Location: Built-in USB
      Host Controller Driver: AppleUSBEHCI
      PCI Device ID: 0x3b3c 
      PCI Revision ID: 0x0006 
      PCI Vendor ID: 0x8086 
      Bus Number: 0xfa 

        Hub:

          Product ID: 0x2514
          Vendor ID: 0x0424  (SMSC)
                       ^^^^ <- vender id

Linux

$ lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
                       ^^^^ <- vender id

実行結果

参考

lsusb on OS X

2011年11月28日月曜日

ARC をソースで!?

前置き

iOSというかllvmでコンパイルするときのARCをソースで管理するときの話です。 この方法はMacでしかできないと思います。

結論

追記1(後で別に書くかも・・・)

[Target] -> [Build Phase] -> [Compile Sources] にてコンパイラフラグを個別に指定してできる。(参考元)

追記2 個人的には混在は嫌いなので、共有ものはライブラリにする方向でその中はARCのON/OFFに依存して統一して書いたのがよいと思う。

ソースで管理するなら、ライブラリを作成してそれを使用するのがいいと思いました。

判断方法

この方法が正攻法かは不明... orz
#if __has_feature(objc_arc)

一応ARCの設定方法

XCode 4.2 の SingleViewApp のとき対応方法

ARC の ON/OFF 対応ようヘッダーファイルを ARCHandle.h を作成

#if __has_feature(objc_arc)
#define AUTORELEASE(A) A
#define ARC_ON
#else
#define AUTORELEASE(A) [A autorelease]
#define ARC_OFF
#endif

AppDelegate.m を変更


// ARC ON の時は基本的に dealloc 書かないので丸ごと削除
#ifdef ARC_OFF
- (void)dealloc
{
    [_window release];
    [_viewController release];
    [super dealloc];
}
#endif


//
// マクロで autorelease を隠蔽したりしなかったり
//
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  self.window = AUTORELEASE([[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] );
    // Override point for customization after application launch.
    if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
   self.viewController = AUTORELEASE([[GVViewController alloc] initWithNibName:@"GVViewController_iPhone" bundle:nil]);
    } else {
   self.viewController = AUTORELEASE([[GVViewController alloc] initWithNibName:@"GVViewController_iPad" bundle:nil]);
    }
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
}

ViewController.m を変更

UILabel に ARC ON/OFFでラベルの内容をかえてます


#if __has_feature(objc_arc)
#define HELLO  @"Hello ARC"
#else
#define HELLO  @"Hello ..."
#endif

ARC ON
ARC OFF

2011年10月26日水曜日

diff android ios (順番はアルファベット順)

現段階での雑感

やっぱりMacはオサレ路線で見せプレイ系で使用して、開発はUbuntu(Linux)がよい

My レベル


android1.6 〜 (2.x系 未開発)〜 3.2 位 開発してみたことあり
iOSiOS 5 sdk 〜 最近やってる

比較


比較してみた表
OSの順序はアルファベット順
項目AndroidiOSWinner備考
Setupsdk解答、環境変数設定 …AppStoreからインストール終了引き分け

iOSはデバイスに開発アプリをインストール辺りで、証明書周りでハマるので惜しいところで引き分け

SDKandroid update だったようなコマンドでおkAppStoreでxcodeを Updateでおk引き分け

iOSはもうちょっとラップしたクラスを提供した方がいいと思う。CoreData周りでそう思った。ContentProviderはどうよって言われると、まぁまぁまぁって感じだけど...

iOSはアップデートの所でappleIDを聞かれるが同じIDでなくてもいけるのわからん

IDEEclipse?xcodeAndroid

基本的にemacs なのでどっちでもいいけど、xcode4系は駄目な気がする

Source & ResourcesJava , XMLObjective-C . XML?Android

xcodeがいろいろ隠蔽しすぎて嫌になります。nibファイルは自分で書くレベルじゃない?

APIまぁJavadocHeaderDoc?Android

もうしけないけど...AppleのClass Referenceは肌に合わない...

OSWin,Ubuntu(linux?), MacMacAndroid

Macって開発しにくくないですか?やっぱUbuntuかな

アプリ.apk.appiOS

作り手次第だけど、同じレベルならiOSじゃね?

2011年10月18日火曜日

環境整備 Ubuntu 11.10, Mac for HHKB

Ubuntu 11.4 から11.10 にアップグレードをした。

gcc は 4.6 になっていた。

Mac でHHKB のドライバをインストールしたが

環境設定にアイコンが出てこない。

のが正解なのだろうか?

2011年10月12日水曜日

Objective-C on Ubuntu 寄り

ここら辺は役に立つ模様の話

Objctive-c
http://developer.apple.com/jp/documentation/cocoa/Conceptual/ObjectiveC/index.html
HeaderDoc
http://developer.apple.com/library/mac/#documentation/DeveloperTools/Conceptual/HeaderDoc/intro/intro.html
GuideLine
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CodingGuidelines/CodingGuidelines.html
Style Guide
http://google-styleguide.googlecode.com/svn/trunk/objcguide.xml

コンパイル周りの話

ubuntu では
gcc -lobjc -lgnustep-base -fconstant-string-class=NSConstantString \
      -I /usr/include/GNUstep -o xxxx ...
って感じなのだが mac では
gcc -framework Foundation -o xxxxx ...
となる

Ubuntuではまったところの話

@property を使用するためには、gcc 4.6 以降が必要らしい。(まだ未確認)
apt-get では取得できないので、ソースからビルドになります。
必要になるライブラリ(おそらく configure のオプションで OFFにしておけば必要ない。Offにできるかは未確認)
sudo apt-get install libgmp3-dev libmpfr-dev libmpc-dev
ビルド
gcc-4.6.1/   ソースディレクトリ
build-gcc/   ビルドディレクトリ
ビルドディレクトリにて
../gcc-4.6.1/configure --prefix=your_specified_path \
                               --exec-prefix=your_specified_path
make -j 3
make install

2011年9月16日金曜日

こんにちは android NDK

NDKを入れみました。
  1. 最初にすることは README.TXT を読む
  2. hello-jni を作成してインストール実行
をしてみました。

README.TXT 斜め読み


  • docs/CHANGES.html
    前のバージョンからの変更のリストありまっせ
  • docs/OVERVIEW.html
    機能とか制限とか重要な話らしい
  • docs/STABLE-APIS.html
    変更しないAPIだぉ
  • docs/INSTALL.html
    インストールの環境周り♪
  • docs/HOWTO.html
    便利なTipsです
  • docs/SYSTEM-ISSUES.html
    問題がない世界はないです。(意訳)
${ndk_home}/documentation.html も読むとイイカモ

hello-jni

下のコマンドを実行しました。

2011年9月13日火曜日

JOptionPane でパスワード入力

久しぶりに、swingのコードを書きました。

JOptionPaneでパスワードを入力するダイアログを出力するときのコードは、こんな感じでした。

String showPasswordDialog(Component parentComponent, String message) {
 JPasswordField pass = new JPasswordField();
 Object[] opts = new Object[]{message , pass};
 int opt = JOptionPane.showConfirmDialog(
   // 親Frame , 表示するObject, タイトル , ダイアログのオプション ← 文言はほぼAPI1.6からコピペ
   parentComponent, opts, null, JOptionPane.OK_CANCEL_OPTION);
 if (opt == JOptionPane.OK_OPTION) {
  return new String(pass.getPassword());
 }
 return null;
}

参考URL(パクリ)
Java Password Dialog

2011年9月9日金曜日

Huaweiのandroid端末の解像度

Huawei MediaPad { android:3.2 } に限らないと思います。
メモレベルの内容です。

MediaPadでは解像度をNormalとHighの2つが選べます。

使用されるdrawableとvaluesの対応は下の表になります。

ResolutionDPIDrawable,Values
Normal 213 hdpi
High 160 mdpi

High は hdpi, Normal は mdpi と思い込んでしまいますがち?

だったので注意が必要でした。

android developer page