タッチパネルに対応するアプリケーションを開発する場合、開発は従来のマウスを使うブラウザ環境で行いつつ検証を実機でという手順を繰り返すことになるが、その際にイベントハンドラに記述するマウスイベントとタッチイベントの切り替えを自動的に判定して行う方法を Apple が公開している iAd のサンプルコード内に見つけたので開発しているアプリケーションのコードに適用した。
I apologize for the inconvenience about Scoreboard iPhone App, which is not yet ready for iOS4. And I have straggled to upgrade for development, meanwhile you can go through the following just 2 steps to set up Scoreboard WebApp on your device of iOS4 for free.
try{if(window.openDatabase){
db = openDatabase("BackgammonPositionsDB","1.0","Backgammon Positions DB",200000);/* 現行バージョンのまま */if(!db){alert("Failed to open the database on disk.");/* 初期化 */}else{
db.transaction(function(tx){/* 新しいカラムがなければ追加する */
tx.executeSql("SELECT crawford, star FROM BGPositions;",[],function(tx, result){},function(tx, error){
tx.executeSql("ALTER TABLE BGPositions ADD COLUMN crawford INTEGER default 0; VACUUM;");
tx.executeSql("ALTER TABLE BGPositions ADD COLUMN star INTEGER default 0; VACUUM;");});});/* 全行読み込み */return;}}else{alert("Couldn't open or support the database. Please try to contact with author.");/* 初期化 */}}catch(e){/* former changeVerion.js (前回はここにバージョンを変える関数をいれていた) */}
Unfortunately, the only way for your code to see the new version number is by closing the browser window. If you get an error code 2 (see “Error Codes”) and the database version you passed in for the old version matches the version in db.version, you should either assume that the version change already happened or display an alert instructing the user to close and reopen the browser window.
So you need to do two things – select the .js file in your project, and turn off the checkbox that indicates that it is compiled (the “bullseye” column). If you don’t do this, you’ll get a warning in your build log about being unable to compile the file (which should be your first warning – always try to figure out and and correct any and all warning that appear in your build).
Then drag it and drop it in the target’s “Copy Bundle Resources”.
PHPの結果が気になったのでこちらの記事を参考に(若干コードを変更)して実験してみたところ、連結の方法が最も速いと言う結果になった。元記事のサンプルコードでも統計的に同じ結果(DoS攻撃してスミマセン)なので、PHPのバージョンや環境の明記が必要だと思った。尚今回の環境はMac OS X 10.5.7のPHP 5.2.8 (cli) (built: Feb 5 2009 21:21:13) をApache/2.2.11 (Unix) (Server built: Feb 3 2009 01:54:45)のモジュールとして利用している。
VeriSign が使っている検証バッジはブログパーツのような方法で出力しているのだが、EMBED タグについて <embed></embed> のように書いてしまうと “[The HTML that caused this error was generated by a script.] Unmatched </embed> encountered. Ignoring tag.” という JavaScript エラーをコンソールが出力していることが分かった。