[Titanium Mobile] Viewの背景色を透明にする方法

Titanium Mobile にて、Viewの背景色を透明にするには、createView で backgroundColor に ‘transparent’ を設定すればOKです。

var view = Ti.UI.createTableView({
    width : 320,
    backgroundColor : 'transparent',
});

以上です。

[Javascript] HTMLエスケープを行う htmlspecialchars

Javascript で HTML において特殊な意味を持つ文字のエスケープを行うPHP関数 htmlspecialchars を実装するコードをメモ。

function htmlspecialchars(ch) { 
    ch = ch.replace(/&/g,"&") ;
    ch = ch.replace(/"/g,""") ;
    ch = ch.replace(/'/g,"'") ;
    ch = ch.replace(/</g,"&lt;") ;
    ch = ch.replace(/>/g,"&gt;") ;
    return ch ;
}

【参考】

Javascript で HTMLエスケープを行うPHP関数、htmlspecialchars を実装:phpspot開発日誌 はてなブックマーク - Javascript で HTMLエスケープを行うPHP関数、htmlspecialchars を実装:phpspot開発日誌

[PostgreSQL] ERROR: missing FROM-clause entry for table

PostgreSQL にて ERROR: missing FROM-clause entry for table というエラーが発生した場合の対応方法をご紹介します。

PostgreSQL

続きを読む

[Titanium Mobile] invalid method (createCoverFlowView) passed to UIModule

Titanium Mobile で下記のようなエラーが発生しました。

[WARN] attempted to load: TiUICoverFlowViewProxy
[WARN] Exception in event callback. {
    line = 22;
    message = "invalid method (createCoverFlowView) passed to UIModule";
    sourceId = 225212864;
}

新しい種類のコンポーネントを追加した後に、このようなエラーが発生することがあるみたいです。

One thing to remember is that when you do a full build Titanium removes unused components from their API. So if you are adding a new type of component, for example, there are no textAreas in your app, and then you add a textArea, you may get this error.
The solution is to force a total rebuild by clearing out the contents of your build/iphone directory

build 以下のファイルを削除してから、もう一度ビルドすると正常に動作しました。

rm -rf build/iphone

以上です。

【参考】

Invalid method (createToolbar) passed to UIModule on device » Community Questions & Answers » Appcelerator Developer Center はてなブックマーク - Invalid method (createToolbar) passed to UIModule on device » Community Questions & Answers » Appcelerator Developer Center

[Shell Script] /bin/bash^M: bad interpreter: No such file or directory

シェルスクリプトを実行したら、エラーが発生しました。

/bin/bash^M: bad interpreter: No such file or directory

原因は、Windowsの改行コード CR/LF になっているせいみたいでした。

Linuxの改行コード LF に変換すれば正常に実行できました。

【参考】

シェルを実行できない失敗例「/bin/bash^M: bad interpreter: No such file or directory」の原因と解決策 – r_nobuホームページ はてなブックマーク - シェルを実行できない失敗例「/bin/bash^M: bad interpreter: No such file or directory」の原因と解決策 - r_nobuホームページ

[VirtualBox] 仮想環境上の Windows7 のディスク容量を増やす方法

VirtualBox の 仮想環境上の Windows7 のディスク容量を増やす方法を調べたのでメモ。

手順は下記のサイトを参考にしました。ありがとうございます。

Virtualboxのディスクサイズを大きくする – komagata はてなブックマーク - Virtualboxのディスクサイズを大きくする - komagata

Windows7 だと「ディスク管理」から簡単にパーティションの設定を変更できますが、XP の場合は下記のフリーソフトを使うとよさそうです。

Windows上から利用できるフリーのパーティション操作ソフト「EASEUS Partition Master Home Edition」 – GIGAZINE はてなブックマーク - Windows上から利用できるフリーのパーティション操作ソフト「EASEUS Partition Master Home Edition」 - GIGAZINE

以上です。

[VMware Server] スナップショット(Snapshot)の削除方法

VMware Server でスナップショット(Snapshot)を削除する方法を調べたのでメモ。

■Snapshotの消去方法

Snapshotで保存したバックアップを削除したい場合、削除をしたいゲストOSのタブを選択。
上にあるメニューの中から、Snapshotを選択し、開いたメニューから Remove Snapshot をクリックする。

・引用元:VMware Serverのバックアップ方法 – Climb IT Square : www.climb.co.jp はてなブックマーク - VMware Serverのバックアップ方法 - Climb IT Square : www.climb.co.jp

以上です。

[VMware Server] アンインストール方法

VMware Server をアンインストールする手順をメモ。

1. インストーラーと同じファイルを実行する
(例):VMware-server-2.0.2-203138.exe

2. インストーラーが起動後、Next をクリックする

3. Remove を選択して、Next をクリックする

4. Remove をクリックする

5. Yes をクリックする

6. Finish をクリックする

以上で、アンインストール完了です。

【参考】

Vmwareアンインストール はてなブックマーク - Vmwareアンインストール

VMware Server のインストール手順

Windows7 に VMware Server をインストールしたメモ。

VMware Server – 無償のサーバ仮想化製品 はてなブックマーク - VMware Server - 無償のサーバ仮想化製品

まず、VMware Server は会員登録(無料)しないと使えないみたいなので、下記リンクから登録する。

Download VMware Server for Free Virtual Server Software はてなブックマーク - Download VMware Server for Free Virtual Server Software

登録手順はこちらを参考。

VMware Server による仮想化(1) - VMware Server の入手 知ったかですが、なにか問題でも?/ウェブリブログ はてなブックマーク - VMware Server による仮想化(1) - VMware Server の入手 知ったかですが、なにか問題でも?/ウェブリブログ

登録後、「Download Packages」から「VMware Server」をダウンロードします。

あとはそのままインストールするだけですが、VMware Player が既にインストールされている場合は、アンインストールする必要があります。

以上です。

[Linux] sort と uniq をパイプでつないで重複行を削除する

メールアドレスの一覧などから重複したものを削除したくて、どうやるのが一番カンタンかいくつか考えてみたところ Linux コマンドでやるのがお手軽そうなので sort と uniq をパイプでつないで重複行を削除しました。

Linux

続きを読む