實松アウトプット

2012-01-11

チュートリアルどう作るの

カテゴリー: web — sanemat @ 02:14:39

minimalで一番かなえたいユーザ体験て何? にwebエンジニアに対応するのがチュートリアルどう作るの? な気がした。
で、どう作るの?

2012-01-04

Objective-C, GHUnit and OCUnit

カテゴリー: ghunit, objective-c, ocunit — sanemat @ 15:38:45
objective-cの話
OCUnitとGHUnitで圧倒的にGHUnitの方が優秀でOCUnitはしぬべき
どっちもすたれてUIAutomationかJsTestDriverになる気がしないでもないけど単体テストは残るだろう
GHUnitは非同期処理、テストの部分実行、コマンドラインからの実行、などが圧倒的でOCUnit = appleはテスト自動化やる気ない。
でもGHUnitつかってるとxcodeのバージョンアップでエラー出たりや構成作り方がパッと見ややこしいところとか、リンカエラーって出て何をどうすればいいのか皆目わからないとき、俺いま何やってんだろうかなーと思う。
というときにOCUnitを手助けできるもの書いて手軽さの方を延命すべきなのか、少なくとも動かすところでは踏ん張ってGHUnit使うべきなのかちょっと考える。
たとえばPHPの場合なら、もうlimeとsimple testはころしてPHPUnitにすべきじゃん? 導入が簡単だどうとか言って延命すべきでない。
Objective-cの場合、stackoverflowでいくつか見た質問や、テスト厨レベルだとGHUnitなんだけど、詰まったときのよく分からない状況を脱出するtipsが足りてない気がしてて、後自分だとお手上げになってしまうので、迷わずGHUnitでいいのかが謎い。
あとどうせテスト書いてる人見ないからはっきり言えばどうでもいいのかもしれない。素振りがめんどいんだよね objective-cのテストコード。課題設定がまずいのかも。apple自身のcalculatorのテストコードはそこそこよく出来てると思うんだが、現実に即しているのってそれしか見たことない。

2011-12-31

Days10: Same API with Push

カテゴリー: android, ios — sanemat @ 23:14:56
boxed iceのentryに出てくる、urbanairshipを使うと、めんどくさいところを全部まかなってくれるらしい? entry自体読みかけだし、urbanairshipつかったことないしで丸投げするのはひどいが。いつかためす
Android push notifications (tutorial) « Boxed Ice Blog
Push Notifications | Urban Airship

Days9: Android Push Notification

カテゴリー: android — sanemat @ 23:09:56
Android2.2以上でPush NotificationはC2DMつかえばいいのでは? まだつかったことないけど、それ以前のバージョンでの苦労は読み物程度にすればいいはず。

Days8: Apple Push Notification with Ruby

カテゴリー: ios — sanemat @ 23:01:57
RubyからAPNs叩くなら、下記gemのREADMEな感じで呼び出せばok
jpoz/APNS – GitHub https://github.com/jpoz/APNS
irbからぽこぽこnotify送れるのにちょっと感動する。APNsはios3以降なので、それ以外のnotificationは特に考えなくて良いはず
local notification送りたければ好きにすればいいと思う
cityville hometownで「tips: ~」とか来るのはlocal notificationだと思うが、コードを見たわけではないので知らない
APNsで来るnotificationが設定 -> 通知 で方法や手段をon/off出来る通知(ios5)だとおもう。前述のhometownはiphone側の設定で通知全offにしたのに、tipsと作物が実りましただけ来るので、ここがlocalなのかなと想像した。

Days7: APNsアカウント振り分け

カテゴリー: ios — sanemat @ 22:27:55

APNsのnotificationの場合アカウントの使い方、一人でやろうとするとシンプルだが、チームでやろうとすると意味が分からなくなる。あとFree/Paidの組み合わせがあると爆発するので泣いとく。

- 必要なだけprofileを作る
- コンパイル用とは別の秘密鍵&CSRセットをつくってpush用にする
– するといいらしい
– したほうがいいよね?といわれればたしかにそうなんだが権限分けと権限まとめたほうがいいところと区別が良くわからん
- どの鍵とどの鍵を共通にしておくと開発チーム的にはかどりつつ、セキュリティ的に踏みとどまれるのかよく理解していない。

* apple的に
- development用とdistribution用があって、その区別の話だけをしている

* social game provider的に
- public distribution用のappleアカウント

– 一般ピープルは触れない
- development用のappleアカウント
– 一般ピープルも触れる
– developのdistribution目的
– developのdevelop目的

なので、組み合わせとしては以下のとおりにするのが、折り合いポイントっぽい。

- public_apple – distribution
– appstore用build
- private_apple – distribution
– otaなど配布用build
- private_apple – development
– development用build

2011-12-25

Days6: SmartPhone Push Notificationはじめ

カテゴリー: android, ios — sanemat @ 22:41:05
Smart Phone(iOS/Android)のPush Notificationについて咀嚼したのでメモ。ここでのPush Notificationとは本当の”Push”だけではなくてぽいものもひとまとめにする。要はiphoneでポップアップが出てきたりandroidでnotifyされるアレ。
まずカッコつきじゃない本当のpush
- iPhone
Apple Push Notification Service (APNs)
http://developer.apple.com/jp/devcenter/ios/library/documentation/RemoteNotificationsPG.pdf
- Android
Android Cloud to Device Messaging (C2DM)
公式ドキュメントを読む。あと、正式名称、略称はすぐ忘れるので、覚えられないので書いておく。
- 対象OS
APNs: iOS3以上
C2DM: Android2.2以上
サーバ側、クライアント側の設定、dev版、配布版別の設定、用意しなきゃなモノ、対象外のosで擬似的なものはどうするか、などなどで知っている人に何度も何度も聞いてなかなか意味がわからなかった。でも基本は公式ドキュメント。あと、一歩を小さくしないとエラーの意味すらよくわからない。

2011-12-04

Days5: Selection Sort

カテゴリー: javascript — sanemat @ 23:31:30
I read and copy and paste from below about Selection Sort:
http://lecture.ecc.u-tokyo.ac.jp/~cichiji/cp-05/cp-05-06-3.html
This is my implementation.
https://gist.github.com/1430305/3f3883b6c2aecd7bd5b5e4adac06ae3fddff61a6

2011-11-27

Days4: npm module install project locally

カテゴリー: javascript — sanemat @ 21:13:00

Default is user local. And if I satisfy some conditions, then automatically switches project local :)

User global:
~/node_modules/

If I clone jasmine-node and I use “npm install” at project root, then npm module install project local.

$ cd /path/to/work
$ git clone git://github.com/mhevery/jasmine-node.git
$ cd jasmine-node
$ npm install requirejs
// then install /path/to/work/jasmine-node/node_modules/requirejs/*

eg. my confirm environment:
$ npm list
jasmine-node@1.0.11 /Users/sane/work/js-study/jasmine-node
├── coffee-script@1.1.3
├── jasmine-reporters@0.1.0
└── requirejs@1.0.2

If I want install global, I can use “npm install -g [pkg]“.

Edited: 2012-01-13 0:51
If you have PROJECT_ROOT/package.json,
$ cd PROJECT_ROOT
$ npm install
then there are modules below:
PROJECT_ROOT/node_modules/*

2011-11-26

Days3: Node.js(v0.6.3) does not have destructuring assignment?

カテゴリー: javascript — sanemat @ 22:17:15
Node.js(v0.6.3) does not have destructuring assignment?
https://developer.mozilla.org/en/New_in_JavaScript_1.7#Destructuring_assignment_(Merge_into_own_page.2Fsection)
Before my implemantation worked:
https://gist.github.com/1336596/12da47b354b7f7c5975fd67b4c72e4c48e958b52
After using destructuring assignment, but below does not work:
https://gist.github.com/1336596/4570cd315b88b41ed360962928c3d4aaafab8dbf
I want to reduce using temporary variable,
$ git diff 12da47b..4570cd3
diff --git a/BubbleSort.js b/BubbleSort.js
index 97b9760..583ecaf 100644
--- a/BubbleSort.js
+++ b/BubbleSort.js
@@ -9,9 +9,7 @@ bubbleSort.bubbleSort = function(){
     for(var i = 0; i  this.values[i + 1]) {
         this.flag = true;
-        var j = this.values[i];
-        this.values[i] = this.values[i + 1];
-        this.values[i + 1] = j;
+        [this.values[i], this.values[i + 1]] = [this.values[i + 1], this.values[i]];
       }
     }
     ++k;
I expected green, but test failed.
https://gist.github.com/1336596/4570cd315b88b41ed360962928c3d4aaafab8dbf#gistcomment-65440
過去の投稿 »

テーマ: Silver is the New Black. WordPress.com Blog.

フォロー

Get every new post delivered to your Inbox.