<?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>Marcus Hellberg &#187; Programming</title>
	<atom:link href="http://www.marcushellberg.com/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.marcushellberg.com</link>
	<description>blog.</description>
	<lastBuildDate>Wed, 01 Dec 2010 07:41:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Update</title>
		<link>http://www.marcushellberg.com/2010/03/20/update/</link>
		<comments>http://www.marcushellberg.com/2010/03/20/update/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 12:39:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Info]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[touchkit]]></category>
		<category><![CDATA[vaadin]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=235</guid>
		<description><![CDATA[So apparently I haven&#8217;t updated my blog in quite a while. Quite a lot has happened since the last update. I started working at IT Mill, the company behind the Vaadin framework.I&#8217;ve gotten off to a good start, I&#8217;m currently working on something I call TouchKit. It&#8217;s a combination of a few custom components and [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>So apparently I haven&#8217;t updated my blog in quite a while. Quite a lot has happened since the last update.</p>
<p>I started working at IT Mill, the company behind the <a href="http://vaadin.com">Vaadin framework</a>.I&#8217;ve gotten off to a good start, I&#8217;m currently working on something I call TouchKit. It&#8217;s a combination of a few custom components and extensions to Vaadin that allows you to create web applications that look like iPhone applications using nothing but Java. Check out the video preview below:</p>
<p><object width="400" height="738"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=10278516&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=10278516&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="400" height="738"></embed></object></p>
<p>Well, that&#8217;s all for now. I&#8217;ll try to get back to the habit of updating the blog a bit more often again <img src='http://www.marcushellberg.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class="shr-publisher-235"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/03/20/update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Textile to XHTML converter</title>
		<link>http://www.marcushellberg.com/2010/01/22/textile-to-xhtml-converter/</link>
		<comments>http://www.marcushellberg.com/2010/01/22/textile-to-xhtml-converter/#comments</comments>
		<pubDate>Fri, 22 Jan 2010 11:42:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=225</guid>
		<description><![CDATA[A while back, I needed to quickly write some documentation that needed to be in XHTML format. Writing in plain XHTML is a pain, so I decided to write the documentation in Textile and then convert it to XHTML before publishing. The problem I found was that all Textile converters were made for use in [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>A while back, I needed to quickly write some documentation that needed to be in XHTML format. Writing in plain XHTML is a pain, so I decided to write the documentation in Textile and then convert it to XHTML before publishing.</p>
<p>The problem I found was that all Textile converters were made for use in blogs and other online tools. What I needed was a good old-fashioned command line program to convert a given textile file into XHTML.</p>
<p>Fortunately, using Ruby and the excellent RedCloth gem, I could write a small script to accomplish this in a few minutes.</p>
<p>If you have any similar needs, copy the source into a file named textile2html, make it executable (chmod +x) and place it somewhere in your path. Then all you have to do is call textile2html with the textile file as an argument:</p>
<pre>$ textile2html documentation.textile</pre>
<pre class="brush:ruby">#!/usr/bin/env ruby -wKU
require "rubygems"
require "RedCloth"

if ARGV.size != 1
puts "Usage: textile2html file.textile"
exit
end

# Read input file
textile_string = ""
begin
  input_file = File.new(ARGV[0], "r")
  input_file.each do |line|
    textile_string+=line
  end
  input_file.close
rescue
  puts "Could not read input file."
  exit
end

# Create output file
filename = ARGV[0].gsub(/\.\w+$/, "")
begin
  output_file = File.new("#{filename}.html", "w")
rescue
  puts "Could not create output file."
  exit
end

html_header = &lt;&lt;DOC
&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt;
&lt;head&gt;
&lt;title&gt;
DOC

html_header += filename;
html_header += &lt;&lt;DOC
&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
DOC

html_footer = &lt;&lt;DOC
&lt;/body&gt;
&lt;/html&gt;
DOC

html_output = RedCloth.new(textile_string).to_html
output_file.puts(html_header)
output_file.puts(html_output)
output_file.puts(html_footer)
output_file.close

puts "Done."
</pre>
<p>Questions? Comments? Post them below.</p>
<div class="shr-publisher-225"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2010/01/22/textile-to-xhtml-converter/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Syntax highlighters</title>
		<link>http://www.marcushellberg.com/2009/12/21/syntax-highlighters/</link>
		<comments>http://www.marcushellberg.com/2009/12/21/syntax-highlighters/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 07:05:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugins]]></category>

		<guid isPermaLink="false">http://www.marcushellberg.com/?p=66</guid>
		<description><![CDATA[As I am probably going to post much on programming, I felt that I needed a way of highlighting code syntax and showing it in an easier to read format to you. At first I thought of just using Alex Gorbatchev&#8217;s SyntaxHighlighter. It turned out that there were in fact several WordPress plugins using Alex&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>As I am probably going to post much on programming, I felt that I needed a way of highlighting code syntax and showing it in an easier to read format to you. At first I thought of just using Alex Gorbatchev&#8217;s <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter" target="_blank">SyntaxHighlighter</a>. It turned out that there were in fact several WordPress plugins using Alex&#8217;s highlighter. Many of the existing highlighters did not work very well, they simply included the JavaScript file, requiring users to insert</p>
<pre class="brush:html">&lt;pre name="code" class="html"&gt;
...
&lt;/pre&gt;</pre>
<p>into the HTML. The problem is that WordPress&#8217; HTML editor strips out the name=&#8221;code&#8221; part, rendering the plugins useless.</p>
<p>What I settled on using, for the time being at least, is Vijesh Mehta <a href="http://www.lastengine.com/syntax-highlighter-wordpress-plugin/" target="_blank">Syntax Highlighter WordPress Plugin</a>. The plugin still requires manual HTML editing, but avoids the stripping of the name attribute by using class=&#8221;brush:language_name&#8221; instead.</p>
<p>So, as a start for my posts on programming: the classical &#8220;hello world&#8221;, in ruby this time.</p>
<pre class="brush:ruby">puts "hello world!"</pre>
<div class="shr-publisher-66"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.marcushellberg.com/2009/12/21/syntax-highlighters/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

