ただ、一つ気になっていたのは、idが85969009とか、巨大な整数になることです。しかし、今日知ったのですが、これはラベルの文字列のハッシュだったんですね。これは、実に便利で、この例は
'Rosaceae'.hash.abs -> 85969009 なのですが、(私のシステムの場合ですが)
Family.find('Rosaceae'.hash.abs)と書けるわけです。
なるほど。
Webで見つけた気になるものをメモしたり、それにコメントしたりするブログ。
ただ、一つ気になっていたのは、idが85969009とか、巨大な整数になることです。しかし、今日知ったのですが、これはラベルの文字列のハッシュだったんですね。これは、実に便利で、この例は
'Rosaceae'.hash.abs -> 85969009 なのですが、(私のシステムの場合ですが)
Family.find('Rosaceae'.hash.abs)と書けるわけです。
Alternatively, you may enable auto-instantiation of the fixture data. For instance, take the following tests:
test "find_alt_method_1" do
assert_equal "Ruby on Rails", @web_sites['rubyonrails']['name']
end
test "find_alt_method_2" do
assert_equal "Ruby on Rails", @rubyonrails.news
end
In order to use these methods to access fixtured data within your testcases, you must specify one of the following in your ActiveSupport::TestCase-derived class:
* to fully enable instantiated fixtures (enable alternate methods 1 and 2 above)
self.use_instantiated_fixtures = true
* create only the hash for the fixtures, do not ‘find’ each instance (enable alternate method 1 only)
self.use_instantiated_fixtures = :no_instances
Add a few more monkeys and pirates and break this into multiple files, and it gets pretty hard to keep track of what‘s going on. Let‘s use labels instead of IDs:
### in pirates.yml
reginald:
name: Reginald the Pirate
monkey: george
### in monkeys.yml
george:
name: George the Monkey
pirate: reginald
Some times you don‘t care about the content of the fixtures as much as you care about the volume. In these cases, you can mix ERb in with your YAML or CSV fixtures to create a bunch of fixtures for load testing, like:
<% for i in 1..1000 %>
fix_<%= i %>:
id: <%= i %>
name: guy_<%= 1 %>
<% end %>
It was deprecated at 2.2.2
- "assert_valid is deprecated. Use assert record.valid? instead"
2010/09/01にリリースぅ?
Selectorsは、要素を選択するためのjQuery表現です。 簡潔な表現で、DOM要素を取得したり、jQueryオブジェクトを生成することができます。
CSS Grids: Examples
Building Pages with YUI CSS Grids
* Using Units: Each unit has a className that provides its percentage width.
* Fixed Page Template: This is a template for creating fixed-width layouts.
* Fluid Page Template: This is a template for creating fluid layouts.
If you want to use my reset styles, then feel free! It's all explicitly in the public domain (I have to formally say that or else people ask me about licensing). You can grab a copy of the file to use and tweak as fits you best
> Quick question: do mod_deflate and mod_rails work together fine? Or
> are there any known problems/caveats with this combo?
There are no known problems.
PC, 携帯, スマートフォンで異なるキャッシュを返してくれる(PCでアクセスしたときに携帯用の画面が表示されることはない)のはいいんだけど、 PC の User-Agent なんてほとんどバラバラなんだから、実質的にキャッシュにヒットする可能性はほとんどないという状態。 ダメじゃん。
で、調べてみたところ、答えは response body 全体の MD5 ハッシュでした。
tgkさんのとこで、PostgreSQLは「インデックスだけ見てデータは見ない」ということができないらしいという話があり、これが気になっていました。
ところで、「インデックスだけ見てデータは見ない」機能なんですが、一言でバシッと言えないとわかりにくいですよね。下の本ではindex-onlyと呼んでいます。教科書として使われている本らしいのでこれに倣えばいいよね。これからはindex-onlyと呼んでいこうと思います。(MySQLやSQL Serverではindex coveringとかcovering indexとか呼んでいますけどね。)
(注) サーバが長いエラーメッセージ(513バイト以上)を出力する場合には、IEは簡易表示ではなく、サーバのメッセージを表示する仕様になっている(参考1、参考2)。AN HTTPDの場合には 512バイト以下のメッセージのときもあり、本来のメッセージが隠されてしまうことがある。
freqは波の数で、lightstrengthが光の強さ加減で
30~50ぐらいが丁度良かった。
jQuery UI is built upon a powerful CSS Framework, including round corners that utilize CSS3's border-radius property. Unfortunately, CSS3 border-radius is only supported by Safari and Firefox, leaving browsers such as Internet Explorer to gracefully degrade to square corners.
jQueryで角丸するならこれが一番メジャー?
JQuery Corner Demo
jQuery Corner Demo
なのかな?