[#408634] How do I make lots of classes aware of each other? — "Andrew S." <lists@...>

I'm apparently missing something fundamental in my knowledge of classes

10 messages 2013/07/02

[#408712] Ruby web service with REST support — "Shubhada S." <lists@...>

Hi All,

17 messages 2013/07/05

[#408812] create variables depending on counter — stefan heinrich <lists@...>

Hi community,

21 messages 2013/07/09

[#408854] execute commands within SMTP email code: send content in variables and not actual variables — dJD col <lists@...>

I am trying to send an email using the code below. I am able to send the

9 messages 2013/07/10

[#409031] tap { break } idiom deserves its own Kernel method? — Andy Lowry <lists@...>

I use this idiom from time to time:

13 messages 2013/07/22

[#409072] Link To Masses Of External Data In Openoffice? — "Austin J." <lists@...>

This is what I want to do.

19 messages 2013/07/23
[#409102] Re: Link To Masses Of External Data In Openoffice? — Tamara Temple <tamouse.lists@...> 2013/07/24

[#409103] Re: Link To Masses Of External Data In Openoffice? — "Austin J." <lists@...> 2013/07/25

tamouse m. wrote in post #1116598:

[#409122] Re: Link To Masses Of External Data In Openoffice? — Tamara Temple <tamouse.lists@...> 2013/07/26

[#409142] Re: Link To Masses Of External Data In Openoffice? — "Austin J." <lists@...> 2013/07/26

tamouse m. wrote in post #1116750:

[#409073] class <=> module — Bráulio Bhavamitra <lists@...>

Hello all,

17 messages 2013/07/23

[#409104] Ruby newbie question on Methods (NoMethoderror) — "Crispian A." <lists@...>

I have recently started learning ruby and so I am writing a small little

10 messages 2013/07/25

[#409170] Working through Ch.10 for learning to program 2.0 (Chris Pine) — JD JD <lists@...>

So, I have been working through this book, and have been doing ok up

33 messages 2013/07/28
[#409195] Re: Working through Ch.10 for learning to program 2.0 (Chris Pine) — Harry Kakueki <list.push@...> 2013/07/29

I tried this and came up with a one-liner that seems to do it. It sorts the

[#409258] WATIR - ScriptError popup on IE - Unable to get rid of! — Graeme Halls <lists@...>

I am new to Ruby & Watir, and I am having a nightmare with IE and Script

11 messages 2013/07/31

Re: Faster primality testing and factorization methods in Ruby

From: Matthew Kerwin <lists@...>
Date: 2013-07-30 05:05:46 UTC
List: ruby-talk #409218
I get the following, on an Ubuntu 64-bit VM (edited to fit the page 
width):

prime.rb:44: warning: assigned but unused variable - rescnt
prime.rb:85: warning: assigned but unused variable - rescnt
prime.rb:119: warning: assigned but unused variable - rescnt
prime.rb:159: warning: assigned but unused variable - rescnt
prime.rb:165: warning: assigned but unused variable - modk
prime.rb:212: warning: shadowing outer local variable - p
Rehearsal -------------------------------------------------
prime tests for P = 20000000000000003
Miller-Rabin    0.000000   0.000000   0.000000 (  0.000761)
primzp7?        2.290000   0.000000   2.290000 (  2.294709)
primzp7a?       0.970000   0.000000   0.970000 (  0.971033)
primzp7b?       0.980000   0.000000   0.980000 (  0.978331)
primzp? 13      1.900000   0.010000   1.910000 (  1.905374)
primzp? 17      1.870000   0.000000   1.870000 (  1.877343)
primzpa? 13     3.200000   0.050000   3.250000 (  3.255519)
primzpa? 17     3.100000   0.040000   3.140000 (  3.127512)
factorzp 13     1.940000   0.000000   1.940000 (  1.949376)
factorzp 17     1.870000   0.000000   1.870000 (  1.870068)
prime? [ruby lib]
                26.550000   0.010000  26.560000 ( 26.569130)
prime_division [ruby lib]
                29.570000   0.000000  29.570000 ( 29.585618)
---------------------------------------- total: 74.350000sec

                user     system      total        real
prime tests for P = 20000000000000003
Miller-Rabin    0.000000   0.000000   0.000000 (  0.000562)
primzp7?        2.320000   0.000000   2.320000 (  2.319329)
primzp7a?       0.980000   0.000000   0.980000 (  0.974572)
primzp7b?       0.980000   0.000000   0.980000 (  0.984110)
primzp? 13      1.920000   0.000000   1.920000 (  1.923894)
primzp? 17      1.880000   0.010000   1.890000 (  1.884494)
primzpa? 13     3.080000   0.030000   3.110000 (  3.109670)
primzpa? 17     3.010000   0.020000   3.030000 (  3.028406)
factorzp 13     1.910000   0.000000   1.910000 (  1.917429)
factorzp 17     1.880000   0.000000   1.880000 (  1.875251)
prime? [ruby lib]
                25.170000   0.000000  25.170000 ( 25.177364)
prime_division [ruby lib]
                28.270000   0.020000  28.290000 ( 28.298034)

[Kiswono Prayogo, note the durations, especially in the core methods; 
10s is too short for calculating primality of large numbers. Have 
patience.]

Note that all the warnings can be resolved by removing the unused 
definitions, and renaming that 'p' variable in the block.  They're 
messy, but unimportant.

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

In This Thread