[#66079] gc_sweep(): unknown data type 48 — Mauricio Fern疣dez <batsman.geo@...>

15 messages 2003/03/01
[#66082] Re: [BUG] gc_sweep(): unknown data type 48 — nobu.nokada@... 2003/03/01

Hi,

[#66085] Re: [BUG] gc_sweep(): unknown data type 48 — Mauricio Fern疣dez <batsman.geo@...> 2003/03/01

On Sat, Mar 01, 2003 at 07:26:58PM +0900, nobu.nokada@softhome.net wrote:

[#66088] Anything like Class::DBI from Perl — pw-googlegroups@... (Peter Wilkinson)

We've been doing some work using Class::DBI in Perl which makes access

17 messages 2003/03/01

[#66217] Prolly a simple question — <ghost-no-spam@...>

Sorry if these questions have come up before, but google searching hasn't

20 messages 2003/03/03

[#66245] TCPSocket delay problem — Seth Kurtzberg <seth@...>

Matz,

23 messages 2003/03/04

[#66269] OSCON — ptkwt@...1.aracnet.com (Phil Tomson)

For those coming to OSCON this year...

18 messages 2003/03/04

[#66315] system command expansion after PTY.spawn — Christian von Mueffling <cvm@...>

Hi!

13 messages 2003/03/05

[#66330] cookies in eruby mod_ruby — Daniel Bretoi <lists@...>

Can someone explain how to set/delete cookies using mod_ruby (eruby)?

13 messages 2003/03/06

[#66332] Russian Ruby resource and Ruby Course — leikind@... (Yuri Leikind)

Hi all,

19 messages 2003/03/06

[#66392] DRB and threads — Brian Candler <B.Candler@...>

I wonder if anyone can give me some hints on the interactions between dRuby

22 messages 2003/03/06
[#66417] Re: DRB and threads — "Robert Klemme" <bob.news@...> 2003/03/07

[#66421] Re: DRB and threads — Brian Candler <B.Candler@...> 2003/03/07

On Fri, Mar 07, 2003 at 07:15:29PM +0900, Robert Klemme wrote:

[#66449] Re: DRB and threads — ahoward <ahoward@...> 2003/03/08

On Fri, 7 Mar 2003, Brian Candler wrote:

[#66454] Re: DRB and threads — Brian Candler <B.Candler@...> 2003/03/08

On Sat, Mar 08, 2003 at 11:38:31AM +0900, ahoward wrote:

[#66440] Solving the 'strange language' documentation problem — "Josef 'Jupp' Schugt" <jupp@...>

Dear Rubyists,

18 messages 2003/03/07

[#66466] I'm to give short talk on ruby at work, anybody have material/outlines they can donate/ — Sam Roberts <sroberts@...>

10 messages 2003/03/08

[#66469] What character sets are available in Ruby ? — peterjohannsen@... (pj)

There is a Ruby FAQ which I read that said that Ruby only supports

17 messages 2003/03/08

[#66522] Thinking of learning Ruby — "anonimous" <n.thomp@...>

I have abour 3 or 4 years experience with Linux, and about 2 years

45 messages 2003/03/10

[#66530] Protocols — "Ray Capozzi" <Ray_Capozzi@...>

Is there a preferred set of ruby libraries for client/server solutions? As

26 messages 2003/03/10
[#66533] Re: Protocols — "MikkelFJ" <mikkelfj-anti-spam@...> 2003/03/10

[#66548] Re: Protocols — <jbritt@...> 2003/03/10

> "Ray Capozzi" <Ray_Capozzi@hotmail.com> wrote in message

[#66633] Threads and DRb — "Hal E. Fulton" <hal9000@...>

I changed the title here because this is not

16 messages 2003/03/10

[#66805] Ruby newbie uninstall question? — "Colin Coates" <colin@...>

Hello Everyone,

12 messages 2003/03/12

[#66850] Ruby / Eiffel ? — <cailloux@...>

Hello evry body

23 messages 2003/03/13

[#66906] Syck 0.08 -- Next-generation of YAML.rb — why the lucky stiff <yaml-core@...>

citizens,

21 messages 2003/03/14
[#66931] Re: [ANN] Syck 0.08 -- Next-generation of YAML.rb — Richard Kilmer <rich@...> 2003/03/14

Works great under OS X and Ruby 1.8!

[#66927] dynamically create a method — Rudolf Polzer <abuse@...>

Is there a possiblilty to dynamically create a method, like this?

14 messages 2003/03/14

[#66974] The onion truck strikes again ... Announcing rake — Jim Weirich <jweirich@...>

Ok, let me state from the beginning that I never intended to write this

25 messages 2003/03/15

[#67013] ANN: vcard 0.1 - a vCard decoding library — Sam Roberts <sroberts@...>

http://raa.ruby-lang.org/list.rhtml?name=vcard

10 messages 2003/03/15

[#67071] How do I get irb to use readline, (with OS X)? — Sam Roberts <sroberts@...>

I'm sure I saw something about this somewhere, but I've been searching,

12 messages 2003/03/16

[#67074] ANN: Madeleine 0.1 — Anders Bengtsson <ndrsbngtssn@...>

28 messages 2003/03/16
[#67109] Re: ANN: Madeleine 0.1 — Brian Candler <B.Candler@...> 2003/03/17

On Mon, Mar 17, 2003 at 07:00:35AM +0900, Anders Bengtsson wrote:

[#67115] Re: ANN: Madeleine 0.1 — Anders Bengtsson <ndrsbngtssn@...> 2003/03/17

--- Brian Candler <B.Candler@pobox.com> skrev:

[#67124] Re: ANN: Madeleine 0.1 — Brian Candler <B.Candler@...> 2003/03/17

On Mon, Mar 17, 2003 at 11:37:56PM +0900, Anders Bengtsson wrote:

[#67128] Re: ANN: Madeleine 0.1 — Anders Bengtsson <ndrsbngtssn@...> 2003/03/17

--- Brian Candler <B.Candler@pobox.com> wrote:

[#67222] OT: XML too hard (YAML opportunity?) — ptkwt@...1.aracnet.com (Phil Tomson)

On /. today there is a discussion about a weblog entry by an XML

27 messages 2003/03/18
[#67239] Re: XML too hard (YAML opportunity?) — <jbritt@...> 2003/03/19

> On /. today there is a discussion about a weblog entry by an XML

[#67302] Frequency of announcements — "Josef 'Jupp' Schugt" <jupp@...>

Hi!

14 messages 2003/03/19

[#67304] Strong advantages over Python — Greg McIntyre <greg@...>

Hi lovely Ruby people,

111 messages 2003/03/20
[#67408] Re: Strong advantages over Python — Greg McIntyre <greg@...> 2003/03/21

Good list. Amalgamated with http://www.ruby-lang.org/en/whats.html, it

[#67416] Re: Strong advantages over Python — Paul Prescod <paul@...> 2003/03/21

Greg McIntyre wrote:

[#67663] Ruby lecture slides (was Strong advantages over Python) — Greg McIntyre <greg@...> 2003/03/23

Thanks to all of you who answered and cleared up some of my perceptions

[#67675] Re: Ruby lecture slides (was Strong advantages over Python) — Paul Prescod <paul@...> 2003/03/23

Greg McIntyre wrote:

[#67685] Re: Ruby lecture slides (was Strong advantages over Python) — Mark Wilson <mwilson13@...> 2003/03/24

[#67697] Re: Ruby lecture slides (was Strong advantages over Python) — Greg McIntyre <greg@...> 2003/03/24

Mark Wilson <mwilson13@cox.net> wrote:

[#67346] class level Exception handling — Xiangrong Fang <xrfang@...>

Hi

12 messages 2003/03/20

[#67366] Newbie question: 9/5=1 ? — Thomas Jollans <nospam@...>

while learning ruby i wanted to program a simple fahrenheit to celsius

16 messages 2003/03/20

[#67387] Ruby tutorial download — Daniel Carrera <dcarrera@...>

Someone asked that I make the ruby tutorial available for download,

13 messages 2003/03/20

[#67415] Proposal: new operator: '<-' (for assignments) — ptkwt@...1.aracnet.com (Phil Tomson)

15 messages 2003/03/21

[#67446] Ruby & LaTeX — Walter Cazzola <cazzola@...>

Dear Ruby Experts,

19 messages 2003/03/21

[#67514] Rake problem? — manfred.lotz@... (Manfred)

Hi,

15 messages 2003/03/21

[#67546] Expression results — debitsch@... (Rasmus)

Hello,

22 messages 2003/03/21
[#67549] Re: Expression results — "Hal E. Fulton" <hal9000@...> 2003/03/21

----- Original Message -----

[#67634] exiting a loop — Daniel Carrera <dcarrera@...>

Hello,

31 messages 2003/03/23

[#67711] Iterate over two lists in parallel — Gavin Sinclair <gsinclair@...>

On Monday, March 24, 2003, 1:54:53 PM, Julian wrote:

33 messages 2003/03/24

[#67915] Conditionally make a method private? — Jeremy <thinker5555@...>

Hello again!

13 messages 2003/03/26

[#67961] What are the differences between Ruby's blocks and Python's lambdas? — sdieselil@... (sdieselil)

See subject.

22 messages 2003/03/26
[#67966] Re: What are the differences between Ruby's blocks and Python's lambdas? — "Chris Pine" <nemo@...> 2003/03/26

As was mentioned, Ruby has lambdas, but they are commonly called "procs".

[#67967] Re: What are the differences between Ruby's blocks and Python's lambdas? — Mauricio Fern疣dez <batsman.geo@...> 2003/03/26

On Thu, Mar 27, 2003 at 12:50:04AM +0900, Chris Pine wrote:

[#67975] Re: What are the differences between Ruby's blocks and Python's lambdas? — Paul Brannan <pbrannan@...> 2003/03/26

On Thu, Mar 27, 2003 at 01:01:25AM +0900, Mauricio Fern疣dez wrote:

[#67983] Re: What are the differences between Ruby's blocks and Python's lambdas? — Mauricio Fern疣dez <batsman.geo@...> 2003/03/26

On Thu, Mar 27, 2003 at 02:20:48AM +0900, Paul Brannan wrote:

[#67986] Re: What are the differences between Ruby's blocks and Python's lambdas? — Paul Brannan <pbrannan@...> 2003/03/26

On Thu, Mar 27, 2003 at 04:40:40AM +0900, Mauricio Fern疣dez wrote:

[#68082] Array question — walter@...

Any one know why Array.join can't take a code block and join that

28 messages 2003/03/27

[#68198] Announce: RHDL-0.4.2 (Ruby HDL) an agile HDL — ptkwt@...1.aracnet.com (Phil Tomson)

RHDL 0.4.2 is now available at:

12 messages 2003/03/29

[#68199] Ruby 1.6.8 vs Ruby 1.8.0 preview 2 - benchmarks — djberg96@... (Daniel Berger)

Hi all,

11 messages 2003/03/29

[#68201] Weighted random selection -- how would you do this? — "Hal E. Fulton" <hal9000@...>

Here's a little question for you.

24 messages 2003/03/29

[#68254] Saving code written during an irb session — Bil Kleb <W.L.Kleb@...>

OK, so I admit: I'm stupid. How do I save the code I've generated

19 messages 2003/03/30

[#68271] Hard coded newline characters — David King Landrith <dave@...>

There are a surprising number of ruby source files that have newline

24 messages 2003/03/30
[#68286] Re: Hard coded newline characters — nobu.nokada@... 2003/03/31

Hi,

[#68328] Re: Hard coded newline characters — David King Landrith <dave@...> 2003/03/31

On Sunday, March 30, 2003, at 08:06 PM, nobu.nokada@softhome.net wrote:

[#68318] syntax highlighting problem in vim — "Josef 'Jupp' Schugt" <jupp@...>

Hi!

16 messages 2003/03/31
[#68325] Re: syntax highlighting problem in vim — KONTRA Gergely <kgergely@...> 2003/03/31

Negative. It is correct for me. How is it displayed at you?

Ruby 1.6.8 vs Ruby 1.8.0 preview 2 - benchmarks

From: djberg96@... (Daniel Berger)
Date: 2003-03-29 05:04:16 UTC
List: ruby-talk #68199
Hi all,

One of the concerns I'm having about Ruby 1.8 is that it appears to be
getting *slower*.  Not so much that it will be a serious issue for me,
but Ruby's speed has been something some of the Perl and Python folks
have been using against Ruby.  I visited the Great Computer Language
Shootout (http://www.bagley.org/~doug/shootout/), put together 9 of
the functions he used and ran them using both 1.6.8 and 1.8 p2.

In 7 of the 9 tests, 1.8 was *slower*.  Should I be worried?

Here is a sampling of the results.  Complete code at the bottom.  I
ran the benchmarks and almost always came up with the same results -
1.6.8 was faster in 7 of 9 tests (and sometimes 8).  The one place
where I noticed a massive improvement, however, was in the 'list'
test.

Dual Pentium II 400
512 MB RAM
Mandrake Linux 9.0

# 1.6.8
                       user     system      total        real
Ackermann function:    1.430000   0.000000   1.430000 (  1.450032)
Array access:          9.010000   0.020000   9.030000 (  9.139022)
Fibonacci numbers:     8.940000   0.010000   8.950000 (  9.036173)
Hash access I:         7.260000   0.000000   7.260000 (  7.241685)
Hash access II:        9.960000   0.060000  10.020000 ( 10.047116)
Lists:                 19.250000  0.050000  19.300000 ( 19.398597)
Nested loop:           10.460000 0.010000  10.470000 ( 10.538426)
Sieve of Eratosthenes: 13.880000   0.040000  13.920000 ( 13.926563)
Word Frequency:        2.700000   0.000000   2.700000 (  2.669599)

# 1.8.0 preview 2
                       user     system      total        real
Ackermann function:    1.560000   0.000000   1.560000 (  1.545286)
Array access:          10.020000   0.010000  10.030000 ( 10.017142)
Fibonacci numbers:     9.130000   0.010000   9.140000 (  9.201564)
Hash access I:         7.960000   0.010000   7.970000 (  8.046752)
Hash access II:        9.780000   0.030000   9.810000 (  9.939460)
Lists:                 2.320000   0.020000   2.340000 (  2.337373)
Nested loop:           11.850000   0.000000  11.850000 ( 11.849551)
Sieve of Eratosthenes: 15.030000   0.040000  15.070000 ( 15.065020)
Word Frequency:        2.990000   0.020000   3.010000 (  3.003743)

# benchmark.rb
require "gcls"
require "benchmark"
include Benchmark

max = 300000
bm do |x|
   x.report("Ackermann function: "){
      max.times{ ack }
   }
   x.report("Array access: "){
      1000.times{ array_access }
   }
   x.report("Fibonacci numbers: "){
      100.times{ fib }
   }
   x.report("Hash access I: "){
      10000.times{ hash_access_I }
   }
   x.report("Hash access II: "){
      5.times{ hash_access_II }
   }
   x.report("Lists: "){
      3.times{
         for iter in 1..10
            result = lists
         end
      }
   }
   x.report("Nested loop: "){
      5.times{ nested_loop }
   }
   x.report("Sieve of Eratosthenes: "){
      10.times{ sieve_of_eratosthenes }
   }
   x.report("Word Frequency: "){
      1000.times{ word_frequency }
   }
end

# gcls.rb
# Ackermann function
def ack(m=0, n=0)
   if m == 0 then
	   n + 1
   elsif n == 0 then
	   ack(m - 1, 1)
   else
	   ack(m - 1, ack(m, n - 1))
   end
end

# Array access
def array_access(n=1)
   x = Array.new(n)
   y = Array.new(n, 0)

   for i in 0...n
      x[i] = i + 1
   end

   for k in 0..999
      (n-1).step(0,-1) do |i|
         y[i] = y.at(i) + x.at(i)
      end
   end
end

# Fibonacci numbers
def fib(n=20)
   if n < 2 then
   	1
   else
   	fib(n-2) + fib(n-1)
   end
end
   
# Hash Access I
def hash_access_I(n=20)
   hash = {}
   for i in 1..n
      hash['%x' % i] = 1
   end

   c = 0
   n.downto 1 do |i|
      c += 1 if hash.has_key? i.to_s
   end
end

# Hash Access II
def hash_access_II(n=20)
   hash1 = {}
   for i in 0 .. 9999
      hash1["foo_" << i.to_s] = i
   end

   hash2 = Hash.new(0)
   n.times do
      for k in hash1.keys
         hash2[k] += hash1[k]
      end
   end
end   

# lists
SIZE = 10000
def lists
   li1 = (1..SIZE).to_a
   li2 = li1.dup
   li3 = Array.new

   while (not li2.empty?)
      li3.push(li2.shift)
   end

   while (not li3.empty?)
      li2.push(li3.pop)
   end

   li1.reverse!

   if li1[0] != SIZE then
      p "not SIZE"
	   return(0)
   end

   if li1 != li2 then
	   return(0)
   end

   return(li1.length)
end

def nested_loop(n = 10)
   x = 0
   n.times do
      n.times do
         n.times do
            n.times do
               n.times do
                  n.times do
			            x += 1
                  end
               end
            end
         end
      end
   end
end

def sieve_of_eratosthenes(n=20)
   count = i = j = 0
   flags0 = Array.new(8192,1)

   n.times do
      count = 0
      flags = flags0.dup
      for i in 2 .. 8192
         next unless flags[i]
	      (i+i).step(8192, i) do |j|
	         flags[j] = nil
	      end
         count = count + 1
      end
   end
end

def statistical_moments
   sum = 0.0
   nums = []
   num = nil

   for line in STDIN.readlines()
	   num = Float(line)
	   nums << num
	   sum += num
   end

   n = nums.length()
   mean = sum/n;
   deviation = 0.0
   average_deviation = 0.0
   standard_deviation = 0.0
   variance = 0.0
   skew = 0.0
   kurtosis = 0.0
    
   for num in nums
	   deviation = num - mean
	   average_deviation += deviation.abs()
	   variance += deviation**2;
	   skew += deviation**3;
	   kurtosis += deviation**4
   end

   average_deviation /= n
   variance /= (n - 1)
   standard_deviation = Math.sqrt(variance)

   if (variance > 0.0)
	   skew /= (n * variance * standard_deviation)
	   kurtosis = kurtosis/(n * variance * variance) - 3.0
   end

   nums.sort()
   mid = n / 2
    
   if (n % 2) == 0
	   median = (nums.at(mid) + nums.at(mid-1))/2
   else
	   median = nums.at(mid)
   end
end

def word_frequency
   data = "While the word Machiavellian suggests cunning, duplicity,
or bad faith, it would be unfair to equate the word with the man. Old
Nicolwas actually a devout and principled man, who had profound
insight into human nature and the politics of his time. Far more
worthy of the pejorative implication is Cesare Borgia, the incestuous
and multi-homicidal pope who was the inspiration for The Prince. You
too may ponder the question that preoccupied Machiavelli: can a
government stay in power if it practices the morality that it preaches
to its people?"
   freq = Hash.new(0)
   for word in data.downcase.tr_s('^A-Za-z',' ').split(' ')
      freq[word] += 1
   end
   freq.delete("")
   lines = Array.new
   freq.each{|w,c| lines << sprintf("%7d\t%s\n", c, w) }
end

Regards,

Dan

In This Thread

Prev Next