<?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>atc &#187; code</title>
	<atom:link href="http://blog.beplacid.net/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.beplacid.net</link>
	<description>Musings of technology, sport, life et al</description>
	<lastBuildDate>Thu, 10 Jun 2010 10:24:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ant TODO Update</title>
		<link>http://blog.beplacid.net/2010/01/02/ant-todo-update/</link>
		<comments>http://blog.beplacid.net/2010/01/02/ant-todo-update/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 21:34:38 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick post]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/?p=111</guid>
		<description><![CDATA[Quick update regarding Ant TODO: there&#8217;s now a JAR available for download, so you can get it running even quicker!

  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2010%2F01%2F02%2Fant-todo-update%2F';
  addthis_title  = 'Ant+TODO+Update';
  addthis_pub    = '';

]]></description>
			<content:encoded><![CDATA[<p>Quick update regarding <a title="Ant TODO" href="http://code.google.com/p/ant-todo/" target="_blank">Ant TODO</a>: there&#8217;s now a <a title="Ant TODO downloads" href="http://code.google.com/p/ant-todo/downloads/list" target="_blank">JAR available for download</a>, so you can get it running even quicker!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2010%2F01%2F02%2Fant-todo-update%2F';
  addthis_title  = 'Ant+TODO+Update';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2010/01/02/ant-todo-update/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Sky Songs and Linux</title>
		<link>http://blog.beplacid.net/2009/12/15/sky-songs-and-linux/</link>
		<comments>http://blog.beplacid.net/2009/12/15/sky-songs-and-linux/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 22:55:02 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[NoNeedForWindows]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick post]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[music]]></category>
		<category><![CDATA[sky]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/?p=104</guid>
		<description><![CDATA[If you want to use the Sky Songs download client in Linux (say Ubuntu or Debian), just paste the following into a file called skysongs in $HOME/bin and then chmod a+x it:
cd $SKY_SONGS_DIR; /usr/bin/java -cp . -jar downloader.jar $*
Note, $SKY_SONGS_DIR should be changed to your installation directory. If you used wine to install Sky Songs, [...]]]></description>
			<content:encoded><![CDATA[<p>If you want to use the <strong>Sky Songs download client in Linux</strong> (say Ubuntu or Debian), just paste the following into a file called skysongs in $HOME/bin and then chmod a+x it:<br />
<code>cd $SKY_SONGS_DIR; /usr/bin/java -cp . -jar downloader.jar $*</code></p>
<p><span style="text-decoration: underline;"><strong>Note</strong></span>, $SKY_SONGS_DIR should be changed to your installation directory. If you used <strong>wine</strong> to install Sky Songs, have a look under <strong>/home/YOURUSERNAME/.wine/drive_c/windows/profiles/YOURUSERNAME/Local Settings/Application Data/Sky  Songs/</strong>.</p>
<p>Sky Songs works by giving you &#8220;SKS&#8221; files that describe to its client (&#8220;<strong>Sky Songs MP3 Downloader</strong>&#8220;) what and how to download; i.e. your songs. Once you&#8217;ve downloaded one (say Renegades.sks; the &#8220;Renegades&#8221; album by Rage Against the Machine), just execute the skysongs script as follows:<br />
<code>alex@prometheus:~/Music$ skysongs Renegades.sks</code></p>
<p>Thankfully the Sky Songs download client is written in Java so it&#8217;s not only cross-platform but its structure is obvious.</p>
<p>Please note that these instructions are absolutely not intended for circumventing Sky&#8217;s download procedure, nor are they to be used to break the Terms of Service you&#8217;re most likely bound to by law. This information is purely for educational purposes and to assist those who are new to Linux get to grips with their everyday software in a new environment.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2009%2F12%2F15%2Fsky-songs-and-linux%2F';
  addthis_title  = 'Sky+Songs+and+Linux';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2009/12/15/sky-songs-and-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Wave Extensions Python API &#8211; Annotation Documentation</title>
		<link>http://blog.beplacid.net/2009/10/19/google-wave-extensions-python-api-annotation-documentation/</link>
		<comments>http://blog.beplacid.net/2009/10/19/google-wave-extensions-python-api-annotation-documentation/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 06:57:53 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Google Wave]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick post]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/?p=93</guid>
		<description><![CDATA[Quick post documenting the much-sought-after structure of the Python API&#8217;s Annotation name/value pairing. If you want to annotate a blip&#8217;s content, you&#8217;ll need to utilise the values below:

conv/title
 lang = en
 style/fontWeight = bold
 style/fontStyle = italic
 style/textDecoration = underline
 style/textDecoration = line-through
 style/fontSize = 2em
 style/color =r gb(229, 51, 51)
 style/backgroundColor = rgb(51, 127, [...]]]></description>
			<content:encoded><![CDATA[<p>Quick post documenting the much-sought-after structure of the Python API&#8217;s Annotation name/value pairing. If you want to annotate a blip&#8217;s content, you&#8217;ll need to utilise the values below:</p>
<ul>
<li>conv/title</li>
<li> lang = en</li>
<li> style/fontWeight = bold</li>
<li> style/fontStyle = italic</li>
<li> style/textDecoration = underline</li>
<li> style/textDecoration = line-through</li>
<li> style/fontSize = 2em</li>
<li> style/color =r gb(229, 51, 51)</li>
<li> style/backgroundColor = rgb(51, 127, 229)</li>
<li> link/manual = <a rel="nofollow" href="http://example.com/" target="_blank">http://example.com/</a></li>
</ul>
<p>A Python example of using the above:</p>
<p><code><br />
msg = "This is a message for you"<br />
doc = wavelet.GetDocument()<br />
doc.SetText(msg)<br />
doc.SetAnnotation(Range(msg[-4:], len(msg) - 1), "style/fontStyle", "italic")</code></p>
<p>The above should italicise the word &#8220;you&#8221; in the variable &#8220;msg&#8221;.</p>
<p><a href="http://groups.google.com/group/google-wave-api/browse_thread/thread/e313db4ff118907a" target="_blank">According to Google employee</a> &#8216;Pamela&#8217;, this isn&#8217;t set in stone &#8220;as we aren&#8217;t  confident in their stability&#8221;. Thanks to Dave of the same Google Group thread for documenting and posting the styling annotation name and value pairs.</p>
<p>Hope that helps someone ;)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2009%2F10%2F19%2Fgoogle-wave-extensions-python-api-annotation-documentation%2F';
  addthis_title  = 'Google+Wave+Extensions+Python+API+%26%238211%3B+Annotation+Documentation';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2009/10/19/google-wave-extensions-python-api-annotation-documentation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Wave Python API and Annotations</title>
		<link>http://blog.beplacid.net/2009/10/19/google-wave-python-api-and-annotations/</link>
		<comments>http://blog.beplacid.net/2009/10/19/google-wave-python-api-and-annotations/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 01:08:53 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Google Wave]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick post]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/?p=90</guid>
		<description><![CDATA[I spent a considerable amount of time this weekend hacking away at my Google Wave robot, Wave Toolkit. It&#8217;s a lot of fun and I&#8217;ve managed to write something that allows for quick implementation of &#8216;commands&#8217; from initial idea to &#8216;live&#8217;.
One of the frustrating things about developing Google Wave extensions is the poor documentation. It [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a considerable amount of time this weekend hacking away at my Google Wave robot, <a title="Wave Toolkit" href="http://wave-toolkit.appspot.com/" target="_blank">Wave Toolkit</a>. It&#8217;s a lot of fun and I&#8217;ve managed to write something that allows for quick implementation of &#8216;commands&#8217; from initial idea to &#8216;live&#8217;.</p>
<p>One of the frustrating things about developing Google Wave extensions is the poor documentation. It starts out great: lovely overview documentation and tutorial, with plenty of insight and step-by-step instructions; and then nothing. It stops there. Apart from reading the API documentation which can be cumbersome, you&#8217;re left alone in the dark, weeping like a sad puppy after meeting its new owners.</p>
<p>An example of this is using Annotations within Google Wave; formatting text for bold or italics,  providing nicely worded hyperlinks or embedding images is governed by inserting annotations that &#8216;explain&#8217; how the text should look. If you try to find out <em>how</em> to use these objects within the Python API you&#8217;ll see it&#8217;s nearly impossible. I got my answer only from guessing and scouring the Google Group and reading and example in Java, then posting when that didn&#8217;t work and finally getting some helpful advice. Please Google, document this protocol more!</p>
<p>So, to save an further frustration, <strong>here&#8217;s how to use Annotations in the Google Wave python API for robots</strong>:<br />
<code> doc = wavelet.CreateBlip().GetDocument()<br />
doc.SetText("THIS IS ANNOTATED TEXT")<br />
doc.SetAnnotation(Range(2, 12), "link/manual", "http://www.google.com")</code></p>
<p>I hope to hell that helps someone and saves the pain I underwent to work it out! Buggered if I know how to bold text though&#8230;Happy hacking!</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2009%2F10%2F19%2Fgoogle-wave-python-api-and-annotations%2F';
  addthis_title  = 'Google+Wave+Python+API+and+Annotations';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2009/10/19/google-wave-python-api-and-annotations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Google Wave Extensions &#8211; Wave Toolkit</title>
		<link>http://blog.beplacid.net/2009/10/17/wave-toolkit-google-wave-extensions/</link>
		<comments>http://blog.beplacid.net/2009/10/17/wave-toolkit-google-wave-extensions/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 22:38:36 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Google Wave]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick post]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/?p=82</guid>
		<description><![CDATA[Update: You might find my latest posts on Google Wave helpful.
So I managed to join the select elite bandwagon that is the Google Wave preview, which entitled me to early access to Google&#8217;s new masterpiece and 8 invites to bribe friends with (although I only have a few, so the whole eight might not stretch [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> You might find my <a href="http://blog.beplacid.net/tag/google-wave/" target="_blank">latest posts on Google Wave</a> helpful.</p>
<p>So I managed to join the select elite bandwagon that is the<strong> Google Wave preview</strong>, which entitled me to early access to Google&#8217;s new masterpiece and 8 invites to bribe friends with (although I only have a few, so the whole eight might not stretch too far&#8230;). I have to admit, I&#8217;m not sure what the fuss is about. It&#8217;s clever, really clever; but there&#8217;s <em>not much to it yet</em>. It is, for all intents and purposes, a well-marketed collaboration tool, or put simply: a clever chatroom. Time will tell though. Perhaps its usefulness is yet to be seen.</p>
<p>Being a devout geek, and a sucker for anything Google, I was led to explore the programming possibilities behind Wave. Rather brilliantly Google have created an API that will allow you to do one of two things: create a &#8216;Robot&#8217; &#8211; an automated participant programmed by you &#8211; or embed your own &#8216;gadget&#8217; in a wave (think a Google map, but your content). The API is rich, if its documentation can be a bit light in some respects (where the hell are the CreateBlip() and such methods documented?! All you get in the API docs are &#8216;Get*&#8217; methods&#8230;pointless!).</p>
<h2>Introducing Wave Toolkit</h2>
<p>Having programmed plenty of bots for IRC and Eternal Lands over the years I had the experience and ideas behind creating an automated character that can be used to aid users, or simply provide a bit of light entertainment. So after plenty of reading and hacking, I managed to come up with <strong><a title="Wave Toolkit" href="http://wave-toolkit.appspot.com/" target="_blank">Wave Toolkit</a></strong>; a simple Python robot for wave that provides <a title="Wave Toolkit Help" href="http://wave-toolkit.appspot.com/help" target="_blank">features</a> that are either lacking or a little tool that might aid your chatroom&#8230;err I mean collaborative-blue-sky-thinking&#8230;yeah.</p>
<p>To get a bot running you do need a Google App Engine account, which allowed me to explore this little world offered by Google. It&#8217;s cleverly done and nicely polished. Still think it&#8217;s just cleverly managed free-hosting though ;)</p>
<p>The capabilities of robots within the Google Wave extension API are pretty much exactly what a human participant can do: edit, post, delete and edit &#8216;<strong>blips</strong>&#8216;, create waves, see who&#8217;s participating and apparently manipulate playback. It&#8217;s very fun writing something that can do all this too; that wonderful satisfying feeling of achievement when you spam &#8220;hello world&#8221; to a wave&#8230;</p>
<p><strong>Wave Toolkit</strong>&#8217;s in constant development so it might be a little ropey, but please <strong>feel free to add wave-toolkit@appspot.com as a contact and invite it to a wave</strong>, and feel free to suggest new things, report bugs or even tell me you love it. ;)</p>
<p>So back to coding more lovely Python, and perhaps writing something useful for all the wavers out there. Right? ;)</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2009%2F10%2F17%2Fwave-toolkit-google-wave-extensions%2F';
  addthis_title  = 'Google+Wave+Extensions+%26%238211%3B+Wave+Toolkit';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2009/10/17/wave-toolkit-google-wave-extensions/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Configure Log4j To Disable Specific Package (Java)</title>
		<link>http://blog.beplacid.net/2008/11/30/configure-log4j-to-disable-specific-package-java/</link>
		<comments>http://blog.beplacid.net/2008/11/30/configure-log4j-to-disable-specific-package-java/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 21:49:21 +0000</pubDate>
		<dc:creator>atc</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Quick post]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[java]]></category>

		<guid isPermaLink="false">http://blog.beplacid.net/2008/11/30/configure-log4j-to-disable-specific-package-java/</guid>
		<description><![CDATA[I came across the need to disable logging (debug) for a specific package in Apache Log4j today whilst coding. It&#8217;s simple. All you need to do is precede the package name, e.g. net.beplacid, with log4j.logger and follow that with &#8220;=LEVEL&#8221;, where &#8216;level&#8217; is one of TRACE, DEBUG, INFO, WARN, ERROR and FATAL &#8211; the standard [...]]]></description>
			<content:encoded><![CDATA[<p>I came across the need to disable logging (debug) for a specific package in Apache Log4j today whilst coding. It&#8217;s simple. All you need to do is precede the package name, e.g. net.beplacid, with log4j.logger and follow that with &#8220;=LEVEL&#8221;, where &#8216;level&#8217; is one of TRACE, DEBUG, INFO, WARN, ERROR and FATAL &#8211; the standard Log4j logging levels. To demonstrate:<br />
<code><br />
log4j.logger.net.beplacid=DEBUG</code></p>
<p>Would set the logging level to DEBUG for all registered loggers in classes net.beplacid. Similarly:</p>
<p><code>log4j.logger.net.beplacid=FATAL</code></p>
<p>Would disable all but FATAL logging calls.</p>
<p>Hope that helps someone, I couldn&#8217;t find an &#8216;easy fix&#8217; page when searching&#8230;</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fblog.beplacid.net%2F2008%2F11%2F30%2Fconfigure-log4j-to-disable-specific-package-java%2F';
  addthis_title  = 'Configure+Log4j+To+Disable+Specific+Package+%28Java%29';
  addthis_pub    = '';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://blog.beplacid.net/2008/11/30/configure-log4j-to-disable-specific-package-java/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
