Paul Butcher | 3 Sep 22:20 2007

Patch for Struct::new documentation

All,

I've attached a patch for the documentation for Struct::new.

The second edition of The Pickaxe Book says:

> Ruby 1.9 and later allow you to pass a block to a Struct's constructor.
> This block is evaluated in the context of the new struct's class and hence
> allows you conveniently to add instance methods to the new struct.

It turns out that this functionality has actually been present since 1.8.3!
This is the relevant ChangeLog entry:

http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/struct.c?view=log#rev5934

(although it references [ruby-talk:02606], it should really be
[ruby-core:02606]:

http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/2606

I've tried to stick to the submission guidelines, but please let me know if
I've screwed anything up!

Cheers,

------------------------------------------------
Paul Butcher
CTO
Texperts
Mobile: +44 (0) 7740 857648
(Continue reading)

Hugh Sasse | 7 Sep 13:08 2007
Picon
Picon

RubyGarden Wiki.

One of the sources of information on Ruby that has a lot of
accumulated knowledge is the Ruby Garden Wiki.   However, I have
reached the point where I consider it broken beyond repair.  The
amount of Wiki spam was bad enough, but at least I could mark that
as being posted by spammers and this seemed to stem the tide a bit.
Now I've just looked and there are loads of completely spurious
pages created, like Rb_P, most of which claim to have no revision 1.
I can't get rid of them.  Maybe, even as a person who can approve
postings, I don't have enough privileges to do so.

So should we just make it read-only now?  Requiring that users have
an account is no use unless we are stringent about who we accept as
having an account.  Otherwise we'll get the "spam from temporary
email address" problem replicated.    

Is there anything else we could do?

        Hugh

Guillermo Alcántara | 8 Sep 00:00 2007
Picon

Re: RubyGarden Wiki.

At yahoo list, you can setup the system as this:

New accounts can't make updates without moderator approving it.

Moderator after a couple of updates changes the new account to a trusted one, so it no longer needs supervision.

How about a system like that? Spammers most likely won't make the effort to play nice to be accepted.

       
____________________________________________________________________________________
Choose the right car based on your needs.  Check out Yahoo! Autos new Car Finder tool.
http://autos.yahoo.com/carfinder/

Hugh Sasse | 10 Sep 11:16 2007
Picon
Picon

Re: RubyGarden Wiki.

> 
> At yahoo list, you can setup the system as this:
> 
> New accounts can't make updates without moderator approving it.
> 
> Moderator after a couple of updates changes the new account to a trusted one, so it no longer needs supervision.
> 
> How about a system like that? Spammers most likely won't make the effort to play nice to be accepted.
> 

Yes, we've already got this - that's why I wrote:

HGS> mount of Wiki spam was bad enough, but at least I could mark that
HGS> as being posted by spammers and this seemed to stem the tide a bit.

and it isn't enough.  

        Hugh

Hugh Sasse | 11 Sep 16:10 2007
Picon
Picon

Re: RubyGarden Wiki.

On Fri, 7 Sep 2007, Hugh Sasse wrote:

> One of the sources of information on Ruby that has a lot of
> accumulated knowledge is the Ruby Garden Wiki.   However, I have
> reached the point where I consider it broken beyond repair.  The
        [...]
> Is there anything else we could do?

I've just found this:

http://haacked.com/archive/2007/09/11/honeypot-captcha.aspx

which describes forms for robots to fill in that humans cannot see,
And screen readers such as Jaws can cope with this.  If there is no 
input to the robot-only fields, the other fields are accepted.

Is this doable for the Wiki?  It will only help for so long, but....

        Hugh

Constantine . | 11 Sep 17:48 2007
Picon

Re: RubyGarden Wiki.

> I've just found this:
>
> http://haacked.com/archive/2007/09/11/honeypot-captcha.aspx
>
> which describes forms for robots to fill in that humans cannot see,
> And screen readers such as Jaws can cope with this.  If there is no
> input to the robot-only fields, the other fields are accepted.
>
> Is this doable for the Wiki?  It will only help for so long, but....
>
>         Hugh

What about a captcha that requires intelligence? I have seen these
around on some of the more popular sites, for instance, a captcha that
asks which one doesn't belong in a group, or which of these is not a
cat, or something to that effect?

Brian Sammon | 16 Sep 06:59 2007

rdoc has issues with multi-line constant defs

I'm investigating why I can't get any useful rdoc output for the HTTPClient 
library. (http://dev.ctor.org/http-access2)

I've created a test case that illustrates the problem I've found.  It appears 
that the rdoc program ignores documented methods when there is multiple-line 
constant definitions in the source-file.

With the attached test case, if I run rdoc on it as-is, I get no HTML 
documentation for the initialize() and get_content() functions.  However, if I 
remove the SSLEnabled and SSPIEnabled definitions, then rdoc will generate 
HTML documentation for initialize() and get_content().

Can anyone confirm this behavior?
Is this a bug in rdoc?  Or is there something wrong with the HTTPClient code?
class HTTPClient

  SSLEnabled = begin
      require 'openssl'
      true
    rescue LoadError
      false
    end

  SSPIEnabled = begin
      require 'win32/sspi'
      true
    rescue LoadError
      false
(Continue reading)

Dirk Traulsen | 18 Sep 21:48 2007
Picon

Patch: Numeric#divmod documentation error corrected and didactically improved

Hi all!

I submitted the following to 
http://rubyforge.org/tracker/index.php?func=detail&aid=14051
&group_id=426&atid=1700

Numeric#divmod  (numeric.c line 264-302)
========================================

  1. There is an error in the table in column a/b:  13/-4 is -4, not -3!

       C:\Dokume~1\All Users\Dokume~1>irb
       irb(main):001:0> RUBY_VERSION    #=> "1.8.6"
       irb(main):002:0> 13/-4           #=> -4      <=!

  2. The divmod formula
    a. is given in C and not Ruby terms,
    b. should use the same parameter names as the table and
    c. is wrong: Numeric does not convert a and b to floats. The division
                 with "/" is handled by the respective subclasses and they
                 do it differently depending on the class of num.

       So, it would be correct and Ruby-esk to write:

 *  Returns an array containing the quotient and modulus obtained by
 *  dividing <i>num</i> by <i>aNumeric</i>.
 *  If 
 *          q, r = a.divmod(b)
 *  then
 *             q = (a/b).floor
(Continue reading)


Gmane