<?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>Linux etc.</title>
	<atom:link href="http://promberger.info/linux/feed/" rel="self" type="application/rss+xml" />
	<link>http://promberger.info/linux</link>
	<description>my outsourced memory for your perusal</description>
	<lastBuildDate>Mon, 02 Aug 2010 11:32:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Use sed to remove the first column in a comma separated file (csv)</title>
		<link>http://promberger.info/linux/2010/08/02/use-sed-to-remove-the-first-column-in-a-comma-separated-file-csv/</link>
		<comments>http://promberger.info/linux/2010/08/02/use-sed-to-remove-the-first-column-in-a-comma-separated-file-csv/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 11:32:41 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Regular expressions]]></category>
		<category><![CDATA[Sed]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=357</guid>
		<description><![CDATA[Here&#8217;s how:
sed -i 's/[^,]*,//' file.csv
Note the [^,]* bit, which matches everything that is not a comma. Don&#8217;t use .*, because this will greedily match commas, too. (Usually, cut is useful for these sort of things, but cut cannot readily replace the file in place.)
]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how:</p>
<pre>sed -i 's/[^,]*,//' file.csv</pre>
<p>Note the <code>[^,]*</code> bit, which matches everything that is not a comma. Don&#8217;t use <code>.*</code>, because this will greedily match commas, too. (Usually, <code>cut</code> is useful for these sort of things, but cut cannot readily replace the file in place.)</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/08/02/use-sed-to-remove-the-first-column-in-a-comma-separated-file-csv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get Emacs key bindings in Ubuntu</title>
		<link>http://promberger.info/linux/2010/02/16/how-to-get-emacs-key-bindings-in-ubuntu/</link>
		<comments>http://promberger.info/linux/2010/02/16/how-to-get-emacs-key-bindings-in-ubuntu/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 12:59:45 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Emacs]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[misc.]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=353</guid>
		<description><![CDATA[To get the Emacs key bindings (especially, Ctrl-a to go to beginning of line, Ctrl-e to end of line) systemwide, e.g. in Firefox, you use:
gconf-editor
and change the setting desktop &#8594; gnome &#8594; interface &#8594; gtk_key_theme from &#8220;Default&#8221; to &#8220;Emacs&#8221;.
]]></description>
			<content:encoded><![CDATA[<p>To get the Emacs key bindings (especially, Ctrl-a to go to beginning of line, Ctrl-e to end of line) systemwide, e.g. in Firefox, you use:</p>
<pre>gconf-editor</pre>
<p>and change the setting desktop &rarr; gnome &rarr; interface &rarr; gtk_key_theme from &#8220;Default&#8221; to &#8220;Emacs&#8221;.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/02/16/how-to-get-emacs-key-bindings-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How not to ask a question on R-help</title>
		<link>http://promberger.info/linux/2010/02/12/how-not-to-ask-a-question-on-r-help/</link>
		<comments>http://promberger.info/linux/2010/02/12/how-not-to-ask-a-question-on-r-help/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 12:03:20 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Noobs]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=349</guid>
		<description><![CDATA[One great way to get help with R is by asking a question on the r-help mailing list. More often than not I have actually figured out the answer simply by typing up the question, because that made me think more clearly about what the problem really was. The people on the list are exceedingly [...]]]></description>
			<content:encoded><![CDATA[<p>One great way to get help with R is by asking a question on the r-help mailing list. More often than not I have actually figured out the answer simply by typing up the question, because that made me think more clearly about what the problem really was. The people on the list are exceedingly helpful. Not all of the posters are. I&#8217;ll now start collecting some fun examples of threads which might be called &#8220;How not to ask a quesiton on R-help&#8221;. Here is <a href="http://tolstoy.newcastle.edu.au/R/e9/help/10/02/4677.html">the first one</a>. Nice quote from Greg Snow:</p>
<blockquote><p>
If you show us your data/code/output as has been requested, then we may be able to tell which it is. Without that information you are expecting either R or the members of the list to read your mind.  I keep making notes to my future self to use the timetravel package (not written yet, that&#8217;s why I need my future self to use it) to send a copy of the esp package (also not written yet) back in time to me so I can use it for situations like this.  But so far that has not worked (maybe my future self is even more lazy than my present self, or my near future self does something to offend my far future self enough that he is unwilling to do this small favor for my current past self, darn, either way means I should probably do better on the diet/exercise).
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/02/12/how-not-to-ask-a-question-on-r-help/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>R: loops vs apply (vectorization)</title>
		<link>http://promberger.info/linux/2010/02/10/r-loops-vs-apply-vectorization/</link>
		<comments>http://promberger.info/linux/2010/02/10/r-loops-vs-apply-vectorization/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 14:08:03 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=346</guid>
		<description><![CDATA[A helpful article in by Uwe Ligges and John Fox in R news 2008(1), pp 46-50, about loops vs. apply was just pointed out on R-help. I&#8217;ve uploaded it here (pdf).
]]></description>
			<content:encoded><![CDATA[<p>A helpful article in by Uwe Ligges and John Fox in R news 2008(1), pp 46-50, about loops vs. apply was just pointed out on R-help. I&#8217;ve uploaded it <a href="http://promberger.info/files/rnews-vectorvsloops2008.pdf">here (pdf)</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/02/10/r-loops-vs-apply-vectorization/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My first RMySQL session</title>
		<link>http://promberger.info/linux/2010/01/21/my-first-rmysql-session/</link>
		<comments>http://promberger.info/linux/2010/01/21/my-first-rmysql-session/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 14:01:48 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[R]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=332</guid>
		<description><![CDATA[# 'fai1' is an empty MySQL database for which 'mpromber' has all privileges
mycon ]]></description>
			<content:encoded><![CDATA[<pre># 'fai1' is an empty MySQL database for which 'mpromber' has all privileges
mycon <- dbConnect(MySQL(),user='mpromber',dbname='fai1') # pass seems to be read from ~/.my.cnf
# dsub is a data frame:
dbWriteTable(mycon,"dsub",dsub) # create table "dsub"
dbDisconnect(mycon) # close connection
</pre>
<p>Time for lunch.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/01/21/my-first-rmysql-session/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MySQL settings in ~/.my.cnf</title>
		<link>http://promberger.info/linux/2010/01/21/mysql-settings-in-mycnf/</link>
		<comments>http://promberger.info/linux/2010/01/21/mysql-settings-in-mycnf/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 12:23:39 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=330</guid>
		<description><![CDATA[You can specify default settings for MySQL in the file ~/.my.cnf (create it if it doesn&#8217;t exist). E.g., you could spare yourself typing your password each time you connect with an entry in that file like this:
[client]
password='mypassword'
This gets loaded in addition to the system configuration file, which for me is at /etc/mysql/my.cnf.
]]></description>
			<content:encoded><![CDATA[<p>You can specify default settings for MySQL in the file <code>~/.my.cnf</code> (create it if it doesn&#8217;t exist). E.g., you could spare yourself typing your password each time you connect with an entry in that file like this:</p>
<pre>[client]
password='mypassword'</pre>
<p>This gets loaded in addition to the system configuration file, which for me is at <code>/etc/mysql/my.cnf</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/01/21/mysql-settings-in-mycnf/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>r-cran-rmysql</title>
		<link>http://promberger.info/linux/2010/01/20/r-cran-rmysql/</link>
		<comments>http://promberger.info/linux/2010/01/20/r-cran-rmysql/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 15:39:05 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=328</guid>
		<description><![CDATA[Memo to self: I installed RMySQL using 
sudo aptitude install r-cran-rmysql
because when I used 
install.packages("RMySQL")
it asked my to specify the MySQL libraries and headers and whatnot and don&#8217;t know where they are.
]]></description>
			<content:encoded><![CDATA[<p>Memo to self: I installed RMySQL using </p>
<pre>sudo aptitude install r-cran-rmysql</pre>
<p>because when I used </p>
<pre>install.packages("RMySQL")</pre>
<p>it asked my to specify the MySQL libraries and headers and whatnot and don&#8217;t know where they are.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/01/20/r-cran-rmysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use R to help with lottery drawing</title>
		<link>http://promberger.info/linux/2010/01/07/use-r-to-help-with-lottery-drawing/</link>
		<comments>http://promberger.info/linux/2010/01/07/use-r-to-help-with-lottery-drawing/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 13:04:50 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[Noobs]]></category>
		<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=325</guid>
		<description><![CDATA[When you start using R, it can be confusing that if you assign something to an object you do not get visual feedback:
x  x
 [1] 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3
You can exploit this fact for doing a quick-and-dirty lottery. Assume you have a file [...]]]></description>
			<content:encoded><![CDATA[<p>When you start using R, it can be confusing that if you assign something to an object you do not get visual feedback:</p>
<pre>x <- rep(1:3,5)</pre>
<p>You have to then type <code>x</code> to see it:</p>
<pre>> x
 [1] 1 2 3 1 2 3 1 2 3 1 2 3 1 2 3</pre>
<p>You can exploit this fact for doing a quick-and-dirty lottery. Assume you have a file with email addresses, one per line, called "entries.txt". First, read them and assign them to an object:</p>
<pre>entries <- readLines("entries.txt")</pre>
<p>Next, create an index of numbers of the same length but in random order:</p>
<pre>index <- sample(1:length(entries),length(entries))</pre>
<p>Note that you don't see it unless you type <code>index</code>. Combine index and emails in a dataframe (also not directly visible):</p>
<pre>dat <- data.frame(cbind(index,entries))</pre>
<p>Now, go to <a href="http://random.org">random.org</a> and draw a number from the index. Type <code>dat</code> to reveal who you drew. This method makes it a bit more "blind" and a bit less likely that you'll cheat.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2010/01/07/use-r-to-help-with-lottery-drawing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Small hyperref error solved</title>
		<link>http://promberger.info/linux/2009/11/09/small-hyperref-error-solved/</link>
		<comments>http://promberger.info/linux/2009/11/09/small-hyperref-error-solved/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 10:58:20 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[LaTeX]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=323</guid>
		<description><![CDATA[For the record. I got an error running hyperref:
Paragraph ended before \Hy@setref@link was complete
This was due to having a regulare closing parenthesis directly after the curly bracket that closed a \ref, like this: (see section \ref{section-1}). Putting in a space between the closing curly bracket and parenthesis solved the problem: ... section-1} )
]]></description>
			<content:encoded><![CDATA[<p>For the record. I got an error running hyperref:</p>
<pre>Paragraph ended before \Hy@setref@link was complete</pre>
<p>This was due to having a regulare closing parenthesis directly after the curly bracket that closed a <code>\ref</code>, like this: <code>(see section \ref{section-1})</code>. Putting in a space between the closing curly bracket and parenthesis solved the problem: <code>... section-1} )</code></p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/11/09/small-hyperref-error-solved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice R example from r-help</title>
		<link>http://promberger.info/linux/2009/11/05/nice-r-example-from-r-help/</link>
		<comments>http://promberger.info/linux/2009/11/05/nice-r-example-from-r-help/#comments</comments>
		<pubDate>Thu, 05 Nov 2009 14:48:34 +0000</pubDate>
		<dc:creator>Marianne</dc:creator>
				<category><![CDATA[R]]></category>

		<guid isPermaLink="false">http://promberger.info/linux/?p=317</guid>
		<description><![CDATA[I don&#8217;t know the first thing about programming, but sometimes you see something and appreciate how elegant it is. This small solution from r-help is a good example. Someone wanted, given a vector c('p','p','t','t','t','p','k','t') to produce NA NA 1 2 3

test ]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know the first thing about programming, but sometimes you see something and appreciate how elegant it is. This small solution from <a href="http://tolstoy.newcastle.edu.au/R/e8/help/09/11/3767.html">r-help</a> is a good example. Someone wanted, given a vector <code>c('p','p','t','t','t','p','k','t')</code> to produce <code>NA NA 1 2 3</code></p>
<pre>
test <- c('p','p','t','t','t','p','k','t')
v <- cumsum(ind <- test == 't')
v[!ind] <- NA
</pre>
<p>I didn't know you could assign something to an object and use it at the same time. Very neat. So if you wanted this all at once, you could also do:</p>
<pre>v <- ifelse(cumsum(ind <- test=='t')==0,NA,cumsum(ind))</pre>
<p>or</p>
<pre>ifelse((v <- cumsum(test=='t'))==0,NA,v)</pre>
<p>Maybe Dimitris' solution is in fact preferred for R, using indexing instead of if/ else, but I don't know enough about R to know whether that makes a difference.</p>
]]></content:encoded>
			<wfw:commentRss>http://promberger.info/linux/2009/11/05/nice-r-example-from-r-help/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
