<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7680681593476647517</id><updated>2011-11-28T10:26:24.096+10:00</updated><category term='xml'/><category term='test'/><category term='testing'/><category term='ruby scrape spider search web page'/><category term='authentication'/><category term='rails'/><category term='functional'/><title type='text'>The good kind of madness</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>17</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-1894550938262523319</id><published>2011-05-23T21:26:00.003+10:00</published><updated>2011-05-23T21:28:51.633+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='functional'/><category scheme='http://www.blogger.com/atom/ns#' term='rails'/><category scheme='http://www.blogger.com/atom/ns#' term='xml'/><category scheme='http://www.blogger.com/atom/ns#' term='testing'/><category scheme='http://www.blogger.com/atom/ns#' term='test'/><category scheme='http://www.blogger.com/atom/ns#' term='authentication'/><title type='text'>Rails 3 - Testing Authentication (format html and xml)</title><content type='html'>Hey guys,&lt;br /&gt;&lt;br /&gt;This is a brief post showing you some functional test examples that test site authentication. I'm testing both format:html (via sessions), and format:xml (via HTTP Basic Auth). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Format HTML tests&lt;/b&gt; (session authorization):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;test "should show user's account when logged in" do&lt;br /&gt;    get :account, { :id =&amp;gt; @user.to_param }, { :user =&amp;gt; @user.to_param }&lt;br /&gt;    assert_response :success&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;test "shouldn't show user's account when not logged in" do&lt;br /&gt;    get :account, { :id =&amp;gt; @user.to_param }&lt;br /&gt;    assert_redirected_to new_session_path&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;test "shouldn't get edit as logged in as different user" do&lt;br /&gt;    get :edit, { :id =&amp;gt; @other_user.to_param }, { :user =&amp;gt; @user.to_param }&lt;br /&gt;    assert_redirected_to user_path(@other_user)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Format XML Tests&lt;/b&gt; (http_auth authorization):&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;test "shouldn't show account (xml) without http_auth provided" do&lt;br /&gt;    get :account, { :format =&amp;gt; 'xml', :id =&amp;gt; @user.to_param }, { :user =&amp;gt; @user.to_param }&lt;br /&gt;    assert_response :unauthorized&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;test "should show account (xml) with http_auth provided"  do&lt;br /&gt;    @request.env['HTTP_AUTHORIZATION'] = encode_credentials(@user.user_name, password_for(@user))&lt;br /&gt;    get :account, { :format =&amp;gt; 'xml', :id =&amp;gt; @user.to_param }&lt;br /&gt;    assert_response :success&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;pre&gt;test "shouldn't show account (xml) with bad http_auth provided"  do&lt;br /&gt;    @request.env['HTTP_AUTHORIZATION'] = encode_credentials('foo', 'bar')&lt;br /&gt;    get :account, { :format =&amp;gt; 'xml', :id =&amp;gt; @user.to_param }&lt;br /&gt;    assert_response :unauthorized&lt;br /&gt;  end&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;b&gt;&lt;i&gt;N.B.&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;Assumes that in your test helper files you have a&amp;nbsp;&lt;code&gt;password_for(user)&lt;/code&gt; method.&lt;br /&gt;&lt;br /&gt;Assumes the following test setup:&lt;br /&gt;&lt;pre&gt;setup do&lt;br /&gt;    @user = users(:joe)&lt;br /&gt;    @other_user = users(:jane)&lt;br /&gt;end&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-1894550938262523319?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/1894550938262523319/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=1894550938262523319' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1894550938262523319'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1894550938262523319'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2011/05/rails-3-testing-authentication-format.html' title='Rails 3 - Testing Authentication (format html and xml)'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-737660366227756662</id><published>2010-03-06T16:48:00.006+10:00</published><updated>2011-05-22T13:23:42.096+10:00</updated><title type='text'>vimrc generator</title><content type='html'>Hey guys and gals,&lt;br /&gt;&lt;br /&gt;I recently got sick of trawling through my old emails to find a .vimrc file a &lt;a href="http://simonbaird.com/"&gt;work colleague&lt;/a&gt; had previously sent me, so I decided to write a simple .vimrc generator based on the vimrc file I was working with.&lt;br /&gt;&lt;br /&gt;The vimrc generator can be found at &lt;a href="http://vimrcgenerator.appspot.com/"&gt;http://vimrcgenerator.appspot.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I wrote the vimrc generator for appengine. I will probably add the source code to github in the near future.&lt;br /&gt;Enjoy,&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-737660366227756662?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/737660366227756662/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=737660366227756662' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/737660366227756662'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/737660366227756662'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2010/03/vimrc-generator.html' title='vimrc generator'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-1283283350955591659</id><published>2010-01-24T19:55:00.020+10:00</published><updated>2010-01-24T20:30:34.651+10:00</updated><title type='text'>Simple fix for the looping "Dropbox daemon not installed!" problem</title><content type='html'>&lt;p&gt;I performed an Ubuntu update the other day, and my dropbox stopped working.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;It kept asking me to install the dropbox daemon, even though I had already installed it.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I fixed this problem by removing the hidden dropbox folders in my home directory, and then reinstalling the dropbox package.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Short answer:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Remove the two hidden dropbox folders (&lt;code&gt;~/.dropbox&lt;/code&gt; and &lt;code&gt;~/.dropbox-dist&lt;/code&gt;) from your home directory, and try running dropbox again.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style="font-weight: bold;"&gt;Long answer:&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Step 1 - Remove the two hidden dropbox folders:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;code&gt;rm -rfd ~/.dropbox-dist/&lt;/code&gt;&lt;/li&gt;&lt;li&gt;&lt;code&gt;rm -rfd ~/.dropbox/&lt;/code&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Step 2 - Reinstall dropbox:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;a href="https://www.dropbox.com/downloading"&gt;Download the appropriate dropbox&lt;/a&gt; for your distro.&lt;/li&gt;&lt;li&gt;Use the download to reinstall the dropbox package.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Step 3 - Open dropbox:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Open dropbox, dropbox is usually found in your applications drop-down under internet. &lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Step 4 - Install daemon and configure:&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;When you run dropbox, it will install the dropbox daemon. Once it has completed that step, it should ask you to log out and in again. Log out, then log back in.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Once you have logged back in, re-run dropbox. This time when you run dropbox, it will ask you for your login details. Provide your login details.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Dropbox will now ask where you want to sync your dropbox to. Select the same folder as you previously used.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;Step 5 - Finished&lt;br /&gt;&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Dropbox should now be working again!&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-1283283350955591659?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/1283283350955591659/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=1283283350955591659' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1283283350955591659'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1283283350955591659'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2010/01/simple-fix-for-looping-dropbox-daemon.html' title='Simple fix for the looping &quot;Dropbox daemon not installed!&quot; problem'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-3050602344105520797</id><published>2009-03-04T16:33:00.007+10:00</published><updated>2009-05-23T10:54:52.173+10:00</updated><title type='text'>Android application release stats</title><content type='html'>Hey guys and gals,&lt;br /&gt;&lt;br /&gt;I have a treat for those of you who are curious about what the uptake rate is for Android apps. I will be sharing my uptake stats via a &lt;a href="http://spreadsheets.google.com/pub?key=pXBzGVD9WcRx_slRPLmvBAA&amp;output=html"&gt;google spreadsheet&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;N.B. These are of course the stats for my apps, meaning that they will not reflect all apps. Also, so far, my apps are for "niche" markets. The release stats would likely be very different for an app such as "Lord of the farts"; Lol, "Lord of the farts".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-3050602344105520797?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/3050602344105520797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=3050602344105520797' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/3050602344105520797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/3050602344105520797'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/03/android-application-release-stats.html' title='Android application release stats'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-9045801334649833809</id><published>2009-02-28T23:43:00.006+10:00</published><updated>2010-01-24T16:20:46.410+10:00</updated><title type='text'>The most useful piece of code I have written for Android so far</title><content type='html'>The following code generates a new tab whenever there is an error and prints the error inside the tab. AWESOME. It is quick and easy, and provides you with immediate feedback when something goes wrong.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;} catch (Exception e) {&lt;br /&gt; tabHost.addTab(tabHost.newTabSpec("ERROR")&lt;br /&gt;     .setIndicator("ERROR")&lt;br /&gt;     .setContent(R.id.errorText)&lt;br /&gt;   );&lt;br /&gt; TextView errorText = (TextView) findViewById(R.id.errorText);&lt;br /&gt; StringBuilder error = new StringBuilder();&lt;br /&gt; error.append("Error: " + e.getMessage() + "\n");&lt;br /&gt; for(StackTraceElement te : e.getStackTrace()) {&lt;br /&gt;  error.append("f: " + te.getFileName() + ", m: " + te.getMethodName() + ", l: " + te.getLineNumber() + "\n");&lt;br /&gt; }&lt;br /&gt; errorText.setText(error.toString());&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;N.B. I am using a TabActivity, the &lt;code&gt;tabHost&lt;/code&gt; variable is the result of &lt;code&gt;this.getTabHost()&lt;/code&gt;. &lt;br /&gt;&lt;code&gt;R.id.errorText&lt;/code&gt; refers to a TextView I have in my layout xml.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-9045801334649833809?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/9045801334649833809/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=9045801334649833809' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/9045801334649833809'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/9045801334649833809'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/02/most-useful-peace-of-code-i-have.html' title='The most useful piece of code I have written for Android so far'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-536287200517795398</id><published>2009-02-28T13:50:00.003+10:00</published><updated>2009-02-28T13:56:10.648+10:00</updated><title type='text'>Ohmage taking shape</title><content type='html'>Hey people,&lt;br /&gt;&lt;br /&gt;the following is another screen shot. It shows how Ohmage is taking shape. &lt;br /&gt;Ohmage can now go from text to color, as well as color to text.&lt;br /&gt;&lt;br /&gt;In the screen you can see the auto-completion functionality in use.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_jITuYk5mPQI/Sai1v2Gv5AI/AAAAAAAAAB4/og8hN4Ynhjg/s1600-h/Screenshot-Android+Emulator+(5554)-1.png"&gt;&lt;img style="cursor:pointer; cursor:hand;width: 400px; height: 334px;" src="http://1.bp.blogspot.com/_jITuYk5mPQI/Sai1v2Gv5AI/AAAAAAAAAB4/og8hN4Ynhjg/s400/Screenshot-Android+Emulator+(5554)-1.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5307691994438427650" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-536287200517795398?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/536287200517795398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=536287200517795398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/536287200517795398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/536287200517795398'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/02/ohmage-taking-shape.html' title='Ohmage taking shape'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_jITuYk5mPQI/Sai1v2Gv5AI/AAAAAAAAAB4/og8hN4Ynhjg/s72-c/Screenshot-Android+Emulator+(5554)-1.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-873365771184026112</id><published>2009-02-27T19:32:00.009+10:00</published><updated>2009-02-27T20:20:36.303+10:00</updated><title type='text'>Ohmage</title><content type='html'>Hey guys and gals,&lt;br /&gt;&lt;br /&gt;I've been spending a little bit of time working with &lt;a href="http://en.wikipedia.org/wiki/Google_Android"&gt;Android&lt;/a&gt; lately. The following is a sneak peek at an app I'm working on. I hope to have it added to the Android market place by the end of this weekend (free app). The app's name is Ohmage, however for stuff and giggles, I may change the name to Pure Ohmage. I should mention that I hope to also have several other features added before I release Ohmage. &lt;br /&gt;&lt;br /&gt;These features include:&lt;br /&gt;1. A "generate colors" based on resistance value (ohms).&lt;br /&gt;2. A lookup formula/equation list. This list will &lt;strong&gt;initially&lt;/strong&gt; be static.&lt;br /&gt;3. A multi tab view to separate the ohmage view from the formula/equation list view.&lt;br /&gt;&lt;br /&gt;N.B. You may notice the resistor image is very coder-art-ish. The image will be updated before I release Ohmage.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jITuYk5mPQI/Sae07kRzbbI/AAAAAAAAABw/1fyZEZd3W5w/s1600-h/Upright.png"&gt;&lt;img style="float:bottom; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 238px; height: 400px;" src="http://3.bp.blogspot.com/_jITuYk5mPQI/Sae07kRzbbI/AAAAAAAAABw/1fyZEZd3W5w/s400/Upright.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5307409621323050418" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://3.bp.blogspot.com/_jITuYk5mPQI/Sae07jxryDI/AAAAAAAAABo/bpmA1Y5I3uM/s1600-h/SideOn.png"&gt;&lt;img style="float:bottom; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 199px;" src="http://3.bp.blogspot.com/_jITuYk5mPQI/Sae07jxryDI/AAAAAAAAABo/bpmA1Y5I3uM/s400/SideOn.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5307409621188331570" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_jITuYk5mPQI/Sae07clhx_I/AAAAAAAAABg/qF_jbN411B8/s1600-h/Selecting+a+color.png"&gt;&lt;img style="float:bottom; margin:0 0 10px 10px;cursor:pointer; cursor:hand;width: 400px; height: 334px;" src="http://4.bp.blogspot.com/_jITuYk5mPQI/Sae07clhx_I/AAAAAAAAABg/qF_jbN411B8/s400/Selecting+a+color.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5307409619258296306" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Update:&lt;br /&gt;&lt;br /&gt;While I do only support 4 band resistors, it will be fairly simple to add support for 5 and 6 band resistors. &lt;br /&gt;&lt;br /&gt;For anyone wanting to know what the learning curve for Android is like, the following is my take on learning Android. I have been working with Android for about 10 hours now. Android programming with the Eclipse plugin is... pleasant :D. Android programs are written in Java and the event system is fairly similar to Java Swing. A lot of the heavy lifting is performed by the Android View, Activity and Adapter classes. &lt;br /&gt;The Api Demos included with the SDK are the holy grail for learning Android. They provide excellent examples and clearly show how to perform your layout in xml, rather than in the raw code.&lt;br /&gt;If you are considering learning Android, I highly recommend making use of the eclipse plugin and the Api Demos.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-873365771184026112?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/873365771184026112/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=873365771184026112' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/873365771184026112'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/873365771184026112'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/02/ohmage.html' title='Ohmage'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_jITuYk5mPQI/Sae07kRzbbI/AAAAAAAAABw/1fyZEZd3W5w/s72-c/Upright.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-3231875500677055278</id><published>2009-02-07T11:51:00.008+10:00</published><updated>2009-02-07T12:27:43.615+10:00</updated><title type='text'>Working with SVN (Subversion) on a local network. Use hostnames when checking out.</title><content type='html'>Hello everybody,&lt;br /&gt;&lt;br /&gt;Firstly, I am working on a new project, "Tiddly Speck" (Working Title), and will return to posting about "Using Ruby to easily scrape/search/spider a web page for "things"" once I have finished the "Tiddly Speck" project.&lt;br /&gt;&lt;br /&gt;Now on with the post..&lt;br /&gt;&lt;br /&gt;When working with subversion on a local network, I highly recommend using &lt;a href="http://en.wikipedia.org/wiki/Hostname"&gt;hostnames&lt;/a&gt; when performing checkouts.&lt;br /&gt;You can add custom hostnames by configuring your system's &lt;a href="http://en.wikipedia.org/wiki/Hosts_file"&gt;hosts file&lt;/a&gt;.&lt;br /&gt;If at any point the machine which you were using to checkout from changes its IP address, having used hostnames means you need only reconfigure the entry for the hostname in your hosts file.&lt;br /&gt;If you didn't use hostnames you would either need to reconfigure your network to give the machine the original IP address it had, reconfigure all the .svn entries for the checkout, or re-checkout with the new IP address and merge all your old changes into your new checkout.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Example&lt;/strong&gt;:&lt;br /&gt;I use my mac mini as my subversion "server" at home.&lt;br /&gt;&lt;br /&gt;My hosts file includes:&lt;br /&gt;&lt;pre&gt;127.0.0.1     localhost&lt;br /&gt;127.0.1.1     robert-ubuntu-desktop&lt;br /&gt;192.168.0.9   macmini&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;This means that I can checkout my repository using a command similar to the following:&lt;br /&gt;&lt;code&gt;svn co http://macmini/svn/ my_new_work_area&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;If at any time my macmini changes its IP address, I only need to edit the macmini entry in my hosts file with the new IP address.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-3231875500677055278?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/3231875500677055278/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=3231875500677055278' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/3231875500677055278'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/3231875500677055278'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/02/working-with-svn-subversion-on-local.html' title='Working with SVN (Subversion) on a local network. Use hostnames when checking out.'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-381242728485790514</id><published>2009-02-05T00:06:00.009+10:00</published><updated>2009-02-05T21:30:18.439+10:00</updated><title type='text'>Ruby - Regex Non-Greedy Operator (?)-  Using Ruby to easily scrape/search/spider a web page for "things" - Part 2</title><content type='html'>Hello again,&lt;br /&gt;&lt;br /&gt;This is part 2 of the "&lt;span style="font-style:italic;"&gt;Using Ruby to easily scrape/search/spider a web page for "things"&lt;/span&gt;" multi-part post.&lt;br /&gt;&lt;br /&gt;In this post I will explain the use of the non-greedy regex operator. In the spider example used in part 1, I scraped for all uses of the html heading element. The html heading element includes h1, h2, h3, etc. More specifically, I was looking for all matches of the regex: &lt;code&gt;&amp;lt;h[0-9]&amp;gt;(.*?)&amp;lt;/h[0-9]&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The following breaks down and explains the above regex:&lt;br /&gt;&lt;code&gt;&amp;lt;h[0-9]&amp;gt;&lt;/code&gt; → Find &lt;code&gt;&amp;lt;h&lt;/code&gt; followed by &lt;code&gt;one digit ([0-9])&lt;/code&gt; followed by &lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;.*?&lt;/code&gt; → Find &lt;code&gt;any character (.)&lt;/code&gt; &lt;code&gt;zero or more times (*)&lt;/code&gt; &lt;code&gt; non-greedily (?)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;/h[0-9]&amp;gt;&lt;/code&gt; → Find &lt;code&gt;&amp;lt;/h&lt;/code&gt; followed by &lt;code&gt;one digit ([0-9])&lt;/code&gt; followed by &lt;code&gt;&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The parentheses (), mark what I want to capture from my regex match. In this case, it is the actual heading, I don't want to capture the &lt;code&gt;&amp;lt;h[0-9]&amp;gt&lt;/code&gt; or the &lt;code&gt;&amp;lt;/h[0-9]&amp;gt;&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;The non-greedy operator &lt;code&gt;(?)&lt;/code&gt; means that the regex should not be greedy; it should look-ahead to see if it can break what it is currently looking at. In the above example, the non-greedy operator was used to prevent the &lt;code&gt;.*&lt;/code&gt; from matching everything and thus never allowing the regex to match &lt;code&gt;&amp;lt;/h[0-9]&amp;gt;&lt;/code&gt;. The following examples demonstrate greedy vs non-greedy:&lt;br /&gt;&lt;br /&gt;Example 1: Greedy:&lt;br /&gt;Regex: &lt;code&gt;&amp;lt;h[0-9]&amp;gt;.*&amp;lt;/h[0-9]&amp;gt;&lt;/code&gt;&lt;br /&gt;Input: &lt;code&gt;&amp;lt;h3&amp;gt;My Title&amp;lt;/h3&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;h[0-9]&amp;gt;&lt;/code&gt; matches: &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;.*&lt;/code&gt; matches: &lt;code&gt;My Title&amp;lt;/h3&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Example 2: Non-Greedy:&lt;br /&gt;Regex: &lt;code&gt;&amp;lt;h[0-9]&amp;gt;.*?&amp;lt;/h[0-9]&amp;gt;&lt;/code&gt;&lt;br /&gt;Input: &lt;code&gt;&amp;lt;h3&amp;gt;My Title&amp;lt;/h3&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;h[0-9]&amp;gt;&lt;/code&gt; matches: &lt;code&gt;&amp;lt;h3&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;.*?&lt;/code&gt; matches: &lt;code&gt;My Title&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;lt;/h[0-9]&amp;gt;&lt;/code&gt; matches: &lt;code&gt;&amp;lt;/h3&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Further Reading:&lt;/strong&gt;&lt;br /&gt;&lt;a href="http://doc.infosnel.nl/ruby_regular_expressions.html"&gt;Ruby regex, quick reference guide&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ruby-doc.org/docs/UsersGuide/rg/regexp.html"&gt;Ruby-doc, user's guide to regex&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ruby-doc.org/core/classes/Regexp.html"&gt;Ruby API: Regexp&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.rubular.com/"&gt;Rubular: A Ruby regular expression editor (Interactive)&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-381242728485790514?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/381242728485790514/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=381242728485790514' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/381242728485790514'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/381242728485790514'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/02/ruby-regex-non-greedy-operator-using_05.html' title='Ruby - Regex Non-Greedy Operator (?)-  Using Ruby to easily scrape/search/spider a web page for &quot;things&quot; - Part 2'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-5367284611364336639</id><published>2009-02-04T23:49:00.016+10:00</published><updated>2009-02-05T09:30:12.295+10:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='ruby scrape spider search web page'/><title type='text'>Ruby - Using Ruby to easily scrape/search/spider a web page for "things" - Part 1</title><content type='html'>Hello,&lt;br /&gt;&lt;br /&gt;This is part 1 of the "&lt;span style="font-style:italic;"&gt;Using Ruby to easily scrape/search/spider a web page for "things"&lt;/span&gt;" multi-part post.&lt;br /&gt;&lt;br /&gt;This part contains the code necessary to scrape a web site for a specific thing. In the case of this example, a heading.&lt;br /&gt;&lt;br /&gt;The other parts of this multi-part post will explain specific sections of the code and will demonstrate how to spider through a website by scraping for links. &lt;br /&gt;&lt;br /&gt;The following code can be used to scrape/search/spider a web site for headings:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#!/sw/bin/ruby&lt;br /&gt;require 'open-uri'&lt;br /&gt;require 'pp'&lt;br /&gt;&lt;br /&gt;spider_url = "http://robertpyke.com/"&lt;br /&gt;pp "Looking up #{spider_url}"&lt;br /&gt;&lt;br /&gt;# The parentheses mark what we want to capture&lt;br /&gt;heading_pattern = /&amp;lt;h[0-9]&amp;gt;(.*?)&amp;lt;\/h[0-9]&amp;gt;/  &lt;br /&gt;&lt;br /&gt;headings = []&lt;br /&gt;open(spider_url) do |f|&lt;br /&gt;  f.each do |line|&lt;br /&gt;    matchdata = line.scan(heading_pattern)&lt;br /&gt;    matchdata.each do |match|  # Each match, match is an array&lt;br /&gt;      match.each do |string|   # Each string within a match&lt;br /&gt;        headings &lt;&lt; string     # Store the heading we found&lt;br /&gt;      end&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;pp headings  # Print the headings we found&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note&lt;/strong&gt;: It should be noted that the regex used to capture the heading is by no means perfect. It has been provided as a simple starting point for people wanting to scrape web pages. Both the limitations of this regex, and a more advanced regex example, will be provided in a later part of this multi-part blog post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-5367284611364336639?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/5367284611364336639/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=5367284611364336639' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/5367284611364336639'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/5367284611364336639'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/02/ruby-using-ruby-to-easily.html' title='Ruby - Using Ruby to easily scrape/search/spider a web page for &quot;things&quot; - Part 1'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-1533038001982239529</id><published>2009-02-04T22:22:00.023+10:00</published><updated>2009-02-05T21:16:11.649+10:00</updated><title type='text'>Ruby - Declaring Strings using %{}</title><content type='html'>Hi guys/gals,&lt;br /&gt;&lt;br /&gt;In Ruby, you can declare a string like follows:&lt;br /&gt;&lt;code&gt;string = "a string"&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;You can also declare a string with:&lt;br /&gt;&lt;code&gt;string = %{Another string}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The cool thing about the %{} declaration is that it is context aware. That is to say, it knows the depth of the &lt;a href="http://en.wikipedia.org/wiki/Curly_bracket_programming_language"&gt;curly&lt;/a&gt; stack. It knows when the next curly will end a start curly within the string and when the next curly will end the curly which started the string.&lt;br /&gt;&lt;br /&gt;The following example demonstrates this:&lt;br /&gt;&lt;code&gt;my_string = &lt;br /&gt;%{1st line, it is fairly normal.&lt;br /&gt;2nd line , it contains "quotation marks".&lt;br /&gt;3rd line, it contains one set of curlies, { a set }.&lt;br /&gt;4th, it contains two sets of curlies, { first set }, { second set }.&lt;br /&gt;5th line, this marks the end of my_string.}&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The above works because the sets of curlies start and end within the string.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following examples show what will happen if you &lt;strong&gt;incorrectly&lt;/strong&gt; use %{}:&lt;br /&gt;&lt;br /&gt;Input: &lt;code&gt;string = %{hello}world}&lt;/code&gt;&lt;br /&gt;Output: &lt;code&gt;-:1: syntax error, unexpected tIDENTIFIER, expecting $end&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Input: &lt;code&gt;string = %{hello{world}&lt;/code&gt;&lt;br /&gt;Output: &lt;code&gt;-:1: unterminated string meets end of file&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Update&lt;/strong&gt;: As mentioned by &lt;a href="http://www.blogger.com/profile/07800779073409671908"&gt;Simon&lt;/a&gt;, you can use any non letter/number character to mark the start and end of a string. The character after the &lt;code&gt;%&lt;/code&gt; marks the start of the String, if the character has an end pair character, the way in which you declare the String will work as I have described for %{}. If the character does not have an end pair character, the next use of the character will mark the end of the String.&lt;br /&gt;&lt;br /&gt;Pair characters include: &lt;code&gt;%{}, %[], %(), %&lt;&gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The following shows different examples of character combinations you &lt;strong&gt;can&lt;/strong&gt; use to start and end a string:&lt;br /&gt;Start: &lt;code&gt;%{&lt;/code&gt; end: &lt;code&gt;}&lt;/code&gt;&lt;br /&gt;Start: &lt;code&gt;%}&lt;/code&gt; end: &lt;code&gt;}&lt;/code&gt;&lt;br /&gt;Start: &lt;code&gt;%[&lt;/code&gt; end: &lt;code&gt;]&lt;/code&gt;&lt;br /&gt;Start: &lt;code&gt;%]&lt;/code&gt; end: &lt;code&gt;]&lt;/code&gt;&lt;br /&gt;Start: &lt;code&gt;%!&lt;/code&gt; end: &lt;code&gt;!&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The following shows an example of a character combination you &lt;strong&gt;cannot&lt;/strong&gt; use:&lt;br /&gt;Start: &lt;code&gt;%{&lt;/code&gt; end: &lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The following are examples of &lt;strong&gt;correct&lt;/strong&gt; String declarations: &lt;br /&gt;&lt;code&gt;my_string1 = &lt;br /&gt;%[My string, I have some other brackets in my String [a, b, c], yay&lt;br /&gt;for context aware Strings.]&lt;/code&gt;&lt;br /&gt;&lt;code&gt;my_string2 = %$MyString which is ended by a dollar sign$&lt;/code&gt;&lt;br /&gt;&lt;code&gt;my_string3 = %&amp;lt;Yet another example of a String which is closed by it's sensible pair character&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;my_string4 = %%Yes, even the percent sign can be used%&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The following are examples of &lt;strong&gt;invalid/incorrect&lt;/strong&gt; String declarations: &lt;br /&gt;Input: &lt;code&gt;my_string4 = %1String Content1&lt;/code&gt;&lt;br /&gt;Output: &lt;code&gt;-:1: unknown type of %string&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Input: &lt;code&gt;my_string5 = %aString Contenta&lt;/code&gt;&lt;br /&gt;Output: &lt;code&gt;-:1: unknown type of %string&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Input: &lt;code&gt;my_string6 = %[String Content[&lt;/code&gt;&lt;br /&gt;Output: &lt;code&gt;-:1: unterminated string meets end of file&lt;/code&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-1533038001982239529?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/1533038001982239529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=1533038001982239529' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1533038001982239529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1533038001982239529'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/02/ruby-declaring-strings-using.html' title='Ruby - Declaring Strings using %{}'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-4723655610206191502</id><published>2009-01-31T16:33:00.006+10:00</published><updated>2009-02-05T00:14:11.454+10:00</updated><title type='text'>Ruby: Adding the comparison operator (&lt;=&gt;) to the Symbol class</title><content type='html'>Hi guys/gals, &lt;br /&gt;&lt;br /&gt;I'm working on some Ruby at the moment.&lt;br /&gt;The code I'm writing uses hash maps and arrays to store word associations. To lower my memory usage, I decided to use symbols. Using symbols means all uses of the same word only use the one symbol worth of memory, instead of using a string worth of memory per word.&lt;br /&gt;&lt;br /&gt;For example, 800 strings of "a", is a lot more usage than 800 symbols of :a, as the symbol is shared. If I used strings, I would have 800 independent copies of "a".&lt;br /&gt;&lt;br /&gt;For display purposes, I wanted to sort my arrays of symbols. I soon learned that I could not call .sort! on an array of symbols. This is because the base class "Symbol" does not have &lt;=&gt; (comparison) operator by default. To be able to sort my arrays of symbols, I needed to add a &lt;=&gt; method to Symbol. The following code shows how to do this: &lt;br /&gt;&lt;br /&gt;&lt;pre&gt;class Symbol&lt;br /&gt;    def &lt;=&gt; value&lt;br /&gt;        to_s &lt;=&gt; value.to_s&lt;br /&gt;    end&lt;br /&gt;end&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The code above injects a &lt;=&gt; (comparison) method into the Symbol class. The &lt;=&gt; method simply converts the symbols that it is comparing to strings, and then calls the string &lt;=&gt; method. &lt;br /&gt;&lt;br /&gt;Note: I wrote the &lt;=&gt; method for my own purpose, to sort my symbols alphabetically. You could have just as easily written a method which compares symbols based on their length.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ruby-doc.org/core/classes/Symbol.html"&gt;Ruby API: Symbol&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.ruby-doc.org/core/classes/String.html#M000778"&gt;Ruby API: String#Comparison&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-4723655610206191502?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/4723655610206191502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=4723655610206191502' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/4723655610206191502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/4723655610206191502'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/01/ruby-adding-comparison-operator-to.html' title='Ruby: Adding the comparison operator (&lt;=&gt;) to the Symbol class'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-1487700825286908033</id><published>2009-01-26T22:34:00.004+10:00</published><updated>2009-01-26T23:06:58.064+10:00</updated><title type='text'>ruby-tower-defence</title><content type='html'>Hey guys/gals,&lt;br /&gt;&lt;br /&gt;I have just spent the past long weekend on a coding binge, 20+ hours of lovely Ruby. The end result is a tower defence "game" with easy to use base classes, making it easy for anyone to add a level, a tower or even a new bullet type. The "game" is in a playable state, and anyone who his familiar with rubygame should check it out. The "game" is available via &lt;a href="http://github.com/brimstone4814/ruby-tower-defence/tree/master"&gt;GIT&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;The following is a screenshot of ruby-tower-defence in action:&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_jITuYk5mPQI/SX2zdWCzPcI/AAAAAAAAABY/okY66gyjavA/s1600-h/ruby-tower-defence"&gt;&lt;img style="margin: 0pt 0pt 10px 10px; width: 400px; height: 240px;" src="http://4.bp.blogspot.com/_jITuYk5mPQI/SX2zdWCzPcI/AAAAAAAAABY/okY66gyjavA/s400/ruby-tower-defence" alt="" id="BLOGGER_PHOTO_ID_5295586053572476354" border="0" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-1487700825286908033?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/1487700825286908033/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=1487700825286908033' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1487700825286908033'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1487700825286908033'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2009/01/ruby-tower-defence.html' title='ruby-tower-defence'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_jITuYk5mPQI/SX2zdWCzPcI/AAAAAAAAABY/okY66gyjavA/s72-c/ruby-tower-defence' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-4798693126542502900</id><published>2008-11-13T12:55:00.003+10:00</published><updated>2009-01-26T23:07:45.650+10:00</updated><title type='text'>Ruby Pong - Screenshot</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_jITuYk5mPQI/SRuXa5_t6rI/AAAAAAAAAAM/isLfyem13sI/s1600-h/Screenshot-FPS:+29.107946580093.png"&gt;&lt;img style="float:left; margin:0 10px 10px 0;cursor:pointer; cursor:hand;width: 400px; height: 212px;" src="http://2.bp.blogspot.com/_jITuYk5mPQI/SRuXa5_t6rI/AAAAAAAAAAM/isLfyem13sI/s400/Screenshot-FPS:+29.107946580093.png" border="0" alt=""id="BLOGGER_PHOTO_ID_5267970677640391346" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The above is a screenshot of the game, Pong, which I discussed in my last post.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-4798693126542502900?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/4798693126542502900/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=4798693126542502900' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/4798693126542502900'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/4798693126542502900'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2008/11/ruby-pong-screen-shot.html' title='Ruby Pong - Screenshot'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_jITuYk5mPQI/SRuXa5_t6rI/AAAAAAAAAAM/isLfyem13sI/s72-c/Screenshot-FPS:+29.107946580093.png' height='72' width='72'/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-5821949174943188994</id><published>2008-11-02T23:03:00.004+10:00</published><updated>2008-11-02T23:44:11.654+10:00</updated><title type='text'>Pong (the game)- Rubygame</title><content type='html'>I have just finished writing Pong, my first full featured game, in &lt;span style="font-weight: bold;"&gt;Rubygame&lt;/span&gt;.&lt;br /&gt;On top of just the normal Pong action, I have added sound effects and background music.&lt;br /&gt;&lt;br /&gt;I have uploaded my source code to my website. Consider the source code "free", i.e. do what you like with it.&lt;br /&gt;You can  &lt;a href="http://robertpyke.com/resources/Pong/"&gt;browse the source code online&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Giving credit where credit is due&lt;/span&gt;:&lt;br /&gt;The main tutorial I used to learn how to create Pong was from the &lt;a href="http://kibabase.libregamewiki.org/index.php/The_Rubygame_Book"&gt;"Rubygame Book".&lt;/a&gt; It is an excellent starting tutorial. It explains a lot of the initial framework setup.&lt;br /&gt;&lt;br /&gt;The background music is from the &lt;a href="http://github.com/jacius/rubygame/tree/master/samples/"&gt;Rubygame samples&lt;/a&gt;. These can be found with the latest release of Rubygame.&lt;br /&gt;&lt;br /&gt;The sound effects are from &lt;a href="http://freesoundfiles.tintagel.net/Audio/"&gt;http://freesoundfiles.tintagel.net/Audio/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Questions?&lt;span style="font-weight: bold;"&gt;&lt;span style="font-weight: bold;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;Feel free to ask any questions you may have regarding the source code, or other ruby related issues you may have.&lt;br /&gt;&lt;a href="http://kibabase.libregamewiki.org/index.php/The_Rubygame_Book"&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-5821949174943188994?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/5821949174943188994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=5821949174943188994' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/5821949174943188994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/5821949174943188994'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2008/11/pong-game-rubygame.html' title='Pong (the game)- Rubygame'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-1554295579935455095</id><published>2008-11-01T02:12:00.013+10:00</published><updated>2008-11-01T14:20:00.415+10:00</updated><title type='text'>Rubygame setup</title><content type='html'>I have just completed my first mock game in rubygame (ruby's version of pygame), and I can't recommend it enough. That said, I did have a few troubles setting it up. The following describes how to setup rubygame in Ubuntu 8.04 (this is likely to work with other recent Ubuntu releases):&lt;br /&gt;&lt;br /&gt;1. Download the rubygame gem from the &lt;a href="http://rubygame.sourceforge.net/"&gt;rubygame official site&lt;/a&gt;. The gem is currently version 2.3.0.&lt;br /&gt;2. Install any necessary libraries. The README from the rubygame site states that you are required to have:&lt;br /&gt;&lt;br /&gt;1. ruby &gt;= 1.8&lt;br /&gt;2. SDL &gt;= 1.2.7&lt;br /&gt;3. rake &gt;= 0.7.0 (for build/install system)&lt;br /&gt;&lt;br /&gt;and that you should, but don't have to have:&lt;br /&gt;&lt;br /&gt;1. SDL_gfx &gt;= 2.0.10&lt;br /&gt;2. SDL_image &gt;= 1.2.3&lt;br /&gt;3. SDL_mixer &gt;= 1.2.7&lt;br /&gt;4. SDL_ttf &gt;= 2.0.6&lt;br /&gt;&lt;br /&gt;I found that I &lt;span style="font-weight: bold;"&gt;had&lt;/span&gt; to have the last 4 SDL libraries to install the rubygame gem.&lt;br /&gt;&lt;br /&gt;So, in case you don't already have ruby, rake and gems, the following &lt;a href="http://wiki.rubyonrails.com/rails/pages/RailsOnUbuntu"&gt;ruby rails website&lt;/a&gt; lists the required commands to install ruby, rake and gems. Note, it will also install rails support, which is a good thing.&lt;br /&gt;&lt;br /&gt;To get the required SDL libraries for rubygame, I installed the following packages via apt-get&lt;br /&gt;&lt;br /&gt;1. libsdl-ruby1.8&lt;br /&gt;2. libsdl1.2-all&lt;br /&gt;3. libsdl1.2-dev&lt;br /&gt;4. libsdl-gfx1.2-dev&lt;br /&gt;5. libsdl-image1.2-dev&lt;br /&gt;6. libsdl-mixer1.2-dev&lt;br /&gt;7. libsdl-ttf2.0-dev&lt;br /&gt;&lt;br /&gt;E.g. sudo apt-get install libsdl-ruby1.8&lt;br /&gt;&lt;br /&gt;Once that was complete, I installed the gem. To install the gem, you must be in a terminal at the directory in which the gem is located. You cannot be in another directory, if you are, it won't find the gem.&lt;br /&gt;&lt;br /&gt;To install the gem, I did the following:&lt;br /&gt;&lt;br /&gt;1. I placed the .gem file I downloaded on my Desktop.&lt;br /&gt;2. I did the following in the terminal to take me to my gem: cd ~/Desktop&lt;br /&gt;3. I did the following in the terminal to install the gem: gem install gem_file.gem&lt;br /&gt;&lt;br /&gt;If you did not receive a gem "install failed" message, you are ready to use rubygame. If you did, read the error message, I found that the error message named the libraries I was missing. An example of an error I received was, "could not find file SDL_IMAGE.h". This error meant that I was missing the libsdl-image1.2-dev package.&lt;br /&gt;&lt;br /&gt;The following is an example ruby program you can use to test your rubygame install. Note this is the entire file contents. If your ruby install worked, the app will run, opening a window titled "Hello World".&lt;br /&gt;&lt;br /&gt;&lt;pre style=";font-family:courier new;font-size:85%;"  &gt;&lt;br /&gt;#START FILE&lt;br /&gt;&lt;br /&gt;require "rubygems"&lt;br /&gt;require "rubygame"&lt;br /&gt;&lt;br /&gt;Rubygame.init&lt;br /&gt;&lt;br /&gt;screen = Rubygame::Screen.set_mode [320,240]&lt;br /&gt;screen.title = 'Hello World'&lt;br /&gt;screen.update&lt;br /&gt;&lt;br /&gt;queue = Rubygame::EventQueue.new&lt;br /&gt;&lt;br /&gt;game_over = false&lt;br /&gt;&lt;br /&gt;until game_over do&lt;br /&gt;   queue.each do |event|&lt;br /&gt;    case event&lt;br /&gt;      when Rubygame::ActiveEvent&lt;br /&gt;        puts "Hello World. Updating"&lt;br /&gt;        screen.update&lt;br /&gt;      when Rubygame::QuitEvent&lt;br /&gt;        game_over = true&lt;br /&gt;    end&lt;br /&gt;  end&lt;br /&gt;end&lt;br /&gt;&lt;br /&gt;Rubygame.quit&lt;br /&gt;&lt;br /&gt;# END FILE&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-1554295579935455095?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/1554295579935455095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=1554295579935455095' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1554295579935455095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/1554295579935455095'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2008/11/rubygame-setup.html' title='Rubygame setup'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7680681593476647517.post-6132243878299167797</id><published>2008-07-07T22:21:00.007+10:00</published><updated>2009-09-23T19:26:05.723+10:00</updated><title type='text'>Ubuntu, Mediatomb, VLC and the PS3 - a match made in heaven.</title><content type='html'>&lt;span style=";font-family:arial;font-size:100%;"  &gt;Today, in the space of a couple of hours, I successfully setup media serving to my PS3 under Ubuntu 8.04. Not only that, but the media server works with:&lt;br /&gt;&lt;/span&gt;&lt;ul  style="font-family:arial;"&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Multiple video and audio codecs and&lt;/span&gt;&lt;/li&gt;&lt;li&gt;&lt;span style="font-size:100%;"&gt;Media &lt;/span&gt;&lt;span style="font-style: italic;font-size:100%;" &gt;scanning&lt;/span&gt;&lt;span style="font-size:100%;"&gt; (tracking forwards and backwards).&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;The following discusses how I accomplished this &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;feat&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;.&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;Introduction:&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;Firstly it should be noted that the PS3 is a DLNA (Digital Living Network Alliance) compatible device, this basically means you can share media to it. Currently under Ubuntu there is a limited number of DLNA compatible media server programs, these programs include &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; and &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;fuppes.&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; I chose &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; as it has an installer through the symantic package manager, and for that reason updates should be automated.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;Installation:&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;First, make sure you have &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;VLC&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; installed, if you don't you can install it using the following command: &lt;code&gt;sudo apt-get install vlc&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Also install &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;ffmpeg&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; for good measure: &lt;code&gt;sudo apt-get install ffmpeg&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;I performed the installation of &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; via the &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;Add/Remove &lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;programs (symantic package manager) application in Ubuntu.&lt;br /&gt;Simply search for &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; in the "All available programs" category and select install. Having completed the previous install step, &lt;span style="font-style: italic;"&gt;mediatomb&lt;/span&gt; is now successfully installed and is avaliable under "Application/Sound &amp;amp; Video", that said, don't open it yet!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;Configuration:&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;Now we need to setup &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;, to do this we first need to run and close &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;, this will cause &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; to do some basic setup. To run &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;, go to a terminal and type: &lt;code&gt;sudo mediatomb&lt;/code&gt;&lt;br /&gt;After you do this wait for some text to output, the text should look something like:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;br /&gt;MediaTomb UPnP Server version 0.11.0 - http://mediatomb.cc/&lt;br /&gt;&lt;br /&gt;===============================================================================&lt;br /&gt;Copyright 2005-2008 Gena Batsyan, Sergey Bostandzhyan, Leonhard Wimmer.&lt;br /&gt;MediaTomb is free software, covered by the GNU General Public License version 2&lt;br /&gt;&lt;br /&gt;2008-07-08 22:47:45    INFO: Loading configuration from: /home/user/.mediatomb/config.xml&lt;br /&gt;2008-07-08 22:47:45    INFO: Checking configuration...&lt;br /&gt;2008-07-08 22:47:45    INFO: Setting filesystem import charset to UTF-8&lt;br /&gt;2008-07-08 22:47:45    INFO: Setting metadata import charset to UTF-8&lt;br /&gt;2008-07-08 22:47:45    INFO: Setting playlist charset to UTF-8&lt;br /&gt;2008-07-08 22:47:45    INFO: Configuration check succeeded.&lt;br /&gt;2008-07-08 22:47:45    INFO: Initialized port: 49152&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;br /&gt;Once the text is outputted close the program, &lt;code&gt;CTRL+C&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Now edit the &lt;/span&gt;&lt;span style="font-style: italic;font-family:arial;font-size:100%;"  &gt;mediatomb&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt; configuration file, to do this simply edit the config.xml file for mediatomb using your text editor: &lt;code&gt;gedit ~/.mediatomb/config.xml&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Note that the file has some comments which instruct you where to change things for PS3 support.&lt;br /&gt;&lt;br /&gt;Line 23: Change the no to a yes, &lt;code&gt;protocolInfo extend = yes&lt;/code&gt;&lt;br /&gt;Before:&lt;br /&gt;&lt;code&gt;&amp;lt;protocolInfo extend="no"/&amp;gt;&amp;lt;!-- For PS3 support change to "yes" --&amp;gt;&lt;/code&gt;&lt;br /&gt;After:&lt;br /&gt;&lt;code&gt;&amp;lt;protocolInfo extend="yes"/&amp;gt;&amp;lt;!-- For PS3 support change to "yes" --&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Line 65: Uncomment, &lt;code&gt;map from="avi" to="video/divx" &lt;/code&gt;&lt;br /&gt;Before:&lt;br /&gt;&lt;code&gt;&amp;lt;!-- &amp;lt;map from="avi" to="video/divx"/&amp;gt; --&amp;gt;&lt;/code&gt;&lt;br /&gt;After:&lt;br /&gt;&lt;code&gt;&amp;lt;map from="avi" to="video/divx"/&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;The above gives you the basic &lt;span style="font-style: italic;"&gt;mediatomb&lt;/span&gt; PS3 support, this basic support will not transcode your files. This means that if a media file isn't encoded using one of the "few" supported codecs then &lt;span style="font-style: italic;"&gt;tough luck&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;To enhance the PS3 support enable transcoding, as &lt;span style="font-style: italic;"&gt;VLC&lt;/span&gt; is installed, enable transcoding via &lt;span style="font-style: italic;"&gt;VLC&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;Line 87: Change the no to a yes, &lt;code&gt;transcoding enabled="yes"&lt;/code&gt;&lt;br /&gt;Before:&lt;br /&gt;&lt;code&gt;&amp;lt;transcoding enabled="no"&amp;gt;&lt;/code&gt;&lt;br /&gt;After:&lt;br /&gt;&lt;code&gt;&amp;lt;transcoding enabled="yes"&amp;gt;&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;Line 103: Change the enabled from no to yes, &lt;code&gt;profile name="vlcmpeg" enabled="yes" type="external"&lt;/code&gt;&lt;br /&gt;Before:&lt;br /&gt;&lt;code&gt;&amp;lt;profile name="vlcmpeg" enabled="no" type="external"&amp;gt;&lt;/code&gt;&lt;br /&gt;After:&lt;br /&gt;&lt;code&gt;&amp;lt;profile name="vlcmpeg" enabled="yes" type="external"&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;/code&gt;Having completed the above steps, save the file.&lt;br /&gt;&lt;br /&gt;All that remains is to re-run the &lt;span style="font-style: italic;"&gt;mediatomb&lt;/span&gt; via the terminal and add media to share. Simply run &lt;span style="font-style: italic;"&gt;mediatomb&lt;/span&gt; in a terminal:&lt;code&gt;mediatomb&lt;/code&gt;. Now go to the URL stated in the &lt;span style="font-style: italic;"&gt;mediatomb&lt;/span&gt; output, this is likely to be &lt;code&gt;http://localhost:49152&lt;/code&gt;. Once at the URL you should see the &lt;span style="font-style: italic;"&gt;mediatomb&lt;/span&gt; interface, to add media simply select the media you want to share from the &lt;span style="font-style: italic;"&gt;Filesystem&lt;/span&gt; and press the &lt;span style="font-style: italic;"&gt;+&lt;/span&gt; symbol in the top right. All shared media is shown in the &lt;span style="font-style: italic;"&gt;Database&lt;/span&gt;.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Finish:&lt;br /&gt;&lt;br /&gt;&lt;/span&gt;Now startup your PS3 and search for media servers, your PS3 should find the &lt;span style="font-style: italic;"&gt;mediatomb&lt;/span&gt; server with your shared media, virtually all the media should be watchable via the &lt;span style="font-style: italic;"&gt;VLC&lt;/span&gt; transcoding.. Enjoy!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;config.xml&lt;/span&gt; &lt;span style="font-style: italic;"&gt;before and after&lt;/span&gt;:&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;Before:&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;        &lt;pre  style="font-family:arial;"&gt;&lt;span style="font-size:100%;"&gt;&lt;pre&gt;&amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;&lt;br /&gt;&amp;lt;config version=&amp;quot;1&amp;quot; xmlns=&amp;quot;http://mediatomb.cc/config/1&amp;quot; xmlns:xsi=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot; xsi:schemaLocation=&amp;quot;http://mediatomb.cc/config/1 http://mediatomb.cc/config/1.xsd&amp;quot;&amp;gt;&lt;br /&gt; &amp;lt;server&amp;gt;&lt;br /&gt;   &amp;lt;ui enabled=&amp;quot;yes&amp;quot;&amp;gt;&lt;br /&gt;     &amp;lt;accounts enabled=&amp;quot;no&amp;quot; session-timeout=&amp;quot;30&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;account user=&amp;quot;mediatomb&amp;quot; password=&amp;quot;mediatomb&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;/accounts&amp;gt;&lt;br /&gt;   &amp;lt;/ui&amp;gt;&lt;br /&gt;   &amp;lt;name&amp;gt;MediaTomb&amp;lt;/name&amp;gt;&lt;br /&gt;   &amp;lt;udn&amp;gt;uuid:77026039-2855-4f76-bb54-4f7b176d4cb8&amp;lt;/udn&amp;gt;&lt;br /&gt;   &amp;lt;home&amp;gt;/home/robertpyke/.mediatomb&amp;lt;/home&amp;gt;&lt;br /&gt;   &amp;lt;webroot&amp;gt;/usr/share/mediatomb/web&amp;lt;/webroot&amp;gt;&lt;br /&gt;   &amp;lt;storage&amp;gt;&lt;br /&gt;     &amp;lt;sqlite3 enabled=&amp;quot;yes&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;database-file&amp;gt;mediatomb.db&amp;lt;/database-file&amp;gt;&lt;br /&gt;     &amp;lt;/sqlite3&amp;gt;&lt;br /&gt;     &amp;lt;mysql enabled=&amp;quot;no&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;host&amp;gt;localhost&amp;lt;/host&amp;gt;&lt;br /&gt;       &amp;lt;username&amp;gt;mediatomb&amp;lt;/username&amp;gt;&lt;br /&gt;       &amp;lt;database&amp;gt;mediatomb&amp;lt;/database&amp;gt;&lt;br /&gt;     &amp;lt;/mysql&amp;gt;&lt;br /&gt;   &amp;lt;/storage&amp;gt;&lt;br /&gt;   &amp;lt;protocolInfo extend=&amp;quot;no&amp;quot;/&amp;gt;&amp;lt;!-- For PS3 support change to &amp;quot;yes&amp;quot; --&amp;gt;&lt;br /&gt;   &amp;lt;!--&lt;br /&gt;      Uncomment the lines below to get rid of jerky avi playback on the&lt;br /&gt;      DSM320 or to enable subtitles support on the DSM units&lt;br /&gt;   --&amp;gt;&lt;br /&gt;   &amp;lt;!--&lt;br /&gt;   &amp;lt;custom-http-headers&amp;gt;&lt;br /&gt;     &amp;lt;add header=&amp;quot;X-User-Agent: redsonic&amp;quot;/&amp;gt;&lt;br /&gt;   &amp;lt;/custom-http-headers&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;manufacturerURL&amp;gt;redsonic.com&amp;lt;/manufacturerURL&amp;gt;&lt;br /&gt;   &amp;lt;modelNumber&amp;gt;105&amp;lt;/modelNumber&amp;gt;&lt;br /&gt;   --&amp;gt;&lt;br /&gt;   &amp;lt;!-- Uncomment the line below if you have a Telegent TG100 --&amp;gt;&lt;br /&gt;   &amp;lt;!--&lt;br /&gt;      &amp;lt;upnp-string-limit&amp;gt;101&amp;lt;/upnp-string-limit&amp;gt;&lt;br /&gt;   --&amp;gt;&lt;br /&gt; &amp;lt;/server&amp;gt;&lt;br /&gt; &amp;lt;import hidden-files=&amp;quot;no&amp;quot;&amp;gt;&lt;br /&gt;   &amp;lt;scripting script-charset=&amp;quot;UTF-8&amp;quot;&amp;gt;&lt;br /&gt;     &amp;lt;common-script&amp;gt;/usr/share/mediatomb/js/common.js&amp;lt;/common-script&amp;gt;&lt;br /&gt;     &amp;lt;playlist-script&amp;gt;/usr/share/mediatomb/js/playlists.js&amp;lt;/playlist-script&amp;gt;&lt;br /&gt;     &amp;lt;virtual-layout type=&amp;quot;builtin&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;import-script&amp;gt;/usr/share/mediatomb/js/import.js&amp;lt;/import-script&amp;gt;&lt;br /&gt;     &amp;lt;/virtual-layout&amp;gt;&lt;br /&gt;   &amp;lt;/scripting&amp;gt;&lt;br /&gt;   &amp;lt;mappings&amp;gt;&lt;br /&gt;     &amp;lt;extension-mimetype ignore-unknown=&amp;quot;no&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;mp3&amp;quot; to=&amp;quot;audio/mpeg&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;ogg&amp;quot; to=&amp;quot;application/ogg&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;asf&amp;quot; to=&amp;quot;video/x-ms-asf&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;asx&amp;quot; to=&amp;quot;video/x-ms-asf&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;wma&amp;quot; to=&amp;quot;audio/x-ms-wma&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;wax&amp;quot; to=&amp;quot;audio/x-ms-wax&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;wmv&amp;quot; to=&amp;quot;video/x-ms-wmv&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;wvx&amp;quot; to=&amp;quot;video/x-ms-wvx&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;wm&amp;quot; to=&amp;quot;video/x-ms-wm&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;wmx&amp;quot; to=&amp;quot;video/x-ms-wmx&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;m3u&amp;quot; to=&amp;quot;audio/x-mpegurl&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;pls&amp;quot; to=&amp;quot;audio/x-scpls&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;flv&amp;quot; to=&amp;quot;video/x-flv&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;!-- Uncomment the line below for PS3 divx support --&amp;gt;&lt;br /&gt;       &amp;lt;!-- &amp;lt;map from=&amp;quot;avi&amp;quot; to=&amp;quot;video/divx&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;       &amp;lt;!-- Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 --&amp;gt;&lt;br /&gt;       &amp;lt;!-- &amp;lt;map from=&amp;quot;avi&amp;quot; to=&amp;quot;video/avi&amp;quot;/&amp;gt; --&amp;gt;&lt;br /&gt;     &amp;lt;/extension-mimetype&amp;gt;&lt;br /&gt;     &amp;lt;mimetype-upnpclass&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;audio/*&amp;quot; to=&amp;quot;object.item.audioItem.musicTrack&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;video/*&amp;quot; to=&amp;quot;object.item.videoItem&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;map from=&amp;quot;image/*&amp;quot; to=&amp;quot;object.item.imageItem&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;/mimetype-upnpclass&amp;gt;&lt;br /&gt;     &amp;lt;mimetype-contenttype&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;audio/mpeg&amp;quot; as=&amp;quot;mp3&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;application/ogg&amp;quot; as=&amp;quot;ogg&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;audio/x-flac&amp;quot; as=&amp;quot;flac&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;image/jpeg&amp;quot; as=&amp;quot;jpg&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;audio/x-mpegurl&amp;quot; as=&amp;quot;playlist&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;audio/x-scpls&amp;quot; as=&amp;quot;playlist&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;audio/x-wav&amp;quot; as=&amp;quot;pcm&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;audio/L16&amp;quot; as=&amp;quot;pcm&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype=&amp;quot;video/x-msvideo&amp;quot; as=&amp;quot;avi&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;/mimetype-contenttype&amp;gt;&lt;br /&gt;   &amp;lt;/mappings&amp;gt;&lt;br /&gt; &amp;lt;/import&amp;gt;&lt;br /&gt; &amp;lt;transcoding enabled=&amp;quot;no&amp;quot;&amp;gt;&lt;br /&gt;   &amp;lt;mimetype-profile-mappings&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype=&amp;quot;video/x-flv&amp;quot; using=&amp;quot;vlcmpeg&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype=&amp;quot;application/ogg&amp;quot; using=&amp;quot;vlcmpeg&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype=&amp;quot;application/ogg&amp;quot; using=&amp;quot;oggflac2raw&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype=&amp;quot;audio/x-flac&amp;quot; using=&amp;quot;oggflac2raw&amp;quot;/&amp;gt;&lt;br /&gt;   &amp;lt;/mimetype-profile-mappings&amp;gt;&lt;br /&gt;   &amp;lt;profiles&amp;gt;&lt;br /&gt;     &amp;lt;profile name=&amp;quot;oggflac2raw&amp;quot; enabled=&amp;quot;no&amp;quot; type=&amp;quot;external&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;mimetype&amp;gt;audio/L16&amp;lt;/mimetype&amp;gt;&lt;br /&gt;       &amp;lt;accept-url&amp;gt;no&amp;lt;/accept-url&amp;gt;&lt;br /&gt;       &amp;lt;first-resource&amp;gt;yes&amp;lt;/first-resource&amp;gt;&lt;br /&gt;       &amp;lt;accept-ogg-theora&amp;gt;no&amp;lt;/accept-ogg-theora&amp;gt;&lt;br /&gt;       &amp;lt;agent command=&amp;quot;ogg123&amp;quot; arguments=&amp;quot;-d raw -f %out %in&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;buffer size=&amp;quot;1048576&amp;quot; chunk-size=&amp;quot;131072&amp;quot; fill-size=&amp;quot;262144&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;/profile&amp;gt;&lt;br /&gt;     &amp;lt;profile name=&amp;quot;vlcmpeg&amp;quot; enabled=&amp;quot;no&amp;quot; type=&amp;quot;external&amp;quot;&amp;gt;&lt;br /&gt;       &amp;lt;mimetype&amp;gt;video/mpeg&amp;lt;/mimetype&amp;gt;&lt;br /&gt;       &amp;lt;accept-url&amp;gt;yes&amp;lt;/accept-url&amp;gt;&lt;br /&gt;       &amp;lt;first-resource&amp;gt;yes&amp;lt;/first-resource&amp;gt;&lt;br /&gt;       &amp;lt;accept-ogg-theora&amp;gt;yes&amp;lt;/accept-ogg-theora&amp;gt;&lt;br /&gt;       &amp;lt;agent command=&amp;quot;vlc&amp;quot; arguments=&amp;quot;-I dummy %in --sout #transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25,aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit&amp;quot;/&amp;gt;&lt;br /&gt;       &amp;lt;buffer size=&amp;quot;14400000&amp;quot; chunk-size=&amp;quot;512000&amp;quot; fill-size=&amp;quot;120000&amp;quot;/&amp;gt;&lt;br /&gt;     &amp;lt;/profile&amp;gt;&lt;br /&gt;   &amp;lt;/profiles&amp;gt;&lt;br /&gt; &amp;lt;/transcoding&amp;gt;&lt;br /&gt;&amp;lt;/config&amp;gt;&lt;/pre&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;span style="font-weight: bold;font-family:arial;font-size:100%;"  &gt;After:&lt;/span&gt;&lt;span style=";font-family:arial;font-size:100%;"  &gt;&lt;br /&gt;&lt;/span&gt;&lt;pre  style="font-family:arial;"&gt;&lt;span&gt;&lt;span style="font-size:100%;"&gt;&lt;pre&gt;&lt;br /&gt;&lt;span style="font-size:100%;"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;br /&gt;&amp;lt;config version="1" xmlns="http://mediatomb.cc/config/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://mediatomb.cc/config/1 http://mediatomb.cc/config/1.xsd"&amp;gt;&lt;br /&gt; &amp;lt;server&amp;gt;&lt;br /&gt;   &amp;lt;ui enabled="yes"&amp;gt;&lt;br /&gt;     &amp;lt;accounts enabled="no" session-timeout="30"&amp;gt;&lt;br /&gt;       &amp;lt;account user="mediatomb" password="mediatomb"/&amp;gt;&lt;br /&gt;     &amp;lt;/accounts&amp;gt;&lt;br /&gt;   &amp;lt;/ui&amp;gt;&lt;br /&gt;   &amp;lt;name&amp;gt;MediaTomb&amp;lt;/name&amp;gt;&lt;br /&gt;   &amp;lt;udn&amp;gt;uuid:77026039-2855-4f76-bb54-4f7b176d4cb8&amp;lt;/udn&amp;gt;&lt;br /&gt;   &amp;lt;home&amp;gt;/home/robertpyke/.mediatomb&amp;lt;/home&amp;gt;&lt;br /&gt;   &amp;lt;webroot&amp;gt;/usr/share/mediatomb/web&amp;lt;/webroot&amp;gt;&lt;br /&gt;   &amp;lt;storage&amp;gt;&lt;br /&gt;     &amp;lt;sqlite3 enabled="yes"&amp;gt;&lt;br /&gt;       &amp;lt;database-file&amp;gt;mediatomb.db&amp;lt;/database-file&amp;gt;&lt;br /&gt;     &amp;lt;/sqlite3&amp;gt;&lt;br /&gt;     &amp;lt;mysql enabled="no"&amp;gt;&lt;br /&gt;       &amp;lt;host&amp;gt;localhost&amp;lt;/host&amp;gt;&lt;br /&gt;       &amp;lt;username&amp;gt;mediatomb&amp;lt;/username&amp;gt;&lt;br /&gt;       &amp;lt;database&amp;gt;mediatomb&amp;lt;/database&amp;gt;&lt;br /&gt;     &amp;lt;/mysql&amp;gt;&lt;br /&gt;   &amp;lt;/storage&amp;gt;&lt;br /&gt;   &amp;lt;protocolInfo extend="yes"/&amp;gt;&amp;lt;!-- For PS3 support change to "yes" --&amp;gt;&lt;br /&gt;   &amp;lt;!--&lt;br /&gt;      Uncomment the lines below to get rid of jerky avi playback on the&lt;br /&gt;      DSM320 or to enable subtitles support on the DSM units&lt;br /&gt;   --&amp;gt;&lt;br /&gt;   &amp;lt;!--&lt;br /&gt;   &amp;lt;custom-http-headers&amp;gt;&lt;br /&gt;     &amp;lt;add header="X-User-Agent: redsonic"/&amp;gt;&lt;br /&gt;   &amp;lt;/custom-http-headers&amp;gt;&lt;br /&gt;&lt;br /&gt;   &amp;lt;manufacturerURL&amp;gt;redsonic.com&amp;lt;/manufacturerURL&amp;gt;&lt;br /&gt;   &amp;lt;modelNumber&amp;gt;105&amp;lt;/modelNumber&amp;gt;&lt;br /&gt;   --&amp;gt;&lt;br /&gt;   &amp;lt;!-- Uncomment the line below if you have a Telegent TG100 --&amp;gt;&lt;br /&gt;   &amp;lt;!--&lt;br /&gt;      &amp;lt;upnp-string-limit&amp;gt;101&amp;lt;/upnp-string-limit&amp;gt;&lt;br /&gt;   --&amp;gt;&lt;br /&gt; &amp;lt;/server&amp;gt;&lt;br /&gt; &amp;lt;import hidden-files="no"&amp;gt;&lt;br /&gt;   &amp;lt;scripting script-charset="UTF-8"&amp;gt;&lt;br /&gt;     &amp;lt;common-script&amp;gt;/usr/share/mediatomb/js/common.js&amp;lt;/common-script&amp;gt;&lt;br /&gt;     &amp;lt;playlist-script&amp;gt;/usr/share/mediatomb/js/playlists.js&amp;lt;/playlist-script&amp;gt;&lt;br /&gt;     &amp;lt;virtual-layout type="builtin"&amp;gt;&lt;br /&gt;       &amp;lt;import-script&amp;gt;/usr/share/mediatomb/js/import.js&amp;lt;/import-script&amp;gt;&lt;br /&gt;     &amp;lt;/virtual-layout&amp;gt;&lt;br /&gt;   &amp;lt;/scripting&amp;gt;&lt;br /&gt;   &amp;lt;mappings&amp;gt;&lt;br /&gt;     &amp;lt;extension-mimetype ignore-unknown="no"&amp;gt;&lt;br /&gt;       &amp;lt;map from="mp3" to="audio/mpeg"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="ogg" to="application/ogg"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="asf" to="video/x-ms-asf"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="asx" to="video/x-ms-asf"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="wma" to="audio/x-ms-wma"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="wax" to="audio/x-ms-wax"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="wmv" to="video/x-ms-wmv"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="wvx" to="video/x-ms-wvx"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="wm" to="video/x-ms-wm"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="wmx" to="video/x-ms-wmx"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="m3u" to="audio/x-mpegurl"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="pls" to="audio/x-scpls"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="flv" to="video/x-flv"/&amp;gt;&lt;br /&gt;       &amp;lt;!-- Uncomment the line below for PS3 divx support --&amp;gt;&lt;br /&gt;       &amp;lt;map from="avi" to="video/divx"/&amp;gt;&lt;br /&gt;       &amp;lt;!-- Uncomment the line below for D-Link DSM / ZyXEL DMA-1000 --&amp;gt;&lt;br /&gt;       &amp;lt;!-- &amp;lt;map from="avi" to="video/avi"/&amp;gt; --&amp;gt;&lt;br /&gt;     &amp;lt;/extension-mimetype&amp;gt;&lt;br /&gt;     &amp;lt;mimetype-upnpclass&amp;gt;&lt;br /&gt;       &amp;lt;map from="audio/*" to="object.item.audioItem.musicTrack"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="video/*" to="object.item.videoItem"/&amp;gt;&lt;br /&gt;       &amp;lt;map from="image/*" to="object.item.imageItem"/&amp;gt;&lt;br /&gt;     &amp;lt;/mimetype-upnpclass&amp;gt;&lt;br /&gt;     &amp;lt;mimetype-contenttype&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="audio/mpeg" as="mp3"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="application/ogg" as="ogg"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="audio/x-flac" as="flac"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="image/jpeg" as="jpg"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="audio/x-mpegurl" as="playlist"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="audio/x-scpls" as="playlist"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="audio/x-wav" as="pcm"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="audio/L16" as="pcm"/&amp;gt;&lt;br /&gt;       &amp;lt;treat mimetype="video/x-msvideo" as="avi"/&amp;gt;&lt;br /&gt;     &amp;lt;/mimetype-contenttype&amp;gt;&lt;br /&gt;   &amp;lt;/mappings&amp;gt;&lt;br /&gt; &amp;lt;/import&amp;gt;&lt;br /&gt; &amp;lt;transcoding enabled="yes"&amp;gt;&lt;br /&gt;   &amp;lt;mimetype-profile-mappings&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype="video/x-flv" using="vlcmpeg"/&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype="application/ogg" using="vlcmpeg"/&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype="application/ogg" using="oggflac2raw"/&amp;gt;&lt;br /&gt;     &amp;lt;transcode mimetype="audio/x-flac" using="oggflac2raw"/&amp;gt;&lt;br /&gt;   &amp;lt;/mimetype-profile-mappings&amp;gt;&lt;br /&gt;   &amp;lt;profiles&amp;gt;&lt;br /&gt;     &amp;lt;profile name="oggflac2raw" enabled="no" type="external"&amp;gt;&lt;br /&gt;       &amp;lt;mimetype&amp;gt;audio/L16&amp;lt;/mimetype&amp;gt;&lt;br /&gt;       &amp;lt;accept-url&amp;gt;no&amp;lt;/accept-url&amp;gt;&lt;br /&gt;       &amp;lt;first-resource&amp;gt;yes&amp;lt;/first-resource&amp;gt;&lt;br /&gt;       &amp;lt;accept-ogg-theora&amp;gt;no&amp;lt;/accept-ogg-theora&amp;gt;&lt;br /&gt;       &amp;lt;agent command="ogg123" arguments="-d raw -f %out %in"/&amp;gt;&lt;br /&gt;       &amp;lt;buffer size="1048576" chunk-size="131072" fill-size="262144"/&amp;gt;&lt;br /&gt;     &amp;lt;/profile&amp;gt;&lt;br /&gt;     &amp;lt;profile name="vlcmpeg" enabled="yes" type="external"&amp;gt;&lt;br /&gt;       &amp;lt;mimetype&amp;gt;video/mpeg&amp;lt;/mimetype&amp;gt;&lt;br /&gt;       &amp;lt;accept-url&amp;gt;yes&amp;lt;/accept-url&amp;gt;&lt;br /&gt;       &amp;lt;first-resource&amp;gt;yes&amp;lt;/first-resource&amp;gt;&lt;br /&gt;       &amp;lt;accept-ogg-theora&amp;gt;yes&amp;lt;/accept-ogg-theora&amp;gt;&lt;br /&gt;       &amp;lt;agent command="vlc" arguments="-I dummy %in --sout #transcode{venc=ffmpeg,vcodec=mp2v,vb=4096,fps=25,aenc=ffmpeg,acodec=mpga,ab=192,samplerate=44100,channels=2}:standard{access=file,mux=ps,dst=%out} vlc:quit"/&amp;gt;&lt;br /&gt;       &amp;lt;buffer size="14400000" chunk-size="512000" fill-size="120000"/&amp;gt;&lt;br /&gt;     &amp;lt;/profile&amp;gt;&lt;br /&gt;   &amp;lt;/profiles&amp;gt;&lt;br /&gt; &amp;lt;/transcoding&amp;gt;&lt;br /&gt;&amp;lt;/config&amp;gt;&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;The associated &lt;span style="font-style: italic;"&gt;before&lt;/span&gt; and &lt;span style="font-style: italic;"&gt;after&lt;/span&gt; &lt;span style="font-weight: bold;"&gt;config.xml&lt;/span&gt; files are available at &lt;a href="http://robertpyke.com/mediatombTutorial1.html"&gt;robertpyke.com&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7680681593476647517-6132243878299167797?l=robertpyke.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://robertpyke.blogspot.com/feeds/6132243878299167797/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=7680681593476647517&amp;postID=6132243878299167797' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/6132243878299167797'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7680681593476647517/posts/default/6132243878299167797'/><link rel='alternate' type='text/html' href='http://robertpyke.blogspot.com/2008/07/ubuntu-mediatomb-vlc-and-ps3-match-made.html' title='Ubuntu, Mediatomb, VLC and the PS3 - a match made in heaven.'/><author><name>Robert Pyke</name><uri>http://www.blogger.com/profile/03780469777703496199</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='28' height='32' src='http://3.bp.blogspot.com/_jITuYk5mPQI/SeyGS4KR4YI/AAAAAAAAACA/yMZN19toJN0/S220/n650402822_1739354_7102218.jpg'/></author><thr:total>10</thr:total></entry></feed>
