<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nachopp's Blog</title>
	<atom:link href="http://ignaciopp.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ignaciopp.wordpress.com</link>
	<description>rants about emacs, gnu tools, web programming and stuff like that</description>
	<lastBuildDate>Wed, 25 Nov 2009 15:53:07 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='ignaciopp.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/2b63a4d7fdfeb5586df90c7c8348fb2c?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Nachopp's Blog</title>
		<link>http://ignaciopp.wordpress.com</link>
	</image>
			<item>
		<title>print last field</title>
		<link>http://ignaciopp.wordpress.com/2009/11/25/print-last-field/</link>
		<comments>http://ignaciopp.wordpress.com/2009/11/25/print-last-field/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 15:53:07 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[gnu]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=400</guid>
		<description><![CDATA[The simple solution with awk is doing:
awk &#8216;{print $NF}&#8217;
This is useful when like in the following  we want to list just files skipping directories:
ls -l &#124; awk &#8216;NR!=1 &#38;&#38; !/^d/ {print $NF}
There are other options of course, take a look at this example from a nice collection of bash and unix tips
&#160;
&#160;
    [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=400&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The simple solution with awk is doing:</p>
<p>awk &#8216;{print $NF}&#8217;</p>
<p>This is useful when like in the following  we want to list just files skipping directories:</p>
<p>ls -l | awk &#8216;NR!=1 &amp;&amp; !/^d/ {print $NF}</p>
<p>There are other options of course, take a look at <a href="http://unstableme.blogspot.com/2008/04/print-last-field-grep.html">this example</a> from a nice collection of bash and unix tips</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/400/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/400/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/400/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=400&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/11/25/print-last-field/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>color the code output to publish</title>
		<link>http://ignaciopp.wordpress.com/2009/11/23/color-the-code-output-to-publish/</link>
		<comments>http://ignaciopp.wordpress.com/2009/11/23/color-the-code-output-to-publish/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 15:48:17 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[tips&tricks]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=395</guid>
		<description><![CDATA[I&#8217;m making a note as I forgot which function was I using after not publishing  anything  for a while
In emacs the function is contained in the package htmlize. This guy made a function to directly have the output code with the css styles inline, as that is necessary when posting in wordpress blogs.
   [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=395&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&#8217;m making a note as I forgot which function was I using after not publishing  anything  for a while</p>
<p>In emacs the function is contained in the package htmlize. This <a href="http://ruslanspivak.com/2007/08/18/htmlize-your-erlang-code-buffer/">guy </a>made a function to directly have the output code with the css styles inline, as that is necessary when posting in wordpress blogs.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/395/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/395/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/395/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=395&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/11/23/color-the-code-output-to-publish/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>Method to bypass the browser cache</title>
		<link>http://ignaciopp.wordpress.com/2009/09/14/method-to-bypass-the-browser-cache/</link>
		<comments>http://ignaciopp.wordpress.com/2009/09/14/method-to-bypass-the-browser-cache/#comments</comments>
		<pubDate>Mon, 14 Sep 2009 00:55:01 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=372</guid>
		<description><![CDATA[At times it&#8217;s necessary to  manually force a non-cache reload/refresh of a page, overriding what browsers  (wrongly) interpret as when the last change of a site happened. (The cache is a temporary storage area where frequently accessed data can be stored for rapid access in our hard drive.)
To do this in FireFox, hold [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=372&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>At times it&#8217;s necessary to  manually force a non-cache reload/refresh of a page, overriding what browsers  (wrongly) interpret as when the last change of a site happened. (The cache is a temporary storage area where frequently accessed data can be stored for rapid access in our hard drive.)<br />
To do this in FireFox, hold down <strong>SHIFT </strong>and click the <strong>RELOAD </strong>button. In Internet Explorer, hold down <strong>CTRL </strong>and click the <strong>REFRESH </strong>button. Other browsers can allow this quick bypass which I was glad to discover, very handy and much simpler than erasing the whole cache.  Check these <a href="http://en.wikipedia.org/wiki/Bypass_your_cache">instructions </a> containing others like Safari, Chrome, Konkeror and Flock.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/372/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/372/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/372/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=372&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/09/14/method-to-bypass-the-browser-cache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>emacs flush lines</title>
		<link>http://ignaciopp.wordpress.com/2009/08/27/emacs-flush-lines/</link>
		<comments>http://ignaciopp.wordpress.com/2009/08/27/emacs-flush-lines/#comments</comments>
		<pubDate>Thu, 27 Aug 2009 21:07:31 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=364</guid>
		<description><![CDATA[To remove empty lines in a region simply do:

M-x flush-lines RET ^$ RET

or, if blank lines contain some white spaces characters:

M-x flush-lines RET ^\W*$ RET

Whereas with sed (which I use inside emacs via M-&#124;   shell-command-on-region ) it&#8217;s simply:

sed -e '/^[	 ]*$/d'
(this is either a tab or a space, press the TAB key since [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=364&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>To remove empty lines in a region simply do:</p>
<pre style="color:#f5f5f5;background-color:rgb(33,33,33);border:1px solid rgb(66,66,66);font-size:8pt;padding:4px;">
M-x flush-lines RET ^$ RET
</pre>
<p>or, if blank lines contain some white spaces characters:</p>
<pre style="color:#f5f5f5;background-color:rgb(33,33,33);border:1px solid rgb(66,66,66);font-size:8pt;padding:4px;">
M-x flush-lines RET ^\W*$ RET
</pre>
<p>Whereas with sed (which I use inside emacs via <strong>M-|  </strong> shell-command-on-region ) it&#8217;s simply:</p>
<pre style="color:#f5f5f5;background-color:rgb(33,33,33);border:1px solid rgb(66,66,66);font-size:8pt;padding:4px;">
sed -e '/^[	 ]*$/d'
(this is either a tab or a space, press the TAB key since most versions
of sed don't recognize the \t character)
</pre>
<p>How easy is to forget this type of things!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/364/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/364/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/364/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=364&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/08/27/emacs-flush-lines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>on syncing with shell present directory</title>
		<link>http://ignaciopp.wordpress.com/2009/08/20/on-syncing-with-shell-present-directory/</link>
		<comments>http://ignaciopp.wordpress.com/2009/08/20/on-syncing-with-shell-present-directory/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 20:10:52 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=356</guid>
		<description><![CDATA[Didn&#8217;t know before  that &#8220;M-x dirs&#8221; queries the shell and resyncs Emacs&#8217; idea of what the current directory stack is. Tiny but useful piece of knowledge.  
       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=356&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Didn&#8217;t know before  that &#8220;M-x dirs&#8221; queries the shell and resyncs Emacs&#8217; idea of what the current directory stack is. Tiny but useful piece of knowledge.  </p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/356/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/356/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/356/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=356&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/08/20/on-syncing-with-shell-present-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>mixing single and double quotes in the command line</title>
		<link>http://ignaciopp.wordpress.com/2009/07/15/mixing-single-and-double-quotes-in-the-command-line/</link>
		<comments>http://ignaciopp.wordpress.com/2009/07/15/mixing-single-and-double-quotes-in-the-command-line/#comments</comments>
		<pubDate>Wed, 15 Jul 2009 15:54:16 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=349</guid>
		<description><![CDATA[This is more of quick reminder for myself on the difficult task of escaping quotes and running an awk or sed command inside the bash command line. I solved the issue in my case using the octal representation of a single quote (\47), taken from here, where more options are shown.
Having previously accommodated the list [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=349&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>This is more of quick reminder for myself on the difficult task of escaping quotes and running an awk or sed command inside the bash command line. I solved the issue in my case using the octal representation of a single quote (\47), taken from <a href="http://www.gnu.org/manual/gawk/html_node/Quoting.html">here</a>, where more options are shown.</p>
<p>Having previously accommodated the list of stale links with their replacements in a two columns format that looked like:</p>
<blockquote><p>
http://addressOld.com          http://www.goodWorkingOne.com<br />
http://addressOld2.com          http://www.goodWorkingOne2.com<br />
etc&#8230;
</p></blockquote>
<p>I used the following:</p>
<pre style="background:rgb(33,33,33);border:1px solid rgb(66,66,66);font-size:8pt;color:#f5f5f5;overflow:auto;padding:4px;">awk '{print "UPDATE library SET url=\47"$2"\47 WHERE url=\47"$1"\47;"}' </pre>
<p>to correctly generated what I wanted sql-postgres statements to update the links table:</p>
<pre style="background:rgb(33,33,33);border:1px solid rgb(66,66,66);font-size:8pt;color:#f5f5f5;overflow:auto;padding:4px;">
UPDATE links SET url='http://goodWorkingOne.com' WHERE url='http://addressOld.com';
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/349/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/349/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/349/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=349&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/07/15/mixing-single-and-double-quotes-in-the-command-line/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>rooster&#8217;s crow,  setting up an alarm clock in emacs</title>
		<link>http://ignaciopp.wordpress.com/2009/07/09/roosters-crow-setting-up-an-alarm-clock-in-emacs/</link>
		<comments>http://ignaciopp.wordpress.com/2009/07/09/roosters-crow-setting-up-an-alarm-clock-in-emacs/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 21:05:17 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=341</guid>
		<description><![CDATA[Traveling with my kid I had some medication to give him the other night. I didn&#8217;t have an alarm clock with me, only my laptop computer. Into the Windows system I found nothing suited to help me gain some rest while waking up again at 3:00 am. I wished Emacs could help, and it certainly [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=341&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Traveling with my kid I had some medication to give him the other night. I didn&#8217;t have an alarm clock with me, only my laptop computer. Into the Windows system I found nothing suited to help me gain some rest while waking up again at 3:00 am. I wished Emacs could help, and it certainly didn&#8217;t disappoint me once more. I found a simple alarm clock coded by Mathias Dahl <a href="http://www.opensubscriber.com/message/help-gnu-emacs@gnu.org/4323621.html">here </a>. Great!, I only had to tweak it a little by adding a sound load enough to ring me at the desired time. I picked a rooster sing, which I had collected a while ago when my child was getting to know farm animals. I put a loop around to repeat it a few times so to guarantee the awakening.<br />
Anyways, for what is worth, here goes the cool little snippet:</p>
<pre style="color:#f5f5f5;background-color:rgb(33,33,33);border:1px solid rgb(66,66,66);font-size:8pt;padding:4px;">
(<span style="color:#ffd700;font-weight:bold;">defvar</span> <span style="color:#ffffe0;">alarm-clock-timer</span> nil
  <span style="color:#f5a818;">"Keep timer so that the user can cancel the alarm"</span>)

(<span style="color:#ffd700;font-weight:bold;">defun</span> <span style="color:#7fff00;font-weight:bold;">alarm-clock-message</span> (text)
  <span style="color:#f5a818;">"The actual alarm action"</span>
  (<span style="color:#ffd700;font-weight:bold;">progn</span>
    (<span style="color:#ffd700;font-weight:bold;">let</span>((i 0))
      (<span style="color:#ffd700;font-weight:bold;">while</span> (&lt; i 3)
        (play-sound-file <span style="color:#f5a818;">"c:/web/sounds/rooster.wav"</span>)
        (setq i (1+ i)))
      (message-box text))))

(<span style="color:#ffd700;font-weight:bold;">defun</span> <span style="color:#7fff00;font-weight:bold;">alarm-clock</span> ()
  <span style="color:#f5a818;">"Set an alarm.
The time format is the same accepted by `</span><span style="color:#00cdcd;font-weight:bold;">run-at-time</span><span style="color:#f5a818;">'.  For
example \"11:30am\"."</span>
  (interactive)
  (<span style="color:#ffd700;font-weight:bold;">let</span> ((time (read-string <span style="color:#f5a818;">"Time: "</span>))
        (text (read-string <span style="color:#f5a818;">"Alarm message: "</span>)))
    (<span style="color:#ffd700;font-weight:bold;">progn</span>
      (setq alarm-clock-timer
          (run-at-time time nil 'alarm-clock-message text)))))

(<span style="color:#ffd700;font-weight:bold;">defun</span> <span style="color:#7fff00;font-weight:bold;">alarm-clock-cancel</span> ()
  <span style="color:#f5a818;">"Cancel the alarm clock"</span>
  (interactive)
  (cancel-timer alarm-clock-timer))
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/341/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/341/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/341/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=341&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/07/09/roosters-crow-setting-up-an-alarm-clock-in-emacs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>emacs shell, workaround for killing input in Windows version</title>
		<link>http://ignaciopp.wordpress.com/2009/07/02/emacs-shell-workaround-for-killing-input-in-windows-version/</link>
		<comments>http://ignaciopp.wordpress.com/2009/07/02/emacs-shell-workaround-for-killing-input-in-windows-version/#comments</comments>
		<pubDate>Thu, 02 Jul 2009 18:47:17 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[dot-emacs]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[tips&tricks]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=334</guid>
		<description><![CDATA[Using an interactive shell in Emacs for Windows you might enconter a bug that causes the shell process to terminate when you signal and eof (See point 7.6 here)
If, for example, you try:

/Program Files/Emacs/ cat &#62;newfile
this is a test file
being created with the cat command
directly from the user input 
in shell.

Now, by pressing C-d (or [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=334&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Using an interactive shell in Emacs for Windows you might enconter a bug that causes the shell process to terminate when you signal and eof (See<a href="http://www.gnu.org/software/emacs/windows/Sub_002dprocesses.html"> point 7.6 here</a>)<br />
If, for example, you try:</p>
<pre style="color:#f5f5f5;background-color:#333333;font-size:8pt border:1px solid rgb(66,66,66);padding:4px;">
<span style="color:#00ffff;">/Program Files/Emacs/ </span><span style="font-weight:bold;">cat &gt;newfile</span>
<span style="font-weight:bold;">this is a test file</span>
<span style="font-weight:bold;">being created with the cat command</span>
<span style="font-weight:bold;">directly from the user input </span>
<span style="font-weight:bold;">in shell.</span>
</pre>
<p>Now, by pressing <strong>C-d (or C-c C-d)</strong> the input should finish here, and the prompt return, but what happens instead, is that the shell process terminates. Same thing occurs if you try to <strong>M-x comint-send-eof </strong>or if you pick an eof signal from the menu.  </p>
<p>I had noticed that before (in my Windows emac, only not under Unix), but last night I <a href="http://www.fi.muni.cz/~hanka/sicstus/doc/html/relnotes/Windows-Limitations.html">found </a>that an eof sign could be generated by typing <strong>C-q C-z</strong>.</p>
<p>I choose to set an alias and bind it to some keys in my .emacs to overcome the issue:</p>
<pre style="color:#f5f5f5;background-color:#333333;font-size:8pt;">
(<span style="color:#ffd700;font-weight:bold;">defalias</span> '<span style="color:#7fff00;font-weight:bold;">eof</span>
  (read-kbd-macro <span style="color:#f5a818;">"C-q C-z RET"</span>))
(global-set-key [M-S-f8] 'eof)
</pre>
<p>
Of course a better solution would be to advice the comint-send-eof to procede accordingly when in emacs for Windows. Anybody knows how to do it, or mind to share a stronger fix than this hack? Any feedback will be appreciated.</p>
<p>Update:<br />
Actually there&#8217;s no need to set an alias, as I learned that this is also possible and more straight-forward: </p>
<pre style="color:#f5f5f5;background-color:rgb(33,33,33);overflow:auto;border:1px solid rgb(66,66,66);font-size:8pt;border-width:1px 1px 0;padding:4px;">
(global-set-key [(meta shift f8)]
 '(<span style="color:#ffd700;font-weight:bold;">lambda</span> () (interactive) (execute-kbd-macro((read-kbd-macro <span style="color:#f5a818;">"C-q C-z RET"</span>)))))</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/334/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/334/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/334/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=334&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/07/02/emacs-shell-workaround-for-killing-input-in-windows-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>more awk tidbits, range of fields</title>
		<link>http://ignaciopp.wordpress.com/2009/07/01/more-awk-tidbits-range-of-fields/</link>
		<comments>http://ignaciopp.wordpress.com/2009/07/01/more-awk-tidbits-range-of-fields/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 17:54:21 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[gnu]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[awk]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=321</guid>
		<description><![CDATA[Knowing how to do loops in awk is helpful to address a range of fields. If for example, we want to output only from second, to prior to last field. Say we&#8217;ve got :
one:two:three:four:five:six:seven:eight:nine
Fields are here defined by &#8220;:&#8221; separator, so using:

awk -F ':' '{for(i=2;i&#60;NF;i++) printf &#34;%s:&#34;,$i}&#39;


We will  get: 

two:three:four:five:six:seven:eight:

     [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=321&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Knowing how to do loops in awk is helpful to address a range of fields. If for example, we want to output only from second, to prior to last field. Say we&#8217;ve got :</p>
<blockquote><p>one:two:three:four:five:six:seven:eight:nine</p></blockquote>
<p>Fields are here defined by &#8220;:&#8221; separator, so using:</p>
<pre style="background:rgb(33,33,33);color:#fff;border:1px solid rgb(66,66,66);">
awk -F ':' '{for(i=2;i&lt;NF;i++) printf &quot;%s:&quot;,$i}&#39;
</pre>
<p></br></br><br />
We will  get: </p>
<blockquote><p>
two:three:four:five:six:seven:eight:
</p></blockquote>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/321/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/321/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/321/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=321&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/07/01/more-awk-tidbits-range-of-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
		<item>
		<title>sed, delete all within regex range</title>
		<link>http://ignaciopp.wordpress.com/2009/06/26/sed-delete-all-withing-regex-range/</link>
		<comments>http://ignaciopp.wordpress.com/2009/06/26/sed-delete-all-withing-regex-range/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 04:26:25 +0000</pubDate>
		<dc:creator>ignacio</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[gnu]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[unix]]></category>
		<category><![CDATA[cat]]></category>
		<category><![CDATA[range]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[tips&tricks]]></category>

		<guid isPermaLink="false">http://ignaciopp.wordpress.com/?p=304</guid>
		<description><![CDATA[On how to delete a chunk of text contained in multiple lines: use sed to catch the range (/a/,/b/)
There were some javascript  google ads calls from a page I downloaded via wget, doing: 
 wget www.someSite.com/somePage.html &#62; toCleanItUp.htlm

After highlighting all the page  C-x h  I did a M-x shell-command-on-region and used the [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=304&subd=ignaciopp&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>On how to delete a chunk of text contained in multiple lines: use sed to catch the range (/a/,/b/)</p>
<p>There were some javascript  google ads calls from a page I downloaded via wget, doing: </p>
<pre style="background:#212121;border:1px solid #424242;overflow:auto;padding:6px;"> wget www.someSite.com/somePage.html &gt; toCleanItUp.htlm
</pre>
<p>After highlighting all the page <strong> C-x h </strong> I did a <strong>M-x shell-command-on-region</strong> and used the following:</p>
<pre style="background:#212121;border:1px solid #424242;overflow:auto;padding:6px;">sed "/&lt;script .*&gt;/,/&lt;\/script&gt;/d" &gt; nowItIsClean.html</pre>
<p>If feeling lazy, (or if I don&#8217;t have the file opened already in an emacs buffer), there&#8217;s the straightforward way of using cat:</p>
<pre style="background:#212121;border:1px solid #424242;overflow:auto;border-width:1px 1px 0;padding:6px;">cat toCleanItUp.html | sed "/&lt;script .*&gt;/,/&lt;\/script&gt;/d" &gt; nowItIsClean.html</pre>
<p>Ah, the beauty of unix tools!</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/ignaciopp.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/ignaciopp.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/ignaciopp.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/ignaciopp.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/ignaciopp.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/ignaciopp.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/ignaciopp.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/ignaciopp.wordpress.com/304/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/ignaciopp.wordpress.com/304/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/ignaciopp.wordpress.com/304/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=ignaciopp.wordpress.com&blog=7647034&post=304&subd=ignaciopp&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://ignaciopp.wordpress.com/2009/06/26/sed-delete-all-withing-regex-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e910a7a47cd252713530179690cb5869?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">ignacio</media:title>
		</media:content>
	</item>
	</channel>
</rss>