<?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>biotext.org.uk</title>
	<atom:link href="http://biotext.org.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://biotext.org.uk</link>
	<description>Not a typewriter</description>
	<lastBuildDate>Wed, 17 Feb 2010 14:01:08 +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>Solr presentation slides available</title>
		<link>http://biotext.org.uk/solr-presentation-slides-available/</link>
		<comments>http://biotext.org.uk/solr-presentation-slides-available/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 14:01:08 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Announcements]]></category>
		<category><![CDATA[biogeeks]]></category>
		<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[karyodas]]></category>
		<category><![CDATA[solr]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=432</guid>
		<description><![CDATA[Tomorrow I&#8217;m giving a London BioGeeks talk about Solr, the Lucene-based search engine we&#8217;re using at CATH, and soon Smesh too.
The slides are available here (PDF, 500KB).
If you&#8217;re in London, come along, everyone&#8217;s welcome. Details here. We also have Manuel Corpas on KaryoDAS, and Phil Dawes on Git. And beer afterwards.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://biogeeks.wordpress.com/2010/01/07/february-tech-meet/">Tomorrow</a> I&#8217;m giving a <a href="http://groups.google.com/group/londonbiogeeks">London BioGeeks</a> talk about <a href="http://lucene.apache.org/solr/">Solr</a>, the <a href="http://lucene.apache.org/">Lucene</a>-based search engine we&#8217;re using at <a href="http://www.cathdb.info/">CATH</a>, and soon <a href="http://smeshup.com/">Smesh</a> too.</p>
<p><a href="/static/biogeeks_solr_feb10.pdf">The slides are available here (PDF, 500KB).</a></p>
<p>If you&#8217;re in London, come along, everyone&#8217;s welcome. Details <a href="http://biogeeks.wordpress.com/2010/01/07/february-tech-meet/">here</a>. We also have <a href="http://manuelcorpas.com/">Manuel Corpas</a> on <a href="https://decipher.sanger.ac.uk/karyodas/display.html">KaryoDAS</a>, and <a href="http://www.phildawes.net/blog/">Phil Dawes</a> on <a href="http://git-scm.com/">Git</a>. And <a href="http://www.theprinceregentgloucesterroad.co.uk/">beer</a> afterwards.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/solr-presentation-slides-available/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Echoes of the past</title>
		<link>http://biotext.org.uk/echoes-of-the-past/</link>
		<comments>http://biotext.org.uk/echoes-of-the-past/#comments</comments>
		<pubDate>Thu, 31 Dec 2009 19:59:21 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Microposts]]></category>
		<category><![CDATA[history]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=430</guid>
		<description><![CDATA[In reflective mood, because it&#8217;s the end of the year, and prompted by some biographical reminiscences on Charlie Stross&#8217;s blog, I just found the contact details for my FidoNet BBS in an old nodelist from 1995.
Happy new year, everyone.
]]></description>
			<content:encoded><![CDATA[<p>In reflective mood, because it&#8217;s the end of the year, and prompted by some biographical reminiscences on <a href="http://www.antipope.org/charlie/blog-static/2009/06/how_i_got_here_in_the_end_part_4.html">Charlie Stross&#8217;s blog</a>, I just found the contact details for my <a href="http://en.wikipedia.org/wiki/FidoNet">FidoNet</a> BBS in <a href="http://www.textfiles.com/fidonet-on-the-internet/n1995/nodelist.363">an old nodelist from 1995</a>.</p>
<p>Happy new year, everyone.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/echoes-of-the-past/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to make sure your media disk is mounted before starting iTunes</title>
		<link>http://biotext.org.uk/how-to-make-sure-your-media-disk-is-mounted-before-starting-itunes/</link>
		<comments>http://biotext.org.uk/how-to-make-sure-your-media-disk-is-mounted-before-starting-itunes/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 22:25:35 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[OS X]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=427</guid>
		<description><![CDATA[This is an Apple Annoyance that&#8217;s been bugging me for a while &#8212; if your iTunes library is on an external HD, and you start iTunes without it mounted, the bloody thing can seriously mangle its own library index (under Tiger at least).
So I&#8217;ve replaced my iTunes Dock icon with a little AppleScript that checks [...]]]></description>
			<content:encoded><![CDATA[<p>This is an Apple Annoyance that&#8217;s been bugging me for a while &#8212; if your iTunes library is on an external HD, and you start iTunes without it mounted, the bloody thing can seriously mangle its own library index (under Tiger at least).</p>
<p>So I&#8217;ve replaced my iTunes Dock icon with a little AppleScript that checks whether said disk is mounted first:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;Finder&quot;</span>
	<span style="color: #ff0033; font-weight: bold;">if</span> <span style="color: #0066ff;">exists</span> <span style="color: #000000;">&#40;</span><span style="color: #0066ff;">disk</span> <span style="color: #009900;">&quot;LaCie&quot;</span><span style="color: #000000;">&#41;</span> <span style="color: #ff0033; font-weight: bold;">then</span>
		<span style="color: #ff0033; font-weight: bold;">tell</span> <span style="color: #0066ff;">application</span> <span style="color: #009900;">&quot;iTunes&quot;</span> <span style="color: #ff0033; font-weight: bold;">to</span> <span style="color: #0066ff;">activate</span>
	<span style="color: #ff0033; font-weight: bold;">else</span>
		<span style="color: #0066ff;">display dialog</span> <span style="color: #009900;">&quot;Don't start iTunes without LaCie external disk mounted.&quot;</span> <span style="color: #0066ff;">buttons</span> <span style="color: #000000;">&#123;</span><span style="color: #009900;">&quot;OK&quot;</span><span style="color: #000000;">&#125;</span> default button <span style="color: #000000;">1</span> <span style="color: #ff0033; font-weight: bold;">with</span> title <span style="color: #009900;">&quot;Cannot start iTunes&quot;</span> <span style="color: #ff0033; font-weight: bold;">with</span> icon stop
	<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">if</span>
<span style="color: #ff0033; font-weight: bold;">end</span> <span style="color: #ff0033; font-weight: bold;">tell</span></pre></td></tr></table></div>

<p>Compile, save as script, add to dock, bingo. (Obviously, replace <code>LaCie</code> with the name of your external HD, as it appears in <code>/Volumes</code> when mounted.)</p>
<p>For extra points, you can give it iTunes&#8217; icon too. Just get Info on iTunes and select the little icon in the top left (not the big one under Preview). Then just cmd-c, select the same icon in the script&#8217;s info window, and cmd-v.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/how-to-make-sure-your-media-disk-is-mounted-before-starting-itunes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Help! Eclipse won’t believe I have Maven 2.2.1</title>
		<link>http://biotext.org.uk/help-eclipse-won%e2%80%99t-believe-i-have-maven-2-2-1/</link>
		<comments>http://biotext.org.uk/help-eclipse-won%e2%80%99t-believe-i-have-maven-2-2-1/#comments</comments>
		<pubDate>Thu, 26 Nov 2009 19:25:57 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Questions]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=423</guid>
		<description><![CDATA[I have a project (built from an AppFuse template) that requires Maven 2.2.1. So I upgraded to this (from 2.1.0) and set my path and my M2_HOME and MAVEN_HOME env variables.
Then I ran mvn eclipse:eclipse and imported the project into Eclipse (Galileo).
However, in the problems list for the project (and at the top of the [...]]]></description>
			<content:encoded><![CDATA[<p>I have a project (built from an AppFuse template) that requires Maven 2.2.1. So I upgraded to this (from 2.1.0) and set my path and my M2_HOME and MAVEN_HOME env variables.</p>
<p>Then I ran mvn eclipse:eclipse and imported the project into Eclipse (Galileo).</p>
<p>However, in the problems list for the project (and at the top of the pom.xml GUI editor) it says:</p>
<blockquote><p>Unable to build project &#8216;/export/people/clegg/data/GanymedeWorkspace/funcserve/pom.xml; it requires Maven version 2.2.1</p></blockquote>
<p>This persists whether I set Eclipse to use its Embedded Maven implementation, or the external 2.2.1 installation, in the Preferences -> Maven -> Installations dialog.</p>
<p>I&#8217;ve tried closing and reopening the project, reindexing the repository, cleaning the project, restarting the IDE, logging out and back in again, everything I can think of! But Eclipse still won&#8217;t believe I have Maven 2.2.1.</p>
<p>I just did a plugin update so I have the latest version of Maven Integration for Eclipse &#8212; 0.9.8.200905041414.</p>
<p>Does anyone know how to convince Eclipse I really do have the right version of Maven? It&#8217;s like it&#8217;s recorded the previous version somewhere else and won&#8217;t pay any attention to my changes <img src='http://biotext.org.uk/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>If you have any clue whatsoever &#8212; <a href="http://stackoverflow.com/questions/1805274/eclipse-wont-believe-i-have-maven-2-2-1">please drop an answer here</a>&#8230;</p>
<p>Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/help-eclipse-won%e2%80%99t-believe-i-have-maven-2-2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MacBook keyboard hacks for # (hash/pound/numbersign)</title>
		<link>http://biotext.org.uk/macbook-keyboard-hacks-for-hash-pound-numbersign/</link>
		<comments>http://biotext.org.uk/macbook-keyboard-hacks-for-hash-pound-numbersign/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 14:32:09 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[keyboard]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[VirtualBox]]></category>
		<category><![CDATA[X11]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=412</guid>
		<description><![CDATA[One of the few annoying things about my oldish MacBook Pro is its keyboard, for example a few unresponsive keys, but particularly the lack of a # key. It&#8217;s a UK keyboard, and has £ for shift-3, and # is hidden in alt-3 (not labelled).
This is fine in native desktop apps, but less fine in [...]]]></description>
			<content:encoded><![CDATA[<p>One of the few annoying things about my oldish MacBook Pro is its keyboard, for example a few unresponsive keys, but particularly the lack of a # key. It&#8217;s a UK keyboard, and has £ for shift-3, and # is hidden in alt-3 (not labelled).</p>
<p>This is fine in native desktop apps, but less fine in some text-mode programs (e.g. vim), when for some reason this often produces a superscript <sup>3</sup> instead.</p>
<p>So I&#8217;ve set up a custom keyboard mapping in iTerm to map F3 to #, which works nicely. <strong>However!</strong></p>
<p>If I&#8217;m SSHed in to a remote Linux machine (or even my local Ubuntu VirtualBox) neither of these keys work in X apps. But, xmodmap (via the config file ~/.Xmodmap) can help. For some reason, Macs all have a dedicated key for these characters &#8212; § and ± &#8212; which <em>no-one</em> ever uses. But with this line in ~/.Xmodmap we can remap it to produce #:</p>
<p>keycode 18=numbersign</p>
<p><strong>UPDATE:</strong> I&#8217;ve found a better way which works pretty much globally&#8230;</p>
<p>Using <a href="http://scripts.sil.org/Ukelele">Ukelele</a> you can copy the British keyboard layout and then remap keys to your heart&#8217;s content. I&#8217;ve moved the § character to the alt-§ key combination, in case I ever need it, and moved the # character to the raw § key. This seems to be respected <em>almost</em> everywhere so I don&#8217;t need to mess around with alt-3 or F3 any more. Joy. It also works over <a href="http://www.jinx.de/JollysFastVNC.html">JollysFastVNC</a> to a remote RealVNC server, which none of the other methods did.</p>
<p>Unfortunately, things still aren&#8217;t perfect. If I actually open a VirtualBox console session into GNOME on the local Ubuntu VM, the pointless § and ± key actually produces &lt; and &gt; so neither of these tricks work. In fact, I can&#8217;t get anything to generate a # even though I have the MacBook Pro Intl keyboard layout selected in GNOME. Any ideas?</p>
<p><strong>UPDATE 2:</strong> YES!! I&#8217;ve finally cracked it for VirtualBox. With the help of the xkeycaps command, I discovered that X the keycodes coming into Ubuntu weren&#8217;t what I thought they were &#8212; somewhere the Mac-ness of the keyboard layout was getting lost. It turned out that the § key was generating keycode 94 instead. So I set up this in .Xmodmap on the Ubuntu VM:</p>
<p>keycode 94=numbersign</p>
<p>Now it works in VirtualBox too. Leave gifts of thanks below <img src='http://biotext.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/macbook-keyboard-hacks-for-hash-pound-numbersign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Penhayl Cottage website &#8212; design notes</title>
		<link>http://biotext.org.uk/penhayl-cottage-website-design-notes/</link>
		<comments>http://biotext.org.uk/penhayl-cottage-website-design-notes/#comments</comments>
		<pubDate>Sat, 17 Oct 2009 14:16:14 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[Penhayl]]></category>
		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=403</guid>
		<description><![CDATA[The website is now live for Penhayl Cottage, a self-catering holiday cottage in Cornwall, run by my family. I&#8217;m not much of a web designer, but thankfully there&#8217;s a lot of free tools around these days that make it easy for an amateur to do a decent-looking job.
The layout was based on a free stylesheet [...]]]></description>
			<content:encoded><![CDATA[<p>The website is now live for <a href="http://www.penhayl-cottage-cornwall.co.uk/index.html">Penhayl Cottage, a self-catering holiday cottage in Cornwall</a>, run by my family. I&#8217;m not much of a web designer, but thankfully there&#8217;s a lot of free tools around these days that make it easy for an amateur to do a decent-looking job.</p>
<p>The layout was based on a free stylesheet from <a href="http://www.free-css.com/free-css-templates/page3/raindrop.php">Free CSS</a> which a great resource for the design-impaired like me. The image gallery on the right side uses a neat Javascript library called <a href="http://www.huddletogether.com/projects/lightbox2/">Lightbox2</a>.</p>
<p>The Google Map doesn&#8217;t use any fancy techniques like their Javascript API or anything. It&#8217;s just embedded in an iframe. <a href="http://mapki.com/wiki/Google_Map_Parameters">This page</a> was very useful in getting the URL parameters right for the marker and the zoom level.</p>
<p>The Flash video player is a very flexible open-source app called <a href="http://flowplayer.org/">Flowplayer</a>, and I used <a href="http://ffmpeg.org/">ffmpeg</a> to convert the original MPEGs into FLVs to play in it.</p>
<p>I used the oldish version of iMovie that came with my Mac to compose the video clips into a single long movie for the downloadable versions, and to export the H.264 m4v version for the iPhone, although apparently there&#8217;s other tools like <a href="http://www.macupdate.com/info.php/id/19769">iSquint</a> that can also do this. Incidentally, iMovie is a bit weird about file formats &#8212; it wouldn&#8217;t open the mpeg files which came from the original DV camera but arrived on a CD-ROM. It will happily open the same format if you plug the camera in directly, but the camera was in Cornwall and I&#8217;m in London. Thanks Apple. Fortunately, <a href="http://www.dvinfo.net/forum/jvc-everio-gz-hd-gz-hm-series/121322-another-imovie-08-thread.html">this thread</a> explains how you can fool it into thinking a disk image containing the files is actually a plugged-in device.</p>
<p>I also used ffmpeg to transcode the m4v back into an mpeg-1. The results aren&#8217;t especially pretty but it will play on most players out there, and anyway, this is just a backup plan for non-Flash-users.</p>
<p>Andrew.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/penhayl-cottage-website-design-notes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to pull fields from MEDLINE the easy way</title>
		<link>http://biotext.org.uk/how-to-pull-fields-from-medline-the-easy-way/</link>
		<comments>http://biotext.org.uk/how-to-pull-fields-from-medline-the-easy-way/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 17:05:40 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[medline]]></category>
		<category><![CDATA[publishing]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=398</guid>
		<description><![CDATA[In response to this thread on FriendFeed&#8230;

curl -s 'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&#38;id=19614587&#38;retmode=text&#38;rettype=medline'&#124;egrep '^(MH &#124;DP )'

This will pull all the MeSH keywords and the date of publication from the article with PubMed ID 19614587. Stripping the field codes from the response is left as an exercise to the reader (but can be done trivially with a Unix command line [...]]]></description>
			<content:encoded><![CDATA[<p>In response to <a href="http://friendfeed.com/the-life-scientists/b1fbd948/i-am-looking-for-simple-option-to-retrieve-mesh">this thread on FriendFeed</a>&#8230;</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">-s</span> <span style="color: #ff0000;">'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&amp;id=19614587&amp;retmode=text&amp;rettype=medline'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #ff0000;">'^(MH |DP )'</span></pre></div></div>

<p>This will pull all the MeSH keywords and the date of publication from the article with PubMed ID 19614587. Stripping the field codes from the response is left as an exercise to the reader (but can be done trivially with a Unix command line utility).</p>
<p>Or for multiple documents, just use comma-separated IDs:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">curl <span style="color: #660033;">-s</span> <span style="color: #ff0000;">'http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&amp;id=11877539,11822933,11871444&amp;retmode=text&amp;rettype=medline'</span><span style="color: #000000; font-weight: bold;">|</span><span style="color: #c20cb9; font-weight: bold;">egrep</span> <span style="color: #ff0000;">'^(PMID-|MH |DP )'</span></pre></div></div>

<p>In this case it&#8217;s good to include the PubMed ID in the results so you know which values come from which doc.</p>
<p>There&#8217;s <a href="http://www.nlm.nih.gov/bsd/mms/medlineelements.html">a full list of the MEDLINE field codes here</a>, and <a href="http://www.ncbi.nlm.nih.gov/corehtml/query/static/efetchlit_help.html">the docs for efetch are here</a>.</p>
<p>If you want to actually search by content, try <a href="http://www.ncbi.nlm.nih.gov/corehtml/query/static/esearch_help.html">esearch</a>, which will return a list of IDs you can send to efetch.</p>
<p>For simple queries like this, XML is totally overkill.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/how-to-pull-fields-from-medline-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding the dimensions of a PostScript image</title>
		<link>http://biotext.org.uk/finding-the-dimensions-of-a-postscript-image/</link>
		<comments>http://biotext.org.uk/finding-the-dimensions-of-a-postscript-image/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 16:35:22 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[graphics]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[publishing]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=387</guid>
		<description><![CDATA[If I have images in .ps or .eps format, how can I tell how big they are? i.e. how big would they print out at &#8216;natural&#8217; size without any scaling?
If they have a correct bounding box defined &#8212; more likely with EPS than PS files &#8212; this bit of Perl will show you the width [...]]]></description>
			<content:encoded><![CDATA[<p>If I have images in .ps or .eps format, how can I tell how big they are? i.e. how big would they print out at &#8216;natural&#8217; size without any scaling?</p>
<p>If they have a correct bounding box defined &#8212; more likely with EPS than PS files &#8212; this bit of Perl will show you the width and height in cm:</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/env perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> warnings<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Usage: measure.pl &lt;postscript-file&gt;</span>
<span style="color: #666666; font-style: italic;"># Or send it some data on stdin.</span>
<span style="color: #666666; font-style: italic;"># Assuming the BBox is correct, it'll tell you the </span>
<span style="color: #666666; font-style: italic;"># dimensions in cm.</span>
&nbsp;
<span style="color: #b1b100;">while</span><span style="color: #009900;">&#40;</span> <span style="color: #000066;">defined</span> <span style="color: #009900;">&#40;</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&amp;lt</span><span style="color: #339933;">;</span><span style="color: #0000ff;">&amp;gt</span><span style="color: #339933;">;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$line</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/^%%BoundingBox:\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)/</span> <span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">my</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$llx</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$lly</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$urx</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$ury</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">$1</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$2</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$3</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$4</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$x_pts</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$urx</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">$llx</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$y_pts</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$ury</span> <span style="color: #339933;">-</span> <span style="color: #0000ff;">$lly</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$x_in</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$x_pts</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">72</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$y_in</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$y_pts</span> <span style="color: #339933;">/</span> <span style="color: #cc66cc;">72</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$x_cm</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$x_in</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2.54</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$y_cm</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$y_in</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2.54</span><span style="color: #339933;">;</span>
        <span style="color: #000066;">printf</span> <span style="color: #ff0000;">&quot;%.1f %.1f<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$x_cm</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">$y_cm</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">last</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Dead handy when preparing images for a paper.</p>
<p>PS if you are hazy about the difference between PS and EPS &#8212; like me &#8212; have a look at <a href="http://www.tailrecursive.org/postscript/eps.html">this article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/finding-the-dimensions-of-a-postscript-image/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Awesome ways to save audio streams for future listening</title>
		<link>http://biotext.org.uk/awesome-ways-to-save-audio-streams-for-future-listening/</link>
		<comments>http://biotext.org.uk/awesome-ways-to-save-audio-streams-for-future-listening/#comments</comments>
		<pubDate>Tue, 25 Aug 2009 14:16:46 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Tips]]></category>
		<category><![CDATA[audio]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=383</guid>
		<description><![CDATA[For a start, you can use mplayer to save the stream to a local disk:
mplayer -bandwidth 10000000000 -cache 32 -dumpstream -dumpfile output_file.ra 'rtsp://some.server/some_stream'
The huge bandwidth parameter will make sure that no throttling happens (at the client side anyway) &#8212; i.e. you can download hours of audio in a few seconds.
The dumpstream parameter writes the stream [...]]]></description>
			<content:encoded><![CDATA[<p>For a start, you can use <a href="http://www.mplayerhq.hu/">mplayer</a> to save the stream to a local disk:</p>
<p><code>mplayer -bandwidth 10000000000 -cache 32 -dumpstream -dumpfile output_file.ra 'rtsp://some.server/some_stream'</code></p>
<p>The huge bandwidth parameter will make sure that no throttling happens (at the client side anyway) &#8212; i.e. you can download hours of audio in a few seconds.</p>
<p>The dumpstream parameter writes the stream out byte-for-byte in the format it arrives in, e.g. RealAudio in the example above. But you can use <a href="http://ffmpeg.org/">ffmpeg</a> to decode a RealAudio stream into a wav, and <a href="http://lame.sourceforge.net/">lame</a> to re-encode it as an mp3, on-the-fly:</p>
<p><code>ffmpeg -i output_file.ra -f wav - | lame - output_file.mp3</code></p>
<p>N.B. That can be quite processor-intensive, but hey, what&#8217;s dual-core for??</p>
<p>ffmpeg will tell you what the bitrate of the stream is, so you can use lame&#8217;s -b switch to make sure you&#8217;re not re-encoding it at a vastly higher quality than it&#8217;s actually capable of.</p>
<p>e.g. for spoken word:</p>
<p><code>ffmpeg -i output_file.ra -f wav - | lame -b 64 -f - output_file.mp3</code></p>
<p>(-f = fast mode, slightly quicker encoding for less quality per bit)</p>
<p>Or if you&#8217;re feeling especially boffiny, use a named pipe so you don&#8217;t have to save the original stream to the hard disk:</p>
<p>&#8230; which is apparently possible but I haven&#8217;t got it to work yet. If you know how, leave a comment before I figure it out <img src='http://biotext.org.uk/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Andrew.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/awesome-ways-to-save-audio-streams-for-future-listening/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>London bio people &#8212; pub tonight</title>
		<link>http://biotext.org.uk/london-bio-people-pub-tonight/</link>
		<comments>http://biotext.org.uk/london-bio-people-pub-tonight/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 10:27:55 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biotext.org.uk/?p=380</guid>
		<description><![CDATA[The biogeeks are getting together again at The Miller from 6ish tonight. All are welcome.
]]></description>
			<content:encoded><![CDATA[<p>The <a href="http://groups.google.com/group/londonbiogeeks">biogeeks</a> are <a href="http://biogeeks.wordpress.com/2009/07/28/social/">getting together again</a> at <a href="http://www.themiller.co.uk/">The Miller</a> from 6ish tonight. All are welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://biotext.org.uk/london-bio-people-pub-tonight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
