Rodhos Soft

備忘録を兼ねた技術的なメモです。Rofhos SoftではiOSアプリ開発を中心としてAndroid, Webサービス等の開発を承っております。まずはご相談下さい。

2017-05-01から1ヶ月間の記事一覧

AVPlayer

iOS

自分で作って忘れていたのだがシンプルな動画再生のプレーヤーとしてRDAVPlayerというコードを書いた。 github.com記事としては qiita.com 今ならもっと違う書き方になるかも。

URLSessionConfigurationのメモ

URLSessionConfigurationのメモこちらに良い記事があった。 qiita.com とりあえずメソッド一覧。あとから説明を追記する形で。 open class URLSessionConfiguration : NSObject, NSCopying { // デフォルト open class var `default`: URLSessionConfigurati…

canvasのサンプル

html5のcanvasで線を描く。 <head> <title>HTML5 canvas</title> </head> <body> <div align="center"> <h1>sample</h1> </div> <div align="center"> <canvas id="canvas" width="200" height="200" > <p>error</p> </canvas> </div> <script> var example = document.getElementById('canvas'); var context = e…</body>

円を描く

extension CGRect { init(_ center:CGPoint, _ size:CGSize) { self.origin = CGPoint(x:center.x - size.width/2, y:center.y - size.height/2) self.size = size } } extension CGPoint { init(_ x:CGFloat, _ y:CGFloat) { self.x = x self.y = y } } ext…

値の受け渡し

コントローラからテンプレートへ値をセットするには $this->set('poi',10); これでテンプレートでは$poiに10が入る。 <p> </p>

エレメント

レイアウトにはめ込んで使える。Templete/Elementフォルダにいれておき、 element("hoge") ?> で読み込める。 値をわたしたければ element("hoge", ['x'=>10,'y'=>5]) ?> のように渡す。色々部品化しておくと良いようだ。

レイアウト

使用するスタイルシートwebroot/css/cake.hello.cssを用意する。 body { background: #eee; color: #999; margin: 10px 8px } #header { font-size: 18pt; font-weight: bold; margin: 10px; } #content { background: #fff; color: #999; padding: 10px 25p…

テンプレート

src/Template/Hello/index.ctpを作ってテンプレートを以下のように用意 <html lang="ja"> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Hello Page</title> </head> <body> <h1>midashi</h1> <p> hello hello </p> </body> </html> コントローラ側でautoRenderをtrueにしてテンプレートを読み込む。

フォワードとリダイレクト

setAction(other); } public fun…

Hello World

/helloにアクセス /hello/otherにアクセス

プロトコルMisc

CustomStringConvertible description オブジェクトの文字表示 print CustomDebugStringConvertible debugDescription オブジェクトの文字表示 debugPrint LosslessStringConvertible 文字列からそのままオブジェクト構築できる TextOutputStream write(_ st…

Tensorflowの画像認識のチュートリアル

キータにも書いたが、自分のメモとしてTensorflowの画像認識のチュートリアルのサンプルに結果表示をいれたものをメモしておきたい。 コードの説明はコメントの形で埋め込んだ。qiita.com #coding:UTF-8 # rdtensorflowsample.swift # KatagiriSo import inp…

制約を更新する。

UIViewのupdateConstraintsを上書きする。superを最後に呼ぶことを忘れない。制約の反映はsetNeedsUpdateConstraintsを呼ぶ。

乱数

let x = arc4random() % 5 let x = arc4random_uniform(5) seed指定いらない。

デバイスごとのUI調整

途中にUIViewを挟んでそのUIViewのアスペクト比を決め、左右などを固定することで、そのUIViewに隣接する形でビューを拘束配置していけば画面の大きさが変わった際の調節ができる。

単語

inherently 生得的に、本質的に verbose 冗長なsibling 兄弟(男女別のない) ancestor 先祖 descendant 子孫trail 通った跡、痕跡 trailing end 終端 追加 2017.06.12 indispensable 絶対必要な Anatomy 解剖学、詳細な分析 Hands on 実践的 fly by の近くを…

proxyでrsyncが使えない時

gitが入っていれば代わりにgitを使う。 howto/SyncingWithGit – MacPortsgitのproxy設定は gitでプロキシを設定 - Qiita