Christoph | 1 May 2005 02:34
Picon

Re: instantiating metaclasses, sorta [Was: determining when inside 'class << self']

Jim Freeze schrieb:

>* Mark Hubbart <discordantus <at> gmail.com> [2005-04-30 16:35:16 +0900]:
>
>  
>
>>While experimenting with this, I discovered something interesting: it
>>is possible to instantiate a metaclass. By duping a metaclass, you
>>regain the ability to instantiate it, apparently without losing any
>>functionality.
>>    
>>
>
>As is said later, duping the object 'erases' the singleton methods
>while 'cloning' carries them over.
>
>I've always considered duping as a nice way of erasing the 'specialness'
>of an object while returning it to its natural state.
>  
>
It's true that duping erases class method for general
objects - it's  FALSE for  Module objects!

---
module A
    def self.bla
      puts "bla"
    end
end

(Continue reading)

caleb clausen | 1 May 2005 03:29

Re: Debugger performance

On Fri, 29 Apr 2005 09:35:16 +0900, Lothar Scholz wrote:
> Hello John,
> 
> JL> Are there any tips for optimizing the perf of the ruby debugger?I use:
>  
> JL> ruby -r debug -rubygems foo.rb
>  
> JL> Thanks
> JL> -John
> JL> http://www.iunknown.com
> 
> There is no real chance for the ruby debugger. But you can try the

I have looked at the performance problems with debug.rb, (the slowness
was very annoying for me) and come to these conclusions:

1) debug.rb is slow because it uses set_trace_func. set_trace_func will
make anything slow.

2) Some features of a debugger (single-stepping, watchpoints probably)
require set_trace_func. But many cases are not. The user won't notice
slowness in single-stepping, and will just have to live with slow
watchpoints. But a lot of the time, you're just doing 'c' (continue) with
breakpoints set. Can we make that faster?

3) You could implement breakpoints via polymorphism as follows: figure out
what class and method the breakpoint is in. Override that method to enable
and disable set_trace_func as the debugger likes when the method is
entered and exited. Use the existing technique (in debug.rb) to detect
when you're at the line that actually has the breakpoint. set_trace_func
(Continue reading)

caleb clausen | 1 May 2005 03:29

Re: Installing all gems

On Fri, 29 Apr 2005 07:52:54 +0900, Bill Guindon wrote:

> On 4/28/05, caleb clausen <google <at> inforadical.net> wrote:
>> I've tried a couple of times to install all the rubygems packages.
>> Inevitably, I run into a problem with a gem that's either broken or
>> incompatible with something else. Can anyone please give me some
>> instructions for installing all (or as many as possible rubygems?
>> 
> 
> Somebody's gotta ask the obvious question... Why would you want to?
> 
> Really, I'm curious.

My goal is not just to make trouble, nor do I just want to have more toys
than anybody else. (Tho the idea does appeal to me....)

I'm trying to test RubyLexer. Part of RubyLexer's tests include a script
that can dertermine (not certainly, but with a high degree of accuracy)
whether RubyLexer is lexing a particular piece of source code in exactly
the same way as ruby itself. I've run this script (and fixed the problems
it found) against every bit of ruby source I could find on my system, and
now I'm looking for more. 

I want to make a parser as well, and I'll need to test that. I think
there's a variation of my current test strategy that will tell me, for an
arbitrary source file, whether it has been parsed correctly. 

Basically, rubygems will all be a sort of ad-hoc language test suite.

This is the sort of thing that's very easy in Debian. That's how I got all
(Continue reading)

Ezra Zygmuntowicz | 1 May 2005 03:28

Re: [QUIZ] Barrel of Monkeys (#30)


On Apr 29, 2005, at 7:27 PM, NAKAMURA, Hiroshi wrote:

> Hi all,
>
> Sorry for OT & advertising.
>
> Bill Guindon wrote:
>
>> On 4/29/05, Ruby Quiz <james <at> grayproductions.net> wrote:
>>
>>
>>> You can find an XML file with over 5,000 song names and play time at
>>> http://rubyquiz.com/SongLibrary.xml.gz (100k compressed). The  
>>> song durations are
>>> in milliseconds.
>>>
>>
>> Any suggestions for an easy to use XML library?  Or for that matter,
>> is it ok to convert it to another format?  Personally, I'd prefer CSV
>> or YAML (hate the extra baggage that comes with XML).
>>
>
> With the latest snapshot of soap4r, you can parse that like this;
>
>   0% irb
>   irb(main):001:0> require 'zlib'
>   => true
>   irb(main):002:0> gz =
> Zlib::GzipReader.new(File.open("SongLibrary.xml.gz"))
(Continue reading)

Jim Freeze | 1 May 2005 04:02
Favicon

Re: instantiating metaclasses, sorta [Was: determining when inside 'class << self']

* Christoph <chr_mail <at> gmx.net> [2005-05-01 09:34:08 +0900]:

> Jim Freeze schrieb:
> 
> >I've always considered duping as a nice way of erasing the 'specialness'
> >of an object while returning it to its natural state.
> > 
> >
> It's true that duping erases class method for general
> objects - it's  FALSE for  Module objects!
> 
> ---
> module A
>    def self.bla
>      puts "bla"
>    end
> end
> 
> A.dup.bla # bla

I'm not sure I understand your point here.
A typical use is below:

  irb(main):001:0> module M
  irb(main):002:1> def fred; "fred"; end
  irb(main):003:1> end
  => nil
  irb(main):004:0> class C; end
  => nil
  irb(main):005:0> c = C.new
(Continue reading)

Chad Fowler | 1 May 2005 04:09
Picon

Re: Building Ruby extensions on OS X Tiger

On 4/30/05, nobu.nokada <at> softhome.net <nobu.nokada <at> softhome.net> wrote:
> Hi,
> 
> At Sat, 30 Apr 2005 09:35:22 +0900,
> Richard Kilmer wrote in [ruby-talk:140540]:
> > Mac OS X Tiger ships with Ruby 1.8.2 pre-installed. However,
> > rbconfig.rb needs to be edited if you want to build any gems. (from
> > Rich...not gems, native extensions)
> >
> > Edit rbconfig.rb
> >
> > sudo pico -w /usr/lib/ruby/1.8/powerpc-darwin8.0/rbconfig.rb
> > Now remove -arch i386 from the CFLAGS and LDFLAGS variables.
> >
> > You will also need to change:
> > CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static"
> > to:
> > CONFIG["LIBRUBYARG_STATIC"] = ""
> > _____
> 
> ARCH_FLAG should be "-arch ppc" on darwin.  As what is it
> defined, and RUBY_SO_NAME?
> 

  CONFIG["ARCH_FLAG"] = ""
  CONFIG["RUBY_SO_NAME"] = "$(RUBY_INSTALL_NAME)"

Should we update the rbconfig.rb again?  KirinDave on irc also found
another problem with the RC_CFLAGS environment variable causing
problems with, for example, RubyInline.
(Continue reading)

James Britt | 1 May 2005 02:08
Favicon

Re: [OT] Re: ANN: A new scripting language Tao 0.9.0 beta released!

Tobias Luetke wrote:
>>To be honest Tao look more like a students semester project.
>>
> 
> 
> Oh. like linux?
> 

Does this language-that-is-not-Ruby have its own mailing list or 
discussion board?

James

Lyle Johnson | 1 May 2005 03:19
Picon

Re: Fox FXProgressBar refresh issue

On 4/29/05, Craig Moran <craig.m.moran.ruby <at> gmail.com> wrote:

> I am having a refresh issue with the FXProgressBar that I'd like to resolve.
>  First, I would like to state that I am not an experienced GUI programmer,
> so I'd like some guidance.  I am working with Fox, trying to implement a
> progress bar.  I've stripped the code below to what I think is the simplest
> base level design.  If it may be done simpler, please let me know.
> 
> The issue is this.  When I run this program and let it complete with no
> interaction, it works fine.  However, if I start clicking on the title bar,
> it will eventually stop refreshing the application GUI.  During my tests,
> this will generally occur at 9% or shortly thereafter.  When I have caused
> the GUI to stop refreshing, the program still runs to completion, then
> refreshes when the progress bar hits 100%.
> 
> Here's what I'd like to know:
>  
>  
> Am I implementing this correctly?

No. ;)

The basic problem is that you're calling doStuff() directly from the
create() method, which means that the program never actually enters
the main event loop until after doStuff() gets completely finished.
That is to say, when you call create() on the application object
(application.create) it indirectly calls your main window's create()
method, and so the program hangs there until you eventually get
through TOTAL iterations of updating the progress bar. Finally, it
exits the main window's create() method, and then the application's
(Continue reading)

nobu.nokada | 1 May 2005 02:30
Picon

Re: Building Ruby extensions on OS X Tiger

Hi,

At Sat, 30 Apr 2005 09:35:22 +0900,
Richard Kilmer wrote in [ruby-talk:140540]:
> Mac OS X Tiger ships with Ruby 1.8.2 pre-installed. However,  
> rbconfig.rb needs to be edited if you want to build any gems. (from  
> Rich...not gems, native extensions)
> 
> Edit rbconfig.rb
> 
> sudo pico -w /usr/lib/ruby/1.8/powerpc-darwin8.0/rbconfig.rb
> Now remove -arch i386 from the CFLAGS and LDFLAGS variables.
> 
> You will also need to change:
> CONFIG["LIBRUBYARG_STATIC"] = "-l$(RUBY_SO_NAME)-static"
> to:
> CONFIG["LIBRUBYARG_STATIC"] = ""
> _____

ARCH_FLAG should be "-arch ppc" on darwin.  As what is it
defined, and RUBY_SO_NAME?

--

-- 
Nobu Nakada

Tom Copeland | 1 May 2005 02:23
Gravatar

Re: about rubyforge: skills and advogato

On Sun, 2005-05-01 at 06:49 +0900, Lionel Thiry wrote:
> On rubyforge, any developers may write and then show a list of skills. But it 
> seems to me that nobody uses it. Did anybody ever use it? And if not, why?

I haven't, but if some folks have:

http://rubyforge.org/search/?type_of_search=skill&words=java

It's something that came built in to GForge, so I haven't bothered
turning it off....

Yours,

Tom


Gmane