Re: [MacRuby-devel] Creating a pdf : Cocoa to MacRuby translation

2010-11-07 Thread Julien Jassaud
Hi,

I don't know if it's a bug but I never explicitly use __octype__ in the script 
and the warning occurs systematically after I call certain CGContextXXX 
functions ( in my case CGContextSelectFont and CGContextShowGlyphsAtPoint ).

I'll try to properly open a ticket.

Julien

Le 6 nov. 2010 à 05:55, Eloy Duran a écrit :

> Normally this is not a bug. Most people lazy initialize instance variables, 
> but you will get warned if you ask it to be more verbose. However, I have 
> been unable to trigger it on MacRuby myself:
> 
> % ruby19 -w -e '!...@foo'
> -e:1: warning: instance variable @foo not initialized
> 
> % macruby -w -e '!...@foo' 
> 
> On 5 nov 2010, at 18:10, Jordan K. Hubbard wrote:
> 
>> 
>> On Nov 4, 2010, at 7:19 PM, Julien Jassaud wrote:
>> 
> This do produces a  pdf but it is completely empty. Also, MacRuby 
> complains when called with the -w option :
> 
> $ macruby -w cocoapdf.rb
> unknown: warning: instance variable __octype__ not initialized
>> 
>> That still seems like a bug, however.  Have you filed a bug report on it?  
>> Thanks.
>> 
>> - Jordan
>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] System crash - MacRuby priority

2010-11-07 Thread Robert Rice
Hi Laurent:

I'm not sure what the definition of a "kernel panic" is. My system Finder 
becomes unresponsive. A/V streams stop displaying video but continue to play 
audio and my MacRuby app continues to run to completion.

I have a busy CPU running a DisplayLink USB monitor connection and I suspect 
the DisplayLink driver could be involved if it doesn't get enough CPU 
resources. I will test it again with a newer DisplayLink driver and with the 
USB monitor connection. But it seems that MacRuby runs at a high priority since 
I can't reproduce the problem when I run the CPU up to 100% with other 
applications.

Thanks,
Bob Rice


On Nov 6, 2010, at 10:23 PM, Laurent Sansonetti wrote:

> Hi Robert,
> 
> What do you mean by making the system crash? Does a kernel panic happen, or 
> does the system just become unusable?
> 
> If a kernel panic happen, or if any core service segfaults because of your 
> app, then you should report this via http://bugreporter.apple.com as others 
> indicated. If the system becomes unusable your app is probably using too much 
> resources. You should profile it using Shark (or Instruments) and see what's 
> going on. Feel free to upload the profile somewhere if you want us to have a 
> look.
> 
> Laurent
> 
> On Nov 6, 2010, at 4:19 PM, Robert Rice wrote:
> 
>> I determined that my system crash was not due to an endless loop - rather 
>> due to a very inefficient algorithm. MacRuby seems to run at such a high 
>> priority that it can cause the system to crash - especially if a streaming 
>> video is running.
>> 
>> Can I lower the priority of my MacRuby application?
>> 
>> Thanks,
>> Bob Rice
>> 
>> ___
>> MacRuby-devel mailing list
>> [email protected]
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
> 
> ___
> MacRuby-devel mailing list
> [email protected]
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] macgem and previously installed gems

2010-11-07 Thread Andy Park
I'm trying to get macirb that came with my new MacRuby installation to play nice
ly with the existing .irbrc, where I'm using a lot of gems previously installed 
with gem. It looks like my gems aren't found by macirb because they were install
ed with gem, so are not found / used by macgem. Would I really need to install a
ll my gems using macgem in order to work with macirb using my existing .irbrc?


___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] macgem and previously installed gems

2010-11-07 Thread Rob Gleeson

On 31 Oct 2010, at 01:16, Andy Park wrote:

> I'm trying to get macirb that came with my new MacRuby installation to play 
> nice
> ly with the existing .irbrc, where I'm using a lot of gems previously 
> installed 
> with gem. It looks like my gems aren't found by macirb because they were 
> install
> ed with gem, so are not found / used by macgem. Would I really need to 
> install a
> ll my gems using macgem in order to work with macirb using my existing .irbrc?
> 

Yep. Gem installations are contained within the installation directory of the 
Ruby interpreter you're using.

A possible solution to your problem could be something like this:

  unless defined?(RUBY_ENGINE) 
# require gems for the Ruby interpreter bundled with OSX.
  else
# require gems for use with MacRuby.
  end

Ruby 1.8 doesn't define RUBY_ENGINE as far as I know, but 1.9 and other Ruby 
implementations do(rbx, JRuby, …)

The Ruby Version Manager(RVM) does a much better job at handling multiple Ruby 
installations(MacRuby included), so 
maybe you can have a look at that too: http://rvm.beginrescueend.com

HTH,
Rob.





___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] System crash - MacRuby priority

2010-11-07 Thread Perry E. Metzger
On Sun, 07 Nov 2010 10:48:07 -0500 Robert Rice 
wrote:
> Hi Laurent:
> 
> I'm not sure what the definition of a "kernel panic" is.

It means your kernel dies and invokes its panic() function, resulting
in the system rebooting.

You describe a situation that is not a kernel panic, it is not even
strictly speaking a crash.

> My system
> Finder becomes unresponsive. A/V streams stop displaying video but
> continue to play audio and my MacRuby app continues to run to
> completion.

This is not a system crash, especially since (presumably) the
machine returns to normal after your app exits. In a system crash,the
machine dies and needs to be rebooted -- you are not experiencing
that.

The exact nature of what is going wrong is difficult to assess
without knowing much about what your Ruby code is doing.

> I have a busy CPU running a DisplayLink USB monitor connection and
> I suspect the DisplayLink driver could be involved if it doesn't
> get enough CPU resources. I will test it again with a newer
> DisplayLink driver and with the USB monitor connection. But it
> seems that MacRuby runs at a high priority since I can't reproduce
> the problem when I run the CPU up to 100% with other applications.

Your other applications do not behave the same way that your Ruby app
does so there is no particular reason to assume this has anything
to do with scheduler priorities at all.

It seems much more likely that this is related to the specific
behavior of your ruby app and is independent of scheduling priority.
For example, you could be tying up other resources needed by the
finder or A/V subsystems, such as disk bandwidth or memory.

-- 
Perry E. [email protected]
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] System crash - MacRuby priority

2010-11-07 Thread Rich Morin
At 7:19 PM -0400 11/6/10, Robert Rice wrote:
> Can I lower the priority of my MacRuby application?

There are some commands that mess with the scheduling
priority, but this (AFAIK) only deals with CPU activity.
It sounds like the problem you're having is related to
I/O bandwidth.  That said, here are some man pages:

 % man nice
 ...
 nice -- execute a utility with an altered scheduling priority
 ...

 % man renice
 ...
 renice -- alter priority of running processes
 ...

-r
-- 
http://www.cfcl.com/rdmRich Morin
http://www.cfcl.com/rdm/resume [email protected]
http://www.cfcl.com/rdm/weblog +1 650-873-7841

Technical editing and writing, programming, system design
___
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel