<?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>Positively Glorious! &#187; Software &amp; Media</title>
	<atom:link href="http://positivelyglorious.com/category/software-media/feed/" rel="self" type="application/rss+xml" />
	<link>http://positivelyglorious.com</link>
	<description>MettaContemplation about Life and World Domination</description>
	<lastBuildDate>Fri, 16 Jul 2010 17:40:17 +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>Surface Tension, Cat Spit, &amp; Friends</title>
		<link>http://positivelyglorious.com/easy-listening/surface-tension-cat-spit-friends/</link>
		<comments>http://positivelyglorious.com/easy-listening/surface-tension-cat-spit-friends/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 19:03:49 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Easy Listening]]></category>
		<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://positivelyglorious.com/?p=2040</guid>
		<description><![CDATA[Here&#8217;s a story. It&#8217;s apropos of nothing, but I&#8217;ve been too busy to write enough here, so I thought this [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Feasy-listening%2Fsurface-tension-cat-spit-friends%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Feasy-listening%2Fsurface-tension-cat-spit-friends%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://positivelyglorious.com/files/2010/02/Screen-shot-2010-02-23-at-10.33.07-AM.png"><img class="alignleft size-medium wp-image-2041" title="Screen shot 2010-02-23 at 10.33.07 AM" src="http://positivelyglorious.com/files/2010/02/Screen-shot-2010-02-23-at-10.33.07-AM-300x185.png" alt="" width="300" height="185" /></a></p>
<p>Here&#8217;s a story. It&#8217;s apropos of nothing, but I&#8217;ve been too busy to  write enough here, so I thought this would make people smile.</p>
<p>I could go on and on about how it&#8217;s a story of Social Networking, and how sometimes the world is a better place because we&#8217;re closer, or at least more able to contact people for random bits of meaningless and make friends.</p>
<p>It could be a story about how we&#8217;re not so distant, or maybe how we&#8217;re differently distant.</p>
<p>But it&#8217;s not, because then I&#8217;d feel the need to actually do a bit of research to support my theory, and post it on mettadore.com, which I know plenty of people are sick of. So, rather than anything meaningful, it&#8217;s merely an amusing anecdote.</p>
<p>I was at work, drinking maté, typing away, la la la, work work work, data data data, la la l&#8211;</p>
<p>AHH!</p>
<p>I spilled maté on my mac!</p>
<p>Well, the story&#8217;s a happy one, because, as you can see from the image of my tweet, physics saved me. That&#8217;s not always the case. At certain times, physics is a right bastard, particularly when I&#8217;m on my skateboard, or ice skates, or standing on my roof trying one more time to get my Superman Underroos to do their damn job!</p>
<p>Anyway, physics is sometimes a bastard, but this time it was cool.</p>
<p>So today, I got an email message from someone that made me chuckle:</p>
<blockquote><p><span style="font-family: andale mono,times">Hi John- </span></p>
<p><span style="font-family: andale mono,times">Google led me to your tweet from 1/28: &#8220;The surface tension of water is strong enough that water won&#8217;t flow into certain sized holes… like those of a MacBook Pro&#8217;s speaker.&#8221; </span></p>
<p><span style="font-family: andale mono,times">I just spilled a (small) bit of iced coffee onto my 15&#8243; 2008 MBP left speaker grill, so the topic is near to me&#8230;  The coffee seemed to just sit on the grill for the couple of seconds it took me to wipe it off. My empirical evidence supports you theory. <img src='http://positivelyglorious.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </span></p>
<p><span style="font-family: andale mono,times">First, I looked on the web for teardown photos to see where the microphone was. No luck. Since I&#8217;m wondering if I might have any trouble, I was wondering if you had any more background for your MBP speaker/surface tension info. </span></p>
<p><span style="font-family: andale mono,times">Thanks!</span></p></blockquote>
<p>I thought it was pretty funny that someone would actually look up &#8220;surface tension&#8221; or something like that- what a total geek. What was funnier was that I actually looked it up, and started to do a calculation the day it happened, just to see. Now &#8220;that&#8217;s&#8221; a total geek!</p>
<p>Anyway, I sent a message back, mostly to be funny, because I always feel both funnier and more helpful when I connect to someone through social networking.</p>
<blockquote><p><span style="font-family: andale mono,times">Hi! Wow, pretty funny connection. Social Networking FTW!</span></p>
<p><span style="font-family: andale mono,times">So, no, nothing. No problems and no later developments. I did  calculations of surface tension in grad school and the size of those  holes are, in fact, too small. However, I will give the caveat that  certain things increase or decrease the surface tension of water. &#8220;Uh  oh? Where&#8217;s he going with this?&#8221; You ask.</span></p>
<p><span style="font-family: andale mono,times">For instance, cat spit. I have some knowledge of cat spit, and it  decreases water&#8217;s surface tension. Don&#8217;t ask me how I know this, it&#8217;s an  embarrassing situation that I&#8217;m still in counseling for. Suffice it to  say that if you have a cat, you may want to be careful letting him drink  beverages around your laptop (The whole &#8220;lack of a thumb&#8221; thing is hard  for them, but I&#8217;ve learned that now, and we&#8217;re moving on)</span></p>
<p><span style="font-family: andale mono,times">Anyway, I&#8217;m not sure where coffee is on this. Whether it increases or  decreases it. However, even if it decreased it, it would have to be an  insane amount to get into that grill. My suspicion is that the Apple  engineers are somewhat sloppy drinkers, and have thought about  everything&#8211; based on they&#8217;re own klutsy habits!</span></p>
<p><span style="font-family: andale mono,times">I think your safe. Yay Mac!</span></p>
<p><span style="font-family: andale mono,times">Hope everything else is equally peachy.<br />
-J</span></p></blockquote>
<p>The whole exchange got me thinking about my New Year&#8217;s Resolution for 2009, which I&#8217;ve re-resolved for 2010. That was &#8220;<a href="http://positivelyglorious.com/easy-listening/my-2008-nonretrospective">to be more Irish.</a>&#8221; It&#8217;s a tough goal. Being Irish is nothing to sniff at. It&#8217;s no easy feat, but I&#8217;m convinced I can do it if I work hard enough. This exchange bodes well, because the Irish have a saying that a stranger is just a friend you haven&#8217;t met yet.</p>
<p>This person shot me an email out of the blue, and email to a stranger, and email to a friend she hasn&#8217;t met yet. That&#8217;s the cool thing about social networking. We&#8217;re all friends.</p>
<p>Yay for Social Networking! (and yay for the Irish, too!)</p>
<img src="http://positivelyglorious.com/?ak_action=api_record_view&id=2040&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/easy-listening/surface-tension-cat-spit-friends/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Death Of Software &amp; Media</title>
		<link>http://positivelyglorious.com/software-media/the-death-of-software-media/</link>
		<comments>http://positivelyglorious.com/software-media/the-death-of-software-media/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 01:05:13 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://positivelyglorious.com/?p=1973</guid>
		<description><![CDATA[Here&#8217;s an announcement, for all you geeky types out there: I&#8217;m finished posting geeky stuff like mathematics, programming and social [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fthe-death-of-software-media%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fthe-death-of-software-media%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Here&#8217;s an announcement, for all you geeky types out there:</p>
<p>I&#8217;m finished posting geeky stuff like mathematics, programming and social media on <a href="http://positivelyglorious.com/">Positively Glorious!</a> and phasing out the Software &amp; Media category here. I will henceforth only post those topics on <a href="http://mettadore.com">Mettadore.com</a>.</p>
<p>Why?</p>
<p>Because I have a large number of people who read Positively Glorious! because of my writings on topics non-geek topics, and they don&#8217;t want to read geeky topics. Furthermore, I have a number of people subscribed to the Positively Glorious! &#8220;Software &amp; Media&#8221; stream, and <em>only</em> that stream. Thus, I&#8217;m assuming they don&#8217;t want to read about spirituality, or my incompetence as an uncle.</p>
<p>So, because I&#8217;m one to give the people what they want, I&#8217;m creating a Geek-only blog.</p>
<p>From now on, if you want ridiculously long diatribes on topics I don&#8217;t know enough about go to <a href="http://positivelyglorious.com">Positively Glorious!</a>, and if you want math, programming, social media and other geeky stuff, tune in to <a href="http://mettadore.com">Mettadore.com</a>.</p>
<img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1973&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/the-death-of-software-media/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Making Sociable More… Sociable</title>
		<link>http://positivelyglorious.com/software-media/making-sociable-more%e2%80%a6-sociable/</link>
		<comments>http://positivelyglorious.com/software-media/making-sociable-more%e2%80%a6-sociable/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 03:24:47 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://positivelyglorious.com/?p=1953</guid>
		<description><![CDATA[I&#8217;ve been using the Sociable WordPress plugin for a while now. It&#8217;s a plugin that gives instant links to various [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fmaking-sociable-more%25e2%2580%25a6-sociable%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fmaking-sociable-more%25e2%2580%25a6-sociable%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I&#8217;ve been using the <a href="http://blogplay.com/sociable-for-wordpress/">Sociable WordPress plugin</a> for a while now. It&#8217;s a plugin that gives instant links to various social media sites, to help you spread your bloggy goodness around the world. One thing that I love about this plugin is the fact that it shows a tagline before the list of links (just look to the end of this post for what I&#8217;m talking about).</p>
<p>For me, this tagline has become something of a… well… tagline. Many people use the default &#8220;Share and enjoy&#8221; tagline.<sup>1</sup> This is probably because most people see the tagline as an introduction to the &#8220;link to social media&#8221; function of Sociable. Me? I actually like the semi-Shakespearian &#8220;ending of a chapter&#8221; feeling that the tagline gives. It&#8217;s like a way to tell the reader that we&#8217;re at the end of this post, this thought, this… chapter.<span id="more-1953"></span></p>
<p>When I started using Sociable, I periodically changed the tagline from &#8220;Whaddaya think, sirs?&#8221; to &#8220;Push the button, Frank.&#8221; and back again. These are two good &#8220;ending taglines&#8221; from that greatest of all shows: <a href="http://en.wikipedia.org/wiki/Mystery_Science_Theater_3000">Mystery Science Theater 3000</a>. Eventually, I got sick of the tagline being the same thing for all posts, and of having to manually change the tagline. So, I thought I&#8217;d hack the plugin source to allow for random taglines.</p>
<h3>Random Taglines Rule!</h3>
<div id="attachment_1960" class="wp-caption alignleft" style="width: 310px"><a href="http://positivelyglorious.com/files/2009/12/Screen-shot-2009-12-24-at-10.14.23-PM.png"><img class="size-medium wp-image-1960 " title="Screen shot 2009-12-24 at 10.14.23 PM" src="http://positivelyglorious.com/files/2009/12/Screen-shot-2009-12-24-at-10.14.23-PM-300x90.png" alt="Sociable-random's admin page" width="300" height="90" /></a><p class="wp-caption-text">Sociable-random&#39;s admin page</p></div>
<p>Thus, I give you the <a href="http://github.com/mettadore/sociable-random">sociable-random</a> plugin. It&#8217;s exactly the same as the sociable plugin, except that it allows for multiple taglines and it automatically uses the &lt;strong&gt; tag for those taglines.</p>
<p>At the bottom of this post, you see a tag that has been randomly chosen from about 7 MST3K quotes. You also see the way I formatted the tagline to separate it a bit from the post, while still connecting it to the sociable links. The CSS for this is:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.sociable_tagline</span> <span style="color: #00AA00;">&#123;</span>
            <span style="color: #000000; font-weight: bold;">padding-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
            <span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span> <span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>
            <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span> <span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
            <span style="color: #000000; font-weight: bold;">line-height</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1.5em</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #6666ff;">.sociable_tagline</span> strong <span style="color: #00AA00;">&#123;</span>
           <span style="color: #000000; font-weight: bold;">border-top</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#444</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<h3>Download</h3>
<p>Download sociable-random from its <a href="http://github.com/mettadore/sociable-random/archives/master">archives link on Github</a>. Feel free to let me know what you think, and if something&#8217;s broken, either fire a message along on of the various channels you see on the right edge of your screen, or using the <a href="http://github.com/mettadore/sociable-random/issues">Github Issues page</a>.</p>
<ol class="footnotes"><li id="footnote_0_1953" class="footnote">which is something I&#8217;d expect to hear from a space ship&#8217;s computer that&#8217;s trying to recreate tea, not something I want on my blog.</li></ol><img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1953&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/making-sociable-more%e2%80%a6-sociable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Head Smacking In Scala: XML Parsing</title>
		<link>http://positivelyglorious.com/software-media/head-smacking-in-scala-xml-parsing/</link>
		<comments>http://positivelyglorious.com/software-media/head-smacking-in-scala-xml-parsing/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 02:29:17 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://john.jmetta.com/?p=1903</guid>
		<description><![CDATA[I program in a lot of different languages, everything from C and C++ to Awk and Sed, Visual Basic and [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fhead-smacking-in-scala-xml-parsing%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fhead-smacking-in-scala-xml-parsing%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>I program in a lot of different languages, everything from C and C++ to Awk and Sed, Visual Basic and ASP to PHP and Javascript. I&#8217;m a bit of a jack-of-all-trades when it comes to languages, but the main one for the past 10 or so years has been <a href="http://python.org">Python</a>. Python is the language that I automatically turn to when I say &#8220;I need to do ${X},&#8221; where X is any given task that does not require a UML diagram and user case studies. It&#8217;s fast, it&#8217;s powerful, and it&#8217;s about as comfortable as an old shoe.</p>
<p>Lately, many of my projects&#8211; including <a href="http://hydra.si">my really really big one</a>&#8211; have been in Java. Since I haven&#8217;t programmed in Java since about 1998 (about when I picked up Python, notably) it&#8217;s been a hard road. Java has become a harsh mistress. That sweet young thing that was so easy going and flexible so many years ago has grown up to be a cynical, hard-edged woman with a riding crop in her hand.</p>
<p>At least, that&#8217;s been <em>my</em> recent experience.<span id="more-1903"></span></p>
<p>Still, it&#8217;s not all been bad. One thing that&#8217;s great about it is that I&#8217;ve discovered the <a href="http://scala-lang.org/">Scala programming language</a>.</p>
<p>If Python and Java got together and had a son, and then if Haskell and Ruby got together and had a daughter, and then that son and daughter got together and had a baby, that baby would be named Scala.</p>
<p>Scala is a scripting language for Java that is powerful, yet fast. It&#8217;s super OOP-centric, yet still has a foot planted firmly in functional programming land. Simple in its syntax, yet able to use any Java classes natively, and it byte compiles to native Java code.</p>
<p>Scala is everything I remember Java promising back in the mid-90s. It&#8217;s basically a language that a Java-whipped Python programmer could only dream of, yet it&#8217;s real.</p>
<p>Still, as when learning <em>any</em> language, there are times when I smack my head. Today&#8217;s head smacker illustrates why it&#8217;s important to not make assumptions when programming in an unfamiliar language.</p>
<h3>My XML Parser</h3>
<p>Today, I was building an XML parser that would grab water quality station information from the websites of organizations like the Army Corps and USGS. This is normally something that I&#8217;d do in Python&#8211; I&#8217;d whip it out real fast and then forget about it&#8211; but I thought this would be another good chance to play with Scala.</p>
<p>It&#8217;s a very simple language,<sup>1</sup> my HTTP request client consists of only the following:<sup>2</sup></p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">import</span> java.<span style="color: #000000;">io</span>.<span style="color: #000000;">InputStream</span><span style="color: #000080;">;</span>
<span style="color: #0000ff; font-weight: bold;">import</span> java.<span style="color: #000000;">net</span>.<span style="color: #000000;">URL</span><span style="color: #000080;">;</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">object</span> Http <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> request<span style="color: #F78811;">&#40;</span>urlString<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span><span style="color: #000080;">:</span> <span style="color: #F78811;">&#40;</span>Boolean, InputStream<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span>
    <span style="color: #0000ff; font-weight: bold;">try</span> <span style="color: #F78811;">&#123;</span>
      <span style="color: #0000ff; font-weight: bold;">val</span> url <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> URL<span style="color: #F78811;">&#40;</span>urlString<span style="color: #F78811;">&#41;</span>
      <span style="color: #0000ff; font-weight: bold;">val</span> body <span style="color: #000080;">=</span> url.<span style="color: #000000;">openStream</span>
      <span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">true</span>, body<span style="color: #F78811;">&#41;</span>
    <span style="color: #F78811;">&#125;</span>
    <span style="color: #0000ff; font-weight: bold;">catch</span> <span style="color: #F78811;">&#123;</span>
      <span style="color: #0000ff; font-weight: bold;">case</span> ex<span style="color: #000080;">:</span>Exception <span style="color: #000080;">=&amp;</span>gt<span style="color: #000080;">;</span> <span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">false</span>, <span style="color: #0000ff; font-weight: bold;">null</span><span style="color: #F78811;">&#41;</span>
   <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p>That&#8217;s all that&#8217;s needed to make the HTTP request to a server. As you can see, we can pull in the Java classes for InputStream and URL and use them natively. That&#8217;s quite nice.</p>
<p>Scala&#8217;s design is a bit strange to me. The fact that you can&#8217;t have static methods in a class (they go in <em>objects</em>) is a little head scratching sometimes. Also, if you have both static and instance methods, and you do so by naming both a class and an object with the same name. Furthermore, you can have traits, which are somewhat like Java interfaces. Thus, you could have three completely separate types with the same name, all which function both independently and together. Talk about head scratching.</p>
<p>While trying to get used to all this, I defined a base parser as a trait, because I&#8217;ll likely be creating parsers for a lot of different types of data sites.</p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">trait</span> BaseParser <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> baseUrl<span style="color: #000080;">:</span>String <span style="color: #000080;">=</span> <span style="color: #6666FF;">&quot;http://&quot;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> fetchAndParseURL<span style="color: #F78811;">&#40;</span>URL<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span>
      <span style="color: #0000ff; font-weight: bold;">val</span> <span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">true</span>, body<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> Http request<span style="color: #F78811;">&#40;</span>URL<span style="color: #F78811;">&#41;</span>
      <span style="color: #0000ff; font-weight: bold;">val</span> xml <span style="color: #000080;">=</span> XML.<span style="color: #000000;">load</span><span style="color: #F78811;">&#40;</span>body<span style="color: #F78811;">&#41;</span>
      xml
   <span style="color: #F78811;">&#125;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> fetchAndParseQuery<span style="color: #F78811;">&#40;</span>query<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> fetchAndParseURL<span style="color: #F78811;">&#40;</span>baseUrl + query<span style="color: #F78811;">&#41;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p>Here is the skeleton of basic functionality for actually grabbing and parsing the XML of a website.<sup>3</sup> fetchAnParseURL() is the basic method, which grabs a URL and parses the XML (error checking and unit tests stripped here). fetchAndParseQuery() is a way to generically modify the base url, with specific modifications to be made in the class.</p>
<p>There are some interesting things in how Scala defines methods. The biggest one is the lack of return statements. Scala assumes that the last object in a method returns. That&#8217;s a bit like magic, sometimes, and thus somewhat scary. Another one is the tendency to use equal signs and not require parentheses (as in baseUrl, which is a method). Another nice thing to note here is that function definitions can be declared on one line. It makes some class definitions quite small:</p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">class</span> USGSStation<span style="color: #F78811;">&#40;</span>siteID<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span> <span style="color: #0000ff; font-weight: bold;">extends</span> Application <span style="color: #0000ff; font-weight: bold;">with</span> BaseParser <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">override</span> <span style="color: #0000ff; font-weight: bold;">def</span> baseUrl <span style="color: #000080;">=</span> <span style="color: #6666FF;">&quot;http://qwwebservices.usgs.gov/Station/search?siteid=USGS-&quot;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> GetMetaData<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#123;</span> <span style="color: #0000ff; font-weight: bold;">this</span>.<span style="color: #000000;">fetchAndParseURL</span><span style="color: #F78811;">&#40;</span>baseUrl + siteID<span style="color: #F78811;">&#41;</span> <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p>So, here&#8217;s my first parser class. It takes a USGS site ID as a string, and overrides with a baseUrl that coincides with the &#8220;station identification&#8221; REST query. It&#8217;s as simple and fast as Python, which blows my mind.</p>
<p>But it doesn&#8217;t work.</p>
<h3>Smacking Your Head With A Unit</h3>
<p>So, I spent a long time trying to figure out why this wouldn&#8217;t work. I mean, it compiled, and it ran, and it returned something. It just didn&#8217;t return what I wanted. I kept getting a null value of the type &#8220;Unit.&#8221;</p>
<p>Well, it turns out that this is the &#8220;don&#8217;t make assumptions&#8221; part of learning a new language. You see, in every other language I know except JavaScript which was designed explicitly to torture terrorist suspect detainees, methods are defined with a signature followed by the definition. That&#8217;s it. Signature, definition, done. </p>
<p>Scala, is different. I thought that the equal sign was a clever way of making one line functions. No, it turns out that it&#8217;s a necessary part of defining a method&#8211; at least if you want it to return anything.</p>
<p>Strangely, Scala doesn&#8217;t break when you mis-define a method, it just returns Unit&#8211; which, as much as I can tell, is the number <a href="http://en.wikipedia.org/wiki/42_(number)#In_The_Hitchhiker.27s_Guide_to_the_Galaxy">42</a>. Once I figured out that my methods needed equal signs, everything worked as expected.</p>
<p>Thus, here is the final XML grabber for the site metadata:</p>

<div class="wp_syntax"><div class="code"><pre class="scala" style="font-family:monospace;"><span style="color: #0000ff; font-weight: bold;">import</span> xml.<span style="color: #F78811;">&#123;</span>Elem, XML<span style="color: #F78811;">&#125;</span>
<span style="color: #0000ff; font-weight: bold;">import</span> java.<span style="color: #000000;">io</span>.<span style="color: #000000;">InputStream</span><span style="color: #000080;">;</span>
<span style="color: #0000ff; font-weight: bold;">import</span> java.<span style="color: #000000;">net</span>.<span style="color: #000000;">URL</span><span style="color: #000080;">;</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">object</span> Http <span style="color: #F78811;">&#123;</span>
   <span style="color: #0000ff; font-weight: bold;">def</span> request<span style="color: #F78811;">&#40;</span>urlString<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span><span style="color: #000080;">:</span> <span style="color: #F78811;">&#40;</span>Boolean, InputStream<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span>
      <span style="color: #0000ff; font-weight: bold;">try</span> <span style="color: #F78811;">&#123;</span>
         <span style="color: #0000ff; font-weight: bold;">val</span> url <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">new</span> URL<span style="color: #F78811;">&#40;</span>urlString<span style="color: #F78811;">&#41;</span>
         <span style="color: #0000ff; font-weight: bold;">val</span> body <span style="color: #000080;">=</span> url.<span style="color: #000000;">openStream</span>
         <span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">true</span>, body<span style="color: #F78811;">&#41;</span>
      <span style="color: #F78811;">&#125;</span>
      <span style="color: #0000ff; font-weight: bold;">catch</span> <span style="color: #F78811;">&#123;</span>
         <span style="color: #0000ff; font-weight: bold;">case</span> ex<span style="color: #000080;">:</span>Exception <span style="color: #000080;">=&amp;</span>gt<span style="color: #000080;">;</span> <span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">false</span>, <span style="color: #0000ff; font-weight: bold;">null</span><span style="color: #F78811;">&#41;</span>
      <span style="color: #F78811;">&#125;</span>
<span style="color: #F78811;">&#125;</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">trait</span> BaseParser <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> baseUrl<span style="color: #000080;">:</span>String <span style="color: #000080;">=</span> <span style="color: #6666FF;">&quot;http://&quot;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> fetchAndParseURL<span style="color: #F78811;">&#40;</span>URL<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #F78811;">&#123;</span>
      <span style="color: #0000ff; font-weight: bold;">val</span> <span style="color: #F78811;">&#40;</span><span style="color: #0000ff; font-weight: bold;">true</span>, body<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> Http request<span style="color: #F78811;">&#40;</span>URL<span style="color: #F78811;">&#41;</span>
      <span style="color: #0000ff; font-weight: bold;">val</span> xml <span style="color: #000080;">=</span> XML.<span style="color: #000000;">load</span><span style="color: #F78811;">&#40;</span>body<span style="color: #F78811;">&#41;</span>
      xml
   <span style="color: #F78811;">&#125;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> fetchAndParseQuery<span style="color: #F78811;">&#40;</span>query<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> fetchAndParseURL<span style="color: #F78811;">&#40;</span>baseUrl + query<span style="color: #F78811;">&#41;</span>
<span style="color: #F78811;">&#125;</span>
&nbsp;
<span style="color: #0000ff; font-weight: bold;">class</span> USGSStation<span style="color: #F78811;">&#40;</span>siteID<span style="color: #000080;">:</span>String<span style="color: #F78811;">&#41;</span> <span style="color: #0000ff; font-weight: bold;">extends</span> Application <span style="color: #0000ff; font-weight: bold;">with</span> BaseParser <span style="color: #F78811;">&#123;</span>
  <span style="color: #0000ff; font-weight: bold;">override</span> <span style="color: #0000ff; font-weight: bold;">def</span> baseUrl <span style="color: #000080;">=</span> <span style="color: #6666FF;">&quot;http://qwwebservices.usgs.gov/Station/search?siteid=USGS-&quot;</span>
  <span style="color: #0000ff; font-weight: bold;">def</span> GetMetaData<span style="color: #F78811;">&#40;</span><span style="color: #F78811;">&#41;</span> <span style="color: #000080;">=</span> <span style="color: #0000ff; font-weight: bold;">this</span>.<span style="color: #000000;">fetchAndParseURL</span><span style="color: #F78811;">&#40;</span>baseUrl + siteID<span style="color: #F78811;">&#41;</span>
<span style="color: #F78811;">&#125;</span></pre></div></div>

<p>…which works correctly. It grabs the site&#8217;s metadata as the full XML object, which I can then parse for elements such as county code, name, latitude/longitude and sensor type. I&#8217;m using this, in conjunction with a bunch of other as-yet-poorly-written-code to pull both sites and site data from their pseudo-REST interface.</p>
<h3>Coda</h3>
<p>So far, I&#8217;m really impressed. Scala is a great language. The total time I spent on this (without including my stupid lack of equal sign problem) was not much more than what I&#8217;d spend on a Python version, and that&#8217;s without me being familiar with the language. More than that, we can byte compile it and use it within our larger infrastructure without resorting to something like Jython or another solution.</p>
<ol class="footnotes"><li id="footnote_0_1903" class="footnote">and this example was made simpler by the fact that <a href="http://blogs.sun.com/rafaelferreira/entry/pragmatic_scala">Raphael Ferreira</a> already built up the code to parse Amazon&#8217;s website</li><li id="footnote_1_1903" class="footnote">Code here, except where otherwise licensed, is licensed under the <a href="http://www.opensource.org/licenses/mit-license.php">MIT</a> license.</li><li id="footnote_2_1903" class="footnote">yes, fellow geeks, I know that there are things I could do better here. This is a quick skeleton to get used to the language, not a final product that needs to be judged. Save that for when I can actually make something work</li></ol><img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1903&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/head-smacking-in-scala-xml-parsing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reactivating Theme and Plugin Editors in WordPressMU</title>
		<link>http://positivelyglorious.com/software-media/reactivating-theme-and-plugin-editors-in-wordpressmu/</link>
		<comments>http://positivelyglorious.com/software-media/reactivating-theme-and-plugin-editors-in-wordpressmu/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 19:45:06 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://john.jmetta.com/?p=1770</guid>
		<description><![CDATA[This entry is part of a series, Migrating to WordPressµ&#187; It&#8217;s like camping with a Therm-a-Rest. They tell you not [...]]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-2')" title="click to expand/collapse slider Migrating to WordPressµ">Migrating to WordPressµ&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-2"></span></small></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Freactivating-theme-and-plugin-editors-in-wordpressmu%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Freactivating-theme-and-plugin-editors-in-wordpressmu%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>It&#8217;s like camping with a <a href="http://cascadedesigns.com/Therm-A-Rest">Therm-a-Rest</a>. They tell you not to blow into it. They say it&#8217;s important to just let it sit and it will self-inflate. Don&#8217;t blow it up. That&#8217;s bad.</p>
<p>But everyone does it.</p>
<p>It&#8217;s the same with the <a href="http://wordpress.org">WordPress</a> core. They say &#8220;Don&#8217;t hack core,&#8221; but everyone does it.<span id="more-1770"></span></p>
<p>Well, almost everyone.</p>
<p>Actually, maybe just one or two of us.</p>
<p>Anyway, I&#8217;d <em>never</em> hack the WordPress core if I were working on something for someone else. I&#8217;ve had to clean up that mess after an update to the WordPress software completely wrecked the website (I wanted to kill that person). </p>
<p>I am a little bit more likely to hack the core code on my <em>personal</em> site, however. Just as I&#8217;m allowed to do anything I want to my house, but would probably bitch-slap someone if they came over and started drilling random holes in the walls.</p>
<p>It&#8217;s mine, I&#8217;ll accept responsibility for screwing it up. I&#8217;m alright making that choice.</p>
<p>So, recently, I moved to a <a href="http://mu.wordpress.org">WordPressµ</a> installation at <a href="http://jmetta.com">The MettaSite</a>, and placed Positively Glorious! and a few other gems under it&#8217;s control. It&#8217;s been great so far, but I missed the ability to edit my theme and individual plugins from within the dashboard. For most installations of WordPressµ, disabling this ability is A Good Thing™, because modifying a theme is pretty dangerous if more than one person has access to that theme. It&#8217;ll work on one site, but break on others. That&#8217;s bad.</p>
<p>But at The MettaSite, there&#8217;s just me, and at most 2 or 3 other people that I might host sites for. In this case, it&#8217;s easy enough for me to activate a theme on one blog only. It&#8217;s a very small, controlled space, so the problems of theme modification are virtually nil.</p>
<p>So, I decided to reactivate my theme and plugin editors in WordPressµ, which involves hacking the core. This is problematic because there are updates to the core code, and every update breaks any hacks you have (as well it should). I might take some time to figure out how to add this functionality to the backend more cleanly and submit an options patch, but until then, I needed a quick reminder about how to fix it&#8211; because WordPress will update, and I won&#8217;t be able to edit because I was stupid and hacked the core.</p>
<h3>The Instructions</h3>
<p>It&#8217;s pretty simple, actually. In WPMU V.2.8.x, look in the file <strong>wp-admin/includes/mu.php</strong> and around line 539 find the function wpmu_menu() in it, you&#8217;ll find an if statement:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>552
553
554
555
556
557
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">…
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>is_site_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'plugins.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the plugin installer for regular users</span>
    <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'plugins.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the plugin editor</span>
    <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'themes.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the themes editor</span>
…</pre></td></tr></table></div>

<p>Change this so that all three of these unset() statements are contained in the if statement. What we&#8217;re doing is turning off those editors <em>only</em> if the user is not a site administrator in the database, rather than always.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>552
553
554
555
556
557
558
559
560
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> wpmu_menu<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$menu</span><span style="color: #339933;">,</span> <span style="color: #000088;">$submenu</span><span style="color: #339933;">,</span> <span style="color: #000088;">$current_user</span><span style="color: #339933;">;</span>
…
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>is_site_admin<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: #990000;">unset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'plugins.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the plugin installer for regular users</span>
        <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'plugins.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">15</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the plugin editor</span>
        <span style="color: #990000;">unset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$submenu</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'themes.php'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">10</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// always remove the themes editor</span>
    <span style="color: #009900;">&#125;</span>
…</pre></td></tr></table></div>

<p>Next, scroll down to And around Line 1116 or so to find function disable_some_pages():</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1126
1127
1128
1129
1130
1131
1132
1133
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">…
    <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'theme-editor.php'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'plugin-editor.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$pages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$page</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: #990000;">strpos</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            wp_die<span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Page disabled by the administrator'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
…</pre></td></tr></table></div>

<p>Change that if statement to this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1126
1127
1128
1129
1130
1131
1132
1133
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">…
    <span style="color: #000088;">$pages</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'theme-editor.php'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'plugin-editor.php'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$pages</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$page</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: #990000;">strpos</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'PHP_SELF'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$page</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #339933;">!</span>is_site_admin<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
            wp_die<span style="color: #009900;">&#40;</span> __<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Page disabled by the administrator'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
    <span style="color: #009900;">&#125;</span>
…</pre></td></tr></table></div>

<p>Again, what we&#8217;re doing is changing from a policy of disabling the editor pages <em>always</em>, to only disabling them if the current user is not a site admin.</p>
<h3>Coda</h3>
<p>That should do it. Once you make these two changes (test them out, of course) you should be able to use the built-in editors for both themes and plugins. Of course, what we&#8217;d all rather have is a better system for editing them, but unless you want to set up your IDE of choice with an FTP link, or maybe even a continuous integration server, this is a pretty good choice.</p>
<p>Have fun, <a href="http://morganpdx.com">Morgan</a> <img src='http://positivelyglorious.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1770&type=feed" alt="" /><div id="hackadelic-sliderNote-2" class="concealed">Entries in this series:<ol><li><a href="http://positivelyglorious.com/software-media/migrating-wordpress-blog-to-wordpressmu/">Migrating From WordPress to WordPressMU (without wildcard subdomains)</a></li><li><a href="http://positivelyglorious.com/software-media/migrating-from-wordpress-to-wordpressmu-part-ii/">Migrating from WordPress to WordPressMU, Part II</a></li><li>Reactivating Theme and Plugin Editors in WordPressMU</li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div>]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/reactivating-theme-and-plugin-editors-in-wordpressmu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Migrating from WordPress to WordPressMU, Part II</title>
		<link>http://positivelyglorious.com/software-media/migrating-from-wordpress-to-wordpressmu-part-ii/</link>
		<comments>http://positivelyglorious.com/software-media/migrating-from-wordpress-to-wordpressmu-part-ii/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 04:04:40 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=1862</guid>
		<description><![CDATA[This entry is part of a series, Migrating to WordPressµ&#187; This is the second part of a series on migrating [...]]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-4')" title="click to expand/collapse slider Migrating to WordPressµ">Migrating to WordPressµ&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-4"></span></small></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fmigrating-from-wordpress-to-wordpressmu-part-ii%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fmigrating-from-wordpress-to-wordpressmu-part-ii%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>This is the second part of a series on migrating a site from a single installation WordPress blog to a WordPressµ multi-user implementation. It assumes you have everything installed and have taken the steps in part 1 of the series.</p>
<p>If you&#8217;re not interested in managing WordPress systems then move along. There&#8217;s nothing to see here.<span id="more-1862"></span>So, now we&#8217;ve done all of our preparatory work, we&#8217;re ready to build up the new blog. WordPressµ uses a different database schema than the single user installation, so we&#8217;re going to modify the database manually.</p>
<h3>Databasey Stuff</h3>
<p style="padding-left: 30px"><strong>0.</strong> <strong>Fire up PHPMyAdmin</strong> or whatever you use for database admin on your old blog. You&#8217;re going to copy the database.</p>
<p style="padding-left: 30px"><strong>1.</strong> <strong>Kill the post revisions </strong>to clean up the database (unless you want to keep them all for some reason) by issuing the following SQL command:</p>
<pre style="padding-left: 60px"><code>DELETE FROM wp_posts WHERE post_type = "revision";</code></pre>
<p style="padding-left: 30px"><strong>2.</strong> <strong>Grab copies of the following database tables</strong> by using the &#8220;Export&#8221; function. I suggest copying each of these tables separately in plain SQL format because we have to modify each table in a text editor.</p>
<pre style="padding-left: 60px"><code>wp_comments
wp_links
wp_options
wp_postmeta
wp_posts
wp_term_relationships
wp_term_taxonomy
wp_terms
</code></pre>
<p style="padding-left: 30px">There are probably more tables there because many plugins install tables. You might want to consider investigating those if you have complex plugins but I won&#8217;t go over them here. You need not copy wp_users and wp_usermeta because there is a different usertable in WPMU and you&#8217;ll probably want to add users using the admin pages.</p>
<p style="padding-left: 30px"><strong>3.</strong> <strong>WPMU has different tables for each database</strong>, so instead of wp_posts, your database will use the table wp_ID_posts where ID is the database ID that you figured out in step 2.71828183 above (we&#8217;ll use 15 for illustration). For each of the tables that you exported, you basically want to use replace &#8220;wp_&#8221; with &#8220;wp_15_&#8221;. You can do this easily using a text editor.</p>
<p style="padding-left: 60px"><strong>π.</strong> <strong>The commandline geeks </strong>will probably use a command looking something like:<sup>1</sup></p>
<p style="padding-left: 90px">for i in `ls wp_* | grep -vE gz | awk -F. &#8216;{print $1}&#8217;`; do cat ${i}.sql | sed -e &#8216;s/wp_/wp_15_/g&#8217; &gt; ${i}-out.sql; done</p>
<p style="padding-left: 60px">Be careful doing this, however, since there&#8217;s a bunch of things in wp_postmeta and such that have values like meta_key=_wp_attached_file that you may screw up (uh, like I did <img src='http://positivelyglorious.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .</p>
<p style="padding-left: 30px"><strong>4</strong>. <strong>Import the new data. </strong>We are essentially re-creating a fully functional database, so we don&#8217;t need the first post, default category, etc. They&#8217;ll cause a duplicate entry error, so you&#8217;ll probably want to empty each table in the new database as you import the new information.</p>
<p style="padding-left: 60px"><strong>Note:</strong> I&#8217;m writing this to go from WP 2.7 to WPMU 2.8, and as I write it, there&#8217;s a 2.9 version about to be released. These releases sometime accompany DB table changes. It&#8217;s a good idea to look through each import statement and compare the old table structure to the new structure. What I say here ma change.</p>
<p style="padding-left: 60px"><strong>wp_posts:</strong> Add a new column called post_category to your wp_15_posts table in your new blog.<sup>2</sup> The old WP versions have this, but the new WPMU does not; thus, your import will fail. Doing this is and then dropping the column later is easier than modifying all of the insert scripts. Once you have an empty wp_15_posts table and the post_category column, do the import.</p>
<p style="padding-left: 60px"><strong>wp_options:</strong> A bit of a tough one. wp_options contains a lot of information in some blogs, and much of that is plugin specific. I opted to just ignore this one actually and let it rebuild everything as needed. It&#8217;s a bit of a conservative option to not mess with this table. You should look through the import statement, just so you know what&#8217;s there at least. You can also selectively delete things that don&#8217;t matter, and insert a bunch of options like comments_notify and posts_per_page just to save time later. I <em>can</em> say that if you change siteurl, things will break.</p>
<p style="padding-left: 60px"><strong>The rest</strong>: Just empty the new database table and import the old one, everything should be fine.</p>
<p style="padding-left: 30px">
<p style="padding-left: 60px">
<p style="padding-left: 30px"><strong>5</strong>. &#8220;<strong>AAHH! My pictures are gone!&#8221;</strong> Calm down! Fear is the mindkiller! Master your fear and follow these steps: Read-understand-then-use the following SQL commands:</p>
<pre style="padding-left: 60px">UPDATE wp_${ID}_posts SET guid = REPLACE (guid, 'wp-content/uploads', 'files');
UPDATE wp_${ID}_posts SET post_content = REPLACE (post_content,
                                              'http://${DOMAIN}/wp-content/uploads',
                                              'http://${DOMAIN}/files');
UPDATE wp_${ID}_postmeta SET meta_value = REPLACE (meta_value,
                                               '/path/to/your/site/wp-content/uploads/',
                                               '/path/to/your/site/wp-content/blogs.dir/${ID}/')
                     WHERE meta_key='_wp_attached_file';</pre>
<p style="padding-left: 30px">where DOMAIN is your domain (e.g. positivelyglorious.com) and ID is your blog&#8217;s id (e.g. 15). You could, of course, do much of this by modifying the SQL text files, but I like the power of SQL because it allows me to search and, say, find what the database is using for &#8220;/path/to/my/site&#8221; in different cases.</p>
<p style="padding-left: 30px">In some cases, the meta_value for meta_key=&#8217;_wp_attached_file&#8217; may look like &#8217;2009/12/10/file.jpg&#8217; instead of &#8216;/path/to/your/site/wp-content/uploads/2009/12/10/file.jpg&#8217;. The above command will ignore these files, and they will react as before in WordPress.</p>
<h3>Coda</h3>
<p>Alright, at this point you have all of the information from your previous blog correctly placed into the database of the new WordPressµ installation. You should be able now to browse to your new blog and see all of your posts. From here, you&#8217;ll want to explore your old plugins, grab your theme, and work from the admin interface. In other words, you&#8217;re on your own.</p>
<p>Go, young padawan. You are ready.</p>
<ol class="footnotes"><li id="footnote_0_1862" class="footnote">This lists all of the files that are wp_TABLENAME.sql. I downloaded my tables in gzipped format and then unzipped them, so this command exclude the gzipped files by filtering with &#8220;grep -vE gz&#8221; since I wanted to keep them. It also passes each listed name through awk and strips off the .sql extension. For each file name pipes the contents (adding the .sql extension) to a sed script that replaces wp_ with wp_15_ (my kzas.jmetta.com database id) and then spits them out to a new file that has a different name wp_TABLENAME-out.sql. Piping through awk and then adding the extension back on is not necessary, but allows us to have a new .sql file at the end for importing.</li><li id="footnote_1_1862" class="footnote">Best to add this column after post_title if you can.</li></ol><img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1862&type=feed" alt="" /><div id="hackadelic-sliderNote-4" class="concealed">Entries in this series:<ol><li><a href="http://positivelyglorious.com/software-media/migrating-wordpress-blog-to-wordpressmu/">Migrating From WordPress to WordPressMU (without wildcard subdomains)</a></li><li>Migrating from WordPress to WordPressMU, Part II</li><li><a href="http://positivelyglorious.com/software-media/reactivating-theme-and-plugin-editors-in-wordpressmu/">Reactivating Theme and Plugin Editors in WordPressMU</a></li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div>]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/migrating-from-wordpress-to-wordpressmu-part-ii/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Migrating From WordPress to WordPressMU (without wildcard subdomains)</title>
		<link>http://positivelyglorious.com/software-media/migrating-wordpress-blog-to-wordpressmu/</link>
		<comments>http://positivelyglorious.com/software-media/migrating-wordpress-blog-to-wordpressmu/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 20:27:11 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=1852</guid>
		<description><![CDATA[This entry is part of a series, Migrating to WordPressµ&#187; Recently, Positively Glorious! had a major failure and I eventually [...]]]></description>
			<content:encoded><![CDATA[<div class="hackadelic-series-info on-frontpage"><small>This entry is part of a series,  <a href="javascript:;" class="hackadelic-sliderButton"onclick="toggleSlider('#hackadelic-sliderPanel-6')" title="click to expand/collapse slider Migrating to WordPressµ">Migrating to WordPressµ&raquo;</a> <span class="hackadelic-sliderPanel concealed" id="hackadelic-sliderPanel-6"></span></small></div><div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fmigrating-wordpress-blog-to-wordpressmu%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fmigrating-wordpress-blog-to-wordpressmu%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently, Positively Glorious! had a major failure and I eventually migrated everything from one blog to a <a href="http://mu.wordpress.org">WordPressµ</a> installation. This allows me to host multiple blogs on one installation and save the time of maintaining the 11 blogs I was previously pulling my hair out over.</p>
<p>Later, <a href="http://morganpdx.com">a friend</a> read about my experience and thought about doing the same thing and I told her I&#8217;d get details to her, and then I quickly forgot. I wish I had, because I now have to migrate <a href="http://radiotierra.org">Radio Tierra&#8217;s</a> site so I can host it here as well, and I don&#8217;t remember what I did.</p>
<p>Thus, like a good little geek, I&#8217;ll write step-by-step directions so that when I have to do it again, I&#8217;ll have documentation. Have fun Morgan.<span id="more-1852"></span></p>
<h3>Preparatory Stuff</h3>
<p style="padding-left: 30px"><strong>0.</strong> <strong>Install everything.</strong> You have WordPressµ installed already, right? Because this is a post about <em>migrating</em>, not installing, right? Okay.</p>
<p style="padding-left: 30px"><strong>1.</strong> <strong>Create the subdomain.</strong> <em>Do this first.</em> If your host allows wildcard domains, that&#8217;s the easiest way, but I&#8217;m using <a href="http://bluehost.com">Bluehost</a> and they don&#8217;t. Despite the <a href="http://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt">FUD</a>, WordPressµ works perfectly fine without wildcard subdomains. I just have to make sure that whenever I create a new blog, I need to <em>first create the subdomain.</em></p>
<p style="padding-left: 30px"><strong>2.</strong> <strong>Create the new blog.</strong> I&#8217;m assuming you&#8217;ll be using subdomains, so let&#8217;s call the new subdomain kzas.jmetta.com for kicks. If you&#8217;re not using subdomains, your mileage may vary.</p>
<p style="padding-left: 30px"><strong><a href="http://en.wikipedia.org/wiki/E_%28mathematical_constant%29">e</a>.</strong> <strong>Get the blog id.</strong> Easiest way to do this is go to Site Admin-&gt;Blogs and look. The blogs in your WordPressµ installation will be listed by number, that number is the blog ID.</p>
<p style="padding-left: 30px"><strong>3.</strong> <strong>Copy wp-content.</strong> You&#8217;ll want to store everything that your old blog held, just in case you forget something, so grab a tarball of that entire directory. You don&#8217;t need to grab a tarball of wp-admin and wp-includes because you didn&#8217;t hack core, right? RIGHT?<sup>1</sup>.</p>
<p style="padding-left: 30px"><strong><a href="http://en.wikipedia.org/wiki/Pi">π</a>. Plugins.</strong> Install any that you had on the other blog, remembering that some plugins just plain don&#8217;t work with WPMU. Also, go ahead and install Donncha&#8217;s awesome <a href="http://ocaoimh.ie/wordpress-mu-domain-mapping/">Domain Mapping Plugin</a>. Go ahead, it&#8217;s worth it. There&#8217;s plenty of juice on using that plugin on <a href="http://wpmututorials.com/plugins/donnchas-domain-mapping-plugin/">Andrea&#8217;s WPMU tutorials site</a>.</p>
<p style="padding-left: 30px"><strong>4</strong>. <strong>Copy the files/folders</strong> in the wp-content/uploads directory of your old blog and place them in wp-content/blogs.dir/${ID}/files at your new blogs home, where ${ID} is your new blogs ID grabbed in step e.</p>
<p style="padding-left: 30px">5. <strong>Copy your theme</strong> from your tarball or old site into wp-content/themes of your new site (of course, now&#8217;s a good time to rethink that faded ol&#8217; theme).</p>
<h3>Coda</h3>
<p>At this point, you&#8217;ve pretty much set up everything so that you have all of the information from the old blog, and are ready to use that information to build up the new blog. For that, we&#8217;re going to use the database directly and copy the old blog&#8217;s database to manually build the new blog. That&#8217;s all a topic for the next post.</p>
<ol class="footnotes"><li id="footnote_0_1852" class="footnote">I did, that kind of screwed me up a bit <img src='http://positivelyglorious.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </li></ol><img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1852&type=feed" alt="" /><div id="hackadelic-sliderNote-6" class="concealed">Entries in this series:<ol><li>Migrating From WordPress to WordPressMU (without wildcard subdomains)</li><li><a href="http://positivelyglorious.com/software-media/migrating-from-wordpress-to-wordpressmu-part-ii/">Migrating from WordPress to WordPressMU, Part II</a></li><li><a href="http://positivelyglorious.com/software-media/reactivating-theme-and-plugin-editors-in-wordpressmu/">Reactivating Theme and Plugin Editors in WordPressMU</a></li></ol><span style="display: block; margin-top: 3px; font-size: 7px"><a href="http://hackadelic.com/solutions/wordpress/sliding-notes" title="Powered by Hackadelic Sliding Notes 1.6.4">Powered by Hackadelic Sliding Notes 1.6.4</a></span></div>]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/migrating-wordpress-blog-to-wordpressmu/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>This one&#8217;s really going to get me into trouble</title>
		<link>http://positivelyglorious.com/software-media/rtfail-manifestofail-manifesto/</link>
		<comments>http://positivelyglorious.com/software-media/rtfail-manifestofail-manifesto/#comments</comments>
		<pubDate>Sat, 05 Dec 2009 19:54:49 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Anthropology]]></category>
		<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://mettadore.com/?p=1825</guid>
		<description><![CDATA[Okay, people. I know you have the power to change the world now, but sometimes you want to change the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Frtfail-manifestofail-manifesto%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Frtfail-manifestofail-manifesto%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Okay, people. I know you have the power to change the world now, but sometimes you want to change the world into something that&#8217;s just really dumb.</p>
<p>The current explosion of social media outlets sure has its problems. Well, more correctly, it has issues that we have not yet had time to process in such a way that those issues are truly incorporated into our culture.<sup>1</sup></p>
<p>Witness, for instance, the Facebook phenomenon. We can now choose to have a lifelong inability to distance ourselves from people. No longer do you have the opportunity to, say, naturally grow apart from a high school friend whom you haven&#8217;t seen in 20 years. Now they follow you forever. The problem here is that we, as a human species, have had roughly 1.5 MILLION YEARS of saying &#8220;you know, it&#8217;s alright if we don&#8217;t see each other anymore.&#8221;<span id="more-1825"></span></p>
<p>The lifelong friendship is something that&#8217;s going to take humanity more than a year or two to figure out.</p>
<p>Another issue that I see is that it&#8217;s just really-super-incredibly-easy to start A Cause.<sup>2</sup> These days, it&#8217;s possible for any random shut-in with internet access to have a blog and speak their Cause to millions of people. The problem here, of course, is that (and I know I sound like I&#8217;m yelling &#8220;get off my lawn&#8221; when I say this) most of these Causes are, well, just really stupid.</p>
<p>I mean, some are good, or at least not horribly inane. There <em>are</em> good Causes, ones like &#8220;help fight leprosy in small towns in the far eastern provinces of Turkmenistan!&#8221; But there are also really dumb ones like &#8220;Join the fight to make the Linux mascot be a fox instead of a penguin!&#8221;<sup>3</sup></p>
<p>I see things like this and I think &#8220;Really? You have that much damn time?&#8221;<sup>4</sup> This is an issue that we as a species need some time to digest. There was a time when starting a Cause took things like &#8220;planning&#8221; and  &#8220;forethought.&#8221; Now, it&#8217;s just a matter of hitting &#8220;send&#8221; or &#8220;tweet.&#8221;</p>
<p>Now, it seems that the word &#8220;Cause&#8221; may have lost just a bit of their former punch. I think that starting a Cause has gotten <em>way</em> too easy.</p>
<h3>The Twitter Retweet</h3>
<p>Alright, the background, in a nutshell. There&#8217;s this thing called Twitter. It&#8217;s something that roughly 98.3% of the global human population have never heard of. On this thing, people basically communicate as if they were digitally hooked up to a college keg party. There are one or two really good conversations going on, but roughly 98.3% of it amounts to &#8220;Hey, I like that movie too!&#8221;<sup>5</sup></p>
<p>So, one of the cool things about Twitter is that you can repeat what other people post. Someone can post &#8220;Star Wars is the greatest movie ever!&#8221; and you can, basically, post &#8220;He said &#8216;Star Wars is the greatest movie ever!&#8217; I think so too!&#8221;</p>
<p>I know, it sounds like I&#8217;m joking, doesn&#8217;t it?</p>
<p>Recently, the Twitter engineers changed how that function works. Now you have a choice of just re-sending that post, or editing it so that you can say &#8220;I think so too.&#8221; And even more recently, people have freaked out that this new re-tweeting functionality is going to ruin Twitter. From all the traffic, you&#8217;d think that it was also going to ruin the internet, make sea level rise, and help support the resurgence of Osama Bin Laden.</p>
<h3>The RTFail Manifesto</h3>
<p>So, in all this hype, I send out a retweet, and forget that it&#8217;s a choice to say &#8220;I like Star Wars too!&#8221; Very soon, I get a post from a guy who started a new Cause called <a href="http://wayan.com/community-of-practice/rtfail-manifesto.html">The RTFail Manifesto</a>. The manifesto states:</p>
<blockquote><p>That&#8217;s right &#8211; if we follow you, and you use the auto RT function 3 times (you will be warned) then you&#8217;re unfollowed. Love ya, but <strong>no</strong> exceptions.  The new RT&#8217;s are Twitter spam, and until they are fixed, they shall be scorned in streams and in apps (looking <a href="http://twitter.com/atebits/status/6183141704">at you</a> Tweetie2).</p></blockquote>
<p>Now, this is one of those things that reads like an <a href="http://www.theonion.com/content/index">Onion</a> article about George W. Bush; you just can&#8217;t really decide whether he actually said that or it&#8217;s a joke. I mean, it would make such a good joke that I <em>really really want it to be one</em>.</p>
<p>Sure, like everyone, there were a few seconds when… I mean, I tend to get swept away with things. Anyone who&#8217;s read some of my ridiculous posts about ridiculous topics will know that. So I have to admit that my first initial 5 second reaction was &#8220;Yeah!&#8221;</p>
<p><img class="alignleft size-medium wp-image-1826" title="Screen shot 2009-12-05 at 10.46.55 AM" src="http://mettadore.com/files/2009/12/Screen-shot-2009-12-05-at-10.46.55-AM-300x140.png" alt="Screen shot 2009-12-05 at 10.46.55 AM" width="300" height="140" />But then I thought again, and my second thought was &#8220;Wait, seriously?&#8221;</p>
<p>I mean, really? A <em>manifesto</em>?</p>
<p>&#8220;You will be warned?&#8221; You&#8217;re actually writing &#8220;you will be warned?&#8221;</p>
<p>Seriously?</p>
<p>Yup, seriously. He&#8217;s serious. I asked.</p>
<p>Can we look at this in perspective? Isn&#8217;t a &#8220;manifesto&#8221; something that might very possible result in, say, <a href="http://en.wikipedia.org/wiki/The_Communist_Manifesto">20 million people losing their lives</a>?</p>
<p>And, even more than that, are we talking about something different, or are we talking about <em>Twitter</em>? I mean, this is a thing that nearly the entire human race knows <em>absolutely nothing about</em>, and even that the majority of the people in my particularly technologically savvy field don&#8217;t use.</p>
<p>Seriously, are either of us important enough that it would matter <em>at all</em> if you stop reading about how much I like Star Wars? And just because I don&#8217;t feel like saying &#8220;I like Star Wars too?&#8221;</p>
<p>Really? Are we really <em>that important</em> that it actually <em>matters</em>?</p>
<p>Well, maybe we are.</p>
<h3>The RTFail ManifestoFail Manifesto!</h3>
<p>So, I&#8217;m jumping on the bandwagon. Realizing the power of the internet and my ability to instantly reach millions of followers (or at least the 35 people who read this stupid blog), I&#8217;m starting my manifesto against the RTFail Manifesto. It&#8217;s called <strong>The RTFail ManifestoFail Manifesto</strong>!</p>
<p>The conditions of my manifesto are as follows:</p>
<p>We will probably use the new re-tweet function sometimes, and may possibly use the old style retweet function sometimes. It all depends on what we feel like for the 0.6 seconds that we actually spend thinking about how we are going to retweet a given Star Wars Quote. If we use the new style retweet three times, you will be required to unfollow us. When you unfollow us, we will probably not know about it, because chances are we don&#8217;t know who you are. However, there is a greater chance that you are not following us anyway, and therefore you will not be warned when we don&#8217;t notice you unfollowing us. There are no exceptions to this manifesto. Seriously, we will not notice your unfollowing of us <em>completely without warning</em>!</p>
<p>There. The gauntlet is thrown!</p>
<h3>Coda</h3>
<p>Alright, alright. Look, I&#8217;m a comic, or at least I have delusions about being funny. Also, I know that some people may see this as me picking a fight, which I&#8217;m not actually trying to do. I&#8217;m not actually laughing at any one person in particular. My goals are far too lofty. I&#8217;m actually laughing at humanity, and our tendency to jump on things before we even think about them. We all do it. I do it. Hell, I wrote a post discussing US security policy in the middle of the night while I was completely trashed. Talk about stupid!</p>
<p>All I can say is that it seems pretty funny to me to create a <em>manifesto</em> over something so trivial as whether someone edits a retweet or not. But, maybe it&#8217;s not. There&#8217;s probably a lot of issues here that I haven&#8217;t thought of because, well, I do it too. I saw something and then jumped right on it and started a Cause without thinking.</p>
<p>I know I&#8217;ll probably get hit hard for this one, and I shouldn&#8217;t go joking about the causes of people who are important enough to set international economic policy, but that&#8217;s the thing about this internet and social media. We don&#8217;t have to take the time to think about our actions.</p>
<p>After all, why should I bother with &#8220;planning&#8221; and &#8220;forethought&#8221; when I can just hit &#8220;publish?&#8221;</p>
<ol class="footnotes"><li id="footnote_0_1825" class="footnote">Anthropological aside: &#8220;Culture,&#8221; as used here, is a fairly nebulous, since social media as we use it spans multiple cultures. However, I&#8217;m reserving the right to speak of &#8220;human&#8221; culture in this instance, just as we can speak of, say, Western culture while ignoring the cultural differences between Western peoples or even families.</li><li id="footnote_1_1825" class="footnote">I use Cause here with a capital C because, really, does anyone who starts a cause NOT want their cause written with a capital letter?</li><li id="footnote_2_1825" class="footnote">Seriously, people, this happened. I was there.</li><li id="footnote_3_1825" class="footnote">And then I think &#8220;Really? I have this much time?&#8221; Because, after all, I&#8217;m <em>freakin&#8217;</em> writing about it!</li><li id="footnote_4_1825" class="footnote">Disclaimer: I say that a lot, I sort of dig on the movie conversations. Just search Mettadore and Star Wars.</li></ol><img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1825&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/rtfail-manifestofail-manifesto/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Need An Open Source Programmer Or Two (Beginners Welcome)</title>
		<link>http://positivelyglorious.com/software-media/need-an-open-source-programmer-or-two-beginners-welcome/</link>
		<comments>http://positivelyglorious.com/software-media/need-an-open-source-programmer-or-two-beginners-welcome/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 06:50:56 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>
		<category><![CDATA[high school]]></category>
		<category><![CDATA[Hood River]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Money]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[women]]></category>
		<category><![CDATA[work]]></category>
		<category><![CDATA[writing]]></category>

		<guid isPermaLink="false">http://positivelyglorious.com/?p=1661</guid>
		<description><![CDATA[Over the past few months, I&#8217;ve been working with Rediviva Magazine on a special (somewhat secret) community project.  We&#8217;re getting [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fneed-an-open-source-programmer-or-two-beginners-welcome%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fneed-an-open-source-programmer-or-two-beginners-welcome%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>Over the past few months, I&#8217;ve been working with Rediviva Magazine on a special (somewhat secret) community project.  We&#8217;re getting closer to a possible launch and I&#8217;d like to get some more people involved so I thought I&#8217;d put the word out there to see whether there are any local programmers interested in working on it with me. Feel free to pass this around.</p>
<h3>Overview</h3>
<p>Ideally, I&#8217;d like to build a small team of programmers who are interested in building an <em>Open Source Software web application</em> that can hopefully become something bigger than what we at Rediviva want to start with. It&#8217;d be ideal if a couple high school hot shots are around who want to work up their resumes for later development jobs, eventually becoming a Project Manager on this one.<span id="more-1661"></span></p>
<h3>Bottom Line</h3>
<p><strong>1) This is not a money making opportunity, full stop.</strong></p>
<p style="padding-left: 30px;">Like most Open Source Software projects, this is is geared to the person who is a programmer because they <em>really love to program</em>; because they love making really cool stuff for the mortals. At best, we&#8217;ll be able to buy you lunch during code sprints. If we run into a hot shot high school hacker or two, we can definitely work out some sort of &#8220;<strong>Web Development Internship&#8221; credit</strong>, which might be useful to you.</p>
<p><strong>2) You will be working as part of a team.<br />
</strong></p>
<p style="padding-left: 30px;">Sorry, but if you are the &#8220;my way or the whine-way&#8221; coder, or one who does great things sitting in his basement but can&#8217;t talk to a normal human, I can&#8217;t use you. I&#8217;ll take personality over skill any day of the week, because I can <em>teach</em> someone the <em>skills</em> they don&#8217;t have.</p>
<p style="padding-left: 30px;"><strong>Speaking of good team players, a note to the girls:</strong> Female coders rock, you know you do. You communicate and work as a team by default- rather than force. Rediviva is run by 3 Women, with one more new on staff. I&#8217;m the token male. If there are some women out there who want to code, you are <em>most</em> welcome.</p>
<p><strong>3) This isn&#8217;t &#8220;work.&#8221;</strong></p>
<p style="padding-left: 30px;">We&#8217;re not talking &#8220;a job,&#8221; we&#8217;re talking about &#8220;a project.&#8221; It&#8217;s Open Source Software, so I&#8217;m expecting you&#8217;ll be working on it in your spare time and during code sprints- not 8 hours/day (unless you want to). The Open Source coders out there are familiar with this, still, it&#8217;s been a question so I&#8217;ll state it outright.</p>
<h3>The Details… Or Hints Thereof</h3>
<p>Okay, if you&#8217;re still reading, you&#8217;re definitely an Open Source coder. So what are we doing? Well, I can&#8217;t give too many details,<sup>1</sup> but here are the things you need to be able to do<strong> <em>or able to learn</em></strong>:</p>
<ol>
<li><strong>Programming:</strong> If it&#8217;s not obvious, you need to be a programmer. We&#8217;ll be using Python, PHP and Java, so knowledge of those languages would be great, but if you&#8217;re a programmer in any two other languages, you can probably learn what we need fast enough.</li>
<li><strong>Web Development:</strong> We&#8217;re programming for the web, and creating an application that&#8217;s easily deployed by anyone. Here&#8217;s what we&#8217;re using:
<ol>
<li> <strong><a href="http://codex.wordpress.org/Writing_a_Plugin">WordPress Custom Programming</a></strong> (PHP): We&#8217;ll be modifying a WordPress theme for Rediviva and eventually creating a Plugin.</li>
<li><strong><a href="http://codeigniter.com/">CodeIgniter</a> </strong>(PHP): We&#8217;re developing a web app using this framework to start with.<sup>2</sup></li>
<li><strong><a href="http://code.google.com/appengine/docs/whatisgoogleappengine.html">Google App Engine</a></strong> (Python or Java): We&#8217;ll be building the web app in this eventually, so anyone can easily deploy and use it for free.</li>
<li><strong><a href="http://code.google.com/apis/gdata/">Google Data API</a> </strong>(PHP): Were working mostly with the Calendar API currently.<strong><br />
</strong></li>
<li><strong><a href="http://code.google.com/apis/wave/">Google Wave API</a></strong> (Python or Java): <strong>You&#8217;ll get a developer preview invitation to Google Wave if you don&#8217;t have access already</strong>. Go watch the developer preview to see what Wave can do. Oh, and request access to the <a href="https://services.google.com/fb/forms/wavesignupfordev/">Wave Developer Sandbox</a> now- it takes a while.</li>
</ol>
</li>
<li><strong><a href="https://www.pivotaltracker.com/">PivotalTracker:</a></strong> It&#8217;s an Agile project management tool that we&#8217;ll be using to organize our development. It&#8217;s free, so if you don&#8217;t have an account, we&#8217;ll just set up one when we start and you can learn to use it on the fly.You don&#8217;t need to know all of this, or any of it for that matter, you just have to be interested in learning how to- and able to learn how. Any programmer can pick up the details of a framework, this list is just here so you know what you&#8217;ll be picking up.</li>
<li><a href="http://github.com"><strong>Github:</strong></a> Source control is hosted at Github, so get a free account if you don&#8217;t already have one. Git&#8217;s pretty easy to use, and if you haven&#8217;t, it&#8217;s a good opportunity to learn.</li>
</ol>
<p>By the way, I&#8217;d much rather program that have flame wars, so arguments about why these tools suck and other/completely different tools are the greatest thing ever will fall on deaf ears.<sup>3</sup></p>
<h3>What&#8217;s Next?</h3>
<p>Interested in playing along, or at least learning more about the project? Contact me (John) via any method you see fit, the best being email or Twitter links at the top of the page. We&#8217;ll set up a meeting around Hood River or somewhere else in The Gorge and talk a bit. That way I can give you more info on what we&#8217;re trying to accomplish and see whether it&#8217;d be a good fit to work on it together.</p>
<p>Let&#8217;s get coding, yo.</p>
<ol class="footnotes"><li id="footnote_0_1661" class="footnote">And the good coders will be able to figure out a lot of details by seeing this anyway</li><li id="footnote_1_1661" class="footnote">Don&#8217;t bother flaming that Cake is better. I don&#8217;t really care.</li><li id="footnote_2_1661" class="footnote">Yes, I know there are other tools. Yes, I know there may be better tools. But honestly, tools are tools&#8211; and all are, for the most part, just as good as others. Choice of tools is basically a matter of opinion, despite the flame wars. These are what I started using when building this project, so this is what we&#8217;re going for. Not trying to be mean, just hate spending time on &#8220;what to use and why&#8221; when that could be spent building something useful.</li></ol><img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1661&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/need-an-open-source-programmer-or-two-beginners-welcome/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snow Leopard &amp; AFP: Access The Volume And Files Locally</title>
		<link>http://positivelyglorious.com/software-media/snow-leopard-afp-access-the-volume-and-files-locally/</link>
		<comments>http://positivelyglorious.com/software-media/snow-leopard-afp-access-the-volume-and-files-locally/#comments</comments>
		<pubDate>Tue, 20 Oct 2009 16:25:52 +0000</pubDate>
		<dc:creator>John</dc:creator>
				<category><![CDATA[Software & Media]]></category>

		<guid isPermaLink="false">http://positivelyglorious.com/?p=1655</guid>
		<description><![CDATA[This is a quick write-up on an error I&#8217;ve been having with my MacBook and a drive connected to Airport [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fsnow-leopard-afp-access-the-volume-and-files-locally%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fpositivelyglorious.com%2Fsoftware-media%2Fsnow-leopard-afp-access-the-volume-and-files-locally%2F&amp;source=mettadore&amp;style=normal&amp;service=bit.ly" height="61" width="50" /><br />
			</a>
		</div>
<p>This is a quick write-up on an error I&#8217;ve been having with my MacBook and a drive connected to Airport Extreme. It&#8217;s really only here so that Google will index it and the info will hopefully be one step in a solution for others with the same problem.</p>
<p>The issue is with my Free Agent drive when connected to an Airport Extreme via USB and accessed with my MacBook Pro, running Snow Leopard, using an AFP connection. I used this drive for a while with no problems in Leopard, and then did a clean install to Snow Leopard without any problems. One day, I tried to access my drive and got the following error:</p>
<pre><span>The server “MettaFi” is available on your computer. Access the volumes and files locally.</span></pre>
<p><span id="more-1655"></span><strong>Geeks:</strong> This post, like all of my posts, is not written from a strictly technical perspective. Thus it has a &#8220;beat around the bush part&#8221; and a &#8220;get to the point&#8221; part&#8211; or as close to a &#8220;get to the point&#8221; part as I&#8217;ll ever get. You might want to skip to the latter.</p>
<p><strong>Non-geeks:</strong> This will probably not be interesting to you in the least.</p>
<h3>The &#8220;Beat Around The Bush&#8221; Part</h3>
<p>Now, this is obviously a problem, since the &#8220;server&#8221; is my network drive, and that&#8217;s in another room in the house connected to my wireless router. I couldn&#8217;t figure out what the hell would be meant by &#8220;access the volumes and files locally&#8221; except that Snow Leopard somehow thought that this drive was physically connected to my computer.</p>
<p>This error has been going on for a few days, and I&#8217;ve been getting increasingly frustrated. This morning, I tried once more to figure it out and magically, it Just Worked. Now, if there&#8217;s one thing a programmer hates more than an undefinable computer problem, it&#8217;s an undefinable computer problem that goes away for an undefinable reason. That&#8217;s random, and randomness is scary in computers.</p>
<p>Then, after about five minutes using my strangely back from the otherworld drive <em>I got the problem again</em>! Now, if there&#8217;s anything a programmer hates more than an undefinable computer problem that goes away for an undefinable reason, it&#8217;s&#8211;</p>
<p>You get the picture. Mystery is a good thing to have in real life, and in literature, and in romance&#8230; it&#8217;s a very, very bad thing to have with computers. In a computer&#8217;s brain, mystery is that place between 0 and 1, and that undefined land is dangerous.</p>
<p>After asking the all-knowing interwebs, I began to piece together some evidence that might lead to a solution. This seems to be working so far for me, but since it&#8217;s an undefinable problem that previously disappeared and reappeared seemingly without my involvement, the mystery is still unsolved.</p>
<h3>The &#8220;Get To The Point&#8221; Part</h3>
<h4>iTunes Library</h4>
<p>Replaying the actions that led to this situation, the primary one seems to be my using an iTunes library that was hosted on the networked drive. I did this, <strong>not</strong> by using the iTunes Preferences pane and choosing a new &#8220;iTunes Media Folder Location,&#8221; but by starting iTunes while holding the option key and creating a new library on the networked drive. This library was automatically named &#8220;iTunes 1&#8243; (this becomes important later).</p>
<p>Since I almost exclusively sleep my MacBook Pro, rather than shut it down, I had constant problems with iTunes when moving locations. iTunes would frequently freeze when I started working in another location (because the library that it was &#8220;currently&#8221; connected to was suddenly missing). I eventually had to create a local iTunes directory in my home folder to use while traveling. This was beginning to bug me, so I resolved to change my music setup such that I used the &#8220;iTunes Media Folder Location&#8221; strategy.</p>
<p>Interestingly, my plan was to do that this morning, when this problem reoccurred.</p>
<h4>AFP Connection Problems In Snow Leopard?</h4>
<p>The connection to my drive is made through an AFP connection automatically by Snow Leopard. As noted by <a href="http://twitter.com/4lex">4lex</a> on Twitter, many other people have had this same, or a similar, problem after upgrading to Snow Leopard (scary thought). Apart from the Twitter traffic, there is an <a href="http://discussions.apple.com/thread.jspa?threadID=2139664&amp;tstart=0">Apple Discussion Forum entry</a> as well as others<sup>1</sup><sup>2</sup>.  Furthermore, it seems that the problem is not something that the normal support line can deal with, as others have been forwarded to engineering.<sup>3</sup></p>
<p>One thread I saw on the Apple Discussion forum noted that a fix was supposed to be rolled out in the next major update: 10.6.2, but I didn&#8217;t want to hold my breath.</p>
<h4>A Possible Alias Problem- or Just A Bug That Was Fixed?</h4>
<p>While searching, I found an <a href="http://newsgroups.derkeiler.com/Archive/Comp/comp.sys.mac.system/2008-04/msg00749.html">old post about Mac Classic</a> apps run on OS 9 that seemed oddly appropriate. The post talked about having an alias to a server or file left over on your computer. Put simply, if that alias is still live, and the computer tries to access the original file using another alias, there&#8217;s a bit of a collision.</p>
<p>I didn&#8217;t know where this alias would be, so I cleaned up my &#8220;recent servers&#8221; and &#8220;recent files&#8221; to see if that fixed it. Nothing.</p>
<p>So I cleaned out my trash. Nothing. Finally, I thought about my iTunes problems and looked in my local iTunes directory. I saw a folder called &#8220;iTunes 1&#8243; in that directory. Now, this is possibly a coincidence. In fact, it&#8217;s probable that iTunes created this during one of the times I traveled and iTunes froze. However, it&#8217;s at least somewhat likely that this directory was some sort of alias to the &#8220;iTunes 1&#8243; directory on my networked drive. Taking a chance, I deleted it. Before deleting, I check the media folder to see if any music had to be moved, but it was empty.</p>
<p><a href="http://twitter.com/4lex/statuses/5021804053"><img class="alignleft size-medium wp-image-1656" title="Screen shot 2009-10-20 at 9.20.16 AM" src="http://positivelyglorious.com/files/2009/10/Screen-shot-2009-10-20-at-9.20.16-AM-300x175.png" alt="Screen shot 2009-10-20 at 9.20.16 AM" width="300" height="175" /></a>Once I deleted the phantom iTunes 1, I checked for system upgrades to Snow Leopard (there were some). That check caused me to restart. After restarting, everything seems to be working. The problem with this, of course, is that I don&#8217;t know if it&#8217;s the Apple Updates or the filesystem alias that fixed the problem. More hanging out in that place between 0 and 1.</p>
<p><strong>Meanwhile, back at the ranch:</strong></p>
<p>I love The TwitterWebs! Just as I was proof-reading this, <a href="http://twitter.com/4lex">4lex</a> sent me a tweet about his problem that seemed to suggest that the alias thread might be a key piece of information. It seems to me that if 4lex renamed his router and his MacBook Pro in the Sharing PrefPane, all the aliases that were sitting on his drive would be broken and Snow Leopard would create new ones. Thus, the collisions would go away. Again, this is not confirmed, but more evidence to that as the source of the problem.</p>
<h3>Coda</h3>
<p>Your mileage <em>will</em> vary, but I hope this information helps lead others toward a solution. If I have any further problems, I&#8217;ll give an update in the comments, so subscribe to them if you&#8217;re interested in any further developments.</p>
<ol class="footnotes"><li id="footnote_0_1655" class="footnote">on <a href="http://forum.boxee.tv/showthread.php?t=11651">Boxee.tv</a> forums</li><li id="footnote_1_1655" class="footnote">on <a href="http://forums.mactalk.com.au/11/72484-snow-leopard-doesnt-connect-novell-drive-using-afp.html">MacTalk</a> Forums</li><li id="footnote_2_1655" class="footnote"><a href="http://twitter.com/4lex/status/4437337203">4lex&#8217;s experience</a></li></ol><img src="http://positivelyglorious.com/?ak_action=api_record_view&id=1655&type=feed" alt="" />]]></content:encoded>
			<wfw:commentRss>http://positivelyglorious.com/software-media/snow-leopard-afp-access-the-volume-and-files-locally/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
