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
Contents
DHH's open_id_authentication plugin had been ready to openid-2.0
GPU Was The Bubble: Nikkei 225 Index Predicts Its Future
Replicate MySQL over VPN
寄付の募り方
シンプルなHelperプラグインを書く:TinyURLHelper
Comments
瀧内元気: MacOS版は以下にあります * [genki/ViMouse](https://githu... '23-1
KingofSmack: Here also good reads for this mobile applicatio... '14-5
Spencer: You don't have to re-compile it, this version w... '14-4
staiano: Any chance we can get a recompile for 10.9? '14-1
dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これ... '13-1
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ