27th Wed

About Me

My name is Genki Takiuchi. I was born in Tokyo at 1980, so I am 27.

I've started programming when I was 8 years old. Simple games brought me to the world defined by BASIC. 20 years made me pass through many languages such as C/C++, HDL, HLSL, Java, D, Perl, Scheme, Erlang, Haskell and Ruby.

I won the Minister of Education prize at the programming contest in Japan when I was 19. I had studied concentratedly about computer graphics (photorealistic rendering) and statistics.

And now, I have worked with Ruby on Rails for more than 2 years. I wrote some articles to "WEB+DB press" and "Nikkei Software" which are magazines published in Japan.

I have a life work that is to solve the problem in the computer graphics.

posted by Png takiuchi on Wed 27 Feb 2008 at 15:24

このブログに英語(非常にbrokenですが)で書いている記事を、 今後はもう一つのブログの方に書くことにしました。

理由としては、複数の言語が混在しているのは読みにくいのでは ないかということと、別なブログとして英語のブログを作ることで 英語の勉強に気合を入れるためです。

ということで、よろしくお願いいたします。

posted by Png genki on Wed 27 Feb 2008 at 13:48

I decided to separate entries into two blogs according to its language. This is the first entry which has written in English to this weblog.

I had decided learn about English about two years ago, but that is not achieved yet. The goal is so far. I want to communicate with cool programmers using English as a native or second language.

By the way, I plan to write something about Ruby on Rails, computer graphics (especially about offline rendering) and so on to this blog.

If you are familiar with Japanse, please visit "Hello, world!" the another weblog which is written Japanese.

Thank you.

posted by Png takiuchi on Wed 27 Feb 2008 at 13:27

At rev. 8929, I have found a good news for OpenID users.

http://svn.rubyonrails.org/rails/plugins/open_id_authentication/CHANGELOG

Tied plugin to ruby-openid 1.1.4 gem until we can make it compatible with 2.x [DHH]

Thanks DHH!

posted by Png genki on Tue 26 Feb 2008 at 16:30

OoO workshop has been successfully held on last Sunday thanks to SGI Japan.

Syoyo, the founder of this event, had predicted the future of GPU in his presentation using a comparison of two charts which are about the Nikkei 225 index and the speed of GPU. Detail is here.

This is the most interesting prediction about GPU I ever met. Nowadays, CPU is speeding up much faster than GPU and its power consumption is still low against GPU's.

I think that FPGA can be a competitor of CPU rather than GPU in near future. The number of gates in FPGA has become very large so that it could be used for development of very complex processor such as Raytracing Processing Unit as known as RPU.

posted by Png genki on Tue 26 Feb 2008 at 11:11

From yesterday to this morning, we had set up two MySQL servers as master-to-master configuration.

One server is located in Tokyo, the other is in Shiga. They are replicated each other in order to get our system redundant and load-balanced. We had used OpenVPN for this purpose. It is very easy to setup by using tunnelling.

Okey, we agree with that the VPN will become the neck of a bottle if our network get heavy traffic. But fortunately or unfortunately, it is not so heavy. So we considered that a performance issue would be still no problem, against a stability issue.

posted by Png genki on Tue 26 Feb 2008 at 08:13

http://tinyurl.com/を見て気がついたのですが、paypalのほかにAmazon Honor Systemというのもあるようです。

手軽なマネタイズ方法としてつけることも検討してみよう

posted by Png satoko on Tue 26 Feb 2008 at 07:38

下記URLから入手できます。
http://svn.s21g.com/public/rails/plugins/tinyurl_helper/

仕様

URLを渡すとTinyURLに変換してリンクを作ります。

使い方

  • application_helper.rbでinclude
       1  module ApplicationHelper
       2    include TinyurlHelper
       3  end
    
  • View内で
       1  <%= link_to_tinyurl "http://www.yahoo.co.jp" %>
    

作り方

  1. 類似するプラグインを探してコーディングの検討をつける
  2. script/generateする
       1  script/generate plugin tinyurl_helper
    
  3. 上で生成されたlib/tinyurl_helper.rbを編集
       1  require 'net/http'
       2  
       3  module TinyurlHelper
       4    def link_to_tinyurl(url, html_options = nil)
       5      uri = 'http://tinyurl.com/api-create.php?url=' + url
       6      uri = URI.parse(uri)
       7      tiny_url = Net::HTTP.get_response(uri).body
       8      options = {:title => url, :alt => url}
       9      options = html_options.nil? ? options : options.merge(html_options)
      10      link_to tiny_url, tiny_url, options
      11    end
      12  end
    
  4. テストを書く(アプリテスト、プラグイン単体テスト両方通るように書くと吉)

       1  -
       2  require 'test/unit'
       3  require File.expand_path(File.dirname(__FILE__) + "/../lib/tinyurl_helper")
       4  
       5  class TinyurlHelperTest < Test::Unit::TestCase
       6    include TinyurlHelper
       7  
       8    #dummy link_to
       9    def link_to(name, options = {}, html_options = nil)
      10      [name, html_options[:title]]
      11    end
      12  
      13    def test_link_to_tinyurl
      14      url = 'http://www.yahoo.co.jp/'
      15      tiny_url, title = link_to_tinyurl(url)
      16      assert_equal 'http://tinyurl.com/910', tiny_url
      17      assert_equal url, title
      18    end
      19  
      20    def test_link_to_tinyurl_with_title
      21      url = 'http://www.yahoo.co.jp/'
      22      tiny_url, title = link_to_tinyurl(url, {:title => 'title'})
      23      assert_equal 'http://tinyurl.com/910', tiny_url
      24      assert_equal 'title', title
      25    end
      26  end
    

  5. README, MIT-LICENSEを書く

    • READMEは名前と、概要・使い方を書く
    • MIT-LICENSEは名前だけ変更
  6. 公開用リポジトリにコミット

  7. pluginディレクトリに登録する

Tips

  • プラグインはweb serverを再起動しないとリロードされない
  • helperを使えるようにする方法は2つ
    1. app/helper/application_helper.rbでinclude(上でやった方法)
    2. plugins/tinyurl_helper/init.rbでsendする
         1   ActionView::Base.send :include, TinyurlHelper
      
posted by Png satoko on Tue 26 Feb 2008 at 05:12

今年の目標に、railsのプラグインを作るというのがあるのですが、時間ができたらと言わずに「さっさと/ささっと作れ」という助言をもらったのでささっとやってみました。まずはどいういうものかという初歩的なところから。

Pluginディレクトリ

ここに多く集められています。
http://agilewebdevelopment.com/plugins

様々な種類のプラグイン

プラグインはRailsの機能拡張するものなのですが、下記のように分類できます。

  • Helper系
  • Model/Controller系
    • acts_as_なんとかという名前が多い
      ex. acts_as_taggable
  • Generator系
  • その他
    • 上記のmix
      ex. acts_as_authenticated => model/controller拡張, generator
    • rake taskを作るもの
      ex. annotate_models

作り方how-to

問題

  • プラグインのテスト、アプリのテスト両方のテストを通すようにtestを書くのが煩雑。
  • プラグインの更新を適用するのが面倒
    (gemのように簡単に最新にならないので、手動で削除、再インストールが必要)
posted by Png satoko on Mon 25 Feb 2008 at 13:31

イベントのお知らせです。

OoO(Offline meeting for Offline renderists)

いちおう今回のメインテーマはあって、それは OoO をオンラインでフォローするための、ompf のオフラインレンダラ版フォーラムを RoR で作ろうというものです.作っていただける方はいるので、それにときどき意見を出すみたいな。

まあでもその一方で、 MLT の実装とか, 論文書くとかしてても OK.

スライド作成が間に合えば、世界初、日本でしか聞けない(<- これ大事)、MUDA のプレゼンとかするかも.

ということで、僕は作る人として参加します。 Offline Renderingについて熱く語りましょう。

posted by Png genki on Sat 23 Feb 2008 at 02:57