Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

2007/09/10

ruby-gsl on windows - cygwin howto



I wanted to use gruff. But it seems that doesn't support complex math functions. So I decided to choose gnuplot and gsl which turned out pretty confusing, especially on cygwin. I googled all day to find out how to invoke gem command on cygwin(Yeah. I was fool.) Anyway here is what I've found. I hope this will help you too.

1. installing cygwin including gnuplot and gsl
(http://www2.warwick.ac.uk/fac/sci/moac/currentstudents/peter_cock/cygwin/part5/)

Default permissions

As mentioned in http://cygwin.com/ml/cygwin/2006-01/msg00257.html, the default permissions for a Cygwin installation are rwxrwxrwx. Even if you don't care about the security implications, Ruby does. You might get sick of seeing Ruby make complaints like:

warning: Insecure world writable dir /usr/local/bin, mode 040777

The directory and exact mode may differ, but you'll need to chmod o-w the directory in question. Here's the minimal set of changes I needed to make to keep Ruby quiet:

chmod o-w /usr/local/bin
chmod o-w /usr/local
chmod o-w /usr
chmod o-w /etc
chmod o-w /usr/sbin
chmod o-w /usr/bin
chmod o-w /usr/X11R6/bin
chmod o-w /usr/X11R6
chmod o-w /cygdrive/c

Of course, this still leaves every binary on your system world-writable. Strangely, Ruby's happy to run world-writable binaries, as long as the directory they're in isn't world-writable.



2. If your want to use gem properly on cygwin, you need to alias commands.
home/.bashrc contains a set of aliases

# Force the c:/ruby version to be found first
PATH=/cygdrive/c/ruby/bin:$PATH

alias autotest='ruby /ruby/bin/autotest'
alias cap='ruby /ruby/bin/cap'
alias gem='ruby /ruby/bin/gem'
alias rake='ruby /ruby/bin/rake'
alias rcov='ruby /ruby/bin/rcov'
alias ruby='/cygdrive/c/ruby/bin/ruby'
alias specrb='ruby /ruby/bin/specrb'

3. installing ruby-gsl
http://ruby-gsl.sourceforge.net/
- download ruby-gsl
- ./configure
- make
- make install

4. Happy coding.

If you have some troubles such as "permission denied" while installing plotutils,
check this article =>
http://ptolemy.eecs.berkeley.edu/~cxh/ptpub/nt/ptntinstall.html

I've installed gem on cygwin.
unset RUBYOPT
chmod -R a+w /usr/lib/ruby/site_ruby/1.8/rubygems
ruby setup.rb
(no more permission denied Errorno:EACCES)

And I followed this article.
http://www.gfd-dennou.org/arch/ruby/

2007/02/03

Algorithms in the Attic



This article was posted on HBR this month.

One reason why math is important at this timing.

"For a powerful perspective on future business, take a hard look at mathematics past. As computing gets ever faster and cheaper, yesterday’s abstruse equations are becoming platforms for tomorrow’s breakthroughs. Companies in several industries are now dusting off these formulas and putting them in the service of new products and processes."

"Why should past work, often quite theoretical, be so useful now? Done in the absence of high-speed, low-cost computational capacity, that work put a premium on imaginative quantitative thinking. With today’s high-powered processors and broadband networks, those abstractions can point the way to practical software that leaps over current operational constraints.Disruptive opportunities abound."

2007/01/28

Doing math.


Well, it's not that easy to say I'm not good at math. Since I realized math is the core of Alogrithm, I had to study it from the basic(actually, from highschool level). When I first gone through downloaded course which was about differential and integral calcus, I was so humiliated by my ignorance about math. For math is a tool for analyzing agolrithms, it's inevitable to study them.