<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>halostatue &#187; Ruby PDF</title>
	<atom:link href="http://www.halostatue.ca/category/ruby/rubypdf/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.halostatue.ca</link>
	<description>software development with ruby in Toronto</description>
	<lastBuildDate>Mon, 29 Mar 2010 18:28:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Beyond time</title>
		<link>http://www.halostatue.ca/2007/08/04/beyond-time/</link>
		<comments>http://www.halostatue.ca/2007/08/04/beyond-time/#comments</comments>
		<pubDate>Sun, 05 Aug 2007 02:26:35 +0000</pubDate>
		<dc:creator>austin</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby PDF]]></category>

		<guid isPermaLink="false">http://www.halostatue.ca/2007/08/04/beyond-time/</guid>
		<description><![CDATA[In Twitteriffic today, I hit the wrong button on a message sent by Nathaniel Talbott and it took me to his blog, which had his entry about handing off test/unit to Ryan Davis. It has taken me a long time to reach this point, but it has to happen: I no longer have time to [...]]]></description>
			<content:encoded><![CDATA[<p>In <a href="http://iconfactory.com/software/twitterrific" title="Twitteriffic by Iconfactory" class="liexternal">Twitteriffic</a> today, I hit the wrong button on a message sent by <a href="http://www.twitter.com/ntalbott" title="Nathaniel"s Twitter Profile" class="liexternal">Nathaniel Talbott</a> and it took me to his <a href="http://blog.talbott.ws" title="Nathaniel"s Blog" class="liexternal">blog</a>, which had his entry about <a href="http://blog.talbott.ws/articles/2007/6/20/test-unit-a-time-to-maintain-and-time-to-hand-off" title="test/unit: A time to maintain, and a time to hand off" class="liexternal">handing off test/unit</a> to Ryan Davis. It has taken me a long time to reach this point, but it has to happen: I no longer have time to maintain PDF::Writer and most of its support libraries. I need a successor. Over the last year (since RubyConf &#8216;06), I have been talking with several people, but no one has actually submitted patches for me to review so we could push out some fixes.</p>
<p>I don&#8217;t really want to give up PDF::Writer or its ancillary libraries, but I owe it to the community to find a maintainer who will be more responsive and put more effort into it than I have. There are some issues to sort out regarding the pieces of the projects, and some changes that I would like to see someone implement. There are basically three projects:</p>
<ol>
<li>Transaction::Simple. This has improved significantly since the last release, but I have not yet implemented the Ruby 1.9 Marshal.load block trick that Matz implemented for me after a minimal case for a <code>#become</code>-like behaviour was shown.</li>
<li>color-tools: This involves someone else, because after some preliminary discussion last year, I moved the color-tools codebase to the Color project on RubyForge and restructured things to be a bit smarter. There&#8217;s also some work that should happen hear regarding colour profiles, but that&#8217;s manageable. I basically want to work with the current owner of the Color project to hand this entire project off to someone who is interested in the math behind colours, and has the expertise to do something with it.</li>
<li>PDF::Writer. The big one. <strike>I need someone to take care of this.</strike> No, the community needs someone to take care of this. I&#8217;m more than willing to share some thoughts about the code, but it&#8217;s a bit of a mess, and there are better ways to do what I did. The code can&#8217;t support the ultimate goal of reading.</li>
</ol>
<p>None of this means that I&#8217;m giving up on Ruby, or on PDF generation; if I find time, you may yet find a different set of PDF tools from me in the future. But PDF::Writer is here and it needs someone to help maintain it.</p>
<p>Could that be you? Comments open on this post for interested parties to let me know. Be warned: I&#8217;m not just handing off PDF::Writer. I&#8217;m going to be looking at code samples; wanting patches. I need to know that you&#8217;re going to give the care the PDF::Writer needs and deserves before I hand off the virtual keys to the project.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.halostatue.ca/2007/08/04/beyond-time/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Ruby Conference 2006 &#8211; Day 1 Evening (Friday, 20 October 2006)</title>
		<link>http://www.halostatue.ca/2006/10/22/ruby-conference-2006-day-1-evening-friday-20-october-2006/</link>
		<comments>http://www.halostatue.ca/2006/10/22/ruby-conference-2006-day-1-evening-friday-20-october-2006/#comments</comments>
		<pubDate>Sun, 22 Oct 2006 13:57:37 +0000</pubDate>
		<dc:creator>austin</dc:creator>
				<category><![CDATA[Ruby PDF]]></category>
		<category><![CDATA[RubyConf]]></category>

		<guid isPermaLink="false">http://www.halostatue.ca/2006/10/22/ruby-conference-2006-day-1-evening-friday-20-october-2006/</guid>
		<description><![CDATA[Dinner tonight was at Old Chicago with Hal Fulton, Ara Howard, Patrick Hurley, Tim Pease, and various others whose names I can’t remember offhand. Great dinner, and I was able to fully explain the problem with WHY the Ruby extension situation on Windows is so bad. I also started talking about THE big problem that [...]]]></description>
			<content:encoded><![CDATA[<p>Dinner tonight was at Old Chicago with Hal Fulton, Ara Howard, Patrick Hurley, Tim Pease, and various others whose names I can’t remember offhand. Great dinner, and I was able to fully explain the problem with WHY the Ruby extension situation on Windows is so bad. I also started talking about THE big problem that I have with Transaction::Simple and haven’t figured out how to solve in a general way (details below). They weren’t quite understanding it, so before the matz Roundtable came up, I showed them a test case that I had come up with while talking with Francis Cianfrocca (who is behind EventMachine and the implementation of Net::LDAP).</p>
<p>The matz Roundtable was pretty short; not too many questions were asked this year, and the discussion didn’t continue for an hour as it did the year before. I was shot down when asking for “become” behaviour (related to the Transaction::Simple bug). After the Roundtable, I managed to snag matz to talk about the problem which led me to request this. I showed him the test case:</p>
<p><span id="more-37"></span></p>
<pre>#!/usr/local/bin/ruby
require 'rubygems'
require 'transaction/simple'

class Child
  attr_accessor :parent
end

class Parent
  include Transaction::Simple

  attr_reader :children
  def initialize
    @children = []
  end

  def < <(child)
    child.parent = self
    @children << child
  end
end

parent = Parent.new
puts "parent.object_id: #{parent.object_id}"
parent << Child.new
puts "parent.children[0].parent.object_id: #{parent.children[0].parent.object_id}"
puts "starting transaction"
parent.start_transaction
parent << Child.new
puts "parent.children[1].parent.object_id: #{parent.children[1].parent.object_id}"
puts "aborting transaction"
parent.abort_transaction
puts "aborted transaction"
puts "parent.object_id: #{parent.object_id}"
puts "parent.children[0].parent.object_id: #{parent.children[0].parent.object_id}"
parent << Child.new
puts "parent.children[1].parent.object_id: #{parent.children[1].parent.object_id}"</pre>
<p>producing the output:
</pre>
<pre>parent.object_id: 3265800
parent.children[0].parent.object_id: 3265800
starting transaction
parent.children[1].parent.object_id: 3265800
aborting transaction
aborted transaction
parent.object_id: 3265800
parent.children[0].parent.object_id: 3265500
parent.children[1].parent.object_id: 3265800</pre>
<p>This bug affects PDF::Writer’s table generation and contributes significantly to the high memory usage. What’s happening is that when you call Parent#start_transaction, Transaction::Simple creates a transaction checkpoint with Marshal::dump. When you call Parent#rewind_transaction or or Parent#abort_transaction, the transaction checkpoint is reverted. This reversion is extremely robust except for this one item. What we really need is something like:</p>
<pre>self = Marshal::restore(checkpoint)</pre>
<p>Obviously, that won’t work and this leads to the problem that is illustrated above. After long discussion with Tim Pease, Patrick Hurley, and Matz, we came up with a workaround that can work for the example bug and for PDF::Writer. It’s not super-efficient, though. Essentially, I will modify Transaction::Simple to have callback methods for post-processing after a transactional operation. Something like this:</p>
<pre>class Parent
  def post_restore_hook
    @children.map! { |child|
      child.parent = self unless self.object_id == child.parent.object_id
      child
    }
  end
end

parent = Parent.new
puts "parent.object_id: #{parent.object_id}"
parent < < Child.new
puts "parent.children[0].parent.object_id: #{parent.children[0].parent.object_id}"
puts "starting transaction"
parent.start_transaction
parent << Child.new
puts "parent.children[1].parent.object_id: #{parent.children[1].parent.object_id}"
puts "aborting transaction"
parent.abort_transaction
parent.post_restore_hook # would be called automatically in the real case
puts "aborted transaction"
puts "parent.object_id: #{parent.object_id}"
puts "parent.children[0].parent.object_id: #{parent.children[0].parent.object_id}"
parent << Child.new
puts "parent.children[1].parent.object_id: #{parent.children[1].parent.object_id}"
</pre>
<p>Which produces the output:
</pre>
<pre>parent = Parent.new
puts "parent.object_id: #{parent.object_id}"
parent < < Child.new
puts "parent.children[0].parent.object_id: #{parent.children[0].parent.object_id}"
puts "starting transaction"
parent.start_transaction
parent << Child.new
puts "parent.children[1].parent.object_id: #{parent.children[1].parent.object_id}"
puts "aborting transaction"
parent.abort_transaction
parent.post_restore_hook
puts "aborted transaction"
puts "parent.object_id: #{parent.object_id}"
puts "parent.children[0].parent.object_id: #{parent.children[0].parent.object_id}"
parent << Child.new
puts "parent.children[1].parent.object_id: #{parent.children[1].parent.object_id}"</pre>
<p>This isn't great: it doesn't feel very Ruby to me, but it does get the job done. It's also not very efficient. After thinking about this for the better part of an hour, matz has suggested that there might be a very ugly hack that’s possible that he’ll look at for me, which may be able to implement everything in Transaction::Simple.</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.halostatue.ca/2006/10/22/ruby-conference-2006-day-1-evening-friday-20-october-2006/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.470 seconds -->
