<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Simon Says</title>
    <link>http://simonwoodside.com</link>
    <language>en</language>
    <webMaster>sbwoodside@yahoo.com (S. Woodside)</webMaster>
    <copyright>Copyright 2007-2008</copyright>
    <ttl>60</ttl>
    <pubDate>Sat, 16 Aug 2008 21:24:49 GMT</pubDate>
    <description>Personal weblog of Simon Woodside</description>
    <item>
      <title>unflac.sh - Convert FLAC files into 320 kbps MP3 files</title>
      <link>http://simonwoodside.com/past/2008/8/17/unflacsh_convert_flac_files_into/</link>
      <pubDate>Sat, 16 Aug 2008 21:19:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/8/17/unflacsh_convert_flac_files_into/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;Convert FLAC files into 320 kbps MP3 files. Someone might find this useful. I call it unflac.sh. It will take every .flac file in the current directory and convert it to MP3 using lame's "insane" preset (which shows what the lame people think about mp3...)&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;#!/bin/tcsh&lt;br /&gt;&lt;br /&gt;# Deal with FLAC, CUE file to convert to high-quality MP3 with LAME&lt;br /&gt;&lt;br /&gt;# Split a foo.cue / foo.flac combo (e.g. from EAC) into separate flac files&lt;br /&gt;####cuebreakpoints *.cue | shnsplit -o flac *.flac&lt;br /&gt;&lt;br /&gt;# convert flac to MP3&lt;br /&gt;foreach f (*.flac)&lt;br /&gt;  flac -c -d "$f" | lame &amp;mdash;preset insane - "${f}.mp3"&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;# Re-add the tags to the separate files&lt;br /&gt;cuetag.sh *.cue *.mp3&lt;/pre&gt;&lt;p&gt;You'll need to have flac and lame installed. It also tries to restore tags using cue but that doesn't seem to work. So sorry.&lt;/p&gt;&lt;p&gt;Why would I do this? Basically, because:&lt;/p&gt;&lt;ul&gt;&lt;li&gt; my MP3 player (N95) doesn't support FLAC &lt;/li&gt;&lt;li&gt;and doesn't have the room for it anyway&lt;/li&gt;&lt;li&gt;and iTunes doesn't support FLAC either (stupid apple...)&lt;/li&gt;&lt;/ul&gt;&lt;p&gt; Some day when I have a player that does, I'll probably switch to all FLAC, or apple lossless or whatever, but in the meantime 320 MP3s from lame are pretty good. I won't say I can't hear the difference because I haven't tried REALLY HARD, but for the listening I'm doing I can't hear the difference...&lt;/p&gt;</description>
    </item>
    <item>
      <title>the ultimate cut out book</title>
      <link>http://simonwoodside.com/past/2008/8/11/the_ultimate_cut_out_book/</link>
      <pubDate>Sun, 10 Aug 2008 21:02:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/8/11/the_ultimate_cut_out_book/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;You have probably seen the book with a space cut out to hide a knife, a gun, another book... but what about a house?&lt;/p&gt;&lt;p&gt;(actually, hiding a book inside a book... that's a cool idea...)&lt;/p&gt;&lt;p&gt;Anyway, that's &lt;a href="http://www.olafureliasson.net/"&gt;Olafur Eliasson&lt;/a&gt; has done. He cut a house into a book. There's no text. Just the house. And it's in negative space. Here's what it looks like:&lt;/p&gt;&lt;p&gt;&lt;img alt="Your House" src="http://farm3.static.flickr.com/2163/2352081142_4b25a201cc_d.jpg" /&gt;&lt;/p&gt;&lt;p&gt;Wild. I found this in &lt;a href="http://www.grafikmagazine.co.uk/"&gt;grafik magazine&lt;/a&gt;. No website, but a real paper work of art.&lt;/p&gt;&lt;p&gt;Eliasson is just too cool. Have a look at what he does with &lt;a href="http://kk.org/kk/2007/10/olafur-eliassons-nerdy-art.php"&gt;white lego bricks&lt;/a&gt;... and just generally &lt;a href="http://images.google.com/images?q=Olafur+Eliasson"&gt;feast your eyes on his works&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Jesse Rodgers's blog</title>
      <link>http://simonwoodside.com/past/2008/8/6/jesse_rodgerss_blog/</link>
      <pubDate>Tue, 05 Aug 2008 21:09:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/8/6/jesse_rodgerss_blog/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;&lt;a href="http://whoyoucallingajesse.com/" title="Who You Calling A Jesse?"&gt;Who You Calling A Jesse?&lt;/a&gt;&lt;/p&gt;&lt;p&gt;He is apparently&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Trying to sort the brilliant ideas from the lesser ones.&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Unfortunately, he is not very successful. But he is trying.&lt;/p&gt;&lt;p&gt;He also uses SimpleLog, the best Ruby on Rails blog out there that doesn't work under Rails 2.0, has been abandoned by its author, but still works great for me.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Because I can</title>
      <link>http://simonwoodside.com/past/2008/8/6/because_i_can/</link>
      <pubDate>Tue, 05 Aug 2008 21:06:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/8/6/because_i_can/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;Open Source Software for Mac. &lt;a href="http://www.opensourcemac.org/"&gt;Lots of Good Stuff&lt;/a&gt;. Very nice.&lt;/p&gt;</description>
    </item>
    <item>
      <title>The Loudness War</title>
      <link>http://simonwoodside.com/past/2008/8/2/the_loudness_war/</link>
      <pubDate>Sat, 02 Aug 2008 18:41:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/8/2/the_loudness_war/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;What the hell is the Loudness War? It's music business, baby. Put it this way. Everything is getting LOUDER.&lt;/p&gt;&lt;p&gt;IF YOU'RE LOUD YOU GET NOTICED PEOPLE READ YOU FIRST BUT EVERYTHING STARTS TO SOUND THE SAME.&lt;/p&gt;&lt;p&gt;That's just a simple "visualization" of what the loudness war is doing to music (recorded music anyway).&lt;/p&gt;&lt;p&gt;You could perhaps lay the blame on 5-CD changers. If you had one back in the 90s, you probably noticed that whenever it switches discs, you had to adjust the volume. And then MP3 players didn't help, although now the software will automatically adjust the loudness of tracks to match each other. And car CD players, where everything has to be loud to even hear it. But really, it's the fault of computers, and in particular a device called a &lt;a href="http://en.wikipedia.org/wiki/Dynamic_range_compression"&gt;digital compressor&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Basically here's the problem in a nutshell. Music has variations in volume, between the quiet parts and the loud parts. If you're in a movie theatre, concert hall, or at home with a good stereo, this is exciting, it's dynamics. The music can start out quiet, and then build up and then reach out and grab you by the throat in the exciting bits. This is GOOD.&lt;/p&gt;&lt;p&gt;But psychological studies have shown that people subconsciously think that louder is better, and the problem comes in when you are moving from one song to another. If you go from a loud song to one that starts out really quiet, your subconscious brain is going to tell you that the quality of music just went down, and you're going to hit the skip button or change radio stations.&lt;/p&gt;&lt;p&gt;So the producers use the compressor to "compress" (yeah, that's why it's called a compressor...) the dynamic range so that the difference between the quiet parts and the loud parts is minute. Basically, they make everything LOUD.&lt;/p&gt;&lt;p&gt;A few years ago Rolling Stone had an article called &lt;a href="http://www.rollingstone.com/news/story/17777619/the_death_of_high_fidelity/print"&gt;The Death of High Fidelity&lt;/a&gt;, it's about the &lt;a href="http://en.wikipedia.org/wiki/Loudness_war"&gt;Loudness War&lt;/a&gt;, and you can see a sort-of good video about it &lt;a href="http://www.youtube.com/watch?v=3Gmex_4hreQ"&gt;on YouTube&lt;/a&gt;.&amp;#160;&lt;/p&gt;&lt;p&gt;There also a a great article from IEEE Spectrum magazine: &lt;a href="http://www.spectrum.ieee.org/aug07/5429"&gt;Tearing Down the Wall of Noise&lt;/a&gt;. Good reading.&lt;/p&gt;&lt;p&gt;All in all these stories demonstrate without a grain of doubt that (a) the Loudness War is real and (b) it's causing damage to the music. Constantly loud music makes you tired and ultimately isn't satisfying or good. The subconscious thing is temporary, but the damage to the music is permanent.&lt;/p&gt;&lt;p&gt;What can you do about it? Buy music that isn't compressed, for starters. Some artists are fighting back, like Norah Jones with Not Too Late and Dylan's Modern Times. Or, just buy OLD albums, like CDs from the 80s, the time before compressors existed. Or buy vinyl, which for physical reasons doesn't really allow compression, but to me, having to go back to old tech like that is just silly. The music industry needs to fix this on the new technology. Even if they can crank up the volume, they shouldn't turn it into pure noise.&lt;/p&gt;&lt;p&gt;&lt;em&gt;PS: Seems that you can use "Average RMS Power" to get a rough idea of the dynamic range of a tune. And you can measure that using various tools, e.g. &lt;a href="http://www.hairersoft.com/AmadeusPro/"&gt;Amadeus Pro&lt;/a&gt; (Analyze &amp;gt; Waveform Statistics). Here are some values from my library:&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;Norah Jones, Feels Like Home, Sunrise: -13.5 dB .... that's not great but it's not as bad as it could be ... I don't really listen to this much any more though, and I think it's partly because it's tiring to listen to.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Decca Georg Solti Nibelung, Walkure Act I: -25 dB... I have no trouble with ear fatigue listenging to this one.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Beatles, Revolver, Taxman (no idea what edition): -16 dB ... I find it a bit loud, but I guess partly that's intentional?&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Cowboy Junkies, Trinity Sessions, Blue Moon: -21 dB .... what can I say? niiiiice.&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;OK, so I guess pretty much everything in my collection is OK at least. Probably because I delete anything that has crap dynamics. For comparison here's some stuff I wouldn't listen to.&lt;/em&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;em&gt;Coldplay, Viva la Vida:-12.3 dB ... well, it could be worse.... a bit... this would be a lot better with better dynamics.&lt;/em&gt;&lt;/li&gt;&lt;li&gt;&lt;em&gt;Rihanna, Disturbia: -11 dB ... just looking at the waveform for this makes my ears hurt in advance.&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;em&gt;Yeah, those are fairly hard to listen to.&lt;/em&gt;&lt;/p&gt;&lt;p&gt;&lt;em&gt;Someone ought to make an average RMS database.&lt;/em&gt;&lt;/p&gt;</description>
    </item>
    <item>
      <title>Azureus's stunning visualizations (Vuze)</title>
      <link>http://simonwoodside.com/past/2008/7/18/azureuss_stunning_visualizations_vuze/</link>
      <pubDate>Fri, 18 Jul 2008 15:51:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/7/18/azureuss_stunning_visualizations_vuze/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;In order to get around Bell Sympatico's bittorrent throttling I recently switched to &lt;a href="http://azureus.sourceforge.net/"&gt;Azureus (aka Vuze).&lt;/a&gt; If you switch to the "classic" UI mode, it has some stunning visualizations of what's happening with your torrents.&lt;/p&gt;&lt;p&gt;The main screen contains a bit more information than you might need, but if you play with the columns that are visible (right click on the headers) you can get something like this:&lt;/p&gt;&lt;p&gt;&lt;img alt="Azureus main screen" src="/weblog/images/2008/azureus/main.png" /&gt;&lt;/p&gt;&lt;p&gt;What you've got there is downloading torrents at the top and finished ones at the bottom. Green happy faces are currently in progress. Gray ones are queued. In the bottom right corner you can see that my total download speed is 311 kilobytes per second, and total upload is 50kB/s (I'm on ADSL).&lt;/p&gt;&lt;p&gt;&lt;img alt="Azureus peers" src="/weblog/images/2008/azureus/peers.png" /&gt;&lt;/p&gt;&lt;p&gt;Suppose I want to zoom in on one particular torrent &#8212; double click on it. This shows each of the peers I'm connected to. What pieces of the file do they have? How far complete are they in total? Bittorrent downloads files in chunks and it does the chunks randomly, not from start to end, so this information can be interesting.&lt;/p&gt;&lt;p&gt;&lt;img alt="Azureus Pieces" src="/weblog/images/2008/azureus/pieces.png" /&gt;&lt;/p&gt;&lt;p&gt;The above shows me EVEN MORE details if I really want it (OK, some of this stuff is really excessive). It shows which of the pieces I've got (blue) and which ones are downloading (in red). Just in case you wanted to know...&lt;/p&gt;&lt;p&gt;&lt;img alt="Azureus swarm" src="/weblog/images/2008/azureus/swarm.png" /&gt;&lt;/p&gt;&lt;p&gt;Swarm (above) is an actual animation of the pieces of the file as each of your peers around the edges send the bits to you in the middle. And it also shows the reverse as well. And the pie charts show how much of the torrent each peer has. Wild stuff.&lt;/p&gt;&lt;p&gt;So, that's if you want to know what's happening with one particular torrent. But what if you want to know about your overall connection with all the different peers and torrents? Well, Azureus gives loads of graphs and charts for that as well.&lt;/p&gt;&lt;p&gt;This one is your overall bandwidth monitor:&lt;/p&gt;&lt;p&gt;&lt;img alt="Azureus activity" src="/weblog/images/2008/azureus/activity.png" /&gt;&lt;/p&gt;&lt;p&gt;Nice. I love staring at this one. It's a really good example about how to cleanly show multiple related variables in a time-based chart (aka histogram). For the top one, the blue filled area is your download speed. Really interesting is the gray line, which is the average download speed of the SWARM. In other words, what is your average peer getting? If you're below this line, then you're getting screwed &#8212; or there's something wrong with your configuration. If you're above it, you're doing well. It's a good way to get a quick fix on the health of your downloads as compared to other users. It also makes it really easy to see if you're being rate-limited by your ISP.&lt;/p&gt;&lt;p&gt;On the bottom half, you can see that I've enabled Auto-Speed and it's automatically cranking the max upload speed up and down based on measuring my bandwidth and other factors that I'm not too clear on.&lt;/p&gt;&lt;p&gt;There's other visualizations but those are my favourites. Some of them aren't really documented and I don't really understand exactly what they mean (transfers and vivaldi for example). Still, obviously one of the azureus open source developers is a data viz keener and s/he's done some fine work.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Hacking the java compiler: using anonymous subclasses as closures</title>
      <link>http://simonwoodside.com/past/2008/7/10/hacking_the_java_compiler_using/</link>
      <pubDate>Thu, 10 Jul 2008 19:17:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/7/10/hacking_the_java_compiler_using/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;In Java, closures/first-order functions are not a language feature. However, as everyone knows, you can effectively get a first-order function by using an anonymous subclass instead. Something like this:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;class MyClosure {&lt;br /&gt;  void run() {} // override this&lt;br /&gt;}&lt;br /&gt;void doSomethingClosureLike() {&lt;br /&gt;  MyClosure closure = new MyClosure() { void run() { System.out.println("We're inside a closure!"); }};&lt;br /&gt;  runTheClosure(closure);&lt;br /&gt;}&lt;br /&gt;void runTheClosure(MyClosure closure) {&lt;br /&gt;  closure.run();&lt;br /&gt;}&lt;br /&gt;// will print We're inside a closure!&lt;/pre&gt;&lt;p&gt;Anyway, it's simple enough, you pass the class instead of the function and there's a little extra verbage but it works!&lt;/p&gt;&lt;p&gt;Also you get closure-like functionality, because inside run() you can access variables from outwhere where you created it. E.g.:&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;void doSomethingCooler() {&lt;br /&gt;  final String myString = "Foo!";&lt;br /&gt;  MyClosure closure = new MyClosure() { void run() { System.out.println("The string is: " + myString); }};&lt;br /&gt;  runTheClosure(closure);&lt;br /&gt;}&lt;br /&gt;// will print The string is: Foo!&lt;/pre&gt;&lt;p&gt;You can also access global variables that change over time, and the closure will use whatever is the current value WHEN THE CLOSURE RUNS.&lt;/p&gt;&lt;p&gt;There's just one small annoying thing, which is this particularly annoying compiler message: &lt;/p&gt;&lt;pre&gt;local variable (WHATEVER) is accessed from within inner class; needs to be declared final&lt;/pre&gt;&lt;p&gt;If you were do change myString to not be final, you'd get that error. Bummer. You could make myString a global variable and that would work, but that's stupid. There is a better way. Try this:&lt;/p&gt;&lt;pre&gt;void doSomethingCooler() {&lt;br /&gt;  String myString = "Foo!";&lt;br /&gt;  final String myStringFinal = myString;&lt;br /&gt;  myString.concat(" Bar!");&lt;br /&gt;&amp;#160; MyClosure closure = new MyClosure() { void run() { System.out.println("The string is:" + myStringFinal); }};&lt;br /&gt; &amp;nbsp;runTheClosure(closure);&lt;br /&gt;}&lt;br /&gt;// will print Foo! Bar!&lt;/pre&gt;&lt;p&gt;Now you can even change myString after you assign myStringFinal, because Java, although they say it doesn't use pointers, really does use pointers. I.e. it passes by reference. So, myStringFinal is actually just a reference to myString, and keeps pointing to it even when you change the contents of myString.&lt;/p&gt;&lt;p&gt;You can CHANGE it (like using concat()) but you CAN'T reassign it. That will break the pointers. It makes sense if you think about it&amp;mdash;myString will have a new memory address, and myStringFinal will still be pointing to the old memory address (and the old string value). So, this won't work:&lt;/p&gt;&lt;pre&gt;myString = "won't work"; // breaks myStringFinal&lt;/pre&gt;&lt;p&gt;You can use this technique with any object (but not primitives like int).&lt;/p&gt;</description>
    </item>
    <item>
      <title>ALL NEW "Simon Says" content RIGHT HERE</title>
      <link>http://simonwoodside.com/past/2008/7/10/all_new_simon_says_content/</link>
      <pubDate>Thu, 10 Jul 2008 10:52:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/7/10/all_new_simon_says_content/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;Wow, WYM Editor is so cool that I can just like type in a new blog post whenever I want to. Wild!&lt;/p&gt;&lt;p&gt;So anyway, I've been saving up a whole load of links and stuff for months until I had this new site all sorted out. So here's something.&lt;/p&gt;&lt;p&gt;Hmm... where did my "stuff to blog about" folder go?&lt;/p&gt;&lt;p&gt;Oh, here's an awesome one. &lt;a href="http://techon.nikkeibp.co.jp/english/special/teardown/"&gt;Nikkei Electronics Teardown Squad&lt;/a&gt;. These guys kick ass. Watch as they take apart a MacBook Air and declare "&lt;a href="http://techon.nikkeibp.co.jp/english/NEWS_EN/20080220/147736/"&gt;No Waste Outside, Nothing but Waste Inside&lt;/a&gt;".&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;About 30 screws were used to attach the keyboard alone. "The total number of screws in the MacBook Air was several times the number used in a PC we make," one of the engineers said. &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;Burn, baby, burn!&lt;/p&gt;&lt;p&gt;OK, here's another one from the files. &lt;a href="http://nathanfowkes.blogspot.com/"&gt;Nathan Fawkes Art&lt;/a&gt;. He's part of a network of film animators and illustrators and concept artists who all have their stuff up on blogspot.&lt;/p&gt;&lt;p&gt;And I'd like to remind myself particularly about &lt;a href="http://nathanfowkes.blogspot.com/2008/02/science-fiction.html"&gt;this post about science fiction&lt;/a&gt;.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Restoring the old posts</title>
      <link>http://simonwoodside.com/past/2008/7/7/restoring_the_old_posts/</link>
      <pubDate>Sun, 06 Jul 2008 20:35:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/7/7/restoring_the_old_posts/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;OK, here's a test of how WYMeditor works, because I'm going to try to copy/paste some code in here. I just had a little foray into my past with XSLT. I had 344 old blog posts (starting year 2000!) to convert from XML to SQL. Nothing better than XSL for the job! Here it is.&lt;/p&gt;&lt;p&gt;NB: I haven't restored images as of this writing.&lt;/p&gt;&lt;pre&gt;&lt;br /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&amp;gt;&lt;br /&gt;  &amp;lt;xsl:output method="xml" indent="no" omit-xml-declaration="yes" encoding="ASCII"/&amp;gt;&lt;br /&gt;  &amp;lt;xsl:strip-space elements="*"/&amp;gt;&lt;br /&gt;  &amp;lt;xsl:variable name="ucletters"&amp;gt;ABCDEFGHIJKLMNOPQRSTUVWXYZ- &amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;  &amp;lt;xsl:variable name="lcletters"&amp;gt;abcdefghijklmnopqrstuvwxyz-_&amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;  &amp;lt;xsl:variable name="allowed_letters"&amp;gt;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_ &amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template match="/"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt; USE `sw-blog-dev`;&lt;br /&gt;    &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;    &amp;lt;xsl:apply-templates select="weblog/entry"/&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template match="entry"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;INSERT INTO `sw-blog-dev`.`posts` (`author_id`,`created_at`,`modified_at`,`permalink`,`title`,`synd_title`,`summary`,`body_raw`,`extended_raw`,`body`,`extended`,`is_active`,`custom_field_1`,`custom_field_2`,`custom_field_3`,`body_searchable`,`extended_searchable`,`text_filter`,`comment_status`) VALUES&lt;br /&gt;    &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;  (2,&amp;lt;/xsl:text&amp;gt; &amp;lt;!&amp;mdash; author_id &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates select="date"/&amp;gt;&amp;lt;xsl:text&amp;gt; 12:00:00',&amp;lt;/xsl:text&amp;gt; &amp;lt;!&amp;mdash; created_at &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates select="date"/&amp;gt;&amp;lt;xsl:text&amp;gt; 12:00:00',&amp;lt;/xsl:text&amp;gt; &amp;lt;!&amp;mdash; modified_at &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates mode="PERMALINK" select="title"/&amp;gt;&amp;lt;xsl:text&amp;gt;',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; permalink &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates mode="XHTML" select="title/text()"/&amp;gt;&amp;lt;xsl:text&amp;gt;',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; title &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates mode="SYND_TITLE" select="content"/&amp;gt;&amp;lt;xsl:text&amp;gt;',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; synd_title &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; summary &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates mode="XHTML" select="content"/&amp;gt;&amp;lt;xsl:text&amp;gt;',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; body_raw &amp;mdash;&amp;gt; &lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; extended_raw &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates mode="XHTML" select="content"/&amp;gt;&amp;lt;xsl:text&amp;gt;',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; body &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; extended &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;1,&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; is_active &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'',&amp;lt;/xsl:text&amp;gt; &amp;lt;!&amp;mdash; custom_field_1 &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'',&amp;lt;/xsl:text&amp;gt; &amp;lt;!&amp;mdash; custom_field_2 &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'',&amp;lt;/xsl:text&amp;gt; &amp;lt;!&amp;mdash; custom_field_3 &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'&amp;lt;/xsl:text&amp;gt;&amp;lt;xsl:apply-templates mode="TEXT_ONLY" select="content"/&amp;gt;&amp;lt;xsl:text&amp;gt;',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; body_searchable &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; extended_searchable &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;'markdown',&amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; text_filter &amp;mdash;&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;1);&lt;br /&gt;    &amp;lt;/xsl:text&amp;gt;&amp;lt;!&amp;mdash; comment_status &amp;mdash;&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;!&amp;mdash; must remember to backslash all single quotes &amp;mdash;&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template match="date"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:value-of select="translate(.,'/','-')" /&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template mode="PERMALINK" match="title"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:value-of select="substring(&lt;br /&gt;                            translate(&lt;br /&gt;                              translate(., translate(., $allowed_letters, ''), ''),&lt;br /&gt;                              $ucletters,&lt;br /&gt;                              $lcletters&lt;br /&gt;                            ),&lt;br /&gt;                          0,42)"/&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template mode="SYND_TITLE" match="content"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:call-template name="escapesinglequotes"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:with-param name="arg1"&amp;gt;&amp;lt;xsl:value-of select="normalize-space( substring(.,0,42) )"/&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt;...&amp;lt;/xsl:text&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template mode="TEXT_ONLY" match="content"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:call-template name="escapesinglequotes"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:with-param name="arg1"&amp;gt;&amp;lt;xsl:value-of select="normalize-space(.)"/&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template mode="XHTML" match="content"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:apply-templates mode="XHTML"/&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template mode="XHTML" match="node()|@*"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:copy&amp;gt;&lt;br /&gt;      &amp;lt;xsl:apply-templates mode="XHTML" select="@*"/&amp;gt;&lt;br /&gt;      &amp;lt;xsl:apply-templates mode="XHTML"/&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:copy&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template mode="XHTML" match="text()"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:call-template name="escapesinglequotes"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:with-param name="arg1"&amp;gt;&amp;lt;xsl:value-of select="normalize-space(.)"/&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;    &amp;lt;xsl:text&amp;gt; &amp;lt;/xsl:text&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template mode="XHTML" match="@*"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:attribute name="{name()}"&amp;gt;&lt;br /&gt;      &amp;lt;xsl:call-template name="escapesinglequotes"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:with-param name="arg1"&amp;gt;&amp;lt;xsl:value-of select="normalize-space(.)"/&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:attribute&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;  &amp;lt;xsl:template name="escapesinglequotes"&amp;gt;&lt;br /&gt;    &amp;lt;xsl:param name="arg1"/&amp;gt;&lt;br /&gt;    &amp;lt;xsl:variable name="apostrophe"&amp;gt;'&amp;lt;/xsl:variable&amp;gt;&lt;br /&gt;    &amp;lt;xsl:choose&amp;gt;&lt;br /&gt;      &amp;lt;!&amp;mdash; this string has at least on single quote &amp;mdash;&amp;gt;&lt;br /&gt;      &amp;lt;xsl:when test="contains($arg1, $apostrophe)"&amp;gt;&lt;br /&gt;        &amp;lt;xsl:if test="string-length(normalize-space(substring-before($arg1, $apostrophe))) &amp;gt; 0"&amp;gt;&amp;lt;xsl:value-of select="substring-before($arg1, $apostrophe)" disable-output-escaping="yes"/&amp;gt;\'&amp;lt;/xsl:if&amp;gt;&lt;br /&gt;        &amp;lt;xsl:call-template name="escapesinglequotes"&amp;gt;&lt;br /&gt;          &amp;lt;xsl:with-param name="arg1"&amp;gt;&amp;lt;xsl:value-of select="substring-after($arg1, $apostrophe)" disable-output-escaping="yes"/&amp;gt;&amp;lt;/xsl:with-param&amp;gt;&lt;br /&gt;        &amp;lt;/xsl:call-template&amp;gt;&lt;br /&gt;      &amp;lt;/xsl:when&amp;gt;&lt;br /&gt;      &amp;lt;!&amp;mdash; no quotes found in string, just print it &amp;mdash;&amp;gt;&lt;br /&gt;      &amp;lt;xsl:when test="string-length(normalize-space($arg1)) &amp;gt; 0"&amp;gt;&amp;lt;xsl:value-of select="normalize-space($arg1)"/&amp;gt;&amp;lt;/xsl:when&amp;gt;&lt;br /&gt;    &amp;lt;/xsl:choose&amp;gt;&lt;br /&gt;  &amp;lt;/xsl:template&amp;gt;&lt;br /&gt;&amp;lt;/xsl:stylesheet&amp;gt;&lt;/pre&gt;&lt;p&gt;Niiiiiiice.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Blogging on Rails</title>
      <link>http://simonwoodside.com/past/2008/7/7/blogging_on_rails/</link>
      <pubDate>Sun, 06 Jul 2008 20:00:00 GMT</pubDate>
      <guid>http://simonwoodside.com/past/2008/7/7/blogging_on_rails/</guid>
      <author>sbwoodside@yahoo.com (Simon)</author>
      <description>&lt;p&gt;Hi there.&lt;/p&gt;&lt;p&gt;Well, I'm back. I was running this site on really ancient technology &#8212; AxKit &#8212; so 2001. Now I'm running it on modern technology, i.e. Rails 2. And doesn't it rock. Now I have a cool GUI editor to type into, I have easy programming in ruby, and I have of course polished both my design and my CSS/XHTML skillz considerably in the mean time, hopefully making this all easier to look at and navigate.&lt;/p&gt;&lt;p&gt;So I'm running on SimpleLog here, but it's not "stock". Oh no. Stock SimpleLog right doesn't run on Rails 2, but this one does. Also, I made it even MORE simple than it used to be:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Support Rails 2.0 (no need to freeze an old rails)&lt;/li&gt;&lt;li&gt;no themes&amp;mdash;annoying to use anyway, and no one was publishing themes either&lt;/li&gt;&lt;li&gt;replaced the editor/preview panel with WYM on Rails, which is by FAR the best WYSIWYG / GUI editor I've ever found, and the end of a long search for me&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;...and so on.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
