sudo vi で色がつかない centos 6.1
~/.bashrcに
export SUDO_EDITOR="/usr/bin/vim"
を追加、source ~/.basrc後に sudo -e ファイル名 もしくは sudoedit ファイル名で
各ユーザーのvimrcを見に行けるようになる模様。

ellievsbear
I'd rather be in outer space 🛸
Peter Solarz
Monterey Bay Aquarium
"I'm Dorothy Gale from Kansas"

Discoholic 🪩

JBB: An Artblog!
Stranger Things
Xuebing Du

Love Begins
Misplaced Lens Cap
d e v o n

tannertan36
Cosimo Galluzzi

titsay

祝日 / Permanent Vacation

roma★
occasionally subtle

seen from Austria
seen from United States

seen from Malaysia
seen from Malaysia

seen from Germany
seen from Germany

seen from United Kingdom

seen from Netherlands

seen from Indonesia
seen from United States

seen from Spain

seen from Malaysia

seen from United States
seen from United States

seen from Austria

seen from Argentina
seen from United States

seen from Brazil

seen from United Kingdom
seen from Malaysia
@kistvan
sudo vi で色がつかない centos 6.1
~/.bashrcに
export SUDO_EDITOR="/usr/bin/vim"
を追加、source ~/.basrc後に sudo -e ファイル名 もしくは sudoedit ファイル名で
各ユーザーのvimrcを見に行けるようになる模様。

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
iphone/objective-c ARC環境下でretain countを取得
CFIndex rc = CFGetRetainCount((__bridge CFTypeRef)self); NSLog(@"retain count:%ld", rc);
thymeleafで日付フォーマット
<span th:text="${#dates.format(dateObj, 'yyyy/MM/dd')}" >2012/08/07</span>
ヘルパー関数のようなものが定義されているみたいだけど、PDFマニュアルの最後の方にまとまってた。 webに一覧が無いのはどうなんだろう。
joda-Time ある日付が期間From Toに含まれているかどうか判定
https://gist.github.com/3081745.js?file=gistfile1.java
nginxとplay framework環境でchunkを使うとレスポンスにゴミデータが入る
nginxは割と長いことproxy passの先であるバックエンドサーバとの通信でHTTP 1.1をサポートしてなかったらしいのでその影響でchunkedが正常に解釈されていないよう。(CentOSでデフォルトで入るnginxは0.8系)
nginx1.3.2を使用することによってこの問題が解決されることを確認した。
どこまでバージョンを下げれるかは不明。
via http://blog.nomadscafe.jp/2012/02/nginx-11x-httpupstreamkeepalive.html

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
mac os xにnginxをインストールしようとするとエラー
configre時に
cc1: warnings being treated as errors src/core/ngx_crypt.c: In function ‘ngx_crypt_apr1’: src/core/ngx_crypt.c:76: warning: ‘MD5_Init’ is deprecated (declared at /usr/include/openssl/md5.h:113) src/core/ngx_crypt.c:77: warning: ‘MD5_Update’ is deprecated (declared at /usr/include/openssl/md5.h:114) ....
のようなMD5.hがうんたらかんたらのエラーが出たのでconfigureのオプションに下記追加
--with-http_ssl_module --with-cc-opt="-Wno-deprecated-declarations"
via http://blog.xavicolomer.com/2011/09/06/osx-lion-and-nginx-installation-tutorial/
ld: symbol(s) not found for architecture x86_64
というエラーも出てたので--with-ld-opt="-L /usr/local/lib"も追加した
SFHFKeychainUtilsでARC
http://mytracks-mobile.blogspot.jp/2012/01/arc.html
基本的にはここのとおり、スタティックライブラリ化するのが一番良かった。
githubでARC化されているプロジェクトもあったけど、作成途中なのかメモリリークしまくってたので使い物にならない。
SBJsonから取得したBooleanの値を比較する
SBJsonを使用してjsonからNSDictionaryに変換した場合、BooleanがNSCFBooleanになっている。
NSCFBooleanはNSNumberとしてキャストできるので、NSCFBooleanをBooleanにするためには
SBJsonParser *parser = [[SBJsonParser alloc] init]; NSDictionary *dic = (NSDictionary *)[parser objectWithString:@"{'flg':'true'}"]; if ([(NSNumber *)[dic objectForKey:@"flg"] boolValue]) { //なにがしかの処理.... }
でOK
Mac os xにMAMP2と合わせてrockmongoを導入時にエラー
MAMP2が入っている環境でrockmongoを導入したところ、ログイン後に画面が真っ白になっていたのでphpエラー全部を表示したところクラスが見つからないというエラーで、現状ではmongo.soはmac上でビルドしないとどうにもならないみたい。
仕方ないので下記サイトを参考に上手く動かないpeclの有効化、mongo.soのビルドを行った。
http://blog.livedoor.jp/hamichamp/archives/51806203.html
http://www.lullabot.com/articles/installing-php-pear-and-pecl-extensions-on-mamp-mac-os-x-107-lion
php5.3.6でpeclが上手く動かないのは、conf/pser.confを適当にリネームすることで回避。
今回ビルドしたファイル:http://ll.la/+VC=
httpd.confでAliasを設定したあと
/MAMP/bin/mamp/Japanese/navigation.phpに
<li id="navigation[rockmongo]"><a href="/rockmongo/" target="contentFrame">rockmongo</a></li>
を追加するとちょっと便利。
Centos Jenkinsとnginx構成でアクセスすると404エラー
nginxのproxy_passにhttp://127.0.0.1:8080を指定してるのに404エラーが出てた。
エラー出てるのが Generated by Winstone Servlet Engine とか書かれてるページだったので、jenkins自体にはアクセスできてるはずと思って試行錯誤したところ、/etc/sysconfig/jenkinsファイル内のJENKINS_ARGS="--prefix=/jenkins"を指定したところ画面にアクセスできた。
言われてみれば、proxy_passでlocation /jenkins {...}という設定になっていてdomain/jenkinsとアクセスすれば/jenkinsも引き継がれ、最終的にはhttp://127.0.0.1:8080/jenkinsというアクセスになるのは当たり前だったというハナシ。

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
MAMP2でmy.cnfの置く場所
いっつも忘れたころに設定が必要になって無駄なぐぐる時間が必要になるのでメモ
バージョン2.0.5
my.cnfを作成する場所は/Applications/MAMP/conf
テンプレートがある場所は/Applications/MAMP/Library/support-files
クエリログの設定
log=/Applications/MAMP/logs/mysql_query.log
iphoneのpush通知を大量送信
普通に大量件数を一括でpush通知しようとするとappleサーバ側で切断される。
切断された場合、最初の方のデータは送信されているようだった。
stackoverflow情報では2000件くらいで切断されるらしいので、2000件づつに分割送信したところ3秒で38000件を正常送信できてめでたしめでたし。
play frameworkでGCログを出力
play 1.2.4
conf/application.confにて
jvm.memory= -Xloggc:gc.log
jvm.memoryは本来メモリサイズなどを指定する時に使用するオプションのようだけどjvmに渡せるオプションは全部ここで渡せそうなのでgcログの指定もできる。
現状、ここ以外でjvmオプションを渡せる箇所は見つからなかった。
Interface Builderでviewをコンポーネント(部品化)して再利用する
http://d.hatena.ne.jp/KishikawaKatsumi/20081024/1224857278
基本的な考え方は上記URL
試してみて分かったのは、Files Ownerには必ずUIViewControllerかその継承クラスを指定しないといけないことと、Files Ownerに指定したクラスのviewプロパティに部品となるviewを指定しないといけない。
initWithNibName時にFiles Ownerのviewへ部品化したviewが格納されてしまうので、呼出し時にダウンキャストするのは避けられないよう。(ダウンキャストを嫌うなら共通のFilesOwnerではなくて個別UIViewControllerを作ってIBOutletとして接続するしかなさそう)
ちょっとしたロジックなら部品化Viewにメソッドを持たせたほうが取り回しがよい。
FilesOwnerにUIViewControllerを直接指定するか、それとも1つ共通ViewControllerを噛ませるかは作った人の趣味
facebook-ios-sdkでARC環境と混在させてビルド
IOS SDK5.0 Xcode4.2 環境
ファイルツリー最上位のプロジェクト設定を開く
TARGETSで対象ビルドターゲットを選択、Build Phasesを表示
Compile Sourcesのタブを展開
facebook-ios-sdk関係のソースファイルをクリックして -fno-objc-arc オプションを付ける
ビルドができる
詳しくは-fno-objc-arc でggr

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
joda-Time 日付が違うかどうか判定
https://gist.github.com/1984679.js?file=gistfile1.java
joda-Time ある期間内で何日分離れているかどうかカウント Days.daysBetween
https://gist.github.com/1984521.js?file=gistfile1.java