2012年10月12日金曜日

Windows, Ruby, Sinatra (2)

RubyでWebアプリケーション : Web with Ruby

(1) CGI - IIS
  • 色々設定面倒
(2) CGI ? Apache
  • httpd.confを修正
  • 分かっていれば簡単。初めてだとちょっとはまる
(3) ruby on rails (and WEBrick)
  • インストールは簡単。
  • 機能豊富、仕掛けは大がかり、重たい。

sinatra on ruby

第4の選択肢: sinatra

シンプル、軽量なWebアプリケーションライブラリ
  • Rackという規格に従っている
MVCでいうところのControllerのみ
  • Model, Viewは好きなライブラリと組み合わせる
インストール、コーディングも簡単

Installing sinatra

コマンドプロンプトから
  • set http_proxy=http://proxy:port       ※proxy越えの場合
  • gem install sinatra

最初のsinatra

hello.rb

require "rubygems"
require "sinatra"
get '/' do
  "Hello, sinatra world"
end

コマンドプロンプトから
  • ruby hello.rb
ブラウザでアクセス
  • http://localhost:4567/

sinatraとパラメータ

hello.rb

require "rubygems"
Require "sinatra"
get '/' do
  “Hello, sinatra world”
end

get '/:name' do
   "Hello, #{params[:name]}!"   
end

コマンドプロンプトから
  • ruby hello.rb
ブラウザでアクセス
  • http://localhost:4567/foo


 sinatraとREST

REST APIと相性が良い

get '/target' do
  “取得の処理”
end

post '/target' do
  “生成(登録)処理”
end

put '/target' do
  “更新処理”
end

delete '/target' do
  “削除処理”
end


Windows, Ruby, Sinatra (1)

Ruby on Windows

Rubyを使ってみよう

  • その前にRubyをインストールしよう
  • Linuxなら簡単: yum install ruby
  • じゃあ、Windowsの場合は?

Windows 2000のころ

http://www.r-labs.org/projects/r-labs/wiki/WindowsにRuby_187をインストールする

Rubyのバイナリをダウンロード、解凍
ftp://ftp.ruby-lang.org/pub/ruby/binaries/mswin32/ruby-1.8.7-p330-i386-mswin32.zip

必要なライブラリ(DLL)群を自分でダウンロード、解凍
  • gdbm.dll
  • iconv.dll
  • libeay32.dll
  • libpq.dll
  • pdcurses.dll
  • readline.dll
  • ssleay32.dll
  • zlib.dll
gem をインストールする
ダウンロード後、  ruby setup.rb を実行

→ 結構面倒だった


Windows XP 以降

RubyInstaller で一発導入
 http://rubyinstaller.org
 http://rubyforge.org/frs/download.php/76054/rubyinstaller-1.9.3-p194.exe

Ruby 1.9からは gem も内蔵
  • gem: Ruby用のライブラリ管理ツール
  • gem install ライブラリ名

※gemのproxy越え

set http_proxy=http://proxy:port
gem install ライブラリ名

最初のruby

first.rb
  • puts “Hello, ruby world!”
コマンドプロンプトから
  • ruby first.rb
  • Hello, ruby world!




2012年3月12日月曜日

BASiCS

  • 最初に戦場:Battlefieldが決まる
  • 戦場が決まれば、顧客:Customerが決まる
  • 戦場が決まれば、競合:Competitorが決まる

  • 強み:Strengthは顧客視点で
  • 競合に比較して
  • お客様が感じるベネフィット、バリュー
  • 独自資源:Assetにより、強みを長期的に維持

  • 自社の強みを顧客に伝える必要がある
  • それがSelling Message
  • 戦略の整合性のチェックにもなる

2012年2月24日金曜日

3C and BASiCS


マーケティングの考え方に、BASiCSというものがあります。
これと3Cの考え方を、私の理解のもと一枚の図にしてみました。
はたして合っているでしょうか??

  • Battle Field (戦場)
  • Asset    (独自資源)
  • Strength  (強み・差別化)
  • Customer  (顧客)
  • Selling Message (売り文句)
の5つの要素に一貫性(integration)を持たせるという考え方です。

これを3つの差別化軸に合わせて考え抜くのが重要と理解しています。
  • Quality 商品軸
  • Casual  手軽軸
  • Custom  密着軸

2011年10月6日木曜日

Thanks, Jobs

ありがとう、そしてさようなら。
Mr. Steve Jobs

2011年6月4日土曜日