<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2010-06-24:526834</id>
  <title>Karzilla, Destroyer of Bugs</title>
  <subtitle>Karzilla, Destroyer of Bugs</subtitle>
  <author>
    <name>Karzilla, Destroyer of Bugs</name>
  </author>
  <link rel="alternate" type="text/html" href="https://karzilla.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://karzilla.dreamwidth.org/data/atom"/>
  <updated>2015-07-01T06:01:44Z</updated>
  <dw:journal username="karzilla" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2010-06-24:526834:13251</id>
    <link rel="alternate" type="text/html" href="https://karzilla.dreamwidth.org/13251.html"/>
    <link rel="self" type="text/xml" href="https://karzilla.dreamwidth.org/data/atom/?itemid=13251"/>
    <title>Friday, Sep 17, 6:45PM</title>
    <published>2010-09-18T00:08:05Z</published>
    <updated>2015-07-01T06:01:44Z</updated>
    <category term="insights"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;h3&gt;Bug counts: resolved 246, assigned 15, needs-review 10&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;I did my first Template Toolkit conversion in bug 3030.  It's still counterintuitive to me that the views are linked to the document hierarchy in DW/Controller files that are buried deep in cgi-bin, instead of some sort of top-level HEY LOOKEE HERE easy to find place, but hey, whatever works.&lt;br /&gt;&lt;br /&gt;I also defined my first hook, because I noticed that the index page only linked to the files in dw-free, and there were a bunch more in the same directory in dw-nonfree that needed to be linked as well.  Hooks are the simplest way to tell a program: "Whoops, hey, if that code over there is loaded, pass this here data through it.  If not, forget I said anything."  It's also a good example of a concept I learned years ago from customizing &lt;a href="http://www.tinyfugue.de/sourceforge/help/tf-40s1-help/topics/hooks.html"&gt;Tinyfugue&lt;/a&gt;; I learned most of my basic programming skills on MU*s before I ever learned Perl.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=karzilla&amp;ditemid=13251" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-06-24:526834:12124</id>
    <link rel="alternate" type="text/html" href="https://karzilla.dreamwidth.org/12124.html"/>
    <link rel="self" type="text/xml" href="https://karzilla.dreamwidth.org/data/atom/?itemid=12124"/>
    <title>Sunday, Aug 29, 10:20PM</title>
    <published>2010-08-30T03:43:04Z</published>
    <updated>2015-07-01T05:52:02Z</updated>
    <category term="insights"/>
    <dw:security>public</dw:security>
    <dw:reply-count>2</dw:reply-count>
    <content type="html">&lt;h3&gt;Bug counts: resolved 229, assigned 23, needs-review 19&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;Continuing on the subject of things that weren't as hard as I feared: making a gearman worker.&lt;br /&gt;&lt;br /&gt;Here's your basic gearman worker in its entirety:&lt;br /&gt;&lt;pre&gt;
use LJ::Worker::Gearman;
gearman_decl( 'name-of-worker'  =&amp;gt; \&amp;worker );
gearman_work();
sub worker {
    # stuff what needs doing
}&lt;/pre&gt;&lt;br /&gt;And then you call it with something like &lt;tt&gt;LJ::gearman_client()-&amp;gt;dispatch_background( 'name-of-worker', ...)&lt;/tt&gt; (at least for my purposes, which were "go do this other time-consuming thing somewhere else and don't tell me what happens.")&lt;br /&gt;&lt;br /&gt;The only real voodoo, AFAICT, is that you have to use Storable methods (freeze/thaw) for passing the function arguments from the web execution to the worker execution.  I just did a copy and paste of code from someone else's worker script and it worked like a charm.&lt;br /&gt;&lt;br /&gt;Later on I get to either write more gearman workers or overcome my fear of TheSchwartz, depending on whether or not gearman can do everything I need for delivering vgifts.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=karzilla&amp;ditemid=12124" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-06-24:526834:11953</id>
    <link rel="alternate" type="text/html" href="https://karzilla.dreamwidth.org/11953.html"/>
    <link rel="self" type="text/xml" href="https://karzilla.dreamwidth.org/data/atom/?itemid=11953"/>
    <title>Thursday, Aug 26, 9:10PM</title>
    <published>2010-08-27T02:33:39Z</published>
    <updated>2015-07-01T05:50:27Z</updated>
    <category term="insights"/>
    <dw:security>public</dw:security>
    <dw:reply-count>0</dw:reply-count>
    <content type="html">&lt;h3&gt;Bug counts: resolved 228, assigned 23, needs-review 21&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;I figured out how to bend S2 to my will!  Well, a bit anyway.&lt;br /&gt;&lt;br /&gt;I was all "um there's no sort function here wtf" and then I saw &lt;a href="http://wiki.dwscoalition.org/notes/S2_Guide:_Language_Tutorial#Built-in_functions"&gt;this bit of wiki&lt;/a&gt; that described how to make a Perl subroutine load into S2.  So that's what I did.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;function builtin keys_alpha(string{} elements) : string[]
"Return the keys of the array in alphabetically sorted order.";&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;That's it.  &lt;tt&gt;keys_alpha&lt;/tt&gt; is a regular Perl subroutine in LJ::S2.  The only nonintuitive part (for me, because I don't like languages that declare variable types) was figuring out what the input and output type declarations should look like.  As near as I can figure, string[] is a regular array reference and string{} is like a hash reference, except unlike a Perl hash it implicitly acts like an array of hash keys in array context.  Anyway, I needed an array because in Perl, arrays preserve the ordering of their elements and hashes do not.&lt;br /&gt;&lt;br /&gt;So yeah, that wasn't as hard as I feared.&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=karzilla&amp;ditemid=11953" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
  <entry>
    <id>tag:dreamwidth.org,2010-06-24:526834:4218</id>
    <link rel="alternate" type="text/html" href="https://karzilla.dreamwidth.org/4218.html"/>
    <link rel="self" type="text/xml" href="https://karzilla.dreamwidth.org/data/atom/?itemid=4218"/>
    <title>Friday, Jul 2, 11:20AM</title>
    <published>2010-07-02T16:25:20Z</published>
    <updated>2010-07-02T16:25:20Z</updated>
    <category term="insights"/>
    <dw:security>public</dw:security>
    <dw:reply-count>5</dw:reply-count>
    <content type="html">&lt;h3&gt;Bug counts: resolved 201, assigned 10, needs-review 6&lt;/h3&gt;&lt;br /&gt;&lt;br /&gt;I have to remind myself that not everyone is as fearless about rearranging the guts of the code as I am.&lt;br /&gt;&lt;br /&gt;Hence, I just &lt;a href="http://bugs.dwscoalition.org/show_bug.cgi?id=1960#c6"&gt;changed my mind&lt;/a&gt; and accepted a patch from a new contributor that I had rejected a few days ago as being too small in scope.  I'll open a new bug for the gut rearranging and probably do it myself.&lt;br /&gt;&lt;br /&gt;I hope I didn't scare the newbie away!&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=karzilla&amp;ditemid=4218" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
