メモ

1〜1000までで 1 が出現する回数確認 class Counter def count c = 0; (1..1000).each{|n| c += ( n.to_s.count "1") } return c; end end Counter.new.count

メモ

クラスの生成と #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/

HTML の overflow で表示しているテーブルの指定した行へスクロールさせる

こんな感じでいいのかな…… firefox 2.0.0.3 と IE6.0 だけ動作確認 <html> <head> <script language="JavaScript" type="text/javascript"> function onSelectionChanged(selection) { target = document.getElementById(selection.value); if (target == null) { return ; } scrollArea = document.getElementById("scrollArea</head></html>…

xdocdiff -TortoiseSVNでWord, Excel, PowerPoint, pdfのdiffを見れるようにするツール

dev

http://freemind.s57.xrea.com/xdocdiff/xdoc2txt 1.24を同梱 した xdocdiff114.exe をダウンロードしてインストール [TortoiseSVN Settiongs] - [Diff Viewer] - [Advanced...]を表示し、 以下の2つを追加Extension:.xls External Program:D:\tools\xdocdi…

OpenIDが熱狂的に受け入れられる理由

dev

http://www.atmarkit.co.jp/news/analysis/200704/23/openid.html

Dreamweaver8 から SVN を使用する

dev

インストール とりあえずデモを試してみる。製品版は 59USD GraFX Software Solutions http://www.grafxsoftware.com SVN for Dreamweaver http://www.grafxsoftware.com/product.php/SVN_for_Dreamweaver/135/インストール後実際に使用すると svn: This cli…

Dreamweaverのライセンス

メインマシン、サブマシンとで2台にインストールできる http://www.adobe.com/jp/products/activation/version1/#itemA-12 現行のマクロメディアのEULAでは、ソフトウェアを1台のコンピュータにインストールして使用することが通常認められています。 しか…

和暦と西暦を簡単に変換する方法

http://www.popxpop.com/archives/2007/03/mindomo.html

Google Code Search 公開ソースコードを検索

dev

http://www.google.com/codesearch@IT http://www.atmarkit.co.jp/fjava/column/andoh/andoh33.html

firefox拡張メモ

dev

Adblock Plus(https://addons.mozilla.org/firefox/1865/) Firebug(http://www.getfirebug.com/) Web Developer(http://chrispederick.com/work/webdeveloper/) Google ノートブック(http://www.google.com/notebook/download/ff) Internote(http://internot…

RFM分析

R(recency:最新購買日) いつ買ったか、最近購入しているか F(frequency:累計購買回数) どのくらいの頻度で買っているか M(monetary:累計購買金額) いくら使っているか http://www.atmarkit.co.jp/aig/04biz/rfm.html

[dev]ddclientのインストール su cd /usr/src/redhat/SOURCES wget http://downloads.sourceforge.net/ddclient/ddclient-3.7.0.tar.gz?modtime=1150316150&big_mirror=0 tar zxvf ddclient-3.7.0.tar.gz cd ddclient-3.7.0 ls cp -f ddclient /usr/sbin mkd…

MySQLがサポートするキャラセット情報を表示する

Version5.0.27 show collation; mysql> show collation like '%932%'; +-------------------+---------+----+---------++---------+ | Collation | Charset | Id | Default | Compiled | +-------------------+---------+----+---------+----------+ | cp932…

DBDesigner4 フリーのER図モデリングツール

本家サイト http://www.fabforce.net/dbdesigner4/ 日本語化サイト http://dbdesigner.iimp.jp/ 紹介ブログ http://forza.cocolog-nifty.com/blog/2004/10/er_dbdesigner.html 日本語マニュアル http://www.aglabo.com/agl/proevo/software/fabforce/ ユーザ…

MySql で ビューを作成

5.0.1からビューが使える用になっていたhttp://dev.mysql.com/doc/refman/5.0/en/views.html http://lists.mysql.com/mysql-ja/172CREATE VIEW ビュー名 AS 検索式 CREATE VIEW TEST_VIEW AS SELECT id FROM TABLE1 UNION ALL SELECT id FROM TABLE2; SELECT…

[other]Google Trend http://www.google.com/trends

[dev][java]簡単な toString のオーバーライド /** * 文字列編集します。 * @see java.lang.Object#toString() */ @Override public String toString() { return ToStringBuilder.reflectionToString(this); }

Mysql で DATE型 として '0000-00-00' が設定されていると、ResultSet#getObject で例外が発生

Exception in thread "main" java.sql.SQLException: Value '0000-00-00' can not be represented as java.sql.Date接続URLに zeroDateTimeBehavior=convertToNull を付加し、エラー回避 jdbc:mysql:///test?useUnicode=true&characterEncoding=SJIS&zeroDat…

samba の起動でエラーが発生する

==> smbd.log <== [2006/11/26 20:21:45, 0] smbd/server.c:main(847) smbd version 3.0.23c-1.fc5 started. Copyright Andrew Tridgell and the Samba Team 1992-2006 smbd: symbol lookup error: smbd: undefined symbol: cupsLangDefaultcups を最新化 yu…

mod_proxy でフォワードプロキシが出来ない

現象 mod_proxy でフォワードプロキシを有効にしても正常に動作してくれない httpd.conf ProxyRequests On Order deny,allow Deny from all Allow from 192.168.0 エラーログ(error_log) [error] (13)Permission denied: proxy: HTTP: attempt to connect to…