Forum: Ruby nmap-0.1.0 (narray + mmap = persistant grids)

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 Ara.T.Howard (Guest)
on 2007-02-28 22:05
(Received via mailing list)
NAME

   nmap (reference ruby class which combines narray and mmap)
   na_str (c extension)

REQUIREMENTS

   mmap : http://moulon.inra.fr/ruby/mmap.html
   narray : http://narray.rubyforge.org/

URIS

   http://codeforpeople.com/lib/ruby/nmap/


SYNOPSIS

   na_str is designed to allow data sharing between narray object and
other ruby
   objects.  the shared data is that returned by the objects to_s or
to_str method
   and rb_string_new4.  using this technique memory mapped (using guy's
mmap
   extensions) data can be altered with no explicit io on the users part
and
   partial changed to numerical grids can occur very quickly and
persistently.

   the nmap.rb reference impl is a concrete example of this usage and is
   included in the distribution.


EXAMPLE USAGE

     jib:~/eg/ruby/na_str > cat a.rb
     #
     # the nmap extension is installed along with na_str
     #
       require 'nmap'
     #
     # the NMap ctor interface is similar to NArray's, but a backing
file must also
     # be specified
     #
       path, x, y = 'int.data', 3, 4
       nmap = NMap.int path, x, y
     #
     # copy the last row to the first
     #
       nmap.na[true, 0] = nmap.na[true, 3]
     #
     # set the last row to be the current time.  if you run this a few
times you'll
     # notice that changes to the narray are automatically written to
the to
     # backing file via the magic of mmap
     #
       nmap.na[true, 3] = Time.now.to_i
     #
     # show the narray
     #
       p nmap.na


   jib:~/eg/ruby/na_str > ruby a.rb
   NArray(ref).int(3,4):
   [ [ 0, 0, 0 ],
     [ 0, 0, 0 ],
     [ 0, 0, 0 ],
     [ 1151439012, 1151439012, 1151439012 ] ]

   jib:~/eg/ruby/na_str > ruby a.rb
   NArray(ref).int(3,4):
   [ [ 1151439012, 1151439012, 1151439012 ],
     [ 0, 0, 0 ],
     [ 0, 0, 0 ],
     [ 1151439014, 1151439014, 1151439014 ] ]


SPEED

   jib:~/eg/ruby/na_str > cat a.rb
   #
   # reference impl installed with na_str
   #
     require 'nmap'
   #
   # setup a narray grid containing 1 gb of ints
   #
     gb = 2 ** 30
     mb = 2 ** 20
     sizeof_int = [42].pack('i').size
     gig_of_ints = gb / sizeof_int
     nmap = NMap.int '1GB',  gig_of_ints
   #
   # set about 1 million of the ints to 42
   #
     nmap.na[0 .. mb] = 42
   #
   # show that the data was written
   #
     p nmap.na[mb - 1]


   jib:~/eg/ruby/na_str > time ruby a.rb
   42

   real    0m0.078s
   user    0m0.020s
   sys     0m0.020s


   jib:~/eg/ruby/na_str > ls -ltar 1GB
   -rw-rw-r--    1 ahoward  ahoward  1073741824 Jun 27 14:28 1GB


highly experimental.  enjoy.

-a
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2007-02-28 23:17
(Received via mailing list)
Ara.T.Howard wrote:
>
> NAME
>
>   nmap (reference ruby class which combines narray and mmap)

Ara, have you considered a name that won't get confused with the nmap
utility? Someone might want to write a ruby-nmap for port scanning etc.
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2007-03-01 00:13
(Received via mailing list)
On Thu, 1 Mar 2007, Joel VanderWerf wrote:

> Ara.T.Howard wrote:
>>
>> NAME
>>
>>   nmap (reference ruby class which combines narray and mmap)
>
> Ara, have you considered a name that won't get confused with the nmap
> utility? Someone might want to write a ruby-nmap for port scanning etc.

um.  no.  never heard of that!  suggestions?

na_map?

-a
3f91cf60c92b20940674ebdeb46f6582?d=identicon&s=25 Brian Smith (praufet)
on 2007-03-01 00:17
(Received via mailing list)
memray?
47b1910084592eb77a032bc7d8d1a84e?d=identicon&s=25 Joel VanderWerf (Guest)
on 2007-03-01 00:20
(Received via mailing list)
ara.t.howard@noaa.gov wrote:
>
> um.  no.  never heard of that!  suggestions?
>
> na_map?

amap

num_map

narray_map

array_map

virtual_array
F9c5973e7d1eb451754426dfe955fb59?d=identicon&s=25 John Mettraux (Guest)
on 2007-03-01 00:22
(Received via mailing list)
2007/3/1, Joel VanderWerf <vjoel@path.berkeley.edu>:
> >> utility? Someone might want to write a ruby-nmap for port scanning etc.
> >
> > um.  no.  never heard of that!  suggestions?
> >
> > na_map?
>
> amap
> ...

n-ara-map ?
4d5b5dd4e263d780a5dfe7ac8b8ac98c?d=identicon&s=25 Tim Pease (Guest)
on 2007-03-01 00:42
(Received via mailing list)
On 2/28/07, John Mettraux <jmettraux@openwfe.org> wrote:
> > >> Ara, have you considered a name that won't get confused with the nmap
>
pnarray  (sounds like canary but with a 'p')

for persistent narray

TwP
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2007-03-01 05:25
(Received via mailing list)
On Thu, 1 Mar 2007, William Smith wrote:

> memray?

ohhhh.  i like.

maybe

   memarray


-a
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2007-03-01 05:25
(Received via mailing list)
On Thu, 1 Mar 2007, William Smith wrote:

> memray?

or just

marray


-a
4feed660d3728526797edeb4f0467384?d=identicon&s=25 Bill Kelly (Guest)
on 2007-03-01 06:37
(Received via mailing list)
From: <ara.t.howard@noaa.gov>
> On Thu, 1 Mar 2007, William Smith wrote:
>
>> memray?
>
> or just
>
> marray

Sounds good... "vmarray" is probably too literalist  :D



Regards,

Bill
852a62a28f1de229dc861ce903b07a60?d=identicon&s=25 Gavin Kistner (phrogz)
on 2007-03-01 07:26
(Received via mailing list)
On Feb 28, 9:24 pm, ara.t.how...@noaa.gov wrote:
> On Thu, 1 Mar 2007, William Smith wrote:
> > memray?
>
> ohhhh.  i like.

"Meeeemray
All alone, in the moonlight.
I can smile at the old days.
When my tests were not Zen.

I remember
The time I knew not what Narrays were
Let the memray live again"
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2007-03-01 08:11
(Received via mailing list)
On Thu, 1 Mar 2007, Phrogz wrote:

>
> I remember
> The time I knew not what Narrays were
> Let the memray live again"
>
>

LOL!

-a
5da4c52f43677f395aff5bde775593c2?d=identicon&s=25 Daniel Schierbeck (dasch)
on 2007-03-01 10:06
(Received via mailing list)
On Thu, 2007-03-01 at 13:25 +0900, ara.t.howard@noaa.gov wrote:
> On Thu, 1 Mar 2007, William Smith wrote:
>
> > memray?
>
> or just
>
> marray
 Well, array -> ary, so:

  mary

?


Cheers,
Daniel
Ae16cb4f6d78e485b04ce1e821592ae5?d=identicon&s=25 Martin DeMello (Guest)
on 2007-03-01 11:54
(Received via mailing list)
On 3/1/07, Daniel Schierbeck <daniel.schierbeck@gmail.com> wrote:
>   mary
mnemmap

martin
753dcb78b3a3651127665da4bed3c782?d=identicon&s=25 Brian Candler (Guest)
on 2007-03-01 12:50
(Received via mailing list)
On Thu, Mar 01, 2007 at 07:53:57PM +0900, Martin DeMello wrote:
> >
> >  mary
>
> mnemmap

do dooo, di do-do...
Cb48ca5059faf7409a5ab3745a964696?d=identicon&s=25 unknown (Guest)
on 2007-03-01 16:07
(Received via mailing list)
On Thu, 1 Mar 2007, Martin DeMello wrote:

>>
>>   mary
>
> mnemmap

eminmap ?? ;-)

-a
96931bfe0c2948f47a98e15ae52e5637?d=identicon&s=25 Chris Carter (cdcarter)
on 2007-03-01 23:10
(Received via mailing list)
On 3/1/07, ara.t.howard@noaa.gov <ara.t.howard@noaa.gov> wrote:
> >> > marray
> be kind whenever possible... it is always possible.
> - the dalai lama
>
>

eigenmap?
Fd22ee3cfc7dac283ce8e451af324f7d?d=identicon&s=25 Chad Perrin (Guest)
on 2007-03-02 00:27
(Received via mailing list)
On Fri, Mar 02, 2007 at 07:10:29AM +0900, Chris Carter wrote:
>
> eigenmap?

One of these days, we'll have to name something eigeneigen.
4d5b5dd4e263d780a5dfe7ac8b8ac98c?d=identicon&s=25 Tim Pease (Guest)
on 2007-03-02 01:57
(Received via mailing list)
On 3/1/07, Chad Perrin <perrin@apotheon.com> wrote:
> On Fri, Mar 02, 2007 at 07:10:29AM +0900, Chris Carter wrote:
> >
> > eigenmap?
>
> One of these days, we'll have to name something eigeneigen.
>

eigeneigen = lambda {|obj| class << obj; class << self; self; end; end}

Should I make a gem?

TwP
E7559e558ececa67c40f452483b9ac8c?d=identicon&s=25 Gary Wright (Guest)
on 2007-03-02 02:05
(Received via mailing list)
On Mar 1, 2007, at 6:26 PM, Chad Perrin wrote:

> On Fri, Mar 02, 2007 at 07:10:29AM +0900, Chris Carter wrote:
>>
>> eigenmap?
>
> One of these days, we'll have to name something eigeneigen.

Here we go eigen.

Gary Wright
Fd22ee3cfc7dac283ce8e451af324f7d?d=identicon&s=25 Chad Perrin (Guest)
on 2007-03-02 02:17
(Received via mailing list)
On Fri, Mar 02, 2007 at 09:56:38AM +0900, Tim Pease wrote:
> Should I make a gem?
Sure.  Make sure you create some documentation.
This topic is locked and can not be replied to.