How to draw a distance map with Ruby

Hi!

I have been scratching my head over this and thought someone here can
help me out:

I have a number of data points that I want to plot in a 2 or 3d space
based on pairwise distances. I do have the distances, but frankly no
idea of how to do the mapping/plotting.

I am not necessarily looking for a complete solution - but would be
grateful if someone could point me in the right direction (tutorials or
which methods to use in ruby…)

Cheers,

Marc

On Mon, Jun 2, 2008 at 7:12 PM, Marc H.
[email protected] wrote:

grateful if someone could point me in the right direction (tutorials or
which methods to use in ruby…)

Cheers,

Marc

Posted via http://www.ruby-forum.com/.

I am just examining RubyDCL (ruby-dcl-1.5.3). May be you will find
something useful there.

Prasad

-------- Original-Nachricht --------

Datum: Tue, 3 Jun 2008 01:23:08 +0900
Von: “G.Durga P.” [email protected]
An: [email protected]
Betreff: Re: How to draw a distance map with Ruby

I am just examining RubyDCL (ruby-dcl-1.5.3). May be you will find
something useful there.

Prasad

Dear Marc,

maybe you can use RGL in some way:

http://rgl.rubyforge.org/rgl/index.html

There is some care taken of the distance in the second example
module_graph.jpg,
not yet what you asked for, but there’s a description language, ‘dot’,
associated to the
project, which might be tweakable into what you asked for.

Best regards,

Axel

I wonder if I stop using perl and start using Ruby.
1-Can ruby programs create Guis much like C# and VB.NET?
2-Can ruby programs be turned into .exe files if needed?
3-Does Ruby support regexp like Perl does?
4-If Ruby as good as perl is when processing text?
5-Does ruby have anything like associative arrays?

Feedback needed

Joe

On Mon, Jun 2, 2008 at 5:54 PM, joseph collins [email protected]
wrote:

I wonder if I stop using perl and start using Ruby.
1-Can ruby programs create Guis much like C# and VB.NET?

That’s a vague question, but the answer: probably not the same kind of
GUI API you’re thinking of.

2-Can ruby programs be turned into .exe files if needed?

Yes. But that’s Windows, so your question misses a large user base.

3-Does Ruby support regexp like Perl does?

I’m going to go with Yes on this one. There are differences between
releases, though (look behind capabilities, etc.)

4-If Ruby as good as perl is when processing text?

Depends on the programmer.

5-Does ruby have anything like associative arrays?

This last question will have many ruby programmers silently biting
their teeth. You may not have done your homework. For Giggles and
Sits…

h = {}

Feedback needed

Joe

A bunch of articles that spear, roast, and slice these questions –
complete with gravy – frequent a simple google search. Funny, I
didn’t think I would ever say that.

hth,
Todd

joseph collins wrote:

I wonder if I should stop using perl and start using Ruby. I need inputfrom the Ruby programmers:

1-Can ruby programs create Guis much like C# and VB.NET?

Yes. I suggest using JRuby + Monkeybars for maximum power + most ease
of use.

But there’s also Fx, Tk, a few other options.

2-Can ruby programs be turned into .exe files if needed?

Um, depends on what you mean.

There is rubyscript2exe that bundles up your code + a Ruby interpreter
in a self-executing file, and using JRuby + the rawr lib you can easily
create distributable executable files for distribution, but these are
not actually turning Ruby code into native code.

3-Does Ruby support regexp like Perl does?

Yes, though not exactly as Perl does. Some small syntax variance.

4-If Ruby as good as perl is when processing text?

I think so. Don’t see why not, but I haven’t used perl in 4 years.

5-Does ruby have anything like associative arrays?

yes. We call them hashes.


James B.

“I can see them saying something like ‘OMG Three Wizards Awesome’”

joseph collins wrote:

I wonder if I should stop using perl and start using Ruby.

Probably not. Perl has certain advantages, not the least of which is the
fact that you know it.

I need input from the Ruby programmers:

1-Can ruby programs create Guis much like C# and VB.NET?

There are quite a few GUI toolkits for Ruby. A Frequently Asked Question
here is “which one is the best?” And the answer is usually “it depends.”

2-Can ruby programs be turned into .exe files if needed?

Probably not as easily as Perl programs can.

3-Does Ruby support regexp like Perl does?

Yes.

4-If Ruby as good as perl is when processing text?

Yes.
5-Does ruby have anything like associative arrays?

Yes.
Feedback needed - thanks! Joe


Change the world with e-mail. Join the i’m Initiative from Microsoft.
http://im.live.com/Messenger/IM/Join/Default.aspx?source=EML_WL_ChangeWorld

Just out of curiosity, are you at Microsoft? There’s something called
IronRuby from Microsoft that runs Ruby on the CLR – it might be just
what you’re looking for. As far as I know, there’s no “IronPerl”,
although there is an IronPython, to throw another language into the mix.
:slight_smile:

-------- Original-Nachricht --------

Datum: Tue, 3 Jun 2008 07:54:57 +0900
Von: joseph collins [email protected]
An: [email protected]
Betreff: Re: How to draw a distance map with Ruby

Joe
Joe,

when posting to this list, please don’t hijack other people’s threads…

Best regards,

Axel

I wonder if I should stop using perl and start using Ruby. I need
inputfrom the Ruby programmers:1-Can ruby programs create Guis much like
C# and VB Shop ruby programs be turned into .exe files if
needed?3-Does Ruby support regexp like Perl does?4-If Ruby as good as
perl is when processing text?5-Does ruby have anything like associative
arrays? Feedback needed - thanks! Joe

On Tue, Jun 3, 2008 at 2:49 AM, joseph collins [email protected]
wrote:

4-If Ruby as good as perl is when processing text?

More or less. The Perl convention of having empty string and 0 mean
false and the automatic conversion between numbers and strings
sometimes makes text processing in Perl a bit more convenient; on the
other hand, the convention in Ruby makes most other things more
convenient.

Eivind.

On Tue, Jun 3, 2008 at 4:33 AM, M. Edward (Ed) Borasky
[email protected] wrote:

joseph collins wrote:

I wonder if I should stop using perl and start using Ruby.

Probably not. Perl has certain advantages, not the least of which is the
fact that you know it.
Not stopping perl is ok; not starting Ruby might be a missed
opportunity though, well of course only you can decide about your
available time.

Cheers
Robert

Thanks - that is what I wanted to hear…I have used perl heavily and
it has served me well.
I will look further into Ruby.

Joe