[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

rubyhacker

1/31/2006 8:53:00 PM

I was trying to use memoize the other day (v 1.2 from Dan Berger --
is there a different/better one?). Ran into some problems...

In this dumb example, where I'm passing the same parameter every time,
the speed should *blaze*, should it not?

This doesn't work for me. I see no measurable speed difference in these
three cases. What am I doing wrong?


Thanks,
Hal


require 'memoize'

include Memoize

def zeta(x)
r2d = 360.0/(2.0*Math::PI) # Radians to degrees
2.0*(Math.sin(x/r2d))*(Math.cos(x/r2d))
end

puts Time.now
1000000.times { z = zeta(2.0) }
puts Time.now

memoize(:zeta)

puts Time.now
1000000.times { z = zeta(2.0) }
puts Time.now

memoize(:zeta,"z.cache")

puts Time.now
1000000.times { z = zeta(2.0) }
puts Time.now

2 Answers

Hal E. Fulton

2/2/2006 6:16:00 AM

0

rubyhacker@gmail.com wrote:
> I was trying to use memoize the other day (v 1.2 from Dan Berger --
> is there a different/better one?). Ran into some problems...

Ignore this post -- I made it 48 hours or so ago. A gateway glitch
delayed it, I guess.


Hal






maz

7/28/2008 9:22:00 AM

0

On 25 Jul., 20:15, Deborah <debo...@modabelam.com> wrote:
> On Fri, 25 Jul 2008 03:27:50 -0700 (PDT),maz<m...@solcon.nl> wrote:
> >On 25 jul, 12:14, "Pieter" <hrdou...@zonnet.nl> wrote:
> >> "Deborah" <debo...@modabelam.com> schreef in berichtnews:jjli84h1i7loh7aqnu5jtlvum3qdm5u8qj@4ax.com...
>
> >> > On Fri, 25 Jul 2008 00:58:12 +0200, "maz" <m...@solcon.nl_> wrote:
>
> >> >>>who are you to whom the Course is given
>
> >> >>I think the "you" to whom the course is given is the "you" who
> >> >>believes it has left God. <<
>
> >> >>Thus, a member of the Sonship,
> >> >>which now is one of the separated ones,
> >> >>to return under Guidance of the leader
> >> >>of the Atonement, distinct and as one
> >> >>with all other members of the Sonship.
>
> >> >>IOW, the you is the Soul. ?
>
> >> > Not exactly the soul, I don't think. The mind, which is the only
> >> > creative (or miscreative level). My impression is that nothing can
> >> > change with the soul, which is already fully created, but the mind can
> >> > go awry.
>
> >> The passage which says that "mind is the
> >> only creative level", is in the context of
> >> using *the mind* to heal, instead of
> >> physical means. Here with "mind" the Soul
> >> is included, since it is from the Soul that it
> >> derives its whole power to create:
>
> >> "707. The mind DID divide itself when it willed to create
> >> its own levels AND the ability to perceive them. But it
> >> could NOT entirely separate itself from the Soul, because
> >> *it is FROM the Soul that it derives its whole power to create*."
> >> (T-3.IV.5:8-9)
>
> >1734. [...] For you DO have control over your mind, for the mind is
> >the mechanism of decision.
>
> >OK, Deborah says the "you" is the mind. Who are you who has control
> >over your mind?
>
> >thanks,maz
>
> You do not think the mind can have control over itself?

Like, I have control over myself, for I am the mechanism of decision?

namazté