Good code examples

(Pierre Barbier de Reuille) #1

Hello,

I'm very new to ruby, and I would like to know if there is some
applications known to be well coded in "rubysh style" that I can learn
from. What I would like to see is Ruby in scientific computing,
application design (i.e. I'm not very interested in Web applications) or
glue language (i.e. extension of some other application of ruby being
heavily extended using other languages).

Thanks for your help,

Pierre

(Ara.T.Howard) #2

i'm doing alot of stuff - mostly little image processing tasks. can you
define what you mean by 'scientific computing'. many people mean numerical
computing by that, but of course there are worlds of scientific programming
that are not numerical in nature. you may find this interesting:

   http://sciruby.codeforpeople.com/
   http://sciruby.codeforpeople.com/sr.cgi/InterestingProjects
   http://sciruby.codeforpeople.com/sr.cgi/InterestingPeople

and example of some coding used for science that is not 'numerical'

   http://raa.ruby-lang.org/project/rq/
   http://www.linuxjournal.com/article/7922

btw. welome to the ruby group!

cheers.

-a

···

On Thu, 1 Sep 2005, Pierre Barbier de Reuille wrote:

Hello,

I'm very new to ruby, and I would like to know if there is some applications
known to be well coded in "rubysh style" that I can learn from. What I would
like to see is Ruby in scientific computing, application design (i.e. I'm
not very interested in Web applications) or glue language (i.e. extension of
some other application of ruby being heavily extended using other
languages).

Thanks for your help,

Pierre

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

(J-Van) #3

There should be a lot of code out there on Ruby extensions written in C.

···

On 8/31/05, Pierre Barbier de Reuille <pierre.barbier@cirad.fr> wrote:

Hello,

I'm very new to ruby, and I would like to know if there is some
applications known to be well coded in "rubysh style" that I can learn
from. What I would like to see is Ruby in scientific computing,
application design (i.e. I'm not very interested in Web applications) or
glue language (i.e. extension of some other application of ruby being
heavily extended using other languages).

(Barbier de Reuille) #4

Dans l'article <Pine.LNX.4.62.0508311529190.29620@harp.ngdc.noaa.gov>,
Ara.T.Howard a écrit :

Hello,

I'm very new to ruby, and I would like to know if there is some applications
known to be well coded in "rubysh style" that I can learn from. What I would
like to see is Ruby in scientific computing, application design (i.e. I'm
not very interested in Web applications) or glue language (i.e. extension of
some other application of ruby being heavily extended using other
languages).

Thanks for your help,

Pierre

i'm doing alot of stuff - mostly little image processing tasks. can you
define what you mean by 'scientific computing'. many people mean numerical
computing by that, but of course there are worlds of scientific programming
that are not numerical in nature. you may find this interesting:

   http://sciruby.codeforpeople.com/
   http://sciruby.codeforpeople.com/sr.cgi/InterestingProjects
   http://sciruby.codeforpeople.com/sr.cgi/InterestingPeople

and example of some coding used for science that is not 'numerical'

   http://raa.ruby-lang.org/project/rq/
   http://www.linuxjournal.com/article/7922

btw. welome to the ruby group!

cheers.

-a

Thanks, that was exactly the kind of ressources I was looking for ! I'm
very interested in numerical computing, but not only :slight_smile:

My main interest is on structural computing (applied to biology) but it
uses a lot of numerical computation :wink:

By the way, does anybody knows if there is some kind of GNU R ruby
binding ? If not it may be a good project as I think I can begin easily
and improve it slowly ...

Pierre

···

On Thu, 1 Sep 2005, Pierre Barbier de Reuille wrote:

--
BOFH excuse #262:

Our POP server was kidnapped by a weasel.

(Dave Burt) #5

Joe Van Dyk suggested that:

There should be a lot of code out there on Ruby extensions written in C.

Pierre, check out the standard library, which comes with Ruby.

YAML/Syck fits the glue/extension category - Syck is a C extension, YAML is
the part written in Ruby.

You can also quickly and easily write wrappers for binary libraries in pure
Ruby, using the DL library. There are no examples of that in the standard
libary, I think, but they exist on RAA, and I can send you one I made for
AutoIt for Windows if you're interested. (Wrapping AutoIt this way is
redundant, because it provides a COM interface.)

You might also want to check out the Ruby Quiz, which is mostly not that
scientific, but includes different people writing code for the same goal,
and a summary of the solutions given; see what titles strike you at
http://www.rubyquiz.com

Cheers,
Dave

(Ara.T.Howard) #6

Thanks, that was exactly the kind of ressources I was looking for ! I'm very
interested in numerical computing, but not only :slight_smile:

great - you'll find ruby a treat then.

My main interest is on structural computing (applied to biology) but it uses
a lot of numerical computation :wink:

can you elaborate? i'm not biologist :wink:

By the way, does anybody knows if there is some kind of GNU R ruby binding ?
If not it may be a good project as I think I can begin easily and improve it
slowly ...

http://raa.ruby-lang.org/project/ruby-rmathlib/

but i have not used it

-a

···

On Thu, 1 Sep 2005, Barbier de Reuille wrote:
--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================

(Barbier de Reuille) #7

Dans l'article <RMsRe.18439$FA3.3660@news-server.bigpond.net.au>, Dave
Burt a écrit :

Joe Van Dyk suggested that:

There should be a lot of code out there on Ruby extensions written in C.

Pierre, check out the standard library, which comes with Ruby.

YAML/Syck fits the glue/extension category - Syck is a C extension, YAML is
the part written in Ruby.

You can also quickly and easily write wrappers for binary libraries in pure
Ruby, using the DL library. There are no examples of that in the standard
libary, I think, but they exist on RAA, and I can send you one I made for
AutoIt for Windows if you're interested. (Wrapping AutoIt this way is
redundant, because it provides a COM interface.)

You might also want to check out the Ruby Quiz, which is mostly not that
scientific, but includes different people writing code for the same goal,
and a summary of the solutions given; see what titles strike you at
http://www.rubyquiz.com

Cheers,
Dave

Great, this seems a good code database to look at :slight_smile:
And also I can try first the quizz and compare what I do with what
others do ... Thanks a lot, I also will have a look at the libraries
your talking about.

Cheers,

Pierre

···

--
BOFH excuse #374:

Its the InterNIC's fault.

(Barbier de Reuille) #8

Dans l'article <Pine.LNX.4.62.0508311740230.29620@harp.ngdc.noaa.gov>,
Ara.T.Howard a écrit :

Thanks, that was exactly the kind of ressources I was looking for ! I'm very
interested in numerical computing, but not only :slight_smile:

great - you'll find ruby a treat then.

My main interest is on structural computing (applied to biology) but it uses
a lot of numerical computation :wink:

can you elaborate? i'm not biologist :wink:

Well, I'm working on some tissue growth. Tissues are here represented as
graph with nodes being cells and edges beeing the neighborhood
relationship. Computing the evoluation of this graph is largely
symbolic. However, you need to solve some ODE on this graph. Most of the
case these ODEs rule the concentrations of different proteins. Solving
these ODEs involve numerical computation.

Also, to study the structure of real tissues we extract quantitative
data from graph constructed using existing tissues. Once extracted we
can get some hundred or thousand data. We need statistical tools to
study them. And they're not easy (cyclic, spatial, ...) so we need tools
like GNU R and the big number of statistic libraries available.

By the way, does anybody knows if there is some kind of GNU R ruby binding ?
If not it may be a good project as I think I can begin easily and improve it
slowly ...

http://raa.ruby-lang.org/project/ruby-rmathlib/

but i have not used it

-a

Pierre

···

On Thu, 1 Sep 2005, Barbier de Reuille wrote:

--
BOFH excuse #431:

Borg implants are failing

(Ara.T.Howard) #9

these may be helpful, if the sovlers can be used. there are some good graph
libs out there too.

   http://ruby-gsl.sourceforge.net/
   http://alcaraz.home.cern.ch/alcaraz/RubyRoot/

cheers.

-a

···

On Thu, 1 Sep 2005, Barbier de Reuille wrote:

can you elaborate? i'm not biologist :wink:

Well, I'm working on some tissue growth. Tissues are here represented as
graph with nodes being cells and edges beeing the neighborhood relationship.
Computing the evoluation of this graph is largely symbolic. However, you
need to solve some ODE on this graph. Most of the case these ODEs rule the
concentrations of different proteins. Solving these ODEs involve numerical
computation.

Also, to study the structure of real tissues we extract quantitative data
from graph constructed using existing tissues. Once extracted we can get
some hundred or thousand data. We need statistical tools to study them. And
they're not easy (cyclic, spatial, ...) so we need tools like GNU R and the
big number of statistic libraries available.

--

email :: ara [dot] t [dot] howard [at] noaa [dot] gov
phone :: 303.497.6469
Your life dwells amoung the causes of death
Like a lamp standing in a strong breeze. --Nagarjuna

===============================================================================