<?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>fleshyorgans &#187; programming</title> <atom:link href="http://fleshy.org.nz/tag/programming/feed/" rel="self" type="application/rss+xml" /><link>http://fleshy.org.nz</link> <description>Essays from a guy with too much pontification on his hands</description> <lastBuildDate>Fri, 27 Apr 2012 05:59:21 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <item><title>Code: Dynamically Insert HTML Into Any Rendered PHP Page</title><link>http://fleshy.org.nz/2008/02/15/code-dynamically-insert-html-into-any-rendered-php-page/</link> <comments>http://fleshy.org.nz/2008/02/15/code-dynamically-insert-html-into-any-rendered-php-page/#comments</comments> <pubDate>Fri, 15 Feb 2008 15:38:34 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[code]]></category> <category><![CDATA[coding]]></category> <category><![CDATA[hacks]]></category> <category><![CDATA[php]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/2008/02/15/code-dynamically-insert-html-into-any-rendered-php-page/</guid> <description><![CDATA[So, this pleases me enough to post it. dynamic buffer insertion with PHP Needed to quickly add a notice to every page on a client&#8217;s site where there was a single include, but not single-included layout pages (teachers, *sigh*). I&#8217;ve never messed with output buffer stuff before, so this was just sort of surprising to [...]]]></description> <content:encoded><![CDATA[<p>So, this pleases me enough to post it.</p><p><script src='http://pastie.org/152702.js'></script></p><p><a
href="http://pastie.caboo.se/152702">dynamic buffer insertion with PHP</a></p><p>Needed to quickly add a notice to every page on a client&#8217;s site where there was a single include, but not single-included layout pages (teachers, *sigh*).</p><p>I&#8217;ve never messed with output buffer stuff before, so this was just sort of surprising to me. It&#8217;s <em>insanely</em> useful.</p><p>Only took about a minute to code, and two to deploy.</p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2008/02/15/code-dynamically-insert-html-into-any-rendered-php-page/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Operator Precedence (ruby et al.)</title><link>http://fleshy.org.nz/2008/02/01/operator-precedence-ruby-et-al/</link> <comments>http://fleshy.org.nz/2008/02/01/operator-precedence-ruby-et-al/#comments</comments> <pubDate>Fri, 01 Feb 2008 15:20:32 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[code]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[ruby]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/2008/02/01/operator-precedence-ruby-et-al/</guid> <description><![CDATA[Thought this was a little silly, but it generated a lot of discussion about precedence, short-circuiting of conditionals, and the value of syntactic sugar. http://pastie.caboo.se/146194]]></description> <content:encoded><![CDATA[<p>Thought this was a little silly, but it generated a lot of discussion about precedence, short-circuiting of conditionals, and the value of syntactic sugar.<br
/> <script src='http://pastie.org/146194.js'></script><br
/> <a
href="http://pastie.caboo.se/146194">http://pastie.caboo.se/146194</a></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2008/02/01/operator-precedence-ruby-et-al/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Quick and dirty hack for acts_as_attachment file movement</title><link>http://fleshy.org.nz/2007/12/10/quick-and-dirty-hack-for-acts_as_attachment-file-movement/</link> <comments>http://fleshy.org.nz/2007/12/10/quick-and-dirty-hack-for-acts_as_attachment-file-movement/#comments</comments> <pubDate>Mon, 10 Dec 2007 20:59:17 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[ruby]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/786</guid> <description><![CDATA[Say you&#8217;re working on something that uses acts_as_attachment. Also say that the person who wrote it decided that all the different models&#8217; attachments would save in the same place. Also suppose that you want to change the file location of all those uploads. Well, here&#8217;s a quick and dirty migration that&#8217;ll save you from moving [...]]]></description> <content:encoded><![CDATA[<p>Say you&#8217;re working on something that uses acts_as_attachment. Also say that the person who wrote it decided that all the different models&#8217; attachments would save in the same place. Also suppose that you want to change the file location of all those uploads.</p><p><em>Well</em>, here&#8217;s a quick and dirty migration that&#8217;ll save you from moving files manually.</p><p><a
href="http://pastie.caboo.se/126613">Automove Files for Storage Changes, with acts_as_attachment</a></p><p>Originally I wanted to do something like  Attachment.new( OldAttachment.find(?).attributes ), but there were issues with that because acts_as_attachment wants uploaded data to be a tmp file or some crap. This ended up being the easier way, all in all.</p><p>Use with care.<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/12/10/quick-and-dirty-hack-for-acts_as_attachment-file-movement/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Seriously Word Press, WTH?</title><link>http://fleshy.org.nz/2007/11/04/seriously-word-press-wth/</link> <comments>http://fleshy.org.nz/2007/11/04/seriously-word-press-wth/#comments</comments> <pubDate>Mon, 05 Nov 2007 04:30:16 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[cats]]></category> <category><![CDATA[code]]></category> <category><![CDATA[php]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/777</guid> <description><![CDATA[While trying to figure out how to remove formatting from &#8216;wp_list_cats&#8217; in Word Press, I discovered this awesome bit. Click the thumbnail for the full glory of the code. You will notice that in my screenshot, the final function call to &#8216;list_cats&#8217; at the end is truncated. This is because there are eighteen parameters. Again [...]]]></description> <content:encoded><![CDATA[<p>While trying to figure out how to remove formatting from &#8216;wp_list_cats&#8217; in Word Press, I discovered this awesome bit. Click the thumbnail for the full glory of the code.<br
/> <a
class="imagelink" href="http://fleshy.org.nz/yum/wp-content/uploads/2007/11/wp_list_cats.png" title="WP List Cats Insanity!"><img
id="image775" src="http://src.sencha.io//http://fleshy.org.nz/yum/wp-content/uploads/2007/11/wp_list_cats.thumbnail.png" alt="WP List Cats Insanity!" /></a></p><p>You will notice that in my screenshot, the final function call to &#8216;list_cats&#8217; at the end is truncated. This is because there are <strong>eighteen parameters</strong>. Again with the clicking.<br
/> <a
class="imagelink" href="http://fleshy.org.nz/yum/wp-content/uploads/2007/11/list_cats.png" title="list_cats even more insane!"><img
id="image776" src="http://src.sencha.io//http://fleshy.org.nz/yum/wp-content/uploads/2007/11/list_cats.thumbnail.png" alt="list_cats even more insane!" /></a></p><p>Also, there&#8217;s an awesome feature in the WP DB object such that if one requeries the same table on the same page, apparently pagination offset is lost. This means that the main index page listing posts cannot also have a recent posts list &#8212; because you either will have recent posts starting with whatever the main list offset is, or you will only ever have as many posts on the index page as the recent posts query returns.</p><p>WIN!<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/11/04/seriously-word-press-wth/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>PHP and Payflow Pro FOR THE LOSE</title><link>http://fleshy.org.nz/2007/10/29/php-and-payflow-pro-for-the-lose/</link> <comments>http://fleshy.org.nz/2007/10/29/php-and-payflow-pro-for-the-lose/#comments</comments> <pubDate>Mon, 29 Oct 2007 20:51:55 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[php]]></category> <category><![CDATA[ruby]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/774</guid> <description><![CDATA[Posting this cause I wan&#8217;t aware and the only other post I found was dated January. Since Paypal purchased Verisign they are discontinuing the pfpro extension to PHP. And in fact, what I&#8217;m reading is that Sept 2009 is the end of life for that functionality, meaning requests will not work beyond that point. For [...]]]></description> <content:encoded><![CDATA[<p>Posting this cause I wan&#8217;t aware and the only other post I found was dated January.</p><p>Since Paypal purchased Verisign they are discontinuing the pfpro extension to PHP. And in fact, what I&#8217;m reading is that Sept 2009 is the end of life for that functionality, meaning requests will not work beyond that point.</p><p>For sites using pfpro that ned to transition, the solution is<br
/> 1) use the java sdk<br
/> 2) use the .net sdk<br
/> 3) write your own api to utilize curl and https<br
/> 4) use a public api for curl and https a la <a
href="http://www.paypaldeveloper.com/pdn/board/message?message.uid=28775#U28775">This post from the paypal developer forum</a></p><p>ALSO&#8230;<br
/> this means if you&#8217;re installing a 64 bit system, you&#8217;re pretty much screwed because there are no new libraries/binaries released for pfpro under that platform&#8230; unless you&#8217;re running a .net or java solution.</p><p>Sucks.</p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/10/29/php-and-payflow-pro-for-the-lose/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Vim tip: keyboard shortcuts</title><link>http://fleshy.org.nz/2007/10/26/vim-tip-keyboard-shortcuts/</link> <comments>http://fleshy.org.nz/2007/10/26/vim-tip-keyboard-shortcuts/#comments</comments> <pubDate>Fri, 26 Oct 2007 15:32:23 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[code]]></category> <category><![CDATA[keyboard]]></category> <category><![CDATA[vim]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/771</guid> <description><![CDATA[Finally got around to learning how to define keyboard shortucts in vim. It&#8217;s easy! map &#60;desiredkey&#62; &#60;targetaction&#62; So, for example, I split windows vertically and want to navigate via ctrl+pagedown or pageup. Here&#8217;s what I did (include &#60; and &#62; when defining) map &#60;c-pageup&#62; &#60;c-w&#62;h map &#60;c-pagedown&#62; &#60;c-w&#62;l Found via a vim wiki search [ad#Google [...]]]></description> <content:encoded><![CDATA[<p>Finally got around to learning how to define keyboard shortucts in vim. It&#8217;s easy!</p><p><code><br
/> map &lt;desiredkey&gt; &lt;targetaction&gt;<br
/> </code><br
/> So, for example, I split windows vertically and want to navigate via ctrl+pagedown or pageup.</p><p>Here&#8217;s what I did (include &lt; and &gt; when defining)<br
/> <code><br
/> map &lt;c-pageup&gt; &lt;c-w&gt;h<br
/> map &lt;c-pagedown&gt; &lt;c-w&gt;l<br
/> </code></p><p>Found via <a
href="http://vim.wikia.com/wiki/Alternative_tab_navigation">a vim wiki search</a><br
/> [ad#Google Adsense small leaderboard]<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/10/26/vim-tip-keyboard-shortcuts/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Vim awesomeness.</title><link>http://fleshy.org.nz/2007/09/28/vim-awesomeness/</link> <comments>http://fleshy.org.nz/2007/09/28/vim-awesomeness/#comments</comments> <pubDate>Fri, 28 Sep 2007 17:56:17 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[code]]></category> <category><![CDATA[vim]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/763</guid> <description><![CDATA[If you use Vim as your text editor, try this :TOhtml This will generate an HTML version of your source code, complete with color scheme. It&#8217;s pretty sweet. Example here (opens a new window) This just tickles me.]]></description> <content:encoded><![CDATA[<p>If you use Vim as your text editor, try this<br
/> :TOhtml</p><p>This will generate an HTML version of your source code, complete with color scheme. It&#8217;s pretty sweet.</p><p><a
target="_new" href="/part_item_rga.rb.html">Example here</a> (opens a new window)</p><p>This just tickles me.<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/09/28/vim-awesomeness/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Odd SQL Server errors</title><link>http://fleshy.org.nz/2007/08/31/odd-sql-server-errors/</link> <comments>http://fleshy.org.nz/2007/08/31/odd-sql-server-errors/#comments</comments> <pubDate>Fri, 31 Aug 2007 18:01:13 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[code]]></category> <category><![CDATA[sql]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/759</guid> <description><![CDATA[Maybe someone will find this post and explain to me why SQL Server behaves like this. My question isn&#8217;t &#8220;how should I rewrite this query&#8221;, but &#8220;why does SQL Server act like this&#8221;. The behavior I see is that for some reason it&#8217;s easier to do TOP bignumber than TOP smallnumber. In my instance, TOP [...]]]></description> <content:encoded><![CDATA[<p>Maybe someone will find this post and explain to me why SQL Server behaves like this. My question isn&#8217;t &#8220;how should I rewrite this query&#8221;, but &#8220;why does SQL Server act like this&#8221;. The behavior I see is that for some reason it&#8217;s easier to do TOP bignumber than TOP smallnumber. In my instance, TOP 3 takes up to 2 minutes to return results, whereas TOP 5 is instantaneous.</p><p><span
id="more-759"></span><br
/> Situation, selecting the first 3 Announcements for particular User Roles at a particular Organization.</p><p>There is an announcement table and a meta table containing org/role join information.</p><p>The (somewhat crappy) query is like so:<br
/> <code>SELECT TOP 3 b.announcement_title FROM announcements b<br
/> WHERE b.anouncement_id IN (<br
/> SELECT<br
/> &nbsp;&nbsp;DISTINCT a.announcement_id<br
/> FROM<br
/> &nbsp;&nbsp;announcements b, announcement_role_org aro<br
/> WHERE<br
/> &nbsp;&nbsp;aro.announcement_id = b.announcement_id<br
/> &nbsp;&nbsp; AND<br
/> &nbsp;&nbsp;aro.role_id = $role_id<br
/> &nbsp;&nbsp; AND<br
/> &nbsp;&nbsp;aro.org_id = $org_id<br
/> )<br
/> </code></p><p>Yes, I know it should have been written as a join.</p><p>This is the problem:</p><ul><li>When the outer select says TOP 3, the server chugs forever and doesn&#8217;t return a result (at least, doesn&#8217;t return a result within 2 minutes, I killed the select after that time limit).</li><li>When the outer select says TOP 5 or TOP 6, it returns results fairly instantly</li></ul><p>WTF?<br
/> For the record, the inner select for the $role and $org I specified only ever return 6 results.</p><p>Oh, lastly&#8230; if I say NOT IN (returns 210 results), it doesn&#8217;t seem to matter what TOP value I have.</p><p>WHY???<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/08/31/odd-sql-server-errors/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>My tools for development under Ubuntu</title><link>http://fleshy.org.nz/2007/08/29/my-tools-for-development-under-ubuntu/</link> <comments>http://fleshy.org.nz/2007/08/29/my-tools-for-development-under-ubuntu/#comments</comments> <pubDate>Thu, 30 Aug 2007 02:03:29 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[gnome]]></category> <category><![CDATA[linux]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[ruby]]></category> <category><![CDATA[ubuntu]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/758</guid> <description><![CDATA[My work machine recently developed the click of death, so I had to get a new hard drive and reinstall everything. Just in case this happens again, and in case anyone else is interested, below is the list of things I install in addition to the standard Ubuntu installation: Development build-essential ruby1.8, librubymysql, ruby-devel,gems mysql [...]]]></description> <content:encoded><![CDATA[<p>My work machine recently developed the click of death, so I had to get a new hard drive and reinstall everything. Just in case this happens again, and in case anyone else is interested, below is the list of things I install in addition to the standard Ubuntu installation:<br
/> <span
id="more-758"></span><br
/> <strong>Development</strong></p><ul><li>build-essential</li><li>ruby1.8, librubymysql, ruby-devel,gems</li><li>mysql</li><li>vim-full (ruby, perl, etc)</li><li>subversion</li><li>kernel-headers</li><li>exuberant ctags</li></ul><p><strong>Config</strong></p><ul><li>nvidia-glx</li><li>envy</li><li>gnome-color-chooser</li></ul><p><strong>Graphics</strong></p><ul><li>inkscape</li><li>gimpshop</li></ul><p><strong>Connectivity</strong></p><ul><li>synergy</li><li>ssh-server</li><li>citrix client</li><li>sshfs</li><li>nfs</li><li>smbfs</li></ul><p><strong>Misc</strong></p><ul><li>firefox extensions</li><li>compiz-fusion</li><li>amarok</li><li>restricted codecs (w32codecs, mp3, flash, etc)</li><li>msttcorefonts</li><li>gmail-notifier</li><li>tilda</li><li>vmware-server</li><li>opera</li><li>ies4linux</li></ul><p>There are a bunch of other things I have to set up as well, such as NFS mounting the dev server, installing Vim plugins, and reinstalling my Firefox extensions, but for the most part it took about an hour and a half from the start of install to finish for me to get my box up and running nicely again. I really like Ubuntu&#8217;s package management <img
src='http://fleshy.org.nz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p><strong>Protip:</strong> Put your dot files (such as .gaim or .vimrc) into subversion. Makes migrating and recovering from HDD failure very easy.<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/08/29/my-tools-for-development-under-ubuntu/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Ruby Braces vs. Do/End blocks</title><link>http://fleshy.org.nz/2007/07/23/ruby-braces-vs-doend-blocks/</link> <comments>http://fleshy.org.nz/2007/07/23/ruby-braces-vs-doend-blocks/#comments</comments> <pubDate>Mon, 23 Jul 2007 15:57:41 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[code]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[ruby]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/748</guid> <description><![CDATA[When parentheses are important: So, braces have higher precedence over do/end blocks. According to Pickaxe, when calling a method with no parentheses, the braces will be applied to the last method parameter, do will be applied to the invocation. A Very Contrived Example: def string_to_integer &#160;&#160;if block_given? &#160;&#160;&#160;&#160;yield.to_i &#160;&#160;else &#160;&#160;&#160;&#160;0 &#160;&#160;end end a = [1,2,3] [...]]]></description> <content:encoded><![CDATA[<p><strong>When parentheses are important:</strong><br
/> So, braces have higher precedence over do/end blocks. According to Pickaxe, when calling a method with no parentheses, the braces will be applied to the last method parameter, do will be applied to the invocation.</p><p>A Very Contrived Example:<br
/> <code><br
/> def string_to_integer<br
/> &nbsp;&nbsp;if block_given?<br
/> &nbsp;&nbsp;&nbsp;&nbsp;yield.to_i<br
/> &nbsp;&nbsp;else<br
/> &nbsp;&nbsp;&nbsp;&nbsp;0<br
/> &nbsp;&nbsp;end<br
/> end<br
/> a = [1,2,3]<br
/> </code><br
/> A) a.inject string_to_integer { &#8217;5&#8242; } do |i,sum| i + sum end => 11<br
/> B) a.inject string_to_integer { |i,sum| i + sum }   => undefined method error<br
/> C) a.inject string_to_integer do  |i,sum| i + sum end   => 6</p><p>in A, the first brace is sent to the string_to_integer method<br
/> in B, the same happens, but the block was actually meant for inject<br
/> in C it works as intended.</p><p>Just food for thought.</p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/07/23/ruby-braces-vs-doend-blocks/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Observation: Code cleverness == Bad</title><link>http://fleshy.org.nz/2007/05/02/observation-code-cleverness-bad/</link> <comments>http://fleshy.org.nz/2007/05/02/observation-code-cleverness-bad/#comments</comments> <pubDate>Wed, 02 May 2007 19:06:01 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[code]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[ruby]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/705</guid> <description><![CDATA[This is inspired by Ruby, but could apply to Perl as well. Situation: class with dynamic, on the fly class method definitions of the form What this does is defines some class methods role1_email_addresses, role2_email_addresses, etc on the fly. Works perfectly, until the first element returned in users is actually an empty email. This is [...]]]></description> <content:encoded><![CDATA[<p>This is inspired by Ruby, but could apply to Perl as well.</p><p>Situation: class with dynamic, on the fly class method definitions of the form<br
/> <script src='http://pastie.org/955714.js'></script></p><p>What this does is defines some class methods role1_email_addresses, role2_email_addresses, etc on the fly.</p><p>Works perfectly, until the first element returned in users is actually an empty email.</p><p>This is an example of writing clever code for succinctness (which is rampant in ruby circles). The problem is this code has bugs, and in order to fix it you have to rewrite it or add extra checks and workarounds. Which means the code is no longer succinct nor clever.</p><p>In my recent experience, that&#8217;s all that overly-clever code gets you. You just end up making extra work for yourself (or the maintainer) down the line.</code><br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2007/05/02/observation-code-cleverness-bad/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>How to add event listeners under the GMap2 API</title><link>http://fleshy.org.nz/2006/08/29/how-to-add-event-listeners-under-the-gmap2-api/</link> <comments>http://fleshy.org.nz/2006/08/29/how-to-add-event-listeners-under-the-gmap2-api/#comments</comments> <pubDate>Tue, 29 Aug 2006 15:40:55 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[api]]></category> <category><![CDATA[code]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/?p=530</guid> <description><![CDATA[Some Javascript stuff here concerning Google Maps and coding for them. This took me a little bit to figure out, cause I was a little slow, last night. Also, the Google Map API documentation doesn&#8217;t seem to cover this sort of eventuality. Say that, for whatever reason, you have an array of GMarker objects and [...]]]></description> <content:encoded><![CDATA[<p>Some Javascript stuff here concerning Google Maps and coding for them.</p><p>This took me a little bit to figure out, cause I was a little slow, last night. Also, the Google Map API documentation doesn&#8217;t seem to cover this sort of eventuality.</p><p>Say that, for whatever reason, you have an array of GMarker objects and you want to programatically apply an info window to each of them.</p><p>Doing so is not as straightforward as this code:<br
/> <code><br
/> for (i in markers) {<br
/> ...<br
/> GEvent.addListener(markers[i], "mouseover", function() {<br
/> marker[i].openInfoWindowHtml(text_var);<br
/> } );<br
/> }<br
/> </code></p><p>This won&#8217;t work, because in the third parameter, &#8220;i&#8221; is passed in literally. In order to have the &#8220;i&#8221; successfully expanded to an index, you have to eval the function creation, like so:<br
/> <code><br
/> for (i in markers) {<br
/> ...<br
/> GEvent.addListener(marker[i], "mouseover", eval('function() {' +<br
/> 'marker[' + i + '].openInfoWindowHtml("' + text_var + '"); ' +<br
/> '} ')<br
/> );<br
/> }<br
/> </code></p><p>Just passing it on.<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2006/08/29/how-to-add-event-listeners-under-the-gmap2-api/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Excellent Rails plugin for auto-ERD generation</title><link>http://fleshy.org.nz/2006/07/23/excellent-rails-plugin-for-auto-erd-generation/</link> <comments>http://fleshy.org.nz/2006/07/23/excellent-rails-plugin-for-auto-erd-generation/#comments</comments> <pubDate>Sun, 23 Jul 2006 15:47:21 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/archives/506</guid> <description><![CDATA[Need to generate a nice ERD or inheritance diagram for your Rails app? This plugin comes to the rescue! This is one of those things that seems like totally a no-brainer, given Rails&#8217; knowledge of the schema. read more&#160;&#124;&#160;digg story]]></description> <content:encoded><![CDATA[<p>Need to generate a nice ERD or inheritance diagram for your Rails app? This plugin comes to the rescue! This is one of those things that seems like totally a no-brainer, given Rails&#8217; knowledge of the schema.</p><p><a
href="http://rav.rubyforge.org/">read more</a>&nbsp;|&nbsp;<a
href="http://digg.com/programming/Excellent_Rails_plugin_for_auto_ERD_generation">digg story</a><br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2006/07/23/excellent-rails-plugin-for-auto-erd-generation/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to tell when your programming logic needs tweaking</title><link>http://fleshy.org.nz/2006/05/07/how-to-tell-when-your-programming-logic-needs-tweaking/</link> <comments>http://fleshy.org.nz/2006/05/07/how-to-tell-when-your-programming-logic-needs-tweaking/#comments</comments> <pubDate>Sun, 07 May 2006 15:48:48 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[code]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/?p=459</guid> <description><![CDATA[I meant to post this when I found it awhile ago: If you&#8217;ve writen code that needs to sometimes generate the following SQL query "SELECT * FROM tbl WHERE (1 = 2) ... " you should probably think about refactoring.]]></description> <content:encoded><![CDATA[<p>I meant to post this when I found it awhile ago:</p><p>If you&#8217;ve writen code that needs to sometimes generate the following SQL query<br
/> <code><br
/> "SELECT * FROM tbl WHERE (1 = 2) ...  "<br
/> </code><br
/> you should probably think about refactoring.</p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2006/05/07/how-to-tell-when-your-programming-logic-needs-tweaking/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>a beautiful layout and how I found it</title><link>http://fleshy.org.nz/2005/11/22/a-beautiful-layout-and-how-i-found-it/</link> <comments>http://fleshy.org.nz/2005/11/22/a-beautiful-layout-and-how-i-found-it/#comments</comments> <pubDate>Tue, 22 Nov 2005 19:09:52 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/?p=329</guid> <description><![CDATA[So, I began with an article on standards when programming, which linked to this bit about marking up XHTML which linked to this bit on microformats. I really like the layout and design of that last link. It&#8217;s just striking, yet clean. Also it kind of reminds me of this 4&#8243; Everlasting Gobstopper I once [...]]]></description> <content:encoded><![CDATA[<p>So, I began with <a
href="http://www.muffinresearch.co.uk/archives/2005/10/31/Become_a_better_Standardista.php">an article on standards when programming</a>, which linked to <a
href="http://tantek.com/presentations/2005/09/elements-of-xhtml/">this bit about marking up XHTML</a> which linked to <a
href="http://maetl.coretxt.net.nz/?m=how-microformats-are-different">this bit on microformats</a>.</p><p>I <em>really</em> like the layout and design of that last link. It&#8217;s just striking, yet clean. Also it kind of reminds me of this 4&#8243; <a
href="http://shop.store.yahoo.com/candydepot/woevgo.html">Everlasting Gobstopper</a> I once had and tried to eat over the course of 8 months, back when I was 12. The inside had concentric rings that looked similar to that target image at the top right.<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2005/11/22/a-beautiful-layout-and-how-i-found-it/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>ugh</title><link>http://fleshy.org.nz/2005/09/23/ugh-2/</link> <comments>http://fleshy.org.nz/2005/09/23/ugh-2/#comments</comments> <pubDate>Fri, 23 Sep 2005 17:32:00 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[code]]></category> <category><![CDATA[coding]]></category> <category><![CDATA[computer science]]></category> <category><![CDATA[lj-archive]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/2005/09/23/ugh-2/</guid> <description><![CDATA[my(@lists) = sort { if( (-f $a &#38;&#38; -f $b) &#124;&#124; (-d $a &#38;&#38; -d $b) ) { return lc($a) cmp lc($b); } else { return -d $a &#124;&#124; -1; } } map { $dir.$_ } readdir LISTDIR; Is why I dislike Perl and I would suggest is a prime example of how Perl hackers [...]]]></description> <content:encoded><![CDATA[<p><code><br
/> my(@lists) = sort { if( (-f $a &amp;&amp; -f $b) || (-d $a &amp;&amp; -d $b) ) { return lc($a) cmp lc($b); } else { return -d $a || -1; } } map { $dir.$_ } readdir LISTDIR;<br
/> </code></p><p>Is why I dislike Perl and I would suggest is a prime example of how Perl hackers give Perl a bad name. I mean, at least multiline it for readability!</p><p>*shakes head*</p><p>In other news, I&#8217;ve already started to make myself sick of the new Ladytron &#8212; even before it&#8217;s released.<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2005/09/23/ugh-2/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>I just rather liked this</title><link>http://fleshy.org.nz/2005/01/19/i-just-rather-liked-this/</link> <comments>http://fleshy.org.nz/2005/01/19/i-just-rather-liked-this/#comments</comments> <pubDate>Wed, 19 Jan 2005 18:29:00 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[lj-archive]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/2005/01/19/i-just-rather-liked-this/</guid> <description><![CDATA[Wrote it all by myself with my own two hands&#8230; On the company intranet, this is my autobiography Born on the frigid tundra of Minnesota, Jonathan journeyed to Indiana at an early age &#8212; seeking fame, fortune, and honor among the programming community. Under the gentle tutelage of the sages at the IUSB Arcanum, Jonathan [...]]]></description> <content:encoded><![CDATA[<p>Wrote it all by myself with my own two hands&#8230;</p><p>On the company intranet, this is my autobiography</p><p><span
id="more-110"></span><br
/> Born on the frigid tundra of Minnesota, Jonathan journeyed to Indiana at an early age &#8212; seeking fame, fortune, and honor among the programming community. Under the gentle tutelage of the sages at the IUSB Arcanum, Jonathan learned the art and magic of Pascal and C++. All was pleasant and serene for a time, but darkness loomed on the horizon&#8230;</p><p>Eventually, perceiving the limitations of his instructors, Jonathan spurned his once-tutors and began to branch on his own&#8230; first in the employ of the ill-fated Golden Dome enterprise, then the equally ill-fated RentPayment.com venture (which was an even riskier endeavor, but promised fantastic returns). Through each of these adventures he learned the lore of PHP, Perl, LDAP, and MySQL. Unfortunately, he was beaten down and broken by the vagaries of chance and the whims of the gods; for neither of these ventures ever realized their success and all members of said parties eventually were left to wander the bleak and barren landscape of a post-boom world.</p><p>Thus contrite and wizened by experience, Jonathan serves as Developer under the scrutiny of the Goshen Viziers. His sole aim and focus is now not to take for granted the teachings of his elders but, having learned wisdom from his travels, to learn, digest, and expand on the accumulated knowledge of the ages.</p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2005/01/19/i-just-rather-liked-this/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>For the benefit of geeks</title><link>http://fleshy.org.nz/2004/12/10/for-the-benefit-of-geeks/</link> <comments>http://fleshy.org.nz/2004/12/10/for-the-benefit-of-geeks/#comments</comments> <pubDate>Fri, 10 Dec 2004 22:58:00 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[code]]></category> <category><![CDATA[lj-archive]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/2004/12/10/for-the-benefit-of-geeks/</guid> <description><![CDATA[This one&#8217;s going to be technical. So, if you&#8217;re not interested in hearing about the difficulties with Java, runtime.exec, and OutputStream I&#8217;ve been having at work, or if you just don&#8217;t find programming interesting, skip this entry. I&#8217;m more posting this for the benefit of those who had the same problems I&#8217;ve had since last [...]]]></description> <content:encoded><![CDATA[<p>This one&#8217;s going to be technical. So, if you&#8217;re not interested in hearing about the difficulties with Java, runtime.exec, and OutputStream I&#8217;ve been having at work, or if you just don&#8217;t find programming interesting, skip this entry. I&#8217;m more posting this for the benefit of those who had the same problems I&#8217;ve had since last friday, and in the hopes that this entry gets spidered so future web searchers will find it and save some hair-pulling. I did probably 50-100 different searches on this issue which yielded me two possible solutions, only one of which ended up referring to my actual problem.</p><p>Also, this is rather long.</p><p>&lt;lj-cut&gt;<br
/> I call this one:</p><p>How I Attempted to Bend OutputStream to My Will<br
/> or<br
/> Jonathan Gets It in the Chocolate Starfish from Java and Windows</p><p>&lt;b&gt;Quick Summary:&lt;/b&gt; when using Runtime.exec() to call a program with a login prompt, that login prompt will never be passed to that process&#8217;s InputStream from getInputStream() if the process has no terminal. Further, text cannot be sent via the OutputStream of getOutputStream() for the same reason.</p><p>Here&#8217;s the scoop.</p><p>&lt;b&gt;Backstory:&lt;/b&gt;<br
/> One of our clients has a website that takes orders for various pieces of merchandise. We take these orders, export and download them to the client&#8217;s server, a Win2k box, where the orders are then processed. Simple on the surface, but when you throw in a few complexities, it becomes kind of a problem. They are, in no particular order:<br
/> &lt;ul&gt;<br
/> &lt;li&gt;We want to transfer the exported orders in a secure fashion, due to privacy considerations<br
/> &lt;li&gt;We would like to avoid purchasing/installing extra software<br
/> &lt;li&gt;We want the process automated<br
/> &lt;li&gt;We want the orders to be removed from the server as soon as they are successfully downloaded<br
/> &lt;/ul&gt;<br
/> One option is pgp encryption and ftp, but starting ftp on our server was a last resort thing. Further, pgp encryption is kind of a hassle in terms of either educating the user or writing a decryption program on the windows end.<br
/> We didn&#8217;t want the customer to have to purchase a windows ssh server package, especially seeing as how we can use a free ssh client to go from their end to &lt;i&gt;our&lt;/i&gt; end.</p><p>So, the decision was made to automate an scp (secure copy, ftp tunnelled through ssh) from the client to our box. Simple enough.<br
/> However, we ended up needing to use SSH Secure Shell&#8217;s scp2 client because it has the nice option of having a flag to move/remove files on the remote host. pscp, putty&#8217;s scp client, doesn&#8217;t have that. Downside is scp2 does not accept passwords on the command line (as does pscp), so automating the login gets tricker.. for one thing because the shared key format for SSH Secure Shell appears to be incompatible with our sshd.</p><p>&lt;b&gt;The Problem:&lt;/B&gt;<br
/> This is the crux of what I&#8217;ve dealt with for the past week. Sending a frickin&#8217; password to scp2. At first we handled it with a simple vbscript. Task scheduler calls a batch file, which then calls the vbscript. The vbscript executes scp2 with the appropriate paths and whatnot, waits for a few seconds to make sure the scp2 window has connected, then uses SendKeys() to send the password to the window. Fine and dandy &#8212; as long as someone&#8217;s logged in. If the machine is sitting at a windows login prompt, scp2 essentially hangs forever waiting for a password. The script sends it&#8230; but the only option for sendkeys is to send to the active &lt;i&gt;window&lt;/i&gt;.. which does not exist when the computer is in a logged-off state.</p><p>Frickin annoying as hell. This was last Friday.</p><p>So I spent most of Friday thinking about the problem, trying to determine what was going on (I didn&#8217;t figure out the logged-off problem until late Monday). I correctly identified that the password wasn&#8217;t being sent right for some reason. So, I looked for some other way to encapsulate the scp process such that I could send directly to stdin and not have to mess with open windows as in VBScript. Java popped into my mind. Seemed like a perfect solution, encapsulation, wrapping shit up and providing access methods. I felt &lt;i&gt;certain&lt;/i&gt; that it would solve my problems.</p><p>Saturday I spent a good portion of the day learning Java. I started from HelloWorld and glanced through the &lt;a href=&#8221;http://java.sun.com/docs/books/tutorial/getStarted/index.html&#8221;&gt;java.sun.com tutorials&lt;/a&gt;, then skipped to Runtime.exec(). Perfect! An API that lets me call system commands!</p><p>Well, I had a few problems, similar to many who try to call &#8220;dir&#8221; on winxp or win2k. dir isn&#8217;t an executable per se, one has to call Runtime.exec(&#8220;cmd /k dir&#8221;) because dir is part of the interpreter. Okay, fine. I found many references on how to grab output from your called command. &lt;a href=&#8221;http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html&#8221;&gt;InputStream&lt;/A&gt; returned by Runtime.exec()getInputStream(); Sweet. I coded one little class that would reliably grab all the output from the command &#8220;cmd /c ping localhost&#8221; and all was golden.</p><p>&lt;b&gt;After a Brief Ray of Light, Further Into the Abyss:&lt;/b&gt;<br
/> It was when I attempted to call programs that accept input that things got nasty.</p><p>I had code as follows<br
/> Runtime rt = Runtime.getRuntime();<br
/> proc = rt.exec(cmd1,null);  // cmd1 is something like &#8220;telnet hostname&#8221;<br
/> OutStream os = proc.getOutputStream();</p><p>I couldn&#8217;t write to it! os.write(&#8216;whatever&#8217;); refused to do my bidding! I hacked away at it, then found this gem &lt;a href=&#8221;http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html&#8221;&gt;on why outputstream and inputstream seem to block each other&lt;/a&gt;. Fine. Apparently you have to grab IO as soon as you exec or they could block. So it needs to be threaded, I can do that.</p><p>So I rewrote my program using the StreamGobbler class he illustrates, tested it with ping, it worked. Then I added a second class, StreamSpitter which was just modified so it accepted OutputStream and wrote instead of read.</p><p>Nothing.</p><p>Still apparently blocking on input. I got really crazy and started messing with synchronization and monitor threads. Still nothing.</p><p>Let me tell you, I hacked and searched the web about this from last Saturday night all the way til Thursday. I found LOTS of people with the same type of problem&#8230; everyone was referred to that pitfalls link above, but I knew it wasn&#8217;t solving my problem. I could read process output just fine, but I couldn&#8217;t apparently send text. Well, if I killed the hanging scp, telnet, or ftp process, I&#8217;d sometimes see my text, but rarely. And yes, I tried many, many, many different variations on newlines just to make sure the program was hitting the &#8220;enter&#8221; key after sending text. I even found someone who said he had to send ^Z (\u001a) to make the stream send.</p><p>&lt;b&gt;Discovery and Resolution:&lt;/b&gt;<br
/> I was about ready to throw up my hands in disgust until I found a little tidbit on the java.sun.com forums. WHich I can&#8217;t find the  link to right now, sorry. Anyway, apparently with login-based applications the application HAS to be somehow connected to a terminal. tty0 for example. If I run scp2 from the command line, I get the console or whatever windowsy variation of tty it uses. So login works. In other words, login for ftp, telnet, ssh, scp, etc, all need their stdio to be at a term. Calling an essentially headless subprocess is going to fail at this BY DESIGN. Supposedly one can do what I was trying to do on a unix system, because the subprocess inherits the parent terminal, but I never tested this.</p><p>Fuck, that was irritating. My code was essentially perfect Saturday night, but it would never execute as intended due to Windows and Java getting together and gangbanging me.</p><p>And remember, this is all because I wanted to send a password to a program.</p><p>In the end, knowing that my code was pristine and good already, I was able to come up with an alternate solution in about 15 minutes. Instead of using scp2, I switched back to pscp. I send the password on the command line and download just fine. Then I turn around and upload an exists file. The next time the export on OUR end runs, if it sees the exists file it knows the download was successful, so it delets what needs to be deleted.</p><p>Really frickin&#8217; frustrating. And you have no idea the elation I felt when I got it all to work right. I was practically dancing for joy <img
src='http://fleshy.org.nz/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /></p><p>&lt;i&gt;Anyway&lt;/i&gt;, that&#8217;s my story.  I just hope some other poor soul who&#8217;s struggling with the same problem finds this and it helps them.</p><p>If you&#8217;re curious, &lt;a href=&#8221;http://www.wanthoney.com/downloader.java&#8221;&gt;here&#8217;s&lt;/a&gt; my downloader class file. The StreamGobbler class you can find &lt;a href=&#8221;http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html&#8221;&gt;at this link&lt;/a&gt;<br
/> &lt;/lj-cut&gt;<br
/></p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2004/12/10/for-the-benefit-of-geeks/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Several things</title><link>http://fleshy.org.nz/2004/10/12/several-things/</link> <comments>http://fleshy.org.nz/2004/10/12/several-things/#comments</comments> <pubDate>Tue, 12 Oct 2004 22:03:00 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[autocross]]></category> <category><![CDATA[food]]></category> <category><![CDATA[lj-archive]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false">http://fleshy.org.nz/yum/2004/10/12/several-things/</guid> <description><![CDATA[I sunburned my face on Sunday. Not bad, but enough to suck. I&#8217;ll let you in on a little secret concerning this: never wash a sunburned face with Lava soap. So, Sunday was the last autocross of the season for the local SCCA group (not to be confused with the SCA. Totally different group of [...]]]></description> <content:encoded><![CDATA[<p>I sunburned my face on Sunday. Not bad, but enough to suck. I&#8217;ll let you in on a little secret concerning this: never wash a sunburned face with Lava soap.</p><p>So, Sunday was the last autocross of the season for the <a
href="http://www.sbrscca.org">local SCCA group</A> (not to be confused with <a
href="http://www.sca.org">the SCA</A>. Totally different group of people.) I ended up doing really well. Best times on this particular course layout I&#8217;ve gotten so far. Another cool thing was that a lot of novices came up and asked for questions and advice from me, and several regular attendees came up to to just shoot the shit and stuff. Prior to this event I&#8217;d always felt a bit like persona non grata because I <a
href="http://camry.wanthoney.com">raced a sedan</a> rather than something more suited. I don&#8217;t know why there was the sudden attention&#8230; Maybe it&#8217;s because people have finally started recognizing me as a regular racer, maybe it&#8217;s because they were impressed a 4cyl Camry could turn decent times. Who knows &#8212; it was nice to get some sort of recognition though.</p><p>Autocrosses always wipe me out. The events typically last 9-3 or 9-5, so it&#8217;s a long time of just being outside in the sun, standing on asphalt, and generally being more active than my 9-6 programming job is. Plus, there typically isn&#8217;t a lunch break. As well I drink a lot of coffee. So I end up dehydrated, malnourished, and sun-stroked by the end of the day. Totally out of it. This past event I planned ahead and purchased a 24-pack of water and some snack bars &#8212; and made sure I only drank a little coffee&#8230;</p><p>I ate one and a half boxes worth of NutriGrain bars on Sunday. I&#8217;m a little worried that such a massive intake of NutriGrain is going to give me cancer of the femur or something. As far as I can tell nothing bad has happened so far, though I will say that Monday morning my urine smelled of burning hemp; so obviously <i>something</i> got messed up. Probably too much niacin or riboflavin. I got about 215% of my RDA on those.</p><p>Come to think of it, I probably did OD on some of the added vitamins and whatnot&#8230; that would certainly explain the fever-like symptoms I exeperienced Sunday night. I&#8217;m still not positive there isn&#8217;t a cold a-brewin&#8217; cause I do feel sniffly, but it may just be too much processed snack bars. We shall see.</p><p>Anyway, Sunday was fun, Monday I was wiped out. I went through Monday in a half-trance. I&#8217;m still not 100% positive I really did see that 8 year old girl doing perfect cartwheels in the parking lot at lunch. And I&#8217;m only 75% positive I saw that gruff guy on a Harley wearing a yellow, Dr. Seuss-ish <a
href="http://www.pimphats.com/wwwdotpimphatsdotcom_pimphats.htm">pimp hat</a>.</p><p>Today I feel a lot better, though. No worries and no hallucinations. Life is good.</p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2004/10/12/several-things/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>The Laws Have Changed</title><link>http://fleshy.org.nz/2004/09/11/the-laws-have-changed/</link> <comments>http://fleshy.org.nz/2004/09/11/the-laws-have-changed/#comments</comments> <pubDate>Sat, 11 Sep 2004 10:27:00 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[general]]></category> <category><![CDATA[lj-archive]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false"></guid> <description><![CDATA[This may be a little disconnected. I saw Garden State last night&#8230; so goood. My friend adam has a (somewhat older) journal entry with thoughts on it. I&#8217;ll just say I echo his impression of the movie, with the added note that perhaps the most effective scene for me was the party scene at the [...]]]></description> <content:encoded><![CDATA[<p>This may be a little disconnected.</p><p><span
id="more-50"></span><br
/> I saw Garden State last night&#8230; so goood. My friend <a
href="http://adam.giant-robot.com">adam</a> has a (somewhat older) journal entry with thoughts on it. I&#8217;ll just say I echo his impression of the movie, with the added note that perhaps the most effective scene for me was the party scene at the very beginning where Large is sitting there zoning in the back room while everyone plays spin the bottle. It wonderfully evoked recollections of past High School and post-HS parties I&#8217;d gone to in days past. The overall tone of disconnectedness and portrayal of going nowhere lives also had a particular resonance with me, as up until recently I&#8217;ve felt VERY much that way. A very entertaining and touching movie. Maybe it&#8217;s me, maybe it&#8217;s the excellent characters, but I actually know or have known people like every single character in that movie, to a certain extent.</p><p>It&#8217;s strange, I&#8217;ve seen quite a few movies lately and each of them (minus <i>Bourne Supremacy</i>) has felt like a significant movie to me. You know, those movies where you walk out feeling pondersome and introspective and can&#8217;t really carry on a conversation immediately after seeing it cause you&#8217;re trying to order your thoughts and reactions. I&#8217;m wondering if I&#8217;ve just had good luck or if my recent elevation out of job-depression has altered the way I&#8217;m viewing things in general.</p><p>I hadn&#8217;t really realized how fully depressed my old job made me. Well, not so much the job itself, but the financial and social situation the job brought about (not a lot of money, no coworkers to talk to, etc). Since starting my programming gig several weeks ago, I just feel filled with joy and light &#8212; hokey as it sounds. Finally I don&#8217;t feel aimless like Large&#8217;s gravedigger friends are depicted. Finally I feel like I&#8217;m going somewhere. This may be because I&#8217;ve had a &#8220;when I get a different job&#8221; goal for so long that now that I find myself past the goalpost, it&#8217;s freeing.</p><p>I know work shouldn&#8217;t be my life, but it and its financial aspects have been my focus for so long that it really IS my life. Further, what I do defines me on a certain level &#8212; if asked what I do I say, &#8220;I&#8217;m such and such at such and such a place&#8221;. In the saying of it I&#8217;m silently approving or disapproving of what I do, and  thus myself; for, if I&#8217;m doing something I consider stupid or bad, by my association I must also be stupid or bad. I don&#8217;t know if that&#8217;s coherent.</p><p>And not to say that my previous job was stupid or bad, just that it was emotionally deadening after awhile; and so MY impression of the job as less than desirable transferred to an impression of myself (for being the one doing the job) as undesirable. Add to that the fact that, for whatever reason, I did a phenomenal job at the last place without really trying &#8212; which led me to view it as not a challenge, not engrossing, almost not worthy of me&#8230; though I never explicitly thought of it as such in so many words. More, any jackass can do this job (though I know that&#8217;s realistically not the case.)</p><p>Suddenly I&#8217;m thrust into a new environment with new challenges&#8230; reawakening the dormant programming neurons. I&#8217;ve been telling people that I can sort of feel the mind reconnecting and reawakening in parts. I&#8217;m not kidding. It&#8217;s a strange sensation and a little exhausting. I&#8217;ve had to recall and use things I did 4 years ago. I&#8217;ve had to use proedures I learned in classes 6 years ago. I&#8217;ve had classes involving programming since my startup job, but nothing on this level. It&#8217;s really akin to a keystone class at college. Objects, hard-core and complex relational databases, non-intuitive data manipulation. It&#8217;s awesome. I got the happy jigglies when I ran across a recursive function in an include file, if that gives you any insight (if you know what I&#8217;m talking about).</p><p>So I&#8217;ve got this great vibe because I&#8217;m doing stuff that&#8217;s interesting and challenging, and finally when people ask me, &#8220;what do you do?&#8221;, I can say, &#8220;I&#8217;m a programmer&#8221;, or &#8220;I&#8217;m a developer&#8221;, and feel a certain sense of pride because what I do is very much not what the average joe can do. It&#8217;s not elitism, it&#8217;s accomplishment and joy in the use of my acquired abilities.</p><p>I&#8217;ve got some leftover financial issues stemming from the lag time between job paychecks, but they don&#8217;t seem so much of an issue. I&#8217;m getting payed a lot more than I was making before, and even though it&#8217;s not enough to suddenly buy all the things I&#8217;ve wanted like a laptop, new desktop, suspension, and wheels, even that isn&#8217;t sad for me. My environment suddenly seems sparkingly and new, and I am happy again.</p><p>Also, my typing is faster. So there&#8217;s that as well.</p> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2004/09/11/the-laws-have-changed/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Television BAD</title><link>http://fleshy.org.nz/2004/06/08/television-bad/</link> <comments>http://fleshy.org.nz/2004/06/08/television-bad/#comments</comments> <pubDate>Tue, 08 Jun 2004 22:37:00 +0000</pubDate> <dc:creator>Jonathan Warner</dc:creator> <category><![CDATA[lj-archive]]></category> <category><![CDATA[programming]]></category> <guid
isPermaLink="false"></guid> <description><![CDATA[Do you ever watch TV just to watch it? Not particularly interested in what&#8217;s on, just watching cause you&#8217;re too lazy to get up and get a book or do something more productive like sleeping? I do. Did tonight, actually. Fun part is when a commercial comes on, I switch channels until I find something [...]]]></description> <content:encoded><![CDATA[<p>Do you ever watch TV just to watch it? Not particularly interested in what&#8217;s on, just watching cause you&#8217;re too lazy to get up and get a book or do something more productive like sleeping? I do. Did tonight, actually.<br
/> <span
id="more-26"></span><br
/> Fun part is when a commercial comes on, I switch channels until I find something else interesting, with the intention to go back to the original station as soon as the commercials are over. However, I end up getting sort of interested in whatever I&#8217;ve landed on &#8212; then 10 minutes later suddenly realize I never went back to the original show I was watching.</p><p>The problem is I was invested enough in the original show to remember that I wanted to see what happened next, but I wasn&#8217;t invested enough to remember what the name of the show was. So I end up flipping channels a lot and hope I land on the original show in an interesting part, cause I just won&#8217;t stick around if I land on the original show and it&#8217;s a slow part. It&#8217;s sort of frustrating, and makes for schizophrenic show timelines&#8230; I end up combining the storylines from Law and Order SVU, That 70&#8242;s Show and ER. Oh no! Red gave Eric AIDS and now he&#8217;s in jail dying of leukemia! It&#8217;s pretty strange.</p><p>The thing that made me get my ass off the couch this evening is I reached the point where the only thing remotely interesting on was at the very bottom of the barrel, television-wise. There&#8217;s a new station in the area. Channel 69. WAAT is the station callsign. As far as I&#8217;ve seen, the programming of WAAT Channel 69 consists of the following:</p><li>M*A*S*H reruns</li><li>Cops episodes</li><li>Hunting and fishing shows from 12AM to 7AM or some crap. They advertise this as some big attraction.</li><li>Some kind of b-movie showcase thing called, I think, <a
href="http://home.comcast.net/~grotto1/index2.html">Svengoolie</a><p>I can dig three out of the four in that list. M*A*S*H is alright. Cops is entertaining on occasion. The hunting and fishing I guess is interesting from a sort of &#8220;let&#8217;s see how the natives live&#8221; perspective.</p><p>Svengoolie, however is attrocious. To give you an idea of what it&#8217;s like, think on this:<br
/> Remember Mystery Science Theater 3000? For those who&#8217;ve never watched it, it&#8217;s basically really bad B-movies with three guys down at the bottom of the screen making joking comments, poking fun, twisting words around, all portrayed as if they were watching this awful movie from the 50&#8242;s in a theater. Some episodes were funny, some were less so. The B-movies they showed were universally awful. Now take that, and imagine that the surrounding show, MST3K, was also a B-movie. So it&#8217;s a b-movie about making fun of b-movies.</p><p>This is Svengoolie, and this was the stinking pile of feces my remote finally landed on this evening; and the reason why I decided to turn off the television and instead look for more wholesome, internet-based entertainment. I say without sarcasm that I would honestly find more enjoyment reading rotten.com than watching Svengoolie.</p><p>See, it&#8217;s not that I don&#8217;t enjoy making fun of bad movies. Far from it! I quite enjoy watching bad films with friends, and I did rather like MST3K. No, in all truth I think the issue I have with Svengoolie is the production quality. Okay the set design is kitschy and the makeup is bad. Part of the gig and &#8220;feel&#8221; for the show. But the jokes that are supposed to be funny because they&#8217;re bad jokes, aren&#8217;t. They&#8217;re not even bad jokes. They&#8217;re statements. And we&#8217;re supposed to infer that they were bad jokes and therefor funny as bad jokes for the simple reason that they were not, in fact, funny. Do you see how maddening this is?</p><p>And the method of poking fun at the movies is shoddy and underproduced, too! 90% of the time it&#8217;s not a clear voice of this Svengoolie or whoever making fun, it&#8217;s a sound clip from ANOTHER MOVIE!!! Props for technical prowess amassing somewhat appropriate source material, but almost every single time they throw in one of these sound clips it&#8217;s of bad enough quality that I either A) cannot understand what the clip said, or B) cannot distinguish the clip from the rest of the movie, thus missing it as a supposedly humorous comment.</p><p>So I suppose the main thing that irritates me about the show is it&#8217;s so half-assed. It&#8217;s like they don&#8217;t care. My German-Protestant work ethic aside, if I&#8217;m going to waste my time in front of the television, I want it to be wasted on something that at least gives the semblance of acknowledging me as more than just a slab of meat with eyes. It&#8217;s totally insulting.</p><p>This show is bad and I want everyone on it to contract horrible dysentery.</p><p>That is all.</p><p>Oh, Edgar the Mouse says, &#8220;Hi&#8221;</li> ]]></content:encoded> <wfw:commentRss>http://fleshy.org.nz/2004/06/08/television-bad/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> </channel> </rss>
