<?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; programming</title>
	<atom:link href="http://www.mfasold.net/blog/tag/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mfasold.net/blog</link>
	<description>Just shouting my thoughts out</description>
	<lastBuildDate>Fri, 23 Jul 2010 14:21:22 +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>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>4</slash:comments>
		</item>
		<item>
		<title>Finding out where your Program Crashes with the Emacs GUD</title>
		<link>http://www.mfasold.net/blog/2009/05/finding-out-where-your-program-crashes-with-the-emacs-gud/</link>
		<comments>http://www.mfasold.net/blog/2009/05/finding-out-where-your-program-crashes-with-the-emacs-gud/#comments</comments>
		<pubDate>Tue, 26 May 2009 14:34:19 +0000</pubDate>
		<dc:creator>Mario</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[emacs]]></category>
		<category><![CDATA[english]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://www.mfasold.net/blog/?p=299</guid>
		<description><![CDATA[This post describes a very, very elementary debugging skill. Yet, I could not find any concise tutorial about it on the web. So, here we go!
Assume you&#8217;re developing a small software under Linux, maybe using C or C++ and the GCC compiler. Testing your program, you find that it crashes with an error (segfault, assertion, [...]]]></description>
			<content:encoded><![CDATA[<p>This post describes a very, very elementary debugging skill. Yet, I could not find any concise tutorial about it on the web. So, here we go!</p>
<p>Assume you&#8217;re developing a small software under Linux, maybe using C or C++ and the GCC compiler. Testing your program, you find that it crashes with an error (segfault, assertion, &#8230;). How do find the cause for this crash rapidly? How can you back-trace the error?</p>
<p>First, compile your program again adding the option &#8220;<code>-g</code>&#8221; (or &#8220;<code>-gstabs</code>&#8220;). The compiler (e.g. g++) will now include information necessary for debugging into your binary. Start Emacs and invoke &#8220;<code>M-x gdb</code>&#8220;. As parameter, enter the full path of your executable. You end up with something like &#8220;<code>gdb --annotate=3 ~/myProject/myProgram</code>&#8220;. In the newly opened buffer, set the commandline parameters as for example in &#8220;<code>start --verbose-mode inputfile.dat</code>&#8220;. Simply append the program options you normally use after &#8220;<code>start</code>&#8220;.</p>
<p>Run the command &#8220;<code>c</code>&#8221; (=continue). Your program will start &#8211; and crash. Now, invoke &#8220;<code>M-x gdb-many-windows</code>&#8220;. You will see the steps leading to the function that caused the crash in the window &#8220;stack frames&#8221;. By clicking on each of the steps, Emacs will directly navigate to the respective source code block, enabling you to trace the cause of the error. Find a more extensive tutorial <a href="http://www.linuxjournal.com/article/7876">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mfasold.net/blog/2009/05/finding-out-where-your-program-crashes-with-the-emacs-gud/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
