角錐の体積が角柱の体積の1/3になる理由

Sorry, this entry is only available in 日本語.

角柱の体積が角(すい)の体積の 3分の1 になる理由を書いておきます。

ここで、 次の2点は既知とします。

  • 底面積と高さが同じ角錐は同じ体積になる。 (これもいつか証明を書きます。)
  • 角柱の体積は底面積と高さの積である。
Continue reading 角錐の体積が角柱の体積の1/3になる理由

Rails: クラス名が ActiveRecord::AttributeMethods 内のモジュールと同じ場合

Sorry, this entry is only available in 日本語.

Rails で作成したクラスの名前が “Read” だったとき、 そして その Read クラス を モデルクラス の中で使用したとき、 次のエラーが出ました。

undefined method `where’ for ActiveRecord::AttributeMethods::Read:Module

Read という クラス ではなく、 Rails が用意している ActiveRecord::AttributeMethods::Read モジュール だと判断されています。 次のようにすると、 作った Read クラス を使用できます。

CoffeeScript: How to write For Loop

How to write for loop in CoffeeScript.

for loop of array

In Ruby, it is written as items.each.

for loop of array with index

In Ruby, it is written as items.each_with_index.

Proof: Irrational numbers \( a \) , \( b \) exist that make \( a^b \) rational number

Irrational numbers ( a ) , ( b ) exist that make ( a^b ) rational.

Prove with law of excluded middle and without fixing what ( a ) and ( b ) are.

Proof

Supporse ( x = sqrt{2} ^ sqrt{2} ) .

Case: ( x ) is Rational

( sqrt{2} ) is irrational, so ( a = b = sqrt{2} ) make ( a^b ) rational. ( ( sqrt{2} ) が無理数であることの証明は 証明: ( sqrt{2} ) は無理数 をご覧ください。)

Case: ( x ) is Irrational

begin{eqnarray*} sqrt{2} & = & (sqrt{2}^sqrt{2})^sqrt{2} & = & sqrt{2}^{sqrt{2} cdot sqrt{2}} & = & sqrt{2}^2 & = & 2 end{eqnarray*}

Then, ( a = x = sqrt{2}^sqrt{2} ) and ( b = sqrt{2} ) are irrational and make ( a^b ) rational.

Above all, there are irrational numbers ( a ) and ( b ) that make ( a^b ) rational.