投稿者: nishimotz

  • 第61回音音研 6月18日

    下記のとおり開催します。直前のお知らせで恐縮ですが、ご興味のある方はお気軽にご参加ください。

    • 第61回 2009年6月18日(木) 18:30-
    • 話題提供1:東京女子大学 松村瞳さん+東京大学 西本
      • テーマ:音声CAPTCHAの検討
      • 要旨:昨年度から東京女子大学と東京大学の共同で行っている「人間が聞き取ることができ、機械に認識されにくい音声」の研究について、昨年度の成果の報告を行い、今年度の研究計画についてご助言をいただきたいと思います。
    • 話題提供2:帝京平成大学・川島先生
      • テーマ:音源分離知覚について
      • 要旨:日常的な場面では人間は重畳信号から個々の音源について知覚する。その理解は例えば何を分離知覚しているのか,あるいはその知覚に関わる要因とメカニズムはどのようなものかという点について行われてきた。今回は音源分離知覚に関するこうした問いについて文献調査と発表者の研究の結果などから得られる回答を整理する。
  • Rails controllerの複数形と単数形

    Ruby on Rails の勉強を始めたころ、なぜここは単数形で名前をつけるのか、なぜここは複数形にするのか、といったことでいちいち悩みました。最近、RESTful routing の勉強をしていて、controller の名前を単数にしてしまった場合の例が見つからず、「名前つけ直そうか」と焦ったのですが。。

    以下、Rails 2.2.2 で確認しました。

    config/routes.rb で

    map.resources :channels
    

    と書くと

    $ rake routes
    channels GET    /channels                        {:controller=>"channels", :action=>"index"}
    formatted_channels GET    /channels.:format                {:controller=>"channels", :action=>"index"}
    POST   /channels                        {:controller=>"channels", :action=>"create"}
    POST   /channels.:format                {:controller=>"channels", :action=>"create"}
    new_channel GET    /channels/new                    {:controller=>"channels", :action=>"new"}
    formatted_new_channel GET    /channels/new.:format            {:controller=>"channels", :action=>"new"}
    edit_channel GET    /channels/:id/edit               {:controller=>"channels", :action=>"edit"}
    formatted_edit_channel GET    /channels/:id/edit.:format       {:controller=>"channels", :action=>"edit"}
    channel GET    /channels/:id                    {:controller=>"channels", :action=>"show"}
    formatted_channel GET    /channels/:id.:format            {:controller=>"channels", :action=>"show"}
    PUT    /channels/:id                    {:controller=>"channels", :action=>"update"}
    PUT    /channels/:id.:format            {:controller=>"channels", :action=>"update"}
    DELETE /channels/:id                    {:controller=>"channels", :action=>"destroy"}
    DELETE /channels/:id.:format            {:controller=>"channels", :action=>"destroy"}
    

    となり、view で <%= link_to “index”, channels_path %> などと書けます。

    たまたま controller を channel のように単数形にしてしまうとどうなるのか、試してみました。

    map.resources :channel
    
    $ rake routes
    channel_index GET    /channel                         {:controller=>"channel", :action=>"index"}
    formatted_channel_index GET    /channel.:format                 {:controller=>"channel", :action=>"index"}
    POST   /channel                         {:controller=>"channel", :action=>"create"}
    POST   /channel.:format                 {:controller=>"channel", :action=>"create"}
    new_channel GET    /channel/new                     {:controller=>"channel", :action=>"new"}
    formatted_new_channel GET    /channel/new.:format             {:controller=>"channel", :action=>"new"}
    edit_channel GET    /channel/:id/edit                {:controller=>"channel", :action=>"edit"}
    formatted_edit_channel GET    /channel/:id/edit.:format        {:controller=>"channel", :action=>"edit"}
    channel GET    /channel/:id                     {:controller=>"channel", :action=>"show"}
    formatted_channel GET    /channel/:id.:format             {:controller=>"channel", :action=>"show"}
    PUT    /channel/:id                     {:controller=>"channel", :action=>"update"}
    PUT    /channel/:id.:format             {:controller=>"channel", :action=>"update"}
    DELETE /channel/:id                     {:controller=>"channel", :action=>"destroy"}
    DELETE /channel/:id.:format             {:controller=>"channel", :action=>"destroy"}
    

    のようになりました。

    link_to ‘xxx’, channels_path が channel_index_path のようになり、多少名前が冗長にはなりますが、無事に RESTful routing に移行できそうです。

    • 2009-07-22 追記:rails 2.x の scaffold が生成するのは「複数形の名前が付けられたコントローラ」なので、scaffold 流に揃えたほうがよさそうですね。
  • IPAX終了

    なんとか2日間の展示を終了できました。オラビーのブースを訪れてくださった方々に感謝します。

    1日目の説明を終えて、どうすればもっと上手に伝わるだろう、と考えたあげく、

    • 放送用のボイスメールシステムです

    ということにしました。昨日よりもうまくご説明できたように思います。

    何人かの方に久しぶりにお会いできて、また「実は個人的にラジオに興味があって」という方がたくさんいらっしゃって、充実した2日間でした。

    誰からもNHK連続ドラマ「つばさ」の話題が出ないなあ、と思っていたのですが、最後の懇親会の場で、IPAの西垣理事長と「つばさ」の話題で盛り上がることができました(笑)

    試してみたいという方がたくさんいらっしゃったので、早くデモサーバを公開できるように努力したいと思います。

    f:id:nishimotz:20090527141951j:image

    手書きの説明を追加しているときに「未踏」を「末路」と書き間違えたのは。。。