<?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>Marios Braindump &#187; english</title>
	<atom:link href="http://www.mfasold.net/blog/tag/english/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mfasold.net/blog</link>
	<description>Just shouting my thoughts out</description>
	<lastBuildDate>Tue, 01 Mar 2011 12:27:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Place an image into an R plot</title>
		<link>http://www.mfasold.net/blog/2011/01/place-an-image-into-a-r-plot/</link>
		<comments>http://www.mfasold.net/blog/2011/01/place-an-image-into-a-r-plot/#comments</comments>
		<pubDate>Thu, 06 Jan 2011 18:01:11 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=495</guid>
		<description><![CDATA[There a basically two options on how to place arbitrary images as a point symbol into a plot in R. If you want to use a raster images such as GIF, JPG or BMP, opt for the &#8220;pixmap&#8221; package.  You will have to convert your image into the PPM format and then use the &#8220;add_logo&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>There a basically two options on how to place arbitrary images as a point symbol into a plot in R. If you want to use a raster images such as GIF, JPG or BMP, opt for the &#8220;pixmap&#8221; package.  You will have to convert your image into the PPM format and then use the &#8220;add_logo&#8221; function of the package. An example usage is given <a href="http://www.mail-archive.com/r-help@r-project.org/msg78261.html">here</a> or <a href="http://rwiki.sciviews.org/doku.php?id=tips:graphics-grid:displaybitmap">here</a>. However, the result will often not render nicely.</p>
<p>An alternative is to import vector graphics such as SVG or PS using the &#8220;grImport&#8221; package (<a href="http://cran.r-project.org/web/packages/grImport/vignettes/import.pdf">Vignette</a>). Suppose you have a postscript graphics named &#8220;candle.ps&#8221; (if you have an SVG graphics, then use e.g. Inkscape to convert SVG to PS), the following gives the desired plot:</p>
<blockquote><p><code>## Read postscript<br />
library(grImport)<br />
PostScriptTrace("candle.ps")<br />
ca = readPicture("candle.ps.xml")</code></p>
<p><code>## Set up some points and set background color<br />
library(lattice)<br />
library(grid)<br />
N = 22; x = seq(9,N*10,9); y = rnorm(N, 40, 30)<br />
trellis.par.set("background", list(col = "#380000"))</code></p>
<p><code>## Plot with lattice function<br />
xyplot(y~x , xlim=c(0, 9*N + 5), ylim=c(20,100),<br />
panel = function(x, y, ...) {<br />
grid.symbols(ca, x, y, units = "native", size = unit(13, "mm"))})</code></p></blockquote>
<p>The result could look like this:</p>
<div class="mceTemp">
<dl id="attachment_510" class="wp-caption alignleft" style="width: 460px;">
<dt class="wp-caption-dt"><img class="size-medium wp-image-510" title="CandlePlot" src="http://www.mfasold.net/blog/wp-content/uploads/CandlePlot1Smaller-450x202.png" alt="Candle Plot" width="450" height="202" /></dt>
</dl>
</div>
<p>Please note two things. First, postscript does not support transparency. It might be necessary that you replace transparent colors with solid colors using Inkscape, for example. Furthermore, grImport does not paint on the default &#8220;base&#8221; graphics system (functions like plot, hist), but only on the &#8220;grid&#8221; graphics system. Therefore we use &#8220;lattice&#8221; to produce graphics, as the package utilizes grid graphics. <a href="http://www.r-project.org/user-2006/Slides/Murrell.pdf">These slides</a> from package creator Paul Murell are an helpful further reading.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2011/01/place-an-image-into-a-r-plot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Best Free Offline Maps Application for Android</title>
		<link>http://www.mfasold.net/blog/2010/09/best-free-offline-maps-application-for-android/</link>
		<comments>http://www.mfasold.net/blog/2010/09/best-free-offline-maps-application-for-android/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 21:14:12 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[maps]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=472</guid>
		<description><![CDATA[I wanted to use my Android device for GPS offline mapping to avoid paying excessive roaming fees abroad. It turned out that is not only difficult to filter the appropriate maps app out of dozens which are available on the Android Market (an overview is given here), but also that there are only few usable [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to use my Android device for GPS offline mapping to avoid paying excessive roaming fees abroad. It turned out that is not only difficult to filter the appropriate maps app out of dozens which are available on the Android Market (an overview is given <a href="http://wiki.openstreetmap.org/wiki/Android">here</a>), but also that there are only few usable solutions. Usable means: simple, fast and bug-free. Here is what I recommend.</p>
<p>As far as I know, there is only a single free app which you can just install and go: <em>MapDroyd</em>. After installing you select the regions for which you want offline maps. The program then downloads them automatically. The app uses its own format for Maps (MicroMap Format) optimized for mobile devices. Since it uses vectorized data the maps are not large. However, the program only shows the map &#8211; no navigation nor POIs. If you are willing to pay a few dollars, there is a version supporting navigation called<em> NavDroyd</em>.</p>
<p>If you want both for free, you should opt for <em>OsmAnd</em>. It provides navigation, search for addresses and POIs. The latter can be downloaded from within the program. The drawback is that you have to create the maps manually and load them on your android device beforehand (<a href="http://code.google.com/p/osmand/wiki/HowToArticles#How_To_Download_data">HowTo</a>). You can use the free tool <a href="http://mobac.dnsalias.org/">MobileAtlasCreator</a> to do so. Also download <a href="http://files.zentus.com/sqlitejdbc/sqlitejdbc-v056.jar">this</a> Java Library and store it in the same directory as the Creator. The program lets you select the area which you want the maps for as well as the source of the mapping data (OSM Mapnik recommended). Since it uses tiled images which have to be created for different zoom levels, maps tend to be much larger than for vectorized data.  I used zoom levels 0 to 16. Note that the size of zoom level 16 images is bigger than 0 to 15 together and that OsmAnd interpolates +2 zoomlevels from a smaller one. Do not forget to press <em>Add Selection</em> in the MobileAtlasCreator and to select <em>Big Planet Tracks SQLite</em> Format &#8211; it will save you huge amounts of effective space  on the SD card. Warning: Map download and creation will probably take up to some hours, depending on the map size.</p>
<p>There is one free App that can do above using vectorized maps, <em>Navit</em>, but it is not available on the market yet and must be inconveniently installed by hand (german instructions <a href="http://tuxanddroid.de/android/kostenlose-offline-navigation-auf-android-mit-navit">here</a>).</p>
<p>Note: I will update this post after having used both tools abroad.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2010/09/best-free-offline-maps-application-for-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Latticist Package for R</title>
		<link>http://www.mfasold.net/blog/2010/07/the-latticist-package-for-r/</link>
		<comments>http://www.mfasold.net/blog/2010/07/the-latticist-package-for-r/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 14:21:16 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[R]]></category>
		<category><![CDATA[research]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=435</guid>
		<description><![CDATA[One of my dear readers, C S,  has pointed out to me the R package latticist. In the beginning I was sceptical, since the package is merely more than an interface to existing visualization routines. However, I now consider it astonishingly useful and use it almost every day. The reason is simple: Getting an intial [...]]]></description>
			<content:encoded><![CDATA[<p>One of my dear readers, <a href="http://r-chart.blogspot.com/">C S</a>,  has pointed out to me the R package <a href="http://code.google.com/p/latticist/">latticist</a>. In the beginning I was sceptical, since the package is merely more than an interface to existing visualization routines. However, I now consider it astonishingly useful and use it almost every day. The reason is simple: Getting an intial glimpse onto a large set of multivariate data is tedious in R, due to the command line interface. With latticist, you get an instant overview over all variables of interest and it allows you to quickly dive into details by selecting subgroups and to look at potential correlations. Recommended.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2010/07/the-latticist-package-for-r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Organization Advice</title>
		<link>http://www.mfasold.net/blog/2010/06/project-organization-advice/</link>
		<comments>http://www.mfasold.net/blog/2010/06/project-organization-advice/#comments</comments>
		<pubDate>Tue, 08 Jun 2010 19:41:14 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[research]]></category>
		<category><![CDATA[scripting]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=432</guid>
		<description><![CDATA[Have you ever had the problem of re-finding how you created this particular image or that specific result of your recent bioinformatics project? I did, and not only once.  In his article &#8220;A quick guide to organizing computational biology projects&#8220;, the distinguished scientist William S. Noble gives great advice on how to organize a research [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever had the problem of re-finding how you created this particular image or that specific result of your recent bioinformatics project? I did, and not only once.  In his article &#8220;<a href="http://www.ploscompbiol.org/article/info%3Adoi%2F10.1371%2Fjournal.pcbi.1000424">A quick guide to organizing computational biology projects</a>&#8220;, the distinguished scientist William S. Noble gives great advice on how to organize a research project practically. His key suggestions include:</p>
<ul>
<li>use a date-based directory structure for the experiments you perform</li>
<li>keep a lab-notebook containing documentation and code for each experiment (How about Org-mode?)</li>
<li>create generate scripts that work on original data and a general runner script for the complete experiment</li>
</ul>
<p>His work flow is applies mostly to *nix enviroments. One thing I&#8217;d like to add: Use symbolic links! Due to huge amounts of data and backup strategies, it might be impractical to have all the project&#8217;s data in a single directory. Create subdirectories of your data and result directories according to the naming convention and link them to other network drives using the &#8216;ln -s&#8217; command.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2010/06/project-organization-advice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Recipe: Read CSV/TSV Textfiles and Ignore Comment-lines</title>
		<link>http://www.mfasold.net/blog/2010/02/python-recipe-read-csvtsv-textfiles-and-ignore-comment-lines/</link>
		<comments>http://www.mfasold.net/blog/2010/02/python-recipe-read-csvtsv-textfiles-and-ignore-comment-lines/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 15:37:53 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=411</guid>
		<description><![CDATA[Scientific data commonly comes in tab-separated textfile format containing comment lines. What is the best way to read this data? Analogous to the recipe given by skip.montanaro, use a commented file decorator as follows:
import sys, re
import csv
class CommentedFile:
    def __init__(self, f, commentstring="#"):
        self.f = f
 [...]]]></description>
			<content:encoded><![CDATA[<p>Scientific data commonly comes in tab-separated textfile format containing comment lines. What is the best way to read this data? Analogous to the recipe given by <a href="http://bugs.python.org/msg48505">skip.montanaro</a>, use a commented file decorator as follows:</p>
<blockquote><pre>import sys, re
import csv
class CommentedFile:
    def __init__(self, f, commentstring="#"):
        self.f = f
        self.commentstring = commentstring
    def next(self):
        line = self.f.next()
        while line.startswith(self.commentstring):
            line = self.f.next()
        return line
    def __iter__(self):
        return self

tsv_file = csv.reader(CommentedFile(open("inputfile.txt", "rb")),
                      delimiter='\t')
for row in tsv_file:
    print row[2] # prints column 3 of each line</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2010/02/python-recipe-read-csvtsv-textfiles-and-ignore-comment-lines/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A Reload-Button in Adobe Acrobat</title>
		<link>http://www.mfasold.net/blog/2009/12/a-reload-button-in-adobe-acrobat/</link>
		<comments>http://www.mfasold.net/blog/2009/12/a-reload-button-in-adobe-acrobat/#comments</comments>
		<pubDate>Mon, 21 Dec 2009 13:08:27 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=408</guid>
		<description><![CDATA[Read this post about how to reload your pdf document. This is particularly useful when you are creating a new document with LaTeX. Sweet, I was waiting for that functionality.
]]></description>
			<content:encoded><![CDATA[<p>Read <a href="http://www.nonperiodic.net/blog/2009/04/02/reloading-a-file-in-adobe-reader/">this post</a> about how to reload your pdf document. This is particularly useful when you are creating a new document with LaTeX. Sweet, I was waiting for that functionality.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/12/a-reload-button-in-adobe-acrobat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use the new Emacs Daemon!</title>
		<link>http://www.mfasold.net/blog/2009/11/use-the-new-emacs-daemon/</link>
		<comments>http://www.mfasold.net/blog/2009/11/use-the-new-emacs-daemon/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 15:33:22 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=400</guid>
		<description><![CDATA[Emacs usually takes quite some time to fully start up. However, as described in the great blog Emacs-Fu, Emacs 23 can now be started in the background as a daemon. This allows to fire up a new Emacs instance really fast. Thanks djcb!
]]></description>
			<content:encoded><![CDATA[<p>Emacs usually takes quite some time to fully start up. However, as <a href="http://emacs-fu.blogspot.com/2008/12/welcome-to-emacs-fu.html">described</a> in the great blog Emacs-Fu, Emacs 23 can now be started in the background as a daemon. This allows to fire up a new Emacs instance really fast. Thanks djcb!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/11/use-the-new-emacs-daemon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Print Particular Lines of a File Using SED</title>
		<link>http://www.mfasold.net/blog/2009/10/print-particular-lines-of-a-file-using-sed/</link>
		<comments>http://www.mfasold.net/blog/2009/10/print-particular-lines-of-a-file-using-sed/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 17:32:56 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=394</guid>
		<description><![CDATA[Say you want to print the lines 3 and 7, and all lines from 11 to 15 of a text-file. The following SED one-liner will do for you
sed -n -e '3p' -e '7p' -e '11,15p' textfile.txt
]]></description>
			<content:encoded><![CDATA[<p>Say you want to print the lines 3 and 7, and all lines from 11 to 15 of a text-file. The following SED one-liner will do for you</p>
<blockquote><p><code>sed -n -e '3p' -e '7p' -e '11,15p' textfile.txt</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/10/print-particular-lines-of-a-file-using-sed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Anycom Bluetooth USB Adapter on Windows 7</title>
		<link>http://www.mfasold.net/blog/2009/10/anycom-bluetooth-usb-adapter-on-windows-7/</link>
		<comments>http://www.mfasold.net/blog/2009/10/anycom-bluetooth-usb-adapter-on-windows-7/#comments</comments>
		<pubDate>Tue, 06 Oct 2009 19:50:17 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=381</guid>
		<description><![CDATA[For the first time I could personally sense the effects of the economic crisis. The manufacturer of my Bluetooth device ANYCOM USB-200, the Germany-based ITM Technology AG is insolvent. Immediate effect for customers like me: No more driver updates and their general unavailability on the homepage.
Here is the good news for everybody who wants to [...]]]></description>
			<content:encoded><![CDATA[<p>For the first time I could personally sense the effects of the economic crisis. The manufacturer of my Bluetooth device ANYCOM USB-200, the Germany-based ITM Technology AG is insolvent. Immediate effect for customers like me: No more driver updates and their general unavailability on the homepage.</p>
<p>Here is the good news for everybody who wants to use an ANYCOM Bluetooth USB adapter (200, 250, 500) on Windows 7. The Vista driver runs just fine under Windows 7. And I got the driver (	&#8220;anycom-bluetooth-usb200-250-500-vista-v6-1-0-4700.exe&#8221;). If anybody needs it, feel free to send me an email (see <a href="http://www.mfasold.net/blog/about/">About</a>). It may be worth noting that Windows 7 complains about not being able to correctly install Bluetooth devices like a headset (Plantronics Voyager 510 for me), while in fact you you only need the correct driver for the adapter.</p>
<p><em>Update: After brisk demand I decided to allow you to <a href="http://www.mfasold.net/anycom-bluetooth-usb200-250-500-vista-v6-1-0-4700.exe">download the driver</a> directly from this website. Of course, no warranty whatsoever provided.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/10/anycom-bluetooth-usb-adapter-on-windows-7/feed/</wfw:commentRss>
		<slash:comments>19</slash:comments>
		</item>
		<item>
		<title>Working with a List of Tuples in Shell Scripting</title>
		<link>http://www.mfasold.net/blog/2009/10/working-with-a-list-of-tuples-in-shell-scripting/</link>
		<comments>http://www.mfasold.net/blog/2009/10/working-with-a-list-of-tuples-in-shell-scripting/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 13:08:17 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[commandline]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[tech]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=367</guid>
		<description><![CDATA[Several people have recently asked me whether or not it is possible to use tuples in their shell script. One example is running a program with a varying set of parameters. Since they often did not find a good solution, they began to formulate their problem in a higher-level scripting language like Ruby. Surprisingly, you [...]]]></description>
			<content:encoded><![CDATA[<p>Several people have recently asked me whether or not it is possible to use tuples in their shell script. One example is running a program with a varying set of parameters. Since they often did not find a good solution, they began to formulate their problem in a higher-level scripting language like Ruby. Surprisingly, you can accomplish the same task easily with simple shell scripting (supported by bash, zsh,..). Consider the following (semi-stupid) example</p>
<blockquote><p><code>#!/bin/bash<br />
paramset="foo.txt 1 --with-graphics<br />
bar.txt 8 --no-graphics<br />
flock.txt 4 --with-graphics"</code></p>
<p><code>echo "$du" | while read file p1 p2 ; do<br />
     ./myProgram $file -t $p1 --verbose $p2<br />
done</code></p></blockquote>
<p>We here run the program <code>myProgram</code> three times (for each line in the multi-line string). Every line contains three white-space separated values (words), to which we assign the variable names <code>file, p1, p2</code> in the loop header. Note that the last variable (in this case <code>p2</code>) always contains all remaining words of a given line if there are more words then variables.</p>
<p>The set of parameters can also be stored in a file. In that case, replace the loop header with <code>cat params.txt  | while read file p1 p2 ; do</code>. If the script is not working properly, examine the Input-Field-Separator (IFS) variable, which should be set to <code>IFS=" "</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/10/working-with-a-list-of-tuples-in-shell-scripting/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

