Christopher Dicely | 1 Apr 2009 01:05
Picon

Re: Why does mathn kill this method?

On Tue, Mar 31, 2009 at 3:46 PM, Siep Korteling <s.korteling <at> gmail.com> wrote:
> Really stumped here.
>
> def sum_digits(n)
>    sum = 0
>    while n>0
>       sum += n % 10
>       n /= 10
>       end
>    sum
>  end
>
> STDOUT.sync=true
>
> puts sum_digits(12) #=> 3
>
> require 'mathn'
> puts sum_digits(12) # hangs
>
>
> What am I doing wrong?

This should illustrate the problem:

irb(main):001:0> require 'mathn'
=> true
irb(main):002:0> n = 10
=> 10
irb(main):003:0> n /= 10
=> 1
(Continue reading)

Martin DeMello | 1 Apr 2009 01:06
Picon

Re: Why does mathn kill this method?

On Wed, Apr 1, 2009 at 4:16 AM, Siep Korteling <s.korteling <at> gmail.com> wrote:
> Really stumped here.
>
> def sum_digits(n)
>    sum = 0
>    while n>0
>       sum += n % 10
>       n /= 10
>       end
>    sum
>  end
>
> STDOUT.sync=true
>
> puts sum_digits(12) #=> 3
>
> require 'mathn'
> puts sum_digits(12) # hangs

n /= 10 just keeps making n into a smaller and smaller rational. it
never reaches 0

martin

Jörg W Mittag | 1 Apr 2009 01:14

Move over, Phusion, here comes the *real* Enterprise Edition!

Hi!

I just learned about another new Ruby Implementation. This one is
called "Blue Ruby" and it is developed by SAP Labs in Palo Alto.
It's – are you all sitting down? – a Ruby Implementation for the ABAP
Virtual Machine, written in ABAP.

There seem to be some similarities with MacRuby, in that Blue Ruby
attempts a very tight integration with the ABAP call stack, so that
two-way integration is totally seamless.

According to the technical whitepaper, Blue Ruby currently (as of
2009-03-27, i.e. four days ago) passes 70.2% of RubySpec (88.8%
language, 67.2% core library), which I find quite impressive. Blue
Ruby is yet another Ruby Implementation that has received a
significant development boost from RubySpec and ruby_parser. Kudos to
the Rubinius community!

You can find more information about Blue Ruby here: 

	<https://SDN.SAP.Com/irj/scn/wiki?path=/display/Research/BlueRuby>

The technical whitepaper is here:

	<https://SDN.SAP.Com/irj/scn/go/portal/prtroot/docs/library/uuid/408a9a3b-03f9-2b10-b29c-f0a3374b19d8>

And an introductory blog entry is here:

	<https://SDN.SAP.Com/irj/scn/weblogs?blog=/pub/wlg/13661>

(Continue reading)

Siep Korteling | 1 Apr 2009 01:15
Picon

Re: Why does mathn kill this method?

Martin DeMello wrote:
> On Wed, Apr 1, 2009 at 4:16 AM, Siep Korteling <s.korteling <at> gmail.com> 
> wrote:
>>
>> STDOUT.sync=true
>>
>> puts sum_digits(12) #=> 3
>>
>> require 'mathn'
>> puts sum_digits(12) # hangs
> 
> n /= 10 just keeps making n into a smaller and smaller rational. it
> never reaches 0
> 
> martin

Yes, that's clear. Thanks for the help (real fast), Christopher and 
Martin.

Siep
--

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

Ryan Davis | 1 Apr 2009 02:49
Gravatar

[ANN] hoe 1.12.0 Released


hoe version 1.12.0 has been released!

* <http://rubyforge.org/projects/seattlerb/>
* <http://seattlerb.rubyforge.org/hoe/>
* <ryand-ruby <at> zenspider.com>

Hoe is a simple rake/rubygems helper for project Rakefiles. It
generates all the usual tasks for projects including rdoc generation,
testing, packaging, and deployment.

Tasks Provided:

* announce          - Create news email file and post to rubyforge.
* audit             - Run ZenTest against the package.
* check_extra_deps  - Install missing dependencies.
* check_manifest    - Verify the manifest.
* clean             - Clean up all the extras.
* config_hoe        - Create a fresh ~/.hoerc file.
* debug_gem         - Show information about the gem.
* default           - Run the default task(s).
* deps:email        - Print a contact list for gems dependent on this  
gem
* deps:fetch        - Fetch all the dependent gems of this gem into  
tarballs
* deps:list         - List all the dependent gems of this gem
* docs              - Build the docs HTML Files
* email             - Generate email announcement file.
* flay              - Analyze for code duplication.
* flog              - Analyze code complexity.
(Continue reading)

Ryan Davis | 1 Apr 2009 02:54
Gravatar

[ANN] graph 1.0.0 Released


graph version 1.0.0 has been released!

* <http://rubyforge.org/projects/seattlerb>

Graph is a type of hash that outputs in graphviz's dot format. It
comes with a command-line interface that is easily pluggable.

It ships with plugins to graph dependencies and status of installed
rubygems, mac ports, and freebsd ports, coloring leaf nodes blue,
outdated nodes red, and outdated leaf nodes purple (red+blue).

Changes:

### 1.0.0 / 2009-03-27

* 1 major enhancement

   * Birthday!

* <http://rubyforge.org/projects/seattlerb>

Saji N. Hameed | 1 Apr 2009 04:42

Re: Wt::Ruby 0.9.1 release

Hi Richard,

> Wt::Ruby version 0.9.1 has been released!
> Requirements
>   * Ruby 1.8.x or 1.9.1
>   * Wt 2.2.3 or Wt 2.99.0 or greater
>   * cmake 2.6.x
>   * boost 1.35 or greater

Installed wtruby without trouble, but got the following error when running 
the Hello World script you included in the annoucement

/usr/lib/ruby/site_ruby/1.8/i686-linux/wthttp.so: /usr/local/lib/libsmokewt.so.1: undefined
symbol: _ZTIN2Wt19WAbstractTableModelE - /usr/lib/ruby/site_ruby/1.8/i686-linux/wthttp.so (LoadError)

m /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from /usr/lib/ruby/site_ruby/1.8/wt.rb:8
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
	from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
	from hello.rb:2

I have the following versions of required software
-------------
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-linux]
wt 2.99.1-1
cmake version 2.6-patch 3
boost 1.37.0-1

saji

(Continue reading)

James Britt | 1 Apr 2009 05:12
Picon
Gravatar

Re: Move over, Phusion, here comes the *real* Enterprise Edition!

Jörg W Mittag wrote:
> BTW: If I counted correctly, we can soon celebrate the 30th Ruby
> Implementation!

What defines an implementation?  70% or more of RubySpec?

All these Ruby VM projects are great, but if I can't run arbitrary Ruby 
code with high expectations of success, then "implementation" may not be 
the right word.

Charlie Nutter of JRuby fame has a good blog post on the topic:

http://blog.headius.com/2009/03/on-benchmarking.html

--

-- 
James Britt

www.jamesbritt.com           - Playing with Better Toys
www.ruby-doc.org             - Ruby Help & Documentation
www.rubystuff.com            - The Ruby Store for Ruby Stuff

Yukihiro Matsumoto | 1 Apr 2009 05:17
Favicon
Gravatar

Re: Change of behaviour for sleep(0) in 1.9

Hi,

In message "Re: Change of behaviour for sleep(0) in 1.9"
    on Wed, 1 Apr 2009 00:02:20 +0900, "Sean O'Halpin" <sean.ohalpin <at> gmail.com> writes:

|Perhaps differing interpretations of this ambiguous documentation from ri?
|"Zero arguments causes sleep to sleep forever."

"Zero arguments" means "sleep", not "sleep(0)".  Disambiguation welcome.

							matz.

Ryan Davis | 1 Apr 2009 05:50
Gravatar

[ANN] hoe 1.12.1 Released


hoe version 1.12.1 has been released!

* <http://rubyforge.org/projects/seattlerb/>
* <http://seattlerb.rubyforge.org/hoe/>
* <ryand-ruby <at> zenspider.com>

Hoe is a simple rake/rubygems helper for project Rakefiles. It
generates all the usual tasks for projects including rdoc generation,
testing, packaging, and deployment.

Tasks Provided:

* announce          - Create news email file and post to rubyforge.
* audit             - Run ZenTest against the package.
* check_extra_deps  - Install missing dependencies.
* check_manifest    - Verify the manifest.
* clean             - Clean up all the extras.
* config_hoe        - Create a fresh ~/.hoerc file.
* debug_gem         - Show information about the gem.
* default           - Run the default task(s).
* deps:email        - Print a contact list for gems dependent on this  
gem
* deps:fetch        - Fetch all the dependent gems of this gem into  
tarballs
* deps:list         - List all the dependent gems of this gem
* docs              - Build the docs HTML Files
* email             - Generate email announcement file.
* flay              - Analyze for code duplication.
* flog              - Analyze code complexity.
(Continue reading)


Gmane