Re: [MacRuby-devel] Looking for feedback on a draft blog post: Optimising Table Views With MacRuby

2010-01-13 Thread isaac kearse
Thanks for your help guys, here is the article:

http://isaac.kearse.co.nz/2010/01/10/async-table-views-with-macruby/

Cheers,
Isaac

On Mon, Jan 11, 2010 at 7:12 PM, isaac kearse  wrote:

> Thanks Jordan,
>
> I wanted to keep this post fairly short and narrow just for my own sanity.
>  But maybe I'll do some more articles on the async theme and collect them
> together for a tutorial/documentation later.  What if the next one solved
> this same issue but with GCD instead of an async NSURLConnection?
>
> Cheers,
> Isaac
>
>
> On Mon, Jan 11, 2010 at 2:56 PM, Jordan K. Hubbard  wrote:
>
>>
>> On Jan 10, 2010, at 2:53 PM, Chuck Remes wrote:
>>
>> > I don't think I would title the post as you have. You are optimizing a
>> little bit by moving to an asynchronous picture load, but that isn't
>> necessarily a common event for table views. Maybe call it "Asynchronous
>> Table View Loading With MacRuby." That pretty much gets to the heart of it.
>>
>> Well, I liked the write-up but found it a little on the short side (though
>> maybe that's expected due to it not being finished yet).  I think a broader
>> topic, and one which the current content represents an excellent example of,
>> might be "Async programming in MacRuby".  With that as one's topic, a fair
>> more interesting arc is suggested where, say, one or two really simply
>> examples are first given, just to get the reader's head pointed in the right
>> direction for async programming, then a more complex example (say, loading a
>> Table View!), then even more complex examples using GCD to schedule some
>> truly arbitrary amount of work, complete with async completion block(s).
>>  Now the article isn't "just about how to populate a table", it's more of an
>> intro to async programming on MacRuby, for which there is also currently a
>> serious dearth of tutorial/expository documentation!  (*wink*).
>>
>> - Jordan
>>
>> ___
>> MacRuby-devel mailing list
>> MacRuby-devel@lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>
>
___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #473: setObjectValue does not set floats, integers in NSTextFields properly.

2010-01-13 Thread MacRuby
#473: setObjectValue does not set floats, integers in NSTextFields properly.
---+
 Reporter:  johnmacs...@…  |   Owner:  eloy.de.en...@…
 Type:  defect |  Status:  new
 Priority:  major  |   Milestone: 
Component:  MacRuby|Keywords:  NSTextField, setObjectValue
---+
Changes (by eloy.de.en...@…):

  * owner:  lsansone...@… => eloy.de.en...@…


-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #555: Redefinition of method gives unexpected behavior

2010-01-13 Thread MacRuby
#555: Redefinition of method gives unexpected behavior
+---
 Reporter:  macch...@…  |   Owner:  lsansone...@…
 Type:  defect  |  Status:  new  
 Priority:  major   |   Milestone:  MacRuby 0.5  
Component:  MacRuby |Keywords:   
+---
 When I run following test program with Ruby 1.9.1/1.8.7 and MacRuby 0.5b2
 I get an unexpected result:

 {{{
 class TestClass
   def initialize; @a_var = "content"; end
 end

 a = TestClass.new; puts "a: %s" % a.inspect

 class TestClass
   def initialize(k); @a_var = k; end
 end

 b = TestClass.new "valueGiven"; puts "b: %s" % b.inspect

 c = TestClass.new; puts "c: %s" % c.inspect
 }}}

 results in Ruby 1.9.1/1.8.7 with the expected behavior:

 {{{
 a: #
 b: #
 initTest.rb:13:in `initialize': wrong number of arguments (0 for 1)
 (ArgumentError)
 from initTest.rb:13:in `new'
 from initTest.rb:13
 }}}

 In MacRuby I get following output:

 {{{
 a: ##-
 b: ##-
 c: ##-
 }}}

 It seems that {{{#initialize}}} (without arguments) is still floating
 around...

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #556: Subsequent calls to dispatch apply improperly access incorrect "self"

2010-01-13 Thread MacRuby
#556: Subsequent calls to dispatch apply improperly access incorrect "self"
---+
 Reporter:  joshua.balla...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:   
Component:  MacRuby|Keywords:  GCD  
---+
 The following code:
 {{{
 class Array
   def pmap(priority = :default, &block)
 results = []
 results_queue =
 Dispatch::Queue.new("#{results.object_id}_access_queue")
 Dispatch::Queue.concurrent(priority).apply(size) do |idx|
   print "self.object_id #=> #{self.object_id}\n"
   print "self[idx] #=> #{self[idx]}\n"
   result = block[self[idx]]
   print "result #=> #{result}\n"
   results_queue.async do
 results[idx] = result
   end
 end
 results_queue.sync {}
 results
   end
 end

 test_ary = ('a'..'j').to_a
 p test_ary
 print "test_ary.object_id #=> #{test_ary.object_id}\n"
 p test_ary.pmap {|i| i.upcase }

 test_ary = (1..10).to_a
 p test_ary
 print "test_ary.object_id #=> #{test_ary.object_id}\n"
 p test_ary.pmap {|i| i**2 }
 }}}
 ...generates this output:
 {{{
 ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j"]
 test_ary.object_id #=> 8594638688
 self.object_id #=> 8594638688
 self[idx] #=> a
 result #=> A
 self.object_id #=> 8594638688
 self[idx] #=> e
 result #=> E
 self.object_id #=> 8594638688
 self[idx] #=> f
 result #=> F
 self.object_id #=> 8594638688
 self[idx] #=> g
 result #=> G
 self.object_id #=> 8594638688
 self[idx] #=> h
 result #=> H
 self.object_id #=> 8594638688
 self[idx] #=> i
 self.object_id #=> 8594638688
 result #=> I
 self[idx] #=> b
 self.object_id #=> 8594638688
 self[idx] #=> j
 result #=> J
 result #=> B
 self.object_id #=> 8594638688
 self[idx] #=> c
 result #=> C
 self.object_id #=> 8594638688
 self[idx] #=> d
 result #=> D
 ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]
 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
 test_ary.object_id #=> 8591101024
 self.object_id #=> 8594638688
 self[idx] #=> a
 result #=> A
 self.object_id #=> 8591101024
 self.object_id #=> 8591101024
 self[idx] #=> 2
 self[idx] #=> 3
 result #=> 9
 self.object_id #=> 8594638688
 result #=> 4
 self.object_id #=> 8591101024
 self[idx] #=> f
 self.object_id #=> 8591101024
 self[idx] #=> 4
 self.object_id #=> 8591101024
 self[idx] #=> 5
 result #=> F
 self[idx] #=> 8
 self.object_id #=> 8591101024
 result #=> 16
 self.object_id #=> 8591101024
 self.object_id #=> 8591101024
 result #=> 25
 result #=> 64
 self[idx] #=> 9
 self[idx] #=> 10
 self[idx] #=> 7
 result #=> 81
 result #=> 100
 result #=> 49
 [nil, 4, 9, 16, 25, nil, 49, 64, 81, 100]
 }}}

 Notice that, in the second call to #pmap, some of the iterations of
 Dispatch::Queue#apply evaluate "self" as the "self" from the first call to
 #pmap

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #556: Subsequent calls to dispatch apply improperly access incorrect "self"

2010-01-13 Thread MacRuby
#556: Subsequent calls to dispatch apply improperly access incorrect "self"
---+
 Reporter:  joshua.balla...@…  |   Owner:  ernest.prabha...@…   
 
 Type:  defect |  Status:  new  
 
 Priority:  blocker|   Milestone:   
 
Component:  MacRuby|Keywords:  GCD  
 
---+
Changes (by ernest.prabha...@…):

  * owner:  lsansone...@… => ernest.prabha...@…


Comment:

 Whoops, probably my bad.  I assume this is with the latest nightly?

 If you could write this failure up as a spec, that would be awesome. If
 not, I'll try to get to it tomorrow.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #557: Ruby exceptions aren't cached when calling at_exit block

2010-01-13 Thread MacRuby
#557: Ruby exceptions aren't cached when calling at_exit block
-+--
 Reporter:  eloy.de.en...@…  |   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:   
Component:  MacRuby  |Keywords:   
-+--
 As can be seen with the following example:

 {{{
 macruby -e "at_exit { raise 'Ohnoesmacruby t.rb' }; require
 'doesnotexist'"
 }}}

 Which results in:

 {{{
 -e:in `': no such file to load -- doesnotexist (LoadError)
 2010-01-13 19:15:33.551 macruby[34637:903] *** Terminating app due to
 uncaught exception 'RuntimeError', reason: 'Ohnoesmacruby t.rb'
 *** Call stack at first throw:
 (
 0   CoreFoundation  0x7fff86bb05a4
 __exceptionPreprocess + 180
 1   libobjc.A.dylib 0x7fff81558313
 objc_exception_throw + 45
 2   libmacruby.dylib0x0001001813fb
 rb_vm_raise + 443
 3   libmacruby.dylib0x000100041bfb
 rb_f_raise + 43
 4   libmacruby.dylib0x00010016d977
 rb_vm_dispatch + 6647
 5   ??? 0x0001011101a1 0x0 +
 4312859041
 6   libmacruby.dylib0x000100040e25
 ruby_finalize + 69
 7   libmacruby.dylib0x0001000a7810 rb_exit
 + 16
 8   macruby 0x00010df6 main +
 182
 9   macruby 0x00010d34 start +
 52
 )
 terminate called after throwing an instance of 'NSException'
 }}}

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


[MacRuby-devel] [MacRuby] #558: unable to require files.

2010-01-13 Thread MacRuby
#558: unable to require files.
-+--
 Reporter:  tvmo...@…|   Owner:  lsansone...@…
 Type:  defect   |  Status:  new  
 Priority:  blocker  |   Milestone:  MacRuby 0.5  
Component:  MacRuby  |Keywords:   
-+--
 lib_file =
 File.join(File.expand_path($0).slice(0,File.expand_path($0).index("dmdnlib")),
 "dmdnlib/lib/lib")
 require "#{lib_file}"

 The result from this is students-v-ldap.rb:in `': no such file to
 load /Volumes/DMDNTech/scripts/ruby/dmdnlib/lib/lib.rb (LoadError)

 I have tried to load said lib.rb by requiring in macirb with an explicit
 path.

 irb(main):002:0> require '/Volumes/DMDNTech/scripts/ruby/dmdnlib/lib/lib'
 LoadError: no such file to load --
 /Volumes/DMDNTech/scripts/ruby/dmdnlib/lib/lib.rb

 macruby /Volumes/DMDNTech/scripts/ruby/dmdnlib/lib/lib.rb runs without any
 errors...

 I need this to work as lib.rb apart from some globals puts all of my
 library folders into the load path.

 Dir.glob("#{$DMDN_ENV[:root]}/**/**").each do |f|
   next if !File.directory?(f)
   next if f =~ /\.app/
   $LOAD_PATH << f
 end

 I then only ever need to use require 'x' instead of an explicit path.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #483: Need GCD wrapper for File (Vnode) Sources

2010-01-13 Thread MacRuby
#483: Need GCD wrapper for File (Vnode) Sources
+---
 Reporter:  ernest.prabha...@…  |Owner:  ernest.prabha...@… 
   
 Type:  enhancement |   Status:  closed 
   
 Priority:  blocker |Milestone:  MacRuby 0.5
   
Component:  MacRuby |   Resolution:  fixed  
   
 Keywords:  |  
+---
Changes (by ernest.prabha...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Provided in r3269 along with specs and doc.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #479: Need GCD wrapper for Process Sources

2010-01-13 Thread MacRuby
#479: Need GCD wrapper for Process Sources
+---
 Reporter:  ernest.prabha...@…  |Owner:  ernest.prabha...@… 
   
 Type:  defect  |   Status:  closed 
   
 Priority:  blocker |Milestone:  MacRuby 0.5
   
Component:  MacRuby |   Resolution:  fixed  
   
 Keywords:  |  
+---
Changes (by ernest.prabha...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Fixed on or before r3267 along with specs and rdoc.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #478: Need GCD wrapper for custom sources

2010-01-13 Thread MacRuby
#478: Need GCD wrapper for custom sources
+---
 Reporter:  ernest.prabha...@…  |Owner:  ernest.prabha...@… 
   
 Type:  defect  |   Status:  closed 
   
 Priority:  blocker |Milestone:  MacRuby 0.5
   
Component:  MacRuby |   Resolution:  fixed  
   
 Keywords:  |  
+---
Changes (by ernest.prabha...@…):

  * status:  new => closed
  * resolution:  => fixed


Comment:

 Fixed on or before r3267 along with specs and rdoc.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #488: GCD Dispatch::Group#notify shouldn't expect any arguments

2010-01-13 Thread MacRuby
#488: GCD Dispatch::Group#notify shouldn't expect any arguments
+---
 Reporter:  ernest.prabha...@…  |Owner:  ernest.prabha...@… 
   
 Type:  defect  |   Status:  closed 
   
 Priority:  blocker |Milestone:  MacRuby 0.5
   
Component:  MacRuby |   Resolution:  invalid
   
 Keywords:  |  
+---
Changes (by ernest.prabha...@…):

  * status:  new => closed
  * resolution:  => invalid


Comment:

 My bad, it need to take a queue.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #489: Need a top-level Dispatch Object

2010-01-13 Thread MacRuby
#489: Need a top-level Dispatch Object
+---
 Reporter:  ernest.prabha...@…  |Owner:  ernest.prabha...@… 
   
 Type:  enhancement |   Status:  closed 
   
 Priority:  minor   |Milestone:  MacRuby 0.5
   
Component:  MacRuby |   Resolution:  wontfix
   
 Keywords:  |  
+---
Changes (by ernest.prabha...@…):

  * status:  new => closed
  * resolution:  => wontfix


Comment:

 Meh, subclassing inside C is a pain.  Forget it.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #556: Subsequent calls to dispatch apply improperly access incorrect "self"

2010-01-13 Thread MacRuby
#556: Subsequent calls to dispatch apply improperly access incorrect "self"
---+
 Reporter:  joshua.balla...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:   
Component:  MacRuby|Keywords:  GCD  
---+
Changes (by lsansone...@…):

  * owner:  ernest.prabha...@… => lsansone...@…


Comment:

 The problem is in RoxorVM::uncache_or_dup_block(). I will investigate this
 later. Possibly related to #511.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #556: Subsequent calls to dispatch apply improperly access incorrect "self"

2010-01-13 Thread MacRuby
#556: Subsequent calls to dispatch apply improperly access incorrect "self"
---+
 Reporter:  joshua.balla...@…  |Owner:  lsansone...@…
 Type:  defect |   Status:  closed   
 Priority:  blocker|Milestone:  MacRuby 0.5  
Component:  MacRuby|   Resolution:  fixed
 Keywords:  GCD|  
---+
Changes (by lsansone...@…):

  * status:  new => closed
  * resolution:  => fixed
  * milestone:  => MacRuby 0.5


Comment:

 Should be fixed in r3272.

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


Re: [MacRuby-devel] [MacRuby] #511: GCD crash with indirect method access

2010-01-13 Thread MacRuby
#511: GCD crash with indirect method access
---+
 Reporter:  joshua.balla...@…  |   Owner:  lsansone...@…
 Type:  defect |  Status:  new  
 Priority:  blocker|   Milestone:   
Component:  MacRuby|Keywords:  GCD  
---+

Comment(by lsansone...@…):

 Josh, can you try to reproduce the problem with r3272?

-- 
Ticket URL: 
MacRuby 

___
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel