あけましておめでとうございます。
本年もよろしくお願いします。
近況ですが、実は結婚しまして、神奈川に引っ越しました。
そんなですが、今後ともよろしくお願いします。
function talkToMe(args){
var app = Application.currentApplication(); // 現在のアプリケーションオブジェクトを取得する
app.includeStandardAdditions = true; // 標準コマンドを使用可能にする
app.say(args);
}
talkToMe("We will soon make breaf stop at ODAWARA.");
これで、スクリプトエディタで実行するととりあえず喋ります。
でもイントネーションがなんとなくおかしい。これ、システムの設定で、読み上げが日本語になっているのが原因です。なので、英語の読み上げ設定に変更します。 var videoDevice:AVCaptureDevice?
~~~~~~~~~~~~~中略~~~~~~~~~~~~~~~~
var error:NSError?
videoDevice = CameraViewController.device(AVMediaTypeVideo, position: AVCaptureDevicePosition.Back)
let videoDeviceInput = AVCaptureDeviceInput.deviceInputWithDevice(videoDevice!, error: &error) as AVCaptureDeviceInput
~~~~~~~~~~~~~中略~~~~~~~~~~~~~~~~
class func device(mediaType: NSString!, position: AVCaptureDevicePosition) -> AVCaptureDevice? {
var devices = AVCaptureDevice.devicesWithMediaType(mediaType) as [AVCaptureDevice]
if devices.isEmpty {
return nil
}
var captureDevice = devices[0]
for device in devices {
if device.position == position {
captureDevice = device
break
}
}
return captureDevice
}
あとイメージをキャプチャして保存するのが結構ハマりました。
func takePict(sender: AnyObject){
var layer : AVCaptureVideoPreviewLayer = previewLayer! as AVCaptureVideoPreviewLayer
self.stillImageOutput?.connectionWithMediaType(AVMediaTypeVideo).videoOrientation = layer.connection.videoOrientation
var error:NSError
self.stillImageOutput?.captureStillImageAsynchronouslyFromConnection(self.stillImageOutput?.connectionWithMediaType(AVMediaTypeVideo), completionHandler: {
(imageDataSampleBuffer,error) -> Void in
if ((imageDataSampleBuffer) != nil) {
var imageData : NSData = AVCaptureStillImageOutput.jpegStillImageNSDataRepresentation(imageDataSampleBuffer)
var image : UIImage = UIImage(data: imageData)
ALAssetsLibrary().writeImageToSavedPhotosAlbum(image.CGImage, orientation: ALAssetOrientation.fromRaw(image.imageOrientation.toRaw())!, completionBlock: nil)
}
})
}
一応こんな感じで何とか動いてます。(正直まだ良く分からない所が多い。)
DistributionNotFound: setuptools==0.6c12dev-r85381とか言われて全然インストール出来ず。ググったら親切な外人が/usr/bin/local/以下のeasy_installが複数入ってる可能性があるから一個消せば動くよって教えてくれたので、解消しました。感謝!
$ sudo pip install ipythonとしてから、
$ sudo pip install jinja2 $ sudo pip install tornado $ sudo pip install pyzmqとして
$ ipython notebookってやると、おもむろにブラウザがこんな感じで立ち上がります。こりゃ便利そう。

$ sudo pip install scikit-learnでインストール完了です。どうも途中Xcodeのcommand line toolが必要みたいなんですが、既に入ってるので、問題ナッシンでした。
public $hasOne = array(
'hoge' => array(
'className' => 'UserInfomation',
'foreignKey' => 'user_id',
'conditions' => 'hoge',
'fields' => 'fuga',
'order' => 'hage',
'dependent' => false
)
こんな感じの所を、こんな感じに直します。
public $hasOne = array(
'hoge' => array(
'className' => 'UserInfomation',
'foreignKey' => 'user_id',
'conditions' => 'hoge',
'fields' => 'fuga',
'order' => 'hage',
'dependent' => false
)
ラインが揃って超スッキリ。後で読む気になります。