オンラインDDLのWaiting for table metadata lockについて
(1) トランザクション中に対象のテーブルをSELECT
A: begin;
A: select * from target_table where id=1;
(2) 対象のテーブルにオンラインDDLを実行
B: CREATE INDEX a_target_table_index ON target_table (field1, field2);
オンラインDDLのWaiting for table metadata lockについて
(1) トランザクション中に対象のテーブルをSELECT
A: begin;
A: select * from target_table where id=1;
(2) 対象のテーブルにオンラインDDLを実行
B: CREATE INDEX a_target_table_index ON target_table (field1, field2);
| app.files_dependencies “foo.rb" => "#{Bundler.bundle_path}/gems/sugarcube-3.0.0/lib/cocoa/sugarcube-files/nsstring.rb" |
| YAML.load('["a","b"]') | |
| #=> ["a", "b"] | |
| YAML.load('["あ","い"]') | |
| #=> nil |
| $ rake preload=true | |
| /Users/e-iwazawa/Develop/github/motioncv-test/vendor/opencv/motioncv.gemspec:2: warning: already initialized constant VERSION | |
| Create ./app/_preload_.rb | |
| + /Library/RubyMotion/data/ios/7.0/BridgeSupport/AVFoundation.bridgesupport | |
| + /Library/RubyMotion/data/ios/7.0/BridgeSupport/AssetsLibrary.bridgesupport | |
| + /Library/RubyMotion/data/ios/7.0/BridgeSupport/CoreGraphics.bridgesupport | |
| + /Library/RubyMotion/data/ios/7.0/BridgeSupport/Foundation.bridgesupport | |
| + /Library/RubyMotion/data/ios/7.0/BridgeSupport/UIKit.bridgesupport | |
| + ./vendor/opencv/framework/opencv2.framework/opencv2.framework.bridgesupport | |
| Build ./build/iPhoneSimulator-7.0-Development |
こういうモデルで
ActiveRecord::Schema.define(version: 20130922022806) do
create_table "models", force: true do |t|
t.string "field1"
t.string "field2"
t.datetime "created_at"
t.datetime "updated_at"| # | |
| # This Snippet may do to be able to refer all definitions of libraries | |
| # from RubyMotion REPL, when You paste this Snippet on bottommost of | |
| # your RubyMotion Rakefile. But it is very slow... | |
| # | |
| # Usage: | |
| # rake preload=true # generate preload source file before build simulator | |
| # | |
| # rake preload:clean # delete preload source file | |
| # |
Rakefileに何らかの定義を書くかや起動オプションの指定で、全てのBridgeSupportファイルの定数やクラスなどを参照実行するプログラムがコンパイルされて、REPLから見えるようになるモードがあると便利そうだ。
| app.vendor_project('vendor/opencv2.framework', :static, | |
| products: ['opencv2'], | |
| source_files: ['Headers/imgproc/imgproc_c.h', 'Headers/imgproc/types_c.h', | |
| 'Headers/motion/MotionCV.h', 'Headers/motion/MotionMat.h'], | |
| force_load: false | |
| ) |
| # -*- coding: utf-8 -*- | |
| Motion::Project::App.setup do |app| | |
| : | |
| app.frameworks += ['AVFoundation','AssetsLibrary'] | |
| app.libs += ['-lc++'] | |
| : | |
| app.vendor_project('vendor/opencv2.framework', :static, | |
| products: ['opencv2'], | |
| force_load: false |
| class GreyScaleViewController < UIViewController | |
| : | |
| def viewDidLoad | |
| super | |
| srcMat = MotionCV.MotionMatFromUIImage(UIImage.imageNamed("sato.jpg")) | |
| greyMat = MotionMat.new | |
| MotionCV.cvtColorInput(srcMat, output:greyMat, code:CV_BGR2GRAY) | |
| @imageView.image = MotionCV.UIImageFromMotionMat(greyMat) | |
| end | |
| end |