<?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>Muddled Ramblings and Half-Baked Ideas &#187; Rumblings from the Secret Labs</title> <atom:link href="http://muddledramblings.com/category/rumblings-from-the-secret-labs/feed" rel="self" type="application/rss+xml" /><link>http://muddledramblings.com</link> <description>A blog about a geek trying to make a living as a writer</description> <lastBuildDate>Fri, 30 Jul 2010 20:19:53 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0.1</generator> <item><title>Cascading Style Sheets (CSS) and PHP</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/css-style-sheets-and-php</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/css-style-sheets-and-php#comments</comments> <pubDate>Sun, 30 May 2010 20:07:21 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[CSS]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[Internet]]></category> <category><![CDATA[php]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8486</guid> <description><![CDATA[Obvious in retrospect.]]></description> <content:encoded><![CDATA[<p>Often when dealing with Cascading Style sheets, or CSS, I find myself wishing that the CSS mechanism included variables. This is especially true when dealing with colors, since you want the same color applied to lots of different things. It can be a real pain to go back through an old style sheet and find the code for the color you want. I was quietly surprised that no one making up how CSS worked had addressed something like this.</p><p>Then, a while back I was giving a buddy of mine a few exercises to introduce him to the exciting world of Web programming, touching on CSS, HTML, PHP and MySQL. I gave him pretty much no guidance; I just thought up plans that would introduce him to the concepts and gave him a list of my favorite references. (I&#8217;ll be posting those exercises here in the nearish future.)</p><p>Anyway, without me to tell him how to do things, he went and dug around and one of the first style sheets he sent me for evaluation had a .php extension rather than .css.</p><p>Bingo! Once you see it in action, it&#8217;s obvious. PHP can be used to generate CSS files just as easily as it can be used to generate HTML files. Now my style sheets can change based on external conditions or can simply define a set of colors that all the style definitions share. Why did it take me so long to figure this out? It seems like this technique should be a <em>lot</em> more common than it is.</p><p>Here&#8217;s a quick code snippet for those who want to try it for themselves:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
	<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type: text/css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$header_back_color</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'#dddddd'</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
#corner_table th {
	background-color:<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$header_back_color</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>;
	text-align: center;
}</pre></div></div><p>A couple of notes: the &lt;?php MUST be the very first thing in the file. No empty lines, no spaces. The reason is that the next line, with the header() function, has to be called before the server sends any page content. (Once the server starts sending content back to the browser, it&#8217;s too late to be fiddling with the headers. Any whitespace outside the &lt;?php tag will be considered content.) The header line is necessary because you need to tell your browser that what you are sending really is a css file.</p><p>In the &lt;head&gt; of the html file, you call the style sheet just like normal, but of course the file you fetch will have a php extension:</p><div
class="wp_syntax"><div
class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot;
      href=&quot;http://yourdomain.com/css-tables.php&quot;
      type=&quot;text/css&quot;
      media=&quot;screen&quot; /&gt;</pre></div></div><p>That&#8217;s all there is to it. Why have I not done this with <em>every</em> css file?</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/css-style-sheets-and-php/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>Drupal and WordPress</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/drupal-and-wordpress</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/drupal-and-wordpress#comments</comments> <pubDate>Wed, 21 Apr 2010 21:30:47 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[Drupal]]></category> <category><![CDATA[technology]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8278</guid> <description><![CDATA[There is a lot of talk at Drupalcon about how they stack up against the competition. We are in the weeding-out phase of the Web Content Management System market, when most of the myriad contenders will fall by the wayside. Those who make a living building and using Drupal naturally want their platform to be [...]]]></description> <content:encoded><![CDATA[<p>There is a lot of talk at Drupalcon about how they stack up against the competition. We are in the weeding-out phase of the Web Content Management System market, when most of the myriad contenders will fall by the wayside. Those who make a living building and using Drupal naturally want their platform to be among the survivors.</p><p>Drupal, according to their own assessment, powers about 1% of the Work Wide Web. The Drupalistas estimate that WordPress accounts for just north of 8%. There is another system called Joomla that is roughly even with Drupal. These three look to be the survivors in the Great-Web-site-in-a-box sweepstakes.</p><p>Honestly, I was a little surprised that Drupal considered WordPress to be a competitor. Sure, they both want to be used for more and more of the Web, but does Lego consider Tonka to be a competitor? Here&#8217;s the deal: Drupal says WordPress is the most popular Content Management System (CMS). I say WordPress is not a CMS at all.</p><p>That&#8217;s not to say WordPress isn&#8217;t a fine tool, in fact, this blog uses WordPress. But would I use WordPress for my current paying gig? No. Honestly I dread the day when WordPress becomes a big, fancy CMS like Drupal. <em>That&#8217;s not what it&#8217;s for.</em> There is a reason WordPress is the big dog, and it&#8217;s not because you can build sophisticated Web applications with it, it&#8217;s because you can install WordPress, find a nice skin, and get your stuff on the Web in an attractive and intuitive way. WordPress is a publishing platform, and a pretty good one at that.</p><p>Drupal, on the other hand, begins to shine at the next level up in terms of sophistication. It is the Lego to WordPress&#8217; Tonka. There is considerably more design up front, and much critical functionality must be added as external modules that don&#8217;t come with the main (&#8220;core&#8221;) code. (Some of these things will be added to core in Drupal 7.) Maintenance of a Drupal site is more labor-intensive as well, as updating the parts is more complicated than with WordPress.</p><p>In exchange for the added complexity, you get a lot more flexibility. That&#8217;s not to say that WordPress can&#8217;t be used to make sophisticated Web sites, but generally speaking WordPress is optimized in putting a defined sort of information (like blog posts) on the screen in a very flexible way. There are hundreds of ways to add other pre-defined data types (for instance, there are shopping cart plugins), and all that works really well and most people are going to be happy with that.</p><p>Drupal is the tool you use when the data types in WordPress won&#8217;t do it for you. In Drupal you are building a Web application, where with WordPress you are using a Web application. Step one in building a site with Drupal is designing the data and the relationships between the various data types. Drupal allows you to design your data without having to design your database. Some of the ways Drupal implements your data design are pretty hokey, but it works. You can create pretty sophisticated data models without knowing a thing about how a database works &#8211; or even what kind of database you&#8217;re using. (In fact, you&#8217;re better off <em>not</em> knowing how the data is structured, because things can move unexpectedly as you tweak your design.) You are also presented with an almost dizzying set of options to decide who is allowed to see, edit, or create each little piece of each data type you define.</p><p>Once you get your content types defined, then you can move on to how to get actual content into the system (handled pretty much automatically), and how to present specific subsets of your data on the screen. To get at the data one often uses views, which are built using a tool that generates (frustratingly limited) database queries and then processes the results with a gratifying set of options tailored to each data type.</p><p>Then it comes time to put stuff on the screen. To control where things go and when, there are regions, blocks, panels, panes, pages, and so forth in a nonintuitive overlapping of roles. Blocks and regions and pages are built in, but the profusion of other options is a testament to the limited way they work together. For all the flexibility of Drupal, GUI building is still clumsy, though getting better (I&#8217;m told).</p><p>At last we come to the task of making the output pretty. For this purpose Drupal uses a maze of performance-sucking php template files that are invoked using a system of names that allows one to set up the display of information at just about any level of granularity. Many of these templates go hand-in-hand with specially-named preprocessor functions that allow you to customize how data is prepared for presentation.</p><p>Drupal separated the preparation of data and the presentation of data to allow people with different skill sets to do the different tasks. The template files can be done with only a minimal amount of php, while the preprocessors are where the real logic is implemented, unencumbered by HTML and CSS. This also has the effect of putting the risky code out of reach of those who aren&#8217;t expert in Web security. All good things.</p><p>I used the phrase &#8220;performance-sucking&#8221; above, and I meant it. The designers of Drupal made a conscious decision to emphasize good architecture and flexibility over fast execution. This was the same decision Google faced a few years back, as they developed ever-more-sophisticated pattern matching algorithms. While competitors kept things simple to reduce server load, the folks at Google decided that the cost of processing cycles and storage was tending toward free, and chose to emphasize the quality of the information they provided instead. Similarly, Drupal has decided to make things in a structurally sound way and spend the processor cycles and disk reads necessary to support that.</p><p>Drupal 7 will be even slower, but will be more scalable (they say). What that means is that although the software is not as fast as it could be, its behavior is predictable as demand increases, and it is easer to scale up your site as things go huge. Good structure pays greater and greater dividends as things get bigger.</p><p>All that stuff Drupal has makes it a more complicated to get up and running, and for a simple site (or even one of moderate complexity but with a relatively straightforward data model), WordPress is going to get you to the promised land with a lot less pain.</p><p>I am led to believe that the WordPress community feels it needs to compete with Drupal just as much as Drupal thinks they need to compete with WordPress. Toward this end WordPress 3.0 will have new features that answer some of Drupal&#8217;s flexibility advantages. All I can say is &#8220;PLEASE, WordPress, <em><strong>don&#8217;t</strong></em> try to be everything Drupal is.&#8221; That WordPress is not everything Drupal is constitutes its greatest advantage. Stay with your market, WordPress!</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/drupal-and-wordpress/feed</wfw:commentRss> <slash:comments>5</slash:comments> </item> <item><title>Drupalcon Day 1 &#8211; notes from the floor</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/drupalcon-day-1-notes-from-the-floor</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/drupalcon-day-1-notes-from-the-floor#comments</comments> <pubDate>Tue, 20 Apr 2010 18:53:27 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[Internet]]></category> <category><![CDATA[technology]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8266</guid> <description><![CDATA[I&#8217;m working on a project right now that is based on a Web development platform called Drupal. I have a long editorial episode building in my head concerning Drupal and competing platforms for Web development, but today I&#8217;m going to write this episode assuming you already know what Drupal is and how it works. (This [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m working on a project right now that is based on a Web development platform called Drupal. I have a long editorial episode building in my head concerning Drupal and competing platforms for Web development, but today I&#8217;m going to write this episode assuming you already know what Drupal is and how it works. (This is also how the documentation for Drupal is written.)</p><p>Once I arrived and registered, I looked over the program to decide which seminars I would attend. I looked down the list and realized I already knew what most of the seminars were discussing. Some of the seminars, I could have been the presenter. I realized that the cross-section of stuff I know about Drupal probably qualifies me as a Drupal expert now.</p><p>Still, there&#8217;s always new stuff to learn. I decided to dedicate my day to security. There are a lot of ways to break a Web site these days.</p><p>Before the security sessions there was the keynote address by the guy who invented Drupal in his dorm room in Antwerp ten years ago. He is still holder of the vision for the project, and hearing him speak I have to say that the project is in good hands. He knows there are challenges ahead, and he was an excellent cheerleader for open source, and for encouraging everyone who uses Drupal to give back to the community. Currently they are trying to release the next major upgrade, something they absolutely must have, and soon (more on that in a bit). &#8220;There are 114 critical bugs to fix,&#8221; he said (or something like this), &#8220;If we break into teams right now we can have them fixed by the end of the day. So, we&#8217;re locking the doors&#8230;&#8221;</p><p>There was a laugh, but his point was a good one. Rather than wait eagerly for the release, the Drupal community should be actively making it happen.</p><p>He also mentioned that 1% of the Web is now powered by Drupal. That&#8217;s pretty dang impressive (until you compare it to WordPress). It&#8217;s difficult to call his methods for estimating that 1% as scientific, but whatever that number is, I can tell you that it could be a lot higher except for one thing: This software induces more WTF? moments than any other development platform I&#8217;ve ever used. Novices who come to the platform install the software, stare blankly at the screen, click things, and give up and move on to a more intuitive product. It would be impossible to measure how many adoptions they have lost because of that initial Now What? moment, but it&#8217;s significant I promise you.</p><p>On a related note, employment opportunities for Drupal experts is on the rise. People who have worked their way through the WTF to where they can be productive with the platform are in demand. I can now navigate and decode the documentation (I think some of the writers of the documentation are so steeped in the Drupal Way that they don&#8217;t even realize they are writing in code), and that puts me in good position to find work. When the out-of-box experience is improved (a major thrust of Drupal 7), my &#8220;expert&#8221; status will be less lucrative.</p><p>Speaking of the Drupal Way: At the risk of being overly general, these guys are more sensitive than even Mac people when it comes to hearing criticism about their platform. Also, there were easily more Macs in evidence than Windows laptops. Perhaps that is because we are on Apple&#8217;s home turf here, but I think that Mac, with its handy Unix underpinnings, is finding a sweet spot in the Web design world, with cachet among the designers as well as unix (the os of the Web) for the übergeeks. (The only apple I brought to the convention, I ate. I have Ol&#8217; Pokey charging up, however, to see if it&#8217;s game for one last field trip before its ten-year-old video system gives up entirely.)</p><p>Back to the keynote: Mr. Buytaert, while talking about the future of Drupal, mentioned that as they got bigger, there would be people for whom using Drupal would be a <em>day job!</em> They wouldn&#8217;t be using it just for the love of it, they would think of it as just another tool to get their job done. Mr. Buytaert, welcome to 2008. Those people are now your market, if you want to meet your stated goals for growth.</p><p>One thing I&#8217;ll say for the guy, he really seems driven by the simple desire to make Drupal the best. He&#8217;s probably wealthy now, but commercial success just doesn&#8217;t seem to be what motivates him. He wants to make his baby better and better and world domination is simply a way to measure how well he&#8217;s doing. It&#8217;s refreshing to hear from someone like that.</p><p>As for the security sessions, I think this best sums it up (this link was given in one of the seminars):</p><p><a
href="http://xkcd.com/"><img
src="http://imgs.xkcd.com/comics/exploits_of_a_mom.png" alt="xkcd 327"/></a></p><p>A note of explanation for the less-geeky (which you can skip): When a programmer is careless, people can put a string in any field on a site and cause database commands to be executed. In the comic, the name &#8220;Robert&#8217;); DROP TABLE Students;&#8211;&#8221; will cause the database the table named &#8216;Students&#8217;, obliterating their records. The &#8216;); tells the database that the command to add the name is finished, then the rest of the text is treated as a new command. Aren&#8217;t you glad you asked?</p><p>I also learned just what a risk it is to link to an image the way I just did. The owner of that site can now attack my blog. Ah, the irony.</p><p>I did learn some useful stuff in the seminars, and just in time, too. I&#8217;m really glad I went.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/drupalcon-day-1-notes-from-the-floor/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>New Features here at MR&amp;HBI!</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/new-features-here-at-mrhbi</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/new-features-here-at-mrhbi#comments</comments> <pubDate>Tue, 30 Mar 2010 16:54:31 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[blog]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[plugin]]></category> <category><![CDATA[WordPress]]></category> <category><![CDATA[words]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8185</guid> <description><![CDATA[Not only that, but you help decide how one of them works!]]></description> <content:encoded><![CDATA[<p>First, allow me to call your attention to the episode immediately before this one. You might notice the little icon is a camera. &#8220;huh,&#8221; you might be saying to yourself, &#8220;I don&#8217;t remember seeing that one before.&#8221; Very observant, Buckaroo! It&#8217;s for a new category, Photography, that I added. &#8220;But,&#8221; the even more observant amongst you might say, &#8220;There are already a handful of episodes in that category.&#8221; Right again, Wisenstein! I recategorized a couple episodes that were under The Great Adventure and found a couple in Idle Chit-Chat that were better filed under the new category. I expect there are plenty more; the trick is finding them.</p><p>The icon is actually my camera sitting on an opened unabridged dictionary. That may seem staged, but that&#8217;s actually where we keep the camera these days. Yes, we have an unabridged dictionary open on a stand at all times. No, that does not make us geeks.</p><p>Second, way down at the bottom of the sidebar, there&#8217;s a section called Other Muddled Stats (or something like that). That&#8217;s a wordpress widget I made that counts all the words in all the episodes, and keeps a tally of how many comments there have been as well. I plan to add other stats as well next time I have the hood open. Perhaps the number of times I&#8217;ve said &#8220;You don&#8217;t have to thank me,&#8221; or the number of times I&#8217;ve blamed the Chinese for things. (Hm&#8230; haven&#8217;t done that in a while&#8230;) Anything you&#8217;d like to know? The number of letters typed? Words in comments? Most prolific commenters? If it&#8217;s on these pages, I can count it.</p><p>The WordPress plugin itself is hand-crafted by yours truly. I started by downloading a different word-counting plugin, but it counted the words on every page load and didn&#8217;t have a sidebar widget. All it was was a database query and a loop. My version only counts when the relevant value changes &#8211; it only counts words when a new episode is posted, for instance. Once I tidy it up I&#8217;ll be adding it to the WordPress repository, so others can also gather useless stats about their blogs. It&#8217;s all about sharing the love.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/new-features-here-at-mrhbi/feed</wfw:commentRss> <slash:comments>9</slash:comments> </item> <item><title>A little help?</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/a-little-help</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/a-little-help#comments</comments> <pubDate>Sun, 21 Mar 2010 22:50:38 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[Muddleverse]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8115</guid> <description><![CDATA[I&#8217;m getting the sweet-o-meter reinstalled. The old one broke and there was confusion about versions and so forth and in the end I decided to go with another plugin that seems to be more actively maintained. This one is fancier, but the creator really didn&#8217;t imagine all the different ways people might want to customize [...]]]></description> <content:encoded><![CDATA[<p>I&#8217;m getting the sweet-o-meter reinstalled. The old one broke and there was confusion about versions and so forth and in the end I decided to go with another plugin that seems to be more actively maintained. This one is fancier, but <a
href="http://blog.aakash.me/index.php/2010/01/wp-likes-3-0-a-glimpse/">the creator</a> really didn&#8217;t imagine all the different ways people might want to customize something like this. As a result I&#8217;ve been tinkering under the hood.</p><p>To get things right I need to see what it looks like when someone besides me has voted for an episode. Can someone out there click the &#8220;sweet&#8221; button at the top of this episode? Thanks!</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/a-little-help/feed</wfw:commentRss> <slash:comments>14</slash:comments> </item> <item><title>Lost in Translation?</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/lost-in-translation</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/lost-in-translation#comments</comments> <pubDate>Fri, 05 Mar 2010 23:25:33 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[php]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[suck]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8056</guid> <description><![CDATA[The mere existence of the message implies a history, as well.]]></description> <content:encoded><![CDATA[<p>Even if you&#8217;re not a programmer, take a look at the following lines of code:</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> sendCommunication<span style="color: #009900;">&#40;</span><span style="color: #000088;">$oCommunication</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">emailMode</span> <span style="color: #339933;">!=</span> EMAIL_TEST_MODE_NONE<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">self</span><span style="color: #339933;">::</span><span style="color: #004000;">emailMode</span> <span style="color: #339933;">==</span> EMAIL_TEST_MODE_LOGGED_IN_ONLY<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #666666; font-style: italic;">// DO NOT COMMENT OUT THE FOLLOWING LINES</span>
            <span style="color: #666666; font-style: italic;">// EVER</span>
            <span style="color: #666666; font-style: italic;">// FOR ANY REASON</span>
            <span style="color: #666666; font-style: italic;">// INSTEAD CHECK THE TEST MODE AND SET THE ADDRESS FIELDS ACCORDINGLY</span>
            <span style="color: #000088;">$oCommunication</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">to</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$oCommunication</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">from</span><span style="color: #339933;">;</span>
            <span style="color: #000088;">$oCommunication</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">cc</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span></pre></div></div><p>Now, I ask you, even if you&#8217;re not a programmer, you know there&#8217;s one thing you would never, ever, do to the above code. Right? Now let&#8217;s say you are a programmer, a professional, being paid because of your ability to find solutions to problems and express them in an abstract language.</p><p>Now further imagine that changing the above code can lead to the customers of the people paying for this work getting spammed with confusing emails with our client&#8217;s name on them.</p><p>Yeah, you guessed it.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/lost-in-translation/feed</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>Jer&#8217;s Software Hut Falls Silent</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/jers-software-hut-falls-silent</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/jers-software-hut-falls-silent#comments</comments> <pubDate>Mon, 01 Mar 2010 00:29:50 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[Jer's Novel Writer]]></category> <category><![CDATA[suck]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=8047</guid> <description><![CDATA[Shutting the doors (at least for now). ]]></description> <content:encoded><![CDATA[<p>The shadowy, misshapen minions have all gone home; the vast underground chamber that once rang with their chants as they turned the giant wooden capstans has fallen silent. The river of lava flows unimpeded, the precarious rope bridges spanning it falling into disrepair. Above, the streets of Sky City Research Facility, once teeming with antigravity cars, are empty, the crystalline architecture acquiring a layer of eagle guano and dust that is transformed into gritty runoff when it rains.</p><p>The crudely-crafted Web site at jerssoftwarehut.com no longer accepts payment for Jer&#8217;s Novel Writer software licenses, and bears the following statement:</p><blockquote><p>Well, it&#8217;s happened; I have a regular job. As I slave away working for the man I often wonder if things might have been different had I only worked harder at making Jer&#8217;s Software Hut a business rather than a hobby. Probably now we will never know. It was a good run but it&#8217;s time to ackowledge that development is stalled and customer service around here has been really awful.</p></blockquote><p>That pretty much says it all; despite thousands of happy users, some of whom even paid for the software, when it came time to have a steady income again I took the safer path of working for someone else. (The ironic twist to this narrative I will leave for another time.)</p><p>It <em>was</em> a good run, and as I get my work life under control I hope soon to at least return to using Jer&#8217;s Novel Writer for its intended purpose &#8211; as a writing tool that helps me create fiction. Until I do that I can&#8217;t even consider opening the shutters on the Hut and throwing the big switch that raises the lightning rod into the violent midnight thunderstorm, while sparks fly and the turbines spin faster and faster, the needles on their gauges creeping ominously into the red. Maybe someday, though. Maybe someday.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/jers-software-hut-falls-silent/feed</wfw:commentRss> <slash:comments>3</slash:comments> </item> <item><title>Haloscan comments to WordPress &#8211; the nitty gritty.</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/haloscan-comments-to-wordpress-the-nitty-gritty</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/haloscan-comments-to-wordpress-the-nitty-gritty#comments</comments> <pubDate>Fri, 05 Feb 2010 21:41:00 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[code]]></category> <category><![CDATA[Haloscan]]></category> <category><![CDATA[php]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7970</guid> <description><![CDATA[... or, what I did last night.]]></description> <content:encoded><![CDATA[<p>As I mentioned in the previous episode, I recently had to move more than 8000 comments from my old comment system, Haloscan, and import them into WordPress. Haloscan served me well back in the day, but they are going away, and all my more recent comments are in the WordPress system anyway. Nice to have them all in one place.</p><p>The process turned out to be pretty easy. I found a script for importing comments from a different system, modified it, modified it some more, found a fundamental problem with it, fixed that, and in the end not much of code remained from the example, except the part where the WordPress logo is displayed on the screen. I assume that part came from the code the guy copied to make the code that I copied.</p><p>Along the way I learned a couple of things. PHP is a pretty flexible language, but running a loop that sets up 8500 data structures and runs 25500 database queries exposes PHP&#8217;s primary weakness: memory management. The whiz kids who invented PHP designed it for a load/compile/execute/exit-and-clean-up flow. Memory allocated during execution is cleaned up when the program is done running (usually when the Web page is delivered). When you try to do heavy lifting with PHP, you have to start paying attention to getting your memory back before the traditional clean-up time.</p><p>The code I started with did a direct database query to add the comment to the comments table, but that got things out of sync with other tables. (The posts table keeps track of the number of comments that apply to it, presumably for performance reasons.) I dug into the core WordPress code and found the method <em>they</em> call to post comments, and I made my code call that function. I have no idea what all the bookkeeping chores are that function does, and really I don&#8217;t care as long as they get done.</p><p>I didn&#8217;t worry about performance too much at first (after all, it only has to run once), but one of the database queries I did was really expensive (scanning all the posts for a specific set of characters). Even running on my local server it was slow, and I knew that if I tried something like that on my actual Web host alarms would go off and they&#8217;d shut me down for a while. I did a little optimization on that front, and it was enough.</p><p>The following script has some Muddle-specific code in it, but it might come in handy for others who need to move Haloscan comments to a new system. The part that parses Haloscan XML is pretty generic and would work for anyone, the part that saves the comments might be useful as a guide as well. The main difference others will have to deal with is where to get proper post_id based on the thread field in the XML. In my case I had a link in each blog episode back to the Haloscan thread.</p><p>The HTML bit in the middle of the file is not essential; but it puts a nice WordPress logo on the screen when the script starts up. I inherited that from the <a
href="http://afewthought.blogspot.com/2005/10/howto-import-comments-from-blogsome-to.html">script I started with</a>.</p><p><strong>NOTE:</strong> While this script has code in it specific to me, I am available to customize it for others who need to move their code from Haloscan into another environment, or, for that matter, from any structured source into WordPress. Drop me a line!</p><div
class="wp_syntax"><div
class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../wp-config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;There doesn't seem to be a wp-config.php file. You must install WordPress before you import any comments.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../wp-config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> saveCommentToWP<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dbRef</span><span style="color: #339933;">,</span> <span style="color: #339933;">&amp;</span><span style="color: #000088;">$postThreads</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//echo &quot;here's where the comment save happens &lt;br/&gt;&lt;br /&gt;&quot;;</span>
    <span style="color: #000088;">$thread</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'thread'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$postID</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$postThreads</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$thread</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$postThreads</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$thread</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT * FROM wp_posts WHERE post_content LIKE '%&quot;</span><span style="color: #339933;">.</span><span style="color: #000088;">$thread</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;%' AND post_status='publish'&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$postID</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$dbRef</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get_var</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$postThreads</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$thread</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$postID</span> ? <span style="color: #000088;">$postID</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$postThreads</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$thread</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;&lt;br /&gt;Thread <span style="color: #006699; font-weight: bold;">$thread</span> has no post!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">else</span>
            <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;&lt;br /&gt;Thread <span style="color: #006699; font-weight: bold;">$thread</span>&quot;</span><span style="color: #339933;">;</span>
        <span style="color: #990000;">flush</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>       <span style="color: #666666; font-style: italic;">// got to have real-time updates!</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$postID</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$postID</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$userId</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'vikingjs@mac.com'</span> ? <span style="color: #cc66cc;">1</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//set up the data the way wp_insert_comment expects it.</span>
        <span style="color: #000088;">$wp_commentData</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_post_ID'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$postID</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'user_id'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span>int<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$userId</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_parent'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_author_IP'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'ip'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_agent'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'Haloscan'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_date'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'datetime'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_date_gmt'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'datetime'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_approved'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'1'</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_content'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'text'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_author'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'name'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'comment_author_email'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$wp_commentData</span> <span style="color: #339933;">=</span> wp_filter_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$comment_ID</span> <span style="color: #339933;">=</span> wp_insert_comment<span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #666666; font-style: italic;">//echo (&quot;&lt;strong&gt;saved comment $comment_ID&lt;/strong&gt;&quot;);</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">// try to reclaim some memory</span>
    <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$wp_commentData</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Content-Type: text/html; charset=utf-8'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot;&gt;
&lt;title&gt;WordPress &amp;rsaquo; Import Comments from RSS&lt;/title&gt;
&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot; /&gt;
&lt;style media=&quot;screen&quot; type=&quot;text/css&quot;&gt;
    body {
        font-family: Georgia, &quot;Times New Roman&quot;, Times, serif;
        margin-left: 20%;
        margin-right: 20%;
    }
    #logo {
        margin: 0;
        padding: 0;
        background-image: url(http://wordpress.org/images/logo.png);
        background-repeat: no-repeat;
        height: 60px;
        border-bottom: 4px solid #333;
    }
    #logo a {
        display: block;
        text-decoration: none;
        text-indent: -100em;
        height: 60px;
    }
    p {
        line-height: 140%;
    }
    &lt;/style&gt;
&lt;/head&gt;&lt;body&gt; 
&lt;h1 id=&quot;logo&quot;&gt;&lt;a href=&quot;http://wordpress.org/&quot;&gt;WordPress&lt;/a&gt;&lt;/h1&gt; 
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Bring in the data</span>
<span style="color: #000088;">$reader</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> XMLReader<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">open</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'export-8.xml'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$postThreads</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #000088;">$thread</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">//echo &quot;&lt;br /&gt;read node type: &quot;.$reader-&gt;nodeType.';     '.$reader-&gt;name.': '.$reader-&gt;value;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeType</span> <span style="color: #339933;">==</span> XMLReader<span style="color: #339933;">::</span><span style="color: #004000;">ELEMENT</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'thread'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #000088;">$thread</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'id'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$thread</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeType</span> <span style="color: #339933;">==</span> XMLReader<span style="color: #339933;">::</span><span style="color: #004000;">ELEMENT</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'comment'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">// begin building comment</span>
                <span style="color: #000088;">$comment</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'thread'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$thread</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeType</span> <span style="color: #339933;">==</span> XMLReader<span style="color: #339933;">::</span><span style="color: #004000;">END_ELEMENT</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'comment'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">nodeType</span> <span style="color: #339933;">==</span> XMLReader<span style="color: #339933;">::</span><span style="color: #004000;">ELEMENT</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
                        <span style="color: #000088;">$property</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">name</span><span style="color: #339933;">;</span>
                        <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// assumes text element following element tag has the data</span>
                        <span style="color: #000088;">$comment</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$property</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">value</span><span style="color: #339933;">;</span>
                    <span style="color: #009900;">&#125;</span>
                    <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">read</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #009900;">&#125;</span>
                saveCommentToWP<span style="color: #009900;">&#40;</span><span style="color: #000088;">$comment</span><span style="color: #339933;">,</span> <span style="color: #000088;">$wpdb</span><span style="color: #339933;">,</span> <span style="color: #000088;">$postThreads</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
            <span style="color: #009900;">&#125;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
    <span style="color: #000088;">$reader</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">close</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&nbsp;
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/haloscan-comments-to-wordpress-the-nitty-gritty/feed</wfw:commentRss> <slash:comments>6</slash:comments> </item> <item><title>In with the Old</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/in-with-the-old</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/in-with-the-old#comments</comments> <pubDate>Fri, 05 Feb 2010 09:27:56 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[geek]]></category> <category><![CDATA[Haloscan]]></category> <category><![CDATA[iBlog]]></category> <category><![CDATA[WordPress]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7968</guid> <description><![CDATA[I got a message today that Haloscan is closing down. That is the service that provided refreshingly spam-free comments on my old blog. A year ago I finally abandoned iBlog for WordPress, and I&#8217;m glad I did. At the time, however, I didn&#8217;t want to tackle moving the old comments over into the new system. [...]]]></description> <content:encoded><![CDATA[<p>I got a message today that Haloscan is closing down. That is the service that provided refreshingly spam-free comments on my old blog. A year ago I finally abandoned iBlog for WordPress, and I&#8217;m glad I did. At the time, however, I didn&#8217;t want to tackle moving the old comments over into the new system. In my conversion I embedded a link into each of the old episodes to the legacy comment system, and left it at that.</p><p>It is fortunate I found out about Haloscan when I did. Another week and 8500 comments would have been lost forever. That&#8217;s a big part of the underlayer of this blog, the part people sink gradually into as they hang around more, and they realize that this isn&#8217;t just about me. There are some pretty interesting conversations, observations, poems, and even stories in those comments. With the timer running I set to work to get the comments out of Haloscan and into WordPress.</p><p>The move turned out to be pretty straightforward. (Simpler, perhaps, than it had been to put the links into the posts.) I&#8217;ll go into the technical details in an episode tomorrow, but for now, why don&#8217;t you pop into the archives for 2004 or so and find an old episode with good comments? Maybe you&#8217;ll find something interesting someone said once. Maybe you&#8217;ll see the name of someone you haven&#8217;t thought of in a while. Maybe you&#8217;ll see something you want to comment on, even.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/in-with-the-old/feed</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>A Job I&#8217;m Glad I Don&#8217;t Have</title><link>http://muddledramblings.com/rumblings-from-the-secret-labs/a-job-im-glad-i-dont-have</link> <comments>http://muddledramblings.com/rumblings-from-the-secret-labs/a-job-im-glad-i-dont-have#comments</comments> <pubDate>Sun, 24 Jan 2010 07:07:57 +0000</pubDate> <dc:creator>Jerry</dc:creator> <category><![CDATA[Rumblings from the Secret Labs]]></category> <category><![CDATA[suck]]></category> <category><![CDATA[technology]]></category> <category><![CDATA[work]]></category><guid
isPermaLink="false">http://muddledramblings.com/?p=7911</guid> <description><![CDATA[Even cushy jobs can suck.]]></description> <content:encoded><![CDATA[<p>As you might be able to tell from the paucity of episodes here at MR&#038;HBI, I&#8217;ve rejoined the ranks of the employed. My writing has taken a real beating, so today I&#8217;m going to spend some time writing about work. You don&#8217;t have to thank me, it&#8217;s what I do.</p><p>I don&#8217;t mind writing software; I&#8217;m pretty good at it and I can make pretty decent money doing it. I would much rather write code than dig ditches, for instance, and luckily for me the world has decided that making Web sites is worth more than roadside drainage. (Before you go and say, &#8220;that&#8217;s because it takes skill and training to make a Web site, but anyone could dig a ditch&#8217;, ask yourself &#8211; could <em>you</em> dig ditches for a living? If the economy were turned upside-down, that ditch-digger living in his nice house would say, &#8216;anyone can make a living sitting on their ass in front of a computer, but I <em>dig ditches</em>. I&#8217;m glad things are the way they are, is all I&#8217;m saying.)</p><p>My current job sends me dangerously into territory I don&#8217;t much like, however, and that&#8217;s the area known as <em>Information Technology</em>. It&#8217;s not really a good name for the job, which is about setting up computers and keeping them running. It&#8217;s less about making things and more about making things work.</p><p>Last night, for instance, I moved the Web product I&#8217;m working on to a different server and it didn&#8217;t work. Naturally I assumed the problem was in my code (it had worked on that server in the past), so it was several hours later that I discovered that for reasons I still don&#8217;t know, the server failed when it tried to compress very large messages. Just *poof* no response beyond the number 500 (something went wrong). To make things more fun the server was specifically set up to not write out a lot of error messages to its log. I turned off the compression feature (with a hammer) and things worked again. Five hours or so spent to add seven characters to a PHP file, to make things work the same way they already did on other servers. Welcome to the world of IT.</p><p>I think the original intention of the phrase information technology referred to the the information that would be stored, manipulated, and distributed by machines. What the I really stands for is the vast store of arcane crap you have to know to do that job well. What line of the php.ini file to modify if you want zlib output buffering and utf-8 character encoding. How to set up all the computers in an office to use a local domain name server first. That&#8217;s the information in IT.</p><p>The worst thing about having an IT job is this, however: When you&#8217;re doing a good job, no one notices. When a company is running smoothly, that&#8217;s a sign that the IT department can be downsized. There are no problems! What are those guys doing all day? Having things <em>not</em> happen as part of your job description makes for tricky times when you do your job well. Of course, when something does go wrong people know just where to find you.</p><p>So if you work in a company that has people on payroll working to keep your technology humming along, cut them a little slack. Someone&#8217;s got to do that stuff; be glad it&#8217;s not you. I do enough IT now to know that I&#8217;d rather let someone else have the pleasure.</p> ]]></content:encoded> <wfw:commentRss>http://muddledramblings.com/rumblings-from-the-secret-labs/a-job-im-glad-i-dont-have/feed</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching 18/37 queries in 0.017 seconds using disk

Served from: muddledramblings.com @ 2010-07-31 04:00:01 -->