![]() |
![]() |
前回はArduino Unoを搭載しマイコン化を果たしたカムプログラムロボット。
しかしタイマーを使ってジタバタさせているだけでは退屈。そこで、ロボットにさらなる高度な機能を付け加えました。
我、ロボットに『機械の眼(Machine Vision)』を与えん!
AndroidのWebブラウザからアクセスするとTLS(SSL)中間証明書エラーが発生する
![]() |
![]() |
Apache2の設定ミス(設定漏れ)
/etc/httpd/conf.d/ssl.confを編集する
|
1 2 3 4 5 6 7 |
SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5:+3DES:!RC4 SSLCertificateFile /etc/letsencrypt/live/chihayafuru.jp/cert.pem SSLCertificateKeyFile /etc/letsencrypt/live/chihayafuru.jp/privkey.pem SSLCertificateChainFile /etc/letsencrypt/live/chihayafuru.jp/chain.pem |
scriptコマンド
$ script <logfile_name>
$ script -a <logfile_name>
Xcode 7以降ではiOSシミュレータで取得したスクリーンショットが画面サイズに連動してしまう。
画面サイズ50%で表示すると、スクリーンショットも実寸大の50%の解像度になってしまう。
スクリーンショットファイル(PNG)保存のショートカットキー : ⌘ + s
Debug => Optimize Rendering for Window Scale のチェックを外す。


東京ビッグサイトで開催されたMaker Faire Tokyo 2017の会場にて先行発売されていたタミヤのロボット工作セットを購入し、マイコンボード(Arduino Uno)を載せる改造を試みてみました。
XcodeのAnalyze(静的コード解析)において以下の警告がでる。
Null passed to a callee that requires a non-null 1st parameter
nil(null)を渡してはならない引数にnilを渡すケースがある。
全ての動作パスでnilを渡さないように修正する。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <!-- 中略 --> <key>UISupportedInterfaceOrientations~iphone</key> <array> <string>UIInterfaceOrientationPortrait</string> </array> <key>UISupportedInterfaceOrientations~ipad</key> <array> <string>UIInterfaceOrientationPortrait</string> <string>UIInterfaceOrientationPortraitUpsideDown</string> <string>UIInterfaceOrientationLandscapeLeft</string> <string>UIInterfaceOrientationLandscapeRight</string> </array> </dict> </plist> |
注:Xcodeからの変更はうまく反映されないため Info.plist をエディタで直接変更する。
旧来の AutoSizing が(デフォルトで)有効になったままで、あたらしい AutoLayout は無効になっている。
UIオブジェクトのプロパティ translatesAutoresizingMaskIntoConstraints が有効になっている。
|
1 2 3 |
UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; indicator.translatesAutoresizingMaskIntoConstraints = NO; // !!! HERE !!! |
UIViewControllerのtopLayoutGuideプロパティを参照する。
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
self.upperView.translatesAutoresizingMaskIntoConstraints = NO; self.lowerView.translatesAutoresizingMaskIntoConstraints = NO; NSNumber *vPadding = @0; NSNumber *hPadding = @0; id topGuide = self.topLayoutGuide; UIView *upperView = self.upperView; UIView *lowerView = self.lowerView; NSDictionary *views = NSDictionaryOfVariableBindings(topGuide, upperView, lowerView); NSDictionary *metricsDictionary = NSDictionaryOfVariableBindings(vPadding, hPadding); NSArray *vConstraints = [NSLayoutConstraint constraintsWithVisualFormat:@"V:|-[vPadding]-[topGuide]-[upperView(100)]-[lowerView]-[vPadding]-|" options:0 metrics:metricsDictionary views:views]; [self.view addConstraints:vConstraints]; NSArray *hConstraints1 = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[hPadding[-[upperView]-[hPadding]-|" options:0 metrics:metricsDictionary views:views]; [self.view addConstraints:hConstraints1]; NSArray *hConstraints2 = [NSLayoutConstraint constraintsWithVisualFormat:@"H:|-[hPadding[-[lowerView]-[hPadding]-|" options:0 metrics:metricsDictionary views:views]; [self.view addConstraints:hConstraints2]; [self.view layoutIfNeeded]; |
https://developer.apple.com/library/content/documentation/UserExperience/Conceptual/AutolayoutPG/
|
1 |
$ nohup <command> & |
|
1 |
$ nohup tar cvzf foo.tgz ./foo & |
ログアウトしたり、リモートターミナルが切断された後もコマンドを継続する。