[#28395] [Bug #2830] Some methods raise ArgumentError instead of TypeError — Marc-Andre Lafortune <redmine@...>
Bug #2830: Some methods raise ArgumentError instead of TypeError
[#28405] [Feature #2832] Vector#each and Enumerable — Marc-Andre Lafortune <redmine@...>
Feature #2832: Vector#each and Enumerable
[#28452] Watched issues on redmine — Caleb Clausen <vikkous@...>
Is there a page on redmine that will show me the list of issues that
[#28482] Question on scoped constant resolution Class vs Module — Peter McLain <peter.mclain@...>
I asked this on ruby-talk, but didn't get anywhere. Someone suggested
[#28505] [Bug #2838] Ruby 1.8.7 (2009-06-12 patchlevel 174) strange round behaviour — P K <redmine@...>
Bug #2838: Ruby 1.8.7 (2009-06-12 patchlevel 174) strange round behaviour
[#28552] [Bug #2945] Regexp#=== is failed by an exception when the exception is occurred in method_missing — Kenta Murata <redmine@...>
Bug #2945: Regexp#=== is failed by an exception when the exception is occurred in method_missing
Hi,
Hi,
Hi,
Hi,
[#28561] Ruby::DL vs Ruby::FFI — Aston <blackapache512-ticket@...>
Ruby.DL and FFI libraries are great for programmers like me who are not int=
On Mon, Mar 8, 2010 at 4:56 PM, Aston <blackapache512-ticket@yahoo.com> wro=
(2010/03/09 1:04), Luis Lavena wrote:
[#28576] "rake not found" error on a rubygems test — Yusuke ENDOH <mame@...>
Hi Eric Hodel,
[#28583] build failure on 26861 using msys/mingw — Jon <jon.forums@...>
Can anyone replicate? I've recently updated both binutils and the mingw runtime so this may very well be my configuration.
[#28602] [Bug #2952] Time.strftime format %N — Russell Penney <redmine@...>
Bug #2952: Time.strftime format %N
[#28643] [Bug #2957] IO.print emits field separator after each object, rather than between — Daniel Kelley <redmine@...>
Bug #2957: IO.print emits field separator after each object, rather than between
[#28665] [ANN] 1.9.2 release plan — Yusuke ENDOH <mame@...>
Hi,
[#28686] trunk (26947) build fail with msys/mingw/vista — Jon <jon.forums@...>
I get the following build failure when msysgit's "c:\git\cmd" dir is on PATH.
On Tue, Mar 16, 2010 at 5:50 AM, Jon <jon.forums@gmail.com> wrote:
[#28712] When a trace hook raises an exception, should it terminate the program? — Rocky Bernstein <rockyb@...>
In Ruby 1.8 and the Ruby 1.9 trunk when running a trace hook that raises an
On Wed, Mar 17, 2010 at 5:42 AM, Rocky Bernstein <rockyb@rubyforge.org> wro=
Let me clarify a bit because I think some of the facts (some by me) may hav=
On Thu, Mar 18, 2010 at 5:52 AM, Rocky Bernstein <rockyb@rubyforge.org> wro=
[#28724] [Feature:trunk] Array#repeated_(permutation|combination) — "KISHIMOTO, Makoto" <ksmakoto@...4u.or.jp>
New methods Array#repeated_(permutation|combination).
[#28735] [Bug #2982] Ruby tries to link with both openssl and readline — Lucas Nussbaum <redmine@...>
Bug #2982: Ruby tries to link with both openssl and readline
Hi,
Issue #2982 has been updated by caleb clausen.
[#28783] [Feature #2065] An ancestors iterator — Simon Chiang <redmine@...>
Issue #2065 has been updated by Simon Chiang.
Hi,
[#28837] [Bug #2993] Module#instance_methods' flag seems to be ignored in singleton classes — Xavier Noria <redmine@...>
Bug #2993: Module#instance_methods' flag seems to be ignored in singleton classes
[#28859] st.c: pool allocator for tables and entries — Eric Wong <normalperson@...>
Hi all,
[#28865] Can DRb be used across a fork() — Chris Schlaeger <cschlaeger@...>
I'm trying to use DRb to communicate between a parent and child
[#28871] WeakRef extending Delegator is a bug waiting to happen? — Charles Oliver Nutter <headius@...>
Hopefully this doesn't contradict my other email too much :)
[#28902] [Bug #2998] gets fails in mingw — Roger Pack <redmine@...>
Bug #2998: gets fails in mingw
[#28907] [Bug #3000] Open SSL Segfaults — Christian Höltje <redmine@...>
Bug #3000: Open SSL Segfaults
Issue #3000 has been updated by Hiroshi NAKAMURA.
Hi,
Hi,
Hi,
[#28924] [Bug #3005] Ruby core dump - [BUG] rb_sys_fail() - errno == 0 — Sebastian YEPES <redmine@...>
Bug #3005: Ruby core dump - [BUG] rb_sys_fail() - errno == 0
[#28954] [Feature #3010] slow require gems in ruby 1.9.1 — Miao Jiang <redmine@...>
Feature #3010: slow require gems in ruby 1.9.1
[#29019] [Bug #3015] NetBSD vs test/dl — Michael Graff <redmine@...>
Bug #3015: NetBSD vs test/dl
On Fri, Mar 26, 2010 at 11:49:59AM +0900, Michael Graff wrote:
[#29031] [Feature #1395](Open) Steppable Kernel::eval — Yusuke Endoh <redmine@...>
Issue #1395 has been updated by Yusuke Endoh.
[#29045] [Feature #3021] Array#product should accept a block. — Marc-Andre Lafortune <redmine@...>
Feature #3021: Array#product should accept a block.
[#29092] merged psych to trunk — Aaron Patterson <aaron@...>
Hey everyone,
[#29118] [Bug #3051] psych is too osx-specifc — Michael Graff <redmine@...>
Bug #3051: psych is too osx-specifc
[#29128] [Bug #3052] DRb::start_service fails to detect used port — Chris Schlaeger <redmine@...>
Bug #3052: DRb::start_service fails to detect used port
Issue #3052 has been updated by Yusuke Endoh.
[#29131] [trunk:bug] Many rubygems tests fail with psych tests. — Tanaka Akira <akr@...>
Many rubygems tests fail with psych tests.
(2010/03/30 17:55), Tanaka Akira wrote:
On Tue, Mar 30, 2010 at 07:13:32PM +0900, NARUSE, Yui wrote:
[#29161] [Bug #3058] Inconsistent eol conversion of IO#read on Windows — Heesob Park <redmine@...>
Bug #3058: Inconsistent eol conversion of IO#read on Windows
[#29167] [Feature #3067] complex.c : Question: why Complex#~ is disabled? It's in the doc — Benoit Daloze <redmine@...>
Feature #3067: complex.c : Question: why Complex#~ is disabled? It's in the doc
[#29179] [Bug #3071] Convert rubygems and rdoc to use psych — Aaron Patterson <redmine@...>
Bug #3071: Convert rubygems and rdoc to use psych
Doesn't this mean the the RubyGems codevase would now be forked
Issue #3071 has been updated by Nobuyoshi Nakada.
[#29186] [Bug #3072] Classes Inheriting from Data — Run Paint Run Run <redmine@...>
Bug #3072: Classes Inheriting from Data
[ruby-core:28860] Re: [Feature #2348] RBTree Should be Added to the Standard Library
Yusuke ENDOH wrote:
> 2010/3/22 Bill Kelly <billk@cts.com>:
>> RBTree and MultiRBTree provide functionality which, with its
>> worst-case O(log N) search, insert, and delete complexity for
>> a sorted pair associative container can't be readily duplicated
>> with Array, Hash, or Set. ?(As far as I know.)
>
> Hash has amortized O(1) search, insert, and delete complexity,
> I think. Indeed, it becomes O(N) at worst-case (when rehash
> occurs). Does anyone have a concrete problem due to rehash?
Agreed: for Hash I would expect O(1) search, and amortized O(1)
insert and delete complexity.
To avoid rehash, a Hash#reserve(size) method might be nice, but,
for me, that is all separate from why I am interested in RBTree.
> I think this feature request is very tough because it can be
> substituted by Hash in many cases. So I think you guys should
> appeal the difference. It would be good to show some real-world
> case where Hash cannot be used and RBTree is really needed.
Some differences:
Hash is not maintained in key-sorted order.
Hash does not offer upper_bound(key) or lower_bound(key)
or bound(key1, key2) in O(log N) time.
Hash doesn't provide fast search for partial string key.
An example, indexing words in documents, and doing
partial keyword searches.
(Note: MultiRBTree#bound seems to be broken.)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
require 'rbtree'
ful_ = %w(
fulcra
fulcrum
fulcrums
fulfil
fulfill
fulfilled
fulfilling
fulfillment
fulfills
fulfilment
fulfils
full
fullback
fullbacks
fulled
fuller
fullest
fulling
fullness
fulls
fully
fulminate
fulminated
fulminates
fulminating
fulmination
fulminations
fulsome
)
multi_ = %w(
multicolored
multicultural
multiculturalism
multidimensional
multifaceted
multifarious
multifariousness
multilateral
multilingual
multimedia
multimillionaire
multimillionaires
multinational
multinationals
multiple
multiples
multiplex
multiplexed
multiplexer
multiplexers
multiplexes
multiplexing
multiplicand
multiplicands
multiplication
multiplications
multiplicative
multiplicities
multiplicity
multiplied
multiplier
multipliers
multiplies
multiply
multiplying
multiprocessing
multipurpose
multiracial
multitasking
multitude
multitudes
multitudinous
multivariate
multivitamin
multivitamins
)
dis_ = %w(
distortions
distorts
distract
distracted
distracting
distraction
distractions
distracts
distrait
distraught
distress
distressed
distresses
distressful
distressing
distressingly
distribute
distributed
distributes
distributing
distribution
distributions
distributive
distributor
distributors
district
districts
distrust
distrusted
distrustful
distrustfully
distrusting
distrusts
disturb
disturbance
disturbances
disturbed
disturbing
disturbingly
disturbs
)
doc1 = [ "foo/doc1.txt", ful_ + multi_ ]
doc2 = [ "bar/doc2.txt", multi_ + dis_ ]
doc3 = [ "baz/doc3.txt", ful_ + dis_ ]
dict = MultiRBTree.new
[doc1, doc2, doc3].each do |docpath, words|
words.each do |w|
dict.store(w, docpath)
end
end
puts dict.lower_bound("mult") # => ["multicolored", "foo/doc1.txt"]
puts dict.upper_bound("mult") # => ["fulsome", "baz/doc3.txt"]
puts dict.bound("mult") # <-- broken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note: The documentation for RBTree#bound reads:
* call-seq:
* rbtree.bound(key1, key2 = key1) => array
* rbtree.bound(key1, key2 = key1) {|key, value| block} => rbtree
*
* Returns an array containing key-value pairs between the result of
* MultiRBTree#lower_bound and MultiRBTree#upper_bound. If a block is
* given it calls the block once for each pair.
So I expected dict.bound("mult") to return all elements from:
dict.lower_bound("mult") => ["multicolored", "foo/doc1.txt"]
through:
dict.upper_bound("mult") => ["fulsome", "baz/doc3.txt"]
However, #bound just retunrs [] :(
I consider this a bug.
* * *
A comment:
Even if MultiRBTree#bound worked as expected, I must concede a
significant liability of MultiRBTree's API compared to C++
std::multimap, is the lack of iterators.
With std::multimap, I can find dict.lower_bound("mult"), and
then iterate over as many or as few subsequent elements in sorted
order as I choose. (When building a typedown menu, for example,
I may only want the first 10 results.)
I suppose rbtree.bound(key1, key2, _limit_) would be one way to
provide equivalent functionality; or perhaps support for 1.9
Enumerable would be another.
* * *
Anyway, issues with MultiRBTree#bound aside, other ways I've
used a Sorted Pair Associative Container include implementing
various kinds of priority queues. (Sorted integer keys.)
* * *
I do think that for RBTree and MultiRBTree to be as generally
useful as C++ std::map and std::multimap, there should be
versions of methods like bound, lower_bound, upper_bound, that
return an enumerator.
Also, I think it should be possible to unambiguously delete
a specific element from a MultiRBTree.
Currently:
t = MultiRBTree.new
t.store "foo", "456"
t.store "foo", "123"
t.delete "foo" # <-- which is deleted? foo/123 or foo/456 ?
It appears that MultiRBTree#delete deletes the oldest key/value
pair matching the supplied key, so it would be foo/456.
As far as I can tell, there's no way to delete foo/123 from t
without first deleting foo/456. So that is another limitation
when compared to std::multimap.
* * *
Hmm.
So it seems that even though RBTree and MultiRBTree are
internally equivalent to C++ std::map and std::multimap, the
interface exposed to the programmer is less flexible than the
C++ versions.
I think RBTree and MultiRBTree would be more useful it were
possible to obtain enumerators from bound and lower_bound,
and to be able to delete arbitrary elements in a MultiRBTree.
Sorry this email is so long. I didn't expect to encounter
these issues.
Regards,
Bill