iOS , unity | iphonesimulator not found unity

久しぶりにシミュレータで動かそうとしたらエラーで。

http://stackoverflow.com/questions/25088252/xcode-error-creating-lldb-target

この辺かと思ったら少し違う?

Base SDK iphonesimulator sdk not found

まったくわからあない

http://forum.unity3d.com/threads/ios8-xcode6-compatibility.249533/page-2#post-1769753

とりあえず4.6.x ?で5.0は大丈夫そう?

grunt で監視して typescriptを自動コンパイル

https://www.npmjs.com/package/grunt-typescript

$ npm install grunt-typescript –save

referenceも各ファイルに書かずに済んで良い感じです

Gruntfiles.js
module.exports = function(grunt) {
grunt.initConfig({
cssmin: {
minify: {
files: {
}
}
},
typescript: {
base: {
src: ['src/typescript/**/*.ts'],
dest: 'src/javascript',
options: {
module: 'commonjs',
target: 'es5',
basePath: 'src/typescript',
references: [
'typings/tsd.d.ts'
],
watch: 'src/typescript'
}
}
}
}
grunt.loadNpmTasks('grunt-typescript');
};

監視開始
$ grunt typescript
Running "typescript:base" (typescript) task

Watching... src/typescript
change src/typescript/routes/index.ts
1 file created. js: 1 file, map: 0 files, declaration: 0 files (1795ms)

ファイルが出来ました。
$ tree src/typescript/
src/typescript/
└── routes
└── index.ts

$ tree src/javascript/
src/javascript/
└── routes
└── index.js

typescript : tsd 定義ファイル管理

tsdで定義ファイルを管理します。
バージョンの確認が必要ですね

$ sudo npm install -g tsd

$ tsd init

$ tsd query node -v all

>> tsd 0.5.7

- node/node-0.10.d.ts : : 2015-03-15 14:36

- node/node-0.11.d.ts : : 2015-03-15 14:36

- node/node-0.8.8.d.ts : : 2015-03-15 14:36

- node/node.d.ts : : 2015-03-15 14:36

$ node -v
v0.10.33

$ tsd query node -v '=0.10'

>> tsd 0.5.7

- node/node-0.10.d.ts : : 2015-03-15 14:36

$ tsd query node -v '=0.10' -a install
$ tsd query node -v '=0.10' -a install -os
>> tsd 0.5.7

- node/node-0.10.d.ts : : 2015-03-15 14:36

>> running install..

>> written 1 file:

- node/node-0.10.d.ts

$ tree typings/
typings/
├── express
│   └── express.d.ts
├── node
│   └── node-0.10.d.ts
└── tsd.d.ts

$ cat tsd.json
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"bundle": "typings/tsd.d.ts",
"installed": {
"node/node-0.10.d.ts": {
"commit": "95d860879fb90c405aeb13eea7b8564f9c0df2bf"
},
"express/express.d.ts": {
"commit": "95d860879fb90c405aeb13eea7b8564f9c0df2bf"
}
}
}

こんな感じで
express.d.tsで呼ばれているnode.d.tsは不要なので、コメントアウト

$ tsc –module commonjs test.js

でコンパイルできました。
これをgruntに入れておきます。

vim : cent os . vim 7.4 +lua

エラーが出たら何か入れる
$ sudo yum install ncurses-devel

$ sudo yum install mercurial

http://www.vim.org/mercurial.php

$ hg clone https://vim.googlecode.com/hg/ vim

$ cd vim
$ ./configure –enable-multibyte –with-features=huge –disable-selinux –enable-luainterp=yes –enable-perlinterp=yes –enable-rubyinterp=yes –enable-pythoninterp=yes

なんかperl_endとかエラーが出るのでとりあえず・・・ –enable-perlinterp を外しました。

nodejs : version指定してインストール

$ npm install -g typescript@1.4.1

typescript確認
$ tsc -v
message TS6029: Version 1.4.1.0

Typescriptを使ってみる。 javascript

http://www.typescriptlang.org/

visual studioでも利用出来るようですね

$ sudo npm install -g typescript
Password:
/usr/local/bin/tsc -> /usr/local/lib/node_modules/typescript/bin/tsc
typescript@1.4.1 /usr/local/lib/node_modules/typescript

# とりあえずhandbook

http://www.typescriptlang.org/Handbook

handbookを一通り読みながら動かしてみた印象は・・・
わかりやすい。
tsと変換後のjsを比較出来るので勉強になりますね

他ライブラリ等利用するには定義ファイルが必要

https://github.com/borisyankov/DefinitelyTyped

メジャーな物はあるそうなので良いのかな?と
でもメンテナンスされてないと使えなくなるからそのあたりは問題かなと

# angularjs

https://angularjs.org/

meanスタックと言うのでフロントはgoogleのangularjsで良いようなので

http://jp.techcrunch.com/2015/03/06/20150305microsoft-and-google-collaborate-on-typescript-hell-has-not-frozen-over-yet/

でtypescriptで良いようなので 2.x

http://mean.io/#!/

とりあえず、meanスタックを使ってみる

http://meanjs.org/

どっちが良いの?

https://nodejs.org/

http://expressjs.com/

http://vuejs.org/

vim : macvim を更新するluaを有効にしてインストール

luaを有効にするため port からインストールしました。

sudo port install vim +python27 +ruby20 +lua +huge

こんなので適当に

活 目黒店。普通の回転寿司。

人気の美登利寿司系列ということで平日昼過ぎ3時くらいに行きました。
少し席が空いている感じで、並ばず入れました。

食事時はいつも列を作っているので、入りませんが空いていれば良い感じだなと思います。
普通の回転寿司。
注文は手書きで、紙とボールペンが1席に1つじゃない?ような、たまたまか

税別表記で
100,130,200,350,500などのお皿がありました。
マグロ赤身が100円で2カンなのでお得かな?と思います。

普通ではありますが、普通の回転寿司は駅近にはないので助かりますね
ネタとシャリのバランスも良いですね
100円130円で普通に食べられるので、いろいろ食べましたが、美味しかったです。
場所とネタを考えると安いと思います!
空いている時間にまた行きます。

活 目黒店

昼総合点★★★☆☆ 3.0

unity : admob mediation

JAVA 7を入れないとダメだったようで。

http://docs.oracle.com/javase/7/docs/webnotes/install/mac/mac-jdk.html

http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html

mac 64bit用 dmgをダウンロード

インストールして、java_homeをチェック変更する
$ /usr/libexec/java_home -v 1.7
/Library/Java/JavaVirtualMachines/jdk1.7.0_71.jdk/Contents/Home

$ java -version
java version “1.7.0_71″
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)

android sdkは21以上で。 android 5対応だそうで

http://answers.unity3d.com/questions/858978/android-freeze-on-load-black-screen-with-title.html

black screenで止まる問題は、 4.6.1p2で修正された模様

http://unity3d.com/unity/qa/patch-releases/4.6.1p3

を入れる。

問題なく起動できました。

ddmsでみると
01-13 13:59:15.087: I/Ads(5370): Instantiating mediation adapter: com.google.ads.mediation.nend.NendAdapter
のようにnend adapterが呼ばれているようです。

admobのcpm設定を変更してみましたが、admobしか表示されません・・・

https://www.nend.net/m/help/index/22

nendのテスト用IDを利用します。

admobでcpmを設定しても
メディエーションレポートをみてもnendの表示回数が0のまま・・・
リクエスト数は増えているけど・・・

mongodbとphp

phpからmongodbを利用してみる

適当にコマンドを入れてみました。
$mongo = new MongoClient( "mongodb://localhost:31230", array("connect"=>true));
$user = array('name'=>"jo");
$ret = $mongo->text->users->createIndex(array("name"=>1), array("unique"=>true));
$ret = $mongo->text->users->insert($user);
$mongo->text->users->remove($user);
$cursor = $mongo->text->users->find();
var_dump(iterator_to_array($cursor));

検索してみました。
$users = array(
array('name'=>"いきものがかり",'team'=>'red'),
array('name'=>"HKT48",'team'=>'red'),
array('name'=>"SKE48",'team'=>'red'),
array('name'=>"AKB48",'team'=>'red'),
array('name'=>"藤あや子",'team'=>'red'),
array('name'=>"水樹奈々",'team'=>'red'),
array('name'=>"水樹奈々男",'team'=>'white'),
array('name'=>"長渕剛",'team'=>'white'),
);
foreach($users as $user){
$ret = $mongo->test->artists->insert($user);
}
$cursor = $mongo->test->artists->find(array(
'$and' => array(
array( 'name' => new MongoRegex('/水樹/i') ),
array( 'team' => 'red' )
)
));
var_dump(iterator_to_array($cursor));

簡単かも・・・