2012年2月29日水曜日
在庫を抱える目的
在庫はなぜ抱える必要があるのだろうか。また、なぜ在庫を減らすことが良いと言われているのだろうか。
まずは、在庫を抱える必要性について、田中屋という八百屋を例に考えてみよう。
田中屋では、毎朝トマトを仕入れて、陳列棚に並べて販売している。陳列棚には100個のトマトを並べることが出来る。トマトは1日あたり約90個売れており、売れ残った分は毎日破棄していた。
ある日を境に、トマトの売れ行きが伸び始め、昼頃には全て売れてしまうようになった。夕方になってもトマトを求めて客がやってくるが、品切れのために売ることが出来ない。より多く仕入れれば品切れにならないのだが、陳列棚には100個までしか並べることができない。
そこで、店主はトマトを200個保管できる倉庫を用意した。倉庫の維持には費用がかかる。しかし、1日あたりトマトを300個売ることができるようになった。在庫を用意することで、品切れに対処したのだ。
このように、在庫を用意する目的は「販売機会の損失」を防ぐことにある。適切な料の在庫を持つことで、需要に対応して売上を伸ばすことができる。
では、在庫を大量に確保すればいいのかというと、そんなことはない。それについては次の記事で書こうと思う。
2012年2月27日月曜日
在庫管理を学ぼうと思った理由
僕がどんな人間か知っている人には「何を無茶なことを考えているんだ」と思われるかもしれないが、ゆくゆくは、自分でソフトハウスを立ち上げたいと考えてる。
そのために今できることの一つは、業務知識を学ぶこと。日商簿記3級を取得したのも、その一環。
簿記の勉強をしてみて感じたことがある。それは、会計に関する知識だけでは、他社のソフトウェアに対抗できるようなものを作れないということ。
会計処理の多くの部分は、会計法や簿記のルールに基づいて行われている。どの会社も似たような処理を行なっているので、IT化にあたってはパッケージソフトの導入がベターなんだ。となると、会計ソフトの開発で「他社との差別化」をするのはかなり難しいと思うんだよね。
会計知識と組み合わせることで、システム開発に役立つ知識は何だろうか。そう考えた時に頭に浮かんだのが「在庫管理」だった。
在庫管理に関しては法が整備されているわけではないので、会社ごとに独自のプロセスがあると考えられる。つまり、パッケージソフトでは手の届かないようなところを解決できるようなシステムを提案するチャンスがあると思うんだ。
さらに、在庫管理と会計処理を一括して行うことができるシステムを構築できれば、顧客の事務処理にかける時間をかなり削減できる。在庫情報をモバイル端末でリアルタイムに参照できるようにすれば、顧客の営業活動にも良い影響を与えられる。取引先の企業にもシステムを導入できれば、EDIの実現により、顧客の受発注処理をより効率化できる。
在庫管理に関する知識の他にも、学ぶべきことはたくさんある。まずは、今の自分にできるところから手をつけて、一歩ずつ着実に目標に向かって進んでいこう。
そのために今できることの一つは、業務知識を学ぶこと。日商簿記3級を取得したのも、その一環。
簿記の勉強をしてみて感じたことがある。それは、会計に関する知識だけでは、他社のソフトウェアに対抗できるようなものを作れないということ。
会計処理の多くの部分は、会計法や簿記のルールに基づいて行われている。どの会社も似たような処理を行なっているので、IT化にあたってはパッケージソフトの導入がベターなんだ。となると、会計ソフトの開発で「他社との差別化」をするのはかなり難しいと思うんだよね。
会計知識と組み合わせることで、システム開発に役立つ知識は何だろうか。そう考えた時に頭に浮かんだのが「在庫管理」だった。
在庫管理に関しては法が整備されているわけではないので、会社ごとに独自のプロセスがあると考えられる。つまり、パッケージソフトでは手の届かないようなところを解決できるようなシステムを提案するチャンスがあると思うんだ。
さらに、在庫管理と会計処理を一括して行うことができるシステムを構築できれば、顧客の事務処理にかける時間をかなり削減できる。在庫情報をモバイル端末でリアルタイムに参照できるようにすれば、顧客の営業活動にも良い影響を与えられる。取引先の企業にもシステムを導入できれば、EDIの実現により、顧客の受発注処理をより効率化できる。
在庫管理に関する知識の他にも、学ぶべきことはたくさんある。まずは、今の自分にできるところから手をつけて、一歩ずつ着実に目標に向かって進んでいこう。
2012年2月3日金曜日
Rails3.0にCapybaraとlaunchyを追加
Gemfileに下記の2行を追加。
gem 'capybara'
gem 'launchy'
bundle installを実行。下記のようなエラーがでる。
bundle install
-- 省略 --
Installing nokogiri (1.5.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
-----
libxslt is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.5.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.0'` succeeds before bundling.
調べた結果、libxslt-develが必要らしいので、インストール。
yum install libxslt-devel
再度bundle installを実行。
bundle install
今度はうまくいった。
gem 'capybara'
gem 'launchy'
bundle installを実行。下記のようなエラーがでる。
bundle install
-- 省略 --
Installing nokogiri (1.5.0) with native extensions
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
-----
libxslt is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html for help with installing dependencies.
-----
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/usr/local/bin/ruby
--with-zlib-dir
--without-zlib-dir
--with-zlib-include
--without-zlib-include=${zlib-dir}/include
--with-zlib-lib
--without-zlib-lib=${zlib-dir}/lib
--with-iconv-dir
--without-iconv-dir
--with-iconv-include
--without-iconv-include=${iconv-dir}/include
--with-iconv-lib
--without-iconv-lib=${iconv-dir}/lib
--with-xml2-dir
--without-xml2-dir
--with-xml2-include
--without-xml2-include=${xml2-dir}/include
--with-xml2-lib
--without-xml2-lib=${xml2-dir}/lib
--with-xslt-dir
--without-xslt-dir
--with-xslt-include
--without-xslt-include=${xslt-dir}/include
--with-xslt-lib
--without-xslt-lib=${xslt-dir}/lib
Gem files will remain installed in /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.9.1/gems/nokogiri-1.5.0/ext/nokogiri/gem_make.out
An error occured while installing nokogiri (1.5.0), and Bundler cannot continue.
Make sure that `gem install nokogiri -v '1.5.0'` succeeds before bundling.
調べた結果、libxslt-develが必要らしいので、インストール。
yum install libxslt-devel
再度bundle installを実行。
bundle install
今度はうまくいった。
2012年2月2日木曜日
一歩前へ!
社長(友人)「今度、とあるシステムをリプレースするから、設計をしてくれないかな」
僕「( ゜д゜)」
設計か・・・うむ、やってみる。やってやる。やってやるぞー!
現在は、既存システムのマニュアルや、社長の話を聞きつつ、データ構造やUIを設計している段階。ある程度まとまったら、一度クライアントと直に会って、詳細を詰めていく予定。
僕「開発方式はどうする?」
社長(友人)「まかせるよ」
僕「( ^ω^)」
システムの規模とウォーターフォールへの不信感から、反復式で設計をまとめた後に、反復式で製造することにした。製造はBDDで行おうと思ったんだけど、NetBeans+PHP+BDDという環境を整えるのに手間取りそう。普段使っているPHPUnitを利用して、TDDで開発する。TDDに関しては、業界で賛否両論あるのだが、やってみないことには何も実感できないよね。
製造が終わったら、操作説明書や運用手順書も作らないとな。
さあさあ、脱プログラマへの第一歩なのよ!(`・ω・´)シャキーン
僕「( ゜д゜)」
設計か・・・うむ、やってみる。やってやる。やってやるぞー!
現在は、既存システムのマニュアルや、社長の話を聞きつつ、データ構造やUIを設計している段階。ある程度まとまったら、一度クライアントと直に会って、詳細を詰めていく予定。
僕「開発方式はどうする?」
社長(友人)「まかせるよ」
僕「( ^ω^)」
システムの規模とウォーターフォールへの不信感から、反復式で設計をまとめた後に、反復式で製造することにした。製造はBDDで行おうと思ったんだけど、NetBeans+PHP+BDDという環境を整えるのに手間取りそう。普段使っているPHPUnitを利用して、TDDで開発する。TDDに関しては、業界で賛否両論あるのだが、やってみないことには何も実感できないよね。
製造が終わったら、操作説明書や運用手順書も作らないとな。
さあさあ、脱プログラマへの第一歩なのよ!(`・ω・´)シャキーン
2012年2月1日水曜日
Rails3でデータベースの日付を日本時間にする方法
Rails3では、データベースに日付を格納するときにUTCとするため、
日本時間のみを扱いたい場合はちょっと不便。
下記の方法で解決できる。
(参考URL: http://blog.libero-tecnologia.net/?p=40)
config/application.rbに下記2行を追加
config.time_zone = ‘Tokyo’
config.active_record.default_timezone = :local
日本時間のみを扱いたい場合はちょっと不便。
下記の方法で解決できる。
(参考URL: http://blog.libero-tecnologia.net/?p=40)
config/application.rbに下記2行を追加
config.time_zone = ‘Tokyo’
config.active_record.default_timezone = :local
2012年1月8日日曜日
Rails3.0 bundle install時のsqliteエラー解決方法
bundle install時に、次のようなエラーが出る場合がある。
An error occured while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.
適切なバージョンのsqliteをインストールしていないために、このエラーが起きるようだ。
yumでsqliteをインストールしてみたが、インストールされるバージョン(3.3)が古いために解決できなかった。
sqlite3.5以上のソースをダウンロードしてインストールしてみた。
**** RPM package creation selected ***
**************************************
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ sqlite-autoconf ]
3 - Version: [ 3070900 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ sqlite-autoconf-3070900 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ sqlite-autoconf ]
Enter a number to change any of them or press ENTER to continue: 2 #Nameを指定する
Enter new name:
>> sqlite
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ sqlite ]
3 - Version: [ 3070900 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ sqlite-autoconf-3070900 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ sqlite-autoconf ]
Enter a number to change any of them or press ENTER to continue: 3 #Versionを指定する
Enter new version:
>> 3.7.9
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ sqlite ]
3 - Version: [ 3.7.9 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ sqlite-autoconf-3070900 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ sqlite-autoconf ]
Enter a number to change any of them or press ENTER to continue: #Enterを押下
rpm -ivh /usr/src/redhat/RPMS/i386/sqlite-3.7.9-1.i386.rpm
sqliteがインストールされたことを確認する。
sqlite3
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .q
Railsのbundle installを実行してみる。
bundle install
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
なんとかうまくいった。ほっと一息。
An error occured while installing sqlite3 (1.3.5), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.5'` succeeds before bundling.
適切なバージョンのsqliteをインストールしていないために、このエラーが起きるようだ。
yumでsqliteをインストールしてみたが、インストールされるバージョン(3.3)が古いために解決できなかった。
yum install sqlite-devel #これではダメ!
sqlite3.5以上のソースをダウンロードしてインストールしてみた。
wget http://www.sqlite.org/sqlite-autoconf-3070900.tar.gz
tar zxvf sqlite-autoconf-3070900.tar.gz
cd sqlite-autoconf-3070900
./configure
tar zxvf sqlite-autoconf-3070900.tar.gz
cd sqlite-autoconf-3070900
./configure
make
checkinstall -R --fstrans=no --exclude=/selinux
****************************************** RPM package creation selected ***
**************************************
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ sqlite-autoconf ]
3 - Version: [ 3070900 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ sqlite-autoconf-3070900 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ sqlite-autoconf ]
Enter a number to change any of them or press ENTER to continue: 2 #Nameを指定する
Enter new name:
>> sqlite
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ sqlite ]
3 - Version: [ 3070900 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ sqlite-autoconf-3070900 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ sqlite-autoconf ]
Enter a number to change any of them or press ENTER to continue: 3 #Versionを指定する
Enter new version:
>> 3.7.9
This package will be built according to these values:
1 - Summary: [ Package created with checkinstall 1.6.0 ]
2 - Name: [ sqlite ]
3 - Version: [ 3.7.9 ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ Applications/System ]
7 - Architecture: [ i386 ]
8 - Source location: [ sqlite-autoconf-3070900 ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ sqlite-autoconf ]
Enter a number to change any of them or press ENTER to continue: #Enterを押下
rpm -ivh /usr/src/redhat/RPMS/i386/sqlite-3.7.9-1.i386.rpm
sqliteがインストールされたことを確認する。
sqlite3
SQLite version 3.7.9 2011-11-01 00:52:41
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .q
Railsのbundle installを実行してみる。
mkdir work_rails_check
cd work_rails_check/
rails new checkapp
cd checkapp/bundle install
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
なんとかうまくいった。ほっと一息。
2012年1月7日土曜日
CentOSにRails3.0を導入(CheckInstall使用)
今回、Rails3の導入にCheckInstallというツールを利用する。
CheckInstallの導入方法
以下Railsインストール手順
あらかじめgccをインストール
yum install gcc
あらかじめrpm-buildをインストール
yum install rpm-build
あらかじめzlib-develをインストール
yum install zlib-devel
あらかじめ必要なパッケージをインストール
yum install gcc gcc-c++ make perl zlib-devel openssl-devel readline-devel libxml2-devel bzip2-devel unzip libjpeg-devel libpng-devel freetype-devel rpm-build -y
Rubyソースコードをダウンロード(ruby-1.9.3-p0だと、Gemがうまく動作しない)
アーカイブを展開
コンパイルしてCheckInstallでRPMパッケージ化
ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
Gemのバージョン確認。
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
Railsインストール。(バージョン3.1.2だと、Railsバージョン確認でエラーが出る)
gem install rails -v 3.0
Railsバージョン確認
rails -v
Rails 3.0.0
以上でRailsのインストールが完了する。
できればRails3.1を使いたかったのだが、今回は妥協した。
CheckInstallの導入方法
以下Railsインストール手順
あらかじめ必要なパッケージをインストール
yum install gcc gcc-c++ make perl zlib-devel openssl-devel readline-devel libxml2-devel bzip2-devel unzip libjpeg-devel libpng-devel freetype-devel rpm-build -y
Rubyソースコードをダウンロード(ruby-1.9.3-p0だと、Gemがうまく動作しない)
wget http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.bz2
アーカイブを展開
tar xjf ruby-1.9.2-p290.tar.bz2
コンパイルしてCheckInstallでRPMパッケージ化
cd ruby-1.9.2-p290
./configure
make
make
checkinstall -R --fstrans=no
・・・途中でいろいろ聞かれるが、EnterキーでOK
RPMパッケージからrubyをインストール
cd /usr/src/redhat/RPMS/i386/
rpm ivh ruby-1.9.2-p290-1.i386.rpm
Rubyのバージョンを確認。rpm ivh ruby-1.9.2-p290-1.i386.rpm
ruby -v
ruby 1.9.2p290 (2011-07-09 revision 32553) [i686-linux]
Gemのバージョン確認。
gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
Railsインストール。(バージョン3.1.2だと、Railsバージョン確認でエラーが出る)
gem install rails -v 3.0
Railsバージョン確認
rails -v
Rails 3.0.0
以上でRailsのインストールが完了する。
できればRails3.1を使いたかったのだが、今回は妥協した。
登録:
投稿 (Atom)