ビットフラグ
ビットフラグはOpsionSetを定義すると使える。
struct Hoge : OptionSet { let rawValue : Int static let a = Hoge(rawValue: 0b0001) static let b = Hoge(rawValue: 0b0010) static let c = Hoge(rawValue: 0b0100) static let all:Hoge = [.a, .b, .c] static let ab:Hoge = all.subtracting(.c) func isNonEmpty() -> Bool { return !self.isEmpty } func isIntersect(_ v:Hoge) -> Bool { return self.intersection(v).isNonEmpty() } }
アクティビティ図
フローチャート代わりに使える。
テンプレ的に以下
```plantuml title <size:18>Sample</size> (*) --> "A" if "State" then partition "PartA" --> [a] "B" as hoge end partition else -> [b] "C" --> "D" endif partition "PartA" { hoge --> ===fork=== ===fork=== --> "E" --> ===join=== ===fork=== --> "F" --> ===join=== ===join=== --> "G" } -->(*) note right : H ```
詳細は以下を参照
yohshiy.blog.fc2.com
最初
作る sqlite3設定
命令群
./bin/cake bake migration CreateProducts name:string description:text created modified ./bin/cake migrations migrate ./bin/cake bake seed Product ./bin/cake migrations seed ./bin/cake bake model Products ./bin/cake bake controller Products ./bin/cake bake template Products
sqlite3
.tables select description, modified, created from products;
ローカルで確認
./bin/cake server
http://localhost:8765/Products
UIを作ってみる
UIを書いてみた。あっているかどうかは不明。
Matrix
Swiftで行列を作ってみた。一応掛け算できる。
パーセプトロン
またパーセプトロンのコードを書いてしまった..。
perceptron code