<?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>rhymes with milk &#187; Geek</title>
	<atom:link href="http://www.rhymeswithmilk.com/category/geek/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rhymeswithmilk.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Wed, 28 Jul 2010 02:03:48 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>5.30.2010</title>
		<link>http://www.rhymeswithmilk.com/geek/5-30-2010/</link>
		<comments>http://www.rhymeswithmilk.com/geek/5-30-2010/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 18:09:46 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Photo]]></category>
		<category><![CDATA[couds]]></category>
		<category><![CDATA[Crested Butte]]></category>
		<category><![CDATA[panorama]]></category>
		<category><![CDATA[photoshop]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=534</guid>
		<description><![CDATA[More Crested Butte. Ally and I went exploring today, and after some feux-off-roading and walking down a trail that we thought was a hiking trail but ended up just being the path to get to some tennis courts, we ended up by a secluded trailhead next to a stream, hoping to get some actual hiking [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/rhymeswithmilk/4672908162/"><img title="5.30.2010" src="http://farm5.static.flickr.com/4066/4672908162_27c0460b68_b.jpg" alt="5.30.2010" width="570px" height="381px" /></a></p>
<p>More Crested Butte. Ally and I went exploring today, and after some feux-off-roading and walking down a trail that we <em>thought</em> was a hiking trail but ended up just being the path to get to some tennis courts, we ended up by a secluded trailhead next to a stream, hoping to get some actual hiking in. The trail was unfortunately blocked by the stream, though, which was probably 15 feet across and freezing cold. It doesn&#8217;t look like it in the photo below, but the little log bridge was super narrow and wobbly, and the stream was narrower (therefore faster and deeper) underneath it.</p>
<p>It was still a beautiful place to just sit and relax.</p>
<p><a href="http://www.flickr.com/photos/rhymeswithmilk/4672907368/"><img title="5.30.2010-2" src="http://farm5.static.flickr.com/4032/4672907368_83d03863ff_b.jpg" alt="5.30.2010-2" width="570px" height="197px" /></a></p>
<p>On another note, this panorama was stitched together using 64 images. After the 20 minutes it took Photoshop to stitch it, I tried to save the image before I started editing, but was denied by Photoshop because it won&#8217;t write files larger than 2GB, and this guy exceeded that by at least 0.5.</p>
<p>Despite my obvious intent to capture enough photos to make a clean and complete panorama, as it usually goes, I still missed large sections, most notably the lower left corner.</p>
<div class="wp-caption alignnone" style="width: 580px"><a href="http://farm5.static.flickr.com/4040/4675507966_842890d888_o.jpg"><img style="border: 0;" title="original panorama" src="http://farm5.static.flickr.com/4040/4675507966_842890d888_o.jpg" alt="original panorama" width="570px" height="185px" /></a><p class="wp-caption-text">(original panorama)</p></div>
<p>When Adobe CS5 was announced, I remember having seen a video talking about how filling in holes like that will now become so easy. So I did some research and found out that there&#8217;s a new tool in Photoshop called &#8220;Content-Aware Fill&#8221; which is similar to the patch tool, but knows what <em>should</em> exist in the target selection. After applying the fill to just the lower left corner, this is how it looked:</p>
<div class="wp-caption alignnone" style="width: 308px"><a href="http://farm5.static.flickr.com/4007/4674885801_dedd735d8a_o.jpg"><img class=" " style="border: 0;" title="content-aware fill applied" src="http://farm5.static.flickr.com/4007/4674885801_dedd735d8a_o.jpg" alt="content-aware fill applied" width="298px" height="349px" /></a><p class="wp-caption-text">(content-aware fill applied)</p></div>
<p>Not too bad, if you ask me. In CS4 I would have either had to crop that whole left section out, or painstakingly recreate that corner with the clone stamp which would probably end up looking fake anyway. After a little cleanup around the edges (and removing all the extra dirty t-shirts that got cloned in), it actually looked like a convincing patch of ground with relatively few duplicate patterns and shapes.</p>
<p>When doing my research that led me to the content-aware fill, I also found a new tool called Puppet Warp which is a lot like the existing Warp tool on steroids. It creates a mesh of triangular sections over the entire layer that you can add anchor points (or &#8220;pins&#8221;) to and move them around to warp the mesh. One of the example uses tutorialists love to show is how you can add anchor pins to a person&#8217;s elbow and shoulder, and easily move their arm around in an anatomically believable way. I&#8217;ve never needed to move a person&#8217;s mid-wave hand position before, so that matters very little to me.</p>
<p>One of the other applications the tool has, though, is to stretch and warp a panorama&#8217;s uneven edges to better fill in an even rectangle without having to crop out large areas. I tried it out, and it was pretty easy to use, though it might take some practice to find pin placements that don&#8217;t end up distorting the final image.</p>
<div class="wp-caption alignnone" style="width: 580px"><a href="http://farm5.static.flickr.com/4014/4675729654_49f8a11d64_b.jpg"><img class=" " style="border: 0;" title="puppet warp applied" src="http://farm5.static.flickr.com/4014/4675729654_49f8a11d64_b.jpg" alt="puppet warp applied" width="570px" height="214px" /></a><p class="wp-caption-text">(puppet warp applied)</p></div>
<p>As you can see, I got a pretty ugly curtain-draping effect at the top, which would have been very difficult to fix and even more obvious if the entire top half of the photo wasn&#8217;t evenly toned sky. Also, the horizon became much more wavy and uneven. Look at the house on the left compared to the car on the right. Though their placement is fairly symmetrical, the angle at which they meet the ground is completely different.</p>
<p>Although the final panorama really isn&#8217;t a <em>good</em> picture by any means, I thought it was too good of a new-Photoshop-tool exercise to not post.</p>
<div class="wp-caption alignnone" style="width: 580px"><a href="http://www.flickr.com/photos/rhymeswithmilk/4672907368/"><img style="border: 0;" title="final panorama" src="http://farm5.static.flickr.com/4032/4672907368_83d03863ff_b.jpg" alt="final panorama" width="570px" height="197px" /></a><p class="wp-caption-text">(final panorama. wtf is up the neon green I added? I mean...seriously.)</p></div>
<p>&#8212;</p>
<p>One last photo for the day, taken (again) from the balcony of our room.</p>
<p><a href="http://www.flickr.com/photos/rhymeswithmilk/4672282613/"><img title="5.30.2010-3" src="http://farm5.static.flickr.com/4001/4672282613_1e4fd54f19_b.jpg" alt="5.30.2010-3" width="570px" height="381px" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/geek/5-30-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Page 7 Page 8</title>
		<link>http://www.rhymeswithmilk.com/geek/page-7/</link>
		<comments>http://www.rhymeswithmilk.com/geek/page-7/#comments</comments>
		<pubDate>Sat, 15 May 2010 23:47:16 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=416</guid>
		<description><![CDATA[This is a pretty exciting time here at rhymes with milk. I&#8217;ve posted 28 posts – 29 including this one – and I have WordPress set to display 5 posts per page, making 6 total pages of posts. Follow so far? The pagination* that I use on this site was actually created as a WordPress [...]]]></description>
			<content:encoded><![CDATA[<p>This is a pretty exciting time here at rhymes with milk. I&#8217;ve posted 28 posts – 29 including this one – and I have WordPress set to display 5 posts per page, making 6 total pages of posts. Follow so far?</p>
<p>The pagination<span class="red">*</span> that I use on this site was actually created as a WordPress function by <a href="http://www.ericmmartin.com/projects/wp-paginate/">Eric Martin</a> (I later found out it&#8217;s also a <a href="http://wordpress.org/extend/plugins/wp-paginate/">WP plugin</a>, but I don&#8217;t think it was when I first installed it). It&#8217;s a clean and simple alternative to the default &#8220;next page/previous page&#8221; links built into WP, and makes the site much more navigable.</p>
<div class="center-img"><img class="size-full wp-image-417" title="pagination" src="http://www.rhymeswithmilk.com/wp-content/uploads/2010/05/Capture.png" alt="pagination" width="363" height="75" /></div>
<p>As you can see, there are currently 6 pages (as I already said&#8230;), and every page has its own link. When it reaches 7 pages, though, is when things get exciting. Since it&#8217;s not possible to continue linking to each individual page, the pagination ends up taking on a new, more compact form. The thing is, I can&#8217;t remember what that form is, though&#8230;</p>
<p>I remember testing out the paginate function when this site was still under construction by writing a bunch of dummy posts and setting WordPress to only show one per page. The function allows you to choose at what point it breaks from its current form into the more compacted one, and I remember setting that to be at page 7. I also remember customizing the compact look, but I can&#8217;t exactly remember what I customized it to.</p>
<p>I&#8217;m super excited to see what&#8217;s about to happen. Here&#8217;s to Page 7.</p>
<p><strong>UPDATE: I have a few private posts that I never ended up posting, but still show up for me when I&#8217;m logged in. Therefore I see more pages than you do, so you all can&#8217;t see this yet, but it just rolled over to 7 for me. And guess what happened? Nothing. My memory was clearly wrong. I&#8217;m beginning to think it&#8217;s page 8 when the magic happens. Yeah, page 8, that&#8217;s definitely it. Here&#8217;s to Page 8!</strong></p>
<p class="afterthought"><span class="red">*</span> How do you pronounce &#8220;paginate&#8221;? Everywhere I look says it&#8217;s paj-uh-ney-shuh, but I refuse to believe that. Why would something originally pronounce with a long &#8220;a&#8221; suddenly change it to a short vowel sound, especially since there&#8217;s still a single consonant then a vowel trailing it? I could understand it if the spelling had been changed as well, to something like paggination, but it didn&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/geek/page-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>not genuine</title>
		<link>http://www.rhymeswithmilk.com/geek/not-genuine/</link>
		<comments>http://www.rhymeswithmilk.com/geek/not-genuine/#comments</comments>
		<pubDate>Sun, 02 May 2010 23:36:15 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Sony VAIO]]></category>
		<category><![CDATA[Windows 7]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=351</guid>
		<description><![CDATA[I just got a new laptop, and it came with dozens of annoyingly bloated applications that I really don&#8217;t need. At least 4 different media galleries and organizers were pre-installed. To get around having to delete and uninstall everything, I just wiped the C: drive and installed a fresh, albeit cracked, version of Windows 7. [...]]]></description>
			<content:encoded><![CDATA[<p>I just got a new laptop, and it came with dozens of annoyingly bloated applications that I really don&#8217;t need. At least 4 different media galleries and organizers were pre-installed. To get around having to delete and uninstall everything, I just wiped the C: drive and installed a fresh, albeit cracked, version of Windows 7.</p>
<p>As it turns out, a lot of the terrible annoying applications were actually there for a reason. They made my computer work. Specifically, they made all the features that originally made my laptop badass work. Not only did a bunch of features stop working (touchpad scrolling, bluetooth, the Fn key), Microsoft somehow found out that the new version of Windows I installed was not genuine, and they reminded me that they knew every 5 minutes.</p>
<p><a href="http://www.rhymeswithmilk.com/wp-content/uploads/2010/05/not_genuine.png"><img class="aligncenter size-medium wp-image-352" title="Not Genuine" src="http://www.rhymeswithmilk.com/wp-content/uploads/2010/05/not_genuine-1024x575.png" alt="" width="570" height="319" /></a></p>
<p>I called Sony to see if I could buy a restore disk, which I was hoping would be able to restore all of the lost functionality. After a lot of confusing phone calls, I found out that a restore disk doesn&#8217;t even exist for my computer. They said that it&#8217;s most likely because it&#8217;s a new model, and often restore disks aren&#8217;t created for at least several months after new products are released.</p>
<p>Which makes NO sense.</p>
<p>Maybe that is in fact the case, but don&#8217;t you think it&#8217;d be easy enough to create an install disk BEFORE you start selling a specific model. But whatever.</p>
<p>Anyway, I eventually was told that my computer actually has the restore &#8220;disk&#8221; built in. When I was installing the fresh version of Windows, I noticed that there was at least one extra partition on my hard drive. I had no idea what it was for at the time, but I decided not to erase it&#8230;just in case.</p>
<p>Thank god I didn&#8217;t. That extra partition contains what is essentially a snapshot of your computer when it left the factory. It had a backup of the original operating system and custom applications Sony spams their new computers with.  Ultimately, it was entirely painless going through the restoration process, and within an hour or two, my computer was back to normal.</p>
<p>What I&#8217;ve learned (aka the moral of the story):</p>
<ul>
<li>Don&#8217;t delete mystery factory-created drive partitions&#8230;just in case.</li>
<li>Uninstall shit like Norton 60-day free trials, but if it says &#8220;Sony&#8221; and you don&#8217;t know what it&#8217;s for, simply don&#8217;t touch it.</li>
<li>If a cracked product requires activation to work, always activate it OFFLINE if possible.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/geek/not-genuine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>disqus</title>
		<link>http://www.rhymeswithmilk.com/geek/disqus/</link>
		<comments>http://www.rhymeswithmilk.com/geek/disqus/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 06:49:16 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[disqus]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=311</guid>
		<description><![CDATA[I&#8217;m a fan of Disqus. It&#8217;s a great commenting system, the Gravatar support is a plus, and the comment tracking they have for your profile is awesome. So a few months ago when I was still in the process of creating this blog, I installed it here on Rhymes With Milk using the official Disqus [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m a fan of Disqus.  It&#8217;s a great commenting system, the Gravatar support is a plus, and the comment tracking they have for your profile is awesome.  So a few months ago when I was still in the process of creating this blog, I installed it here on Rhymes With Milk using the official Disqus WordPress plugin.</p>
<p>As the process of creating this site started to wind down, I started thinking about validating my code (as any good developer would do).  Essentially this just means that I check to see if the organization that governs internet standards thinks my XHTML is up to snuff.  And whaddaya know, the homepage alone has over 3 dozen errors<span class="red">*</span>, but none of them are errors I made.  They mostly come from the code Disqus adds to the page (with most of the others coming from an embedded YouTube video).</p>
<p>This really rubbed me the wrong way.  These weren&#8217;t simple negligible errors like &#8220;you shouldn&#8217;t have a border size declared on an iframe because that&#8217;s not allowed&#8221; (this in fact is an error on <a href="http://thehumancondition.tumblr.com/">Mark&#8217;s blog</a> &#8212; I think it&#8217;s a Tumblr thing, so give them shit for it, not Mark)<span class="red">**</span> but ones like &#8220;there&#8217;s an extra link closer-outer tag for a link that doesn&#8217;t even exist.&#8221;  Seriously, Disqus? You didn&#8217;t test the plugin before you launched it?</p>
<p>So I decided to hack it.  The php files that actually define the plugin&#8217;s actions are a bit more advanced than I was prepared for (I can usually pick my way through other people&#8217;s code pretty well.  Just take a look at my archives.  You think those looked like that out-of-the-box?  Hell no.).  I Googled the problem with very low expectations (Disqus dev documentation is surprisingly scarce) but <a href="http://blog.thoughtpick.com/2009/10/how-to-build-a-xhtml-valid-wordpress-blog-with-disqus-plugin.html">stumbled upon this gem</a>.  This blog takes you step-by-step on how to correct the invalid markup that Disqus adds to your page.  Awesome, it just saved me at least 4 hair-pulling hours.</p>
<p>I think the post was written at least one plugin version ago because some things looked a bit different on mine than in the examples, but for the most part I was able to do just what it said verbatim.  And happily it worked.  My site&#8217;s validation checked out (aside from that stupid YouTube video), but for some reason I lost comment count.  All posts said that there were zero comments.  With my tail between my legs, I got rid of the hacked Disqus and reinstalled a factory-fresh version, complete with its terrible markup.</p>
<p>But not all is lost.  The site doesn&#8217;t really visually or functionally &#8220;break&#8221; because of the poorly written code (at least not on good browsers), so in the short run I can ignore the validation issues.  And hopefully &#8220;the short run&#8221; is all that I&#8217;ll have to worry about.  3 days ago Disqus posted <a href="http://blog.disqus.com/post/399344439/were-looking-for-wordpress-plugin-beta-testers">this</a> on <a href="http://blog.disqus.com/">their blog</a>:</p>
<blockquote><p>We’re nearing the release of our new WordPress plugin that contains bug fixes, better importing, compatibility fixes with themes and other plugins, as well as offers new improvements in performance and speed.</p></blockquote>
<p>And one of the comment moderators (aka a Disqus employee) said that the plugin is supposed to be released this week!  It feels like Christmas in the RWM household.  Hopefully they get it right this time.  All the way right.</p>
<p class="afterthought"><span class="red">*</span> Take a look for yourself.  <a href="http://validator.w3.org/check?uri=http://www.rhymeswithmilk.com/&#038;charset=(detect+automatically)&#038;doctype=Inline&#038;group=0">Click here</a> to see all the errors.</p>
<p class="afterthought" style="border: 0;"><span class="red">**</span> The only reason I looked at the validation info for his site was because he also has Disqus installed on his blog and I wanted to see if it generated the same errors there, too. It does not because the Tumblr and WordPress inclusion codes are different.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/geek/disqus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>a sneak peek&#8230;</title>
		<link>http://www.rhymeswithmilk.com/life/a-sneak-peek/</link>
		<comments>http://www.rhymeswithmilk.com/life/a-sneak-peek/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 07:00:17 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Ally B Speakin]]></category>
		<category><![CDATA[graphic design]]></category>
		<category><![CDATA[illustrator]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=297</guid>
		<description><![CDATA[&#8230;of Ally&#8217;s new blog design. Dustin and I worked all night on it.]]></description>
			<content:encoded><![CDATA[<p>&#8230;of Ally&#8217;s new blog design.  Dustin and I worked all night on it.</p>
<p><img class="aligncenter size-full wp-image-298" title="allybspeakin" src="http://www.rhymeswithmilk.com/wp-content/uploads/2010/02/comp1.png" alt="" width="350" height="263" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/life/a-sneak-peek/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>lost night</title>
		<link>http://www.rhymeswithmilk.com/life/lost-night/</link>
		<comments>http://www.rhymeswithmilk.com/life/lost-night/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 05:19:12 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[LOST]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=266</guid>
		<description><![CDATA[The LOST premier last night blew me away. Maybe I just do a poor job of holding in my emotions, but I couldn&#8217;t help but smile through the whole thing.  I do have to admit, though, that it was partially due to the company. Mark, Gordon, Ally and I got together for (almost?) every LOST last season [...]]]></description>
			<content:encoded><![CDATA[<p>The LOST premier last night blew me away. Maybe I just do a poor job of holding in my emotions, but I couldn&#8217;t help but smile through the whole thing.  I do have to admit, though, that it was partially due to the company.</p>
<p><a href="http://thehumancondition.tumblr.com/">Mark</a>, <a href="http://twitter.com/mynameisgordon">Gordon</a>, <a href="http://www.allybspeakin.com/">Ally</a> and I got together for (almost?) every LOST last season and made something of a tradition out of it.  Each week a different person would have to cook the whole group dinner.  I somehow got branded as the motherly one, cooking (baking mostly) things like potpie and lasagna, you know, the kind with ricotta and spinach.</p>
<p>We all got together last night (plus Annabelle) for the first time in 8 months to keep our traditional LOST nights alive through the final season.  With Mark living in Denver and Gordon living in&#8230;unemployment? things are a bit different this year, so coordinating it happened all at the last minute. To make it easy on everybody else while we get back into the rhythm, I volunteered to cook for the premier.</p>
<p>I then realized only 20 hours before dinner was supposed to be served that I was going to spend 7 of those hours sleeping, 10 of them at work and school, 1 of them in transit, and the other 2 getting ready for bed/getting out of bed.  Nowhere in there would I have time to find a recipe, go shopping, or cook. So Ally stepped up and took the responsibility off of my shoulders even though she had NO time to herself either since she had class AND and had to get ready to leave the state the next morning&#8230;er, this morning.</p>
<p>But she took it like the champ she is and threw together a simple but lovely salad, and cooked (baked! Haha, maybe I won&#8217;t be the matron this time around!) a few pizzas, one with veggies and the other with pepperoni.</p>
<p>Oh, I forgot to mention the other big difference between this season and last.  Last year, 3 out of the 4 of us were vegetarian with me being the token omnivore (one that coincidentally hardly ever ate meat, not out of principle or taste, but out of lack-of-opportunity).  All of our dinners were vegetarian, and each week&#8217;s appointed chef came up with a damn good meal.  It&#8217;s going to be strange this season now that only one of our clan has stuck with vegetarianism.  It&#8217;s hard to say whether Ally&#8217;s dual pizzas set a precedent of making meals that cater to all parties, or if we&#8217;re going to end up cooking strictly vegetarian meals out of respect for Mark (and laziness to not have to prepare two versions).  I guess we&#8217;ll find out&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/life/lost-night/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>syntax highlighter</title>
		<link>http://www.rhymeswithmilk.com/geek/syntax-highlighter/</link>
		<comments>http://www.rhymeswithmilk.com/geek/syntax-highlighter/#comments</comments>
		<pubDate>Mon, 01 Feb 2010 04:15:11 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[syntax highlighter]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=227</guid>
		<description><![CDATA[I just installed a syntax highlighter tool here on Rhymes With Milk and am pretty excited about it so far. What it means is that I can paste snippets of code into WordPress&#8217; post editor essentially verbatim, and a JavaScript function translates it into a nicely formatted version for the blog. I had seen this [...]]]></description>
			<content:encoded><![CDATA[<p>I just installed a syntax highlighter tool here on Rhymes With Milk and am pretty excited about it so far.  What it means is that I can paste snippets of code into WordPress&#8217; post editor essentially verbatim, and a JavaScript function translates it into a nicely formatted version for the blog.</p>
<p>I had seen this sort of thing on other websites before, but only just realized that I might have a use for it, too.  I wasn&#8217;t quite sure how to go about finding something like that, so I asked Twitter if it had any recommendations.  True to form, Twitter offered me no help, so I started doing my own research.  Finding the right set of keywords to search for one of these wasn&#8217;t easy, but I eventually stumbled onto <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">Alex Gorbatchev&#8217;s webiste</a>.  It was exactly the one I was thinking of when I set out to find one.</p>
<p>After a super simple install (you just have to FTP the files to your server and add the right file calls in your header) and some custom styling, it was all ready to go.  I did have a few problems personalizing it though.</p>
<h3>toolbar functionality</h3>
<p>The program has an optional little toolbar that pops-up when you hover over the syntax highlighter div with buttons for printing, copying, displaying as plain text in a pop-up, and a small &#8220;about&#8221; pop-up.  I initially thought this toolbar could be pretty handy, but that some of the buttons could probably go&mdash;namely the print one.  I hardly believe anybody is ever going to see my code examples, a small fraction of them are actually going to care about what they&#8217;re looking at, fewer would actually want to use it for reference, and none of them would want it physically represented so badly that there should be just a single button for them to accomplish that. But despite digging around in the core JavaScript file for quite a while, I wasn&#8217;t able to figure out how to selectively remove buttons.  It looked like for me it was all-or-nothing.</p>
<p>I decided that I should go with &#8220;all&#8221; at this point mostly because of the copy button. The way the lines are displayed within the div make it so that when you manually highlight-and-copy, you also get stuck copying the line numbers.  This little cumbersome detail made me think that having a single copy button that only grabs the relevant code would be convenient, but there&#8217;s some sort of XML file that the function looks for but could not find.  Something like that.  Again, digging around in the core files didn&#8217;t help me any, and unfortunately the official website has pretty poor documentation and troubleshooting help.</p>
<h3>line wrap</h3>
<p>The line wrap function, unlike the ones dictating the toolbar buttons, can simply be switched on or off with an appropriately placed &#8220;true&#8221; or &#8220;false&#8221; respectively.  When turned on, lines wrap nicely (although no line wrap is generally all <em>that</em> nice when looking at code), expanding the height of its table row, pushing the following lines and line numbers down further.  When wrap is turned off a scrollbar appears at the bottom.  I almost prefer this method, but it doesn&#8217;t display everything beyond the edge of the box very nicely.  For some reason, the lines alternating colors end at the edge of the box, and a solid background color is displayed beyond their right ends, and depending on the CSS, this color might not ever correspond to either of the line colors.  Lame.</p>
<h3>solution?</h3>
<p>I found <a href="http://www.outofwhatbox.com/blog/syntaxhighlighter-downloads/">this guy</a> who has created a modified version of the original syntax highlighter.  His previous documentation claims that a few of the issues I mentioned above had been fixed, and a ton of extra (and helpful) functionality had been added.  I downloaded it and started testing the different functions&#8230;and it fell short of the claims.  For all that I could tell, I had downloaded the same damn thing as the original.  And again, explanations on how to implement said added functionality was minimal.  I gave up with it much quicker than I normally do with things mostly because the test html file that comes with the download (it&#8217;s meant to test whether the program works or not) was out of date.  It was the test file for the previous release, not the most current.  I couldn&#8217;t even use his own test file as reference on how to implement the various features.  I can think of other ways to find reference, but I stopped there because even that kind of small oversight makes me lose faith in the developer.</p>
<p>Therefore, I stuck with the official release (not the mod) and just turned the toolbar off, and line wrap on.</p>
<p>I was going to leave you with a small C++ example since that&#8217;s the language I&#8217;m currently using the most, but it&#8217;s syntax mode is actually kind of lacking.  So instead, how about we try doing a PHP program (which has much better syntax support) that uses the accumulation plan.</p>
<pre class="brush: php;">
&lt;?php

$myArray = array(12, 102, -44, 61, 0);
$total = 0;

for($i=0; $i&lt;count($myArray); $i++)
{
	$total += $myArray[$i];
}

echo 'The total amount in my array is ' . $total . '!';

?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/geek/syntax-highlighter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Music</title>
		<link>http://www.rhymeswithmilk.com/geek/music/</link>
		<comments>http://www.rhymeswithmilk.com/geek/music/#comments</comments>
		<pubDate>Tue, 05 Jan 2010 05:47:45 +0000</pubDate>
		<dc:creator>Mike</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[ftw]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.rhymeswithmilk.com/?p=136</guid>
		<description><![CDATA[The Blow &#8211; Hey Boy I now have audio! This is actually a plugin (the WordPress Audio Player, which only a few days ago came out with what I hear was a much-needed update), which is something WordPress does really well (plugins, that is). Finding, installing, and activating plugins is never more than a few [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.rhymeswithmilk.com/media/audio/TheBlow-HeyBoy.mp3">The Blow &#8211; Hey Boy</a></p>
<p>I now have audio!</p>
<p>This is actually a plugin (the <a href="http://wpaudioplayer.com/">WordPress Audio Player</a>, which only a few days ago came out with what I hear was a much-needed update), which is something WordPress does really well (plugins, that is).  Finding, installing, and activating plugins is never more than a few convenient clicks away.  But of course, as has been my luck with this theme so far, it wasn&#8217;t as easy as that for me.</p>
<p>After installing and activating, I uploaded the above mp3 via FTP<span style="color: #ff0000;">*</span> and created a new post with the suggested [audio song.mp3] insertion format.  I got a big fat error saying:</p>
<blockquote><p>Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version <a href="http://get.adobe.com/flashplayer/">here</a>. You also need to have JavaScript enabled in your browser.</p></blockquote>
<p>Flash is up-to-date and JS is enabled, so that wasn&#8217;t the problem.  Being that this is a fairly common error message to get with this plugin, I was able to find a lot of support in the WP forums.  Many people suggested adding <code>&lt;?php wp_head(); ?&gt;</code> to the head section of the blog.  This somehow triggers the plugin or something, and it fixed the problem for most people.  After adding it, a bunch of new code appeared in the head section of my source code, so I was hopeful that this solved it.</p>
<p>It didn&#8217;t.  Same error kept coming up.</p>
<p>And since it fixed the problem for most people, there was little support beyond that in the forums.  I downloaded another audio player that simply loads the WP Audio Player when you click on a link, and it had no problems.  Obviously it wasn&#8217;t a problem with my browser, Flash, or even my blog.  There was a problem with how the plugin was communicating with the theme (it actually worked just fine when I switched to the WordPress default theme).  Though most complicated PHP is over my head, I was forced to dive into the plugin&#8217;s main file ([PLUGIN DIR]/audio-player/audio-player.php) to see if I could spot where the error was being triggered.</p>
<p>Miraculously, I was able to decipher enough to figure out that the plugin was trying to add a small snippet of code to the page&#8217;s footer.  A light bulb went off when I saw that.  While doing research on what the wp_head() function does, I noticed <a href="http://codex.wordpress.org/Theme_Development#Plugin_API_Hooks">somewhere</a> that there was an equivalent wp_footer() function.  I put that into my footer.php file right before the <code>&lt;/body&gt;</code> tag, and what do you know?  I now have audio.</p>
<p>Slowly but surely this blog is coming together.</p>
<p><span style="color: #ff0000;">*</span>WordPress also has a really simple media-upload tool built in which I would have used, but naturally I ran into roadblocks with it as well.  My server allows max upload sizes of 2MB by default, and after some research I was told to edit my php.ini file.  Using HostMonster&#8217;s PHP Config tool, I created a new default php.ini file and edited it accordingly.  It didn&#8217;t work.  I don&#8217;t know if I just have to wait for the changes to take effect or if it just didn&#8217;t work.  I guess I&#8217;ll try <a href="http://wordpress.org/support/topic/277832?replies=16#post-1096106">this</a> if I still can&#8217;t upload bigger files by tomorrow.</p>
<p><strong>UPDATE</strong>: I just uploaded a 6MB song, so apparently editing the php.ini file worked.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.rhymeswithmilk.com/geek/music/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://www.rhymeswithmilk.com/media/audio/TheBlow-HeyBoy.mp3" length="4993024" type="audio/mpeg" />
		</item>
	</channel>
</rss>
