{"id":91,"date":"2013-05-12T09:30:00","date_gmt":"2013-05-12T09:30:00","guid":{"rendered":"http:\/\/www.sgmlguru.org\/wp\/?p=91"},"modified":"2015-01-14T18:35:20","modified_gmt":"2015-01-14T18:35:20","slug":"i-did-some-code","status":"publish","type":"post","link":"http:\/\/www.sgmlguru.org\/wp\/?p=91","title":{"rendered":"I Did Some Code!"},"content":{"rendered":"<p>Yesterday evening, I had an itch that needed scratching.<\/p>\n<p>I was lacking some convenience features in an <b>XMetaL<\/b>-based authoring environment I am finalising for a client. There is a structure in the DTD that I am presenting as a table using some CSS in the editor, which makes perfect sense since it&#8217;s always going to be formatted that way when published. Presenting a structure as a table in <b>XMetaL<\/b>, however, means that <b>XMetaL<\/b> will hide the elements defined as table rows; it&#8217;s a side effect of how tables are presented in the editor and most editors have similar problems.<\/p>\n<p>But where HTML or CALS tables are supported by <b>XMetaL<\/b>&#8216;s customisations for tables (with adding or deleting rows or cells), my custom structure isn&#8217;t. It only looks like a table, it isn&#8217;t one because the actual semantics are quite different when studied in detail, and so the standard table functionality is not available. I needed custom code for my table-like structure.<\/p>\n<p>Under normal circumstances, I&#8217;d simply walk over to a colleague, describe my problem and let him do his magic. There is something slightly twisted and evil in any object-oriented programming, and I usually want no part of it. You have an &#8220;object&#8221; that, depending on things you very often can&#8217;t see or would not fully fathom anyway, have special magical abilities you can use to solve your problem, which is all fine and well, but very often, you also have a seemingly similar &#8220;object&#8221; that doesn&#8217;t have those magical abilities. It instead possesses different ones, and because you are but a learner and only borrowing the magic wand, you eventually leave it be.<\/p>\n<p>It&#8217;s evil.<\/p>\n<p>But this time, I thought &#8220;how hard can it be?&#8221; and started writing, aided by other people&#8217;s efforts, an <i>XMetaL Programmer&#8217;s Guide<\/i>, and an Ouija board (no, not really; just <b>Notepad ++<\/b>). Soon, those magical objects appeared with their special abilities, and I started invoking magic using <i>while<\/i> loops and other features I know from scripting languages. Remember Mickey Mouse in <i>Fantasia<\/i>? That&#8217;s me, thinking &#8220;how hard can it be?&#8221;<\/p>\n<p>The difference was that the magic here is better protected. Mickey never had access to Ctrl+Z.<\/p>\n<p>Two hours later, I had my little convenience functions. The sorcerer has yet to return, but I am confident that my code works. The broom does what it&#8217;s told to do.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Yesterday evening, I had an itch that needed scratching. I was lacking some convenience features in an XMetaL-based authoring environment I am finalising for a client. There is a structure in the DTD that I am presenting as a table using some CSS in the editor, which makes perfect sense since it&#8217;s always going to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[60,59,58],"tags":[],"_links":{"self":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/91"}],"collection":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=91"}],"version-history":[{"count":0,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=\/wp\/v2\/posts\/91\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=91"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=91"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sgmlguru.org\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=91"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}