2007-06-01から1ヶ月間の記事一覧

メモ

クラスの生成と #to_s のオーバーライド class Song def initialize(name, artist, duration) @name = name @artist = artist @duration = duration end def to_s "Song: #@name--#@artist (#@duration)" end end song = Song.new("Bicylops", "Fleck", 260)…

メモ

プログラミングRuby 第2版 言語編作者: Dave Thomas,Chad Fowler,Andy Hunt,まつもとゆきひろ,田和勝出版社/メーカー: オーム社発売日: 2006/08/26メディア: 大型本購入: 7人 クリック: 270回この商品を含むブログ (152件) を見る 命名規則 ローカル変数・メ…

経度・緯度

経度・緯度を60進法から10進法へ変換 http://blog.fkoji.com/2005/09210026.html上記エントリでの例 139°45′35.187″ = 139 + (45 / 60) + (35.187 / 60 / 60) = 139.759774167 日本測地系と世界測地系の変換 http://blog.gpso.info/2006/08/post_2.html 携帯…

railsメモ

RubyGems での ActiveSupport irb -r rubygems -r active_support こっちでもOK ruby script/console 時間と数 1.second #=> 1 2.minutes + 30.seconds #=> 150 4.hours + 32.minutes #=> 16320 10.months + 10.days #=> 26784000 1.week #=> 604800 1.fortn…

rubyメモ

文字列とシンボルの違い "name".class # =>String "name".intern.class # => Symbol :name.object_id == "name".object_id # => false :name.object_id == "name".intern.object_id # => true 配列 [1,2,3] [:num, 10] %w( a b c) # ['a', 'b', 'c']と同じ …

JSEclipse

Adobe LAB の Javascriptプラグインhttp://www.interaktonline.com/Documentation/JSEclipse/jseclipse.htm#2000_installing.htmEdit Remote Site JSEclipse from Adobe Labs http://download.macromedia.com/pub/labs/jseclipse/autoinstall

LoginEngineプラグインをインストール

インストール プロジェクトディレクトリに移動し cd helloscript/plugin でインストール ruby script/plugin install -f http://svn.rails-engines.org/plugins/login_engine自動的にインストールされる -f はインストール済みのプラグインをもう一度取得し…

プラグイン

リポジトリの取得 ruby script/plugin discoverすべて Y を選択 一覧参照 ruby script/plugin list プラグインインストール ruby script/plugin install engines ruby script/plugin install login_engine

Aptana RadRails のインストールメモ

Aptana RadRails をインストールし、DBから一覧を表示するページを作成 IDEのインストール 以下より Aptana + RadRails をダウンロード http://aptana.com/download_rails_rdt.php プラグインのインストール インストール後起動し、 [ヘルプ]-[ソフトウェア…

関数の追加と関数の借用

// 新しい木クラスを作成します function Tree(name, leaf, bark) { this.name = name; this.leaf = leaf; this.bark = bark; } // 関数を追加します Tree.prototype.describe = function() { return this.name + ": leaf=" + this.leaf +", bark=" + this.b…

ruby rails のインストール

yum install ruby* yum install rdoc yum install irb yum install rubygems gem install rails --include-dependencieshello プロジェクト作成 rails hellohello サーバの起動 ruby script/server起動確認 http://127.0.0.1:3000/