| 予定 | TODO | Link |
|---|---|---|
|
|
|
|
Namazu for hns による簡易全文検索 詳しくは 詳細指定/ヘルプを参照して下さい |
|||||||||||||||||||||||||||||||||||||||||||||||
今は Facebookアプリが SSL で提供されることを、Facebookのサーバが認証時に確認します。僕の場合は…
今回は Ruby で使ってるのでこんな感じ。
require 'win32ole'
require 'fileutils'
module Hoge
class DataBase
def initialize( db_path )
@path = db_path
constr = "Provider=" + "Microsoft.SQLSERVER.CE.OLEDB.3.5" + ";" +
"Data Source=" + @path + ";" +
"SSCE:Max Database Size=2048"
dbexist = FileTest.exist?( @path )
if dbexist == false then
adox = WIN32OLE.new( "ADOX.Catalog" )
adox.Create( constr )
end
@con = WIN32OLE.new( "ADODB.Connection" )
@con.Open( constr )
if dbexist == false then
@con.Execute(
"CREATE TABLE tvalues ( ctime datetime, " +
" ctag nchar(80), " +
" cvalue float, " +
" UNIQUE ( ctime, ctag ), " +
" PRIMARY KEY( ctime, ctag ) )" )
end
@insertCommand = WIN32OLE.new( "ADODB.Command" )
@insertCommand.CommandText = "INSERT INTO tvalues ( ctime, ctag, cvalue ) " +
" values ( ?, ?, ? )"
@insertCommand.ActiveConnection = @con
@insertCommand.Prepared = true
@queryCommand = WIN32OLE.new( "ADODB.Command" )
@queryCommand.CommandText = "SELECT cvalue FROM tvalues" +
" WHERE ctime = ? AND ctag = ?"
@queryCommand.ActiveConnection = @con
@queryCommand.Prepared = true
end
def insert( time, tag, value )
@con.BeginTrans
@insertCommand.Parameters.Item(0).Value = time
@insertCommand.Parameters.Item(1).Value = tag
@insertCommand.Parameters.Item(2).Value = value
@insertCommand.Execute
@con.CommitTrans
end
def select( time, tag )
@queryCommand.Parameters.Item(0).Value = time
@queryCommand.Parameters.Item(1).Value = tag
rs = @queryCommand.Execute
if rs.Eof then
return nil
else
return rs.Fields.Item(0).Value
end
end
end
end
こんな感じで、 Win32API から、Win32 API の Sleep を直接呼び出して回避。
require 'Win32API' api = Win32API.new( 'kernel32', 'Sleep', 'i', 'v' ) arg = 10*1000 api.call( arg )ただし、Ruby の Thread は native ではないので、 これやっちゃうと多分丸ごと止まっちゃうと思うので注意。
ちなみに、TTL なストロボを(ハイスピードシンクロ以外で)使うなら、カメラの露出モードはマニュアルが使いやすいです。 *1 マニュアルといっても、設定した絞り値に対して、ストロボがカメラと協調して適正な光量を測定してくれますから。
シャッター速度は、シンクロ(X)速度が基本。が、例えば背景を写し込みたい場合には、シャッター速度を遅くしていきます(露出計の指示通りにすれば定常光のみで標準露出)。定常光が乗る分、主要被写体が露出オーバーになっちゃう場合が出てきますが、ここで絞っても無駄で *2 、ストロボの発光量を調整します。 つまり、ハイライト側(人物)はストロボの光量補正で、シャドウ(背景)はシャッター速度で調整していきます。
ただ、ビデオカメラと違って色々問題が…