<?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/"
	>

<channel>
	<title>moosechips</title>
	<atom:link href="http://www.moosechips.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.moosechips.com</link>
	<description>leaving my mark on the internet</description>
	<pubDate>Sun, 18 Jul 2010 11:22:30 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Python Subprocess Module Examples</title>
		<link>http://www.moosechips.com/2010/07/python-subprocess-module-examples/</link>
		<comments>http://www.moosechips.com/2010/07/python-subprocess-module-examples/#comments</comments>
		<pubDate>Sun, 18 Jul 2010 11:20:33 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<code>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=602</guid>
		<description><![CDATA[Some examples using the subprocess python module.
Make a simple system call:

#! /usr/bin/env python
import subprocess
# Use a sequence of args
return_code = subprocess.call&#40;&#91;&#34;echo&#34;, &#34;hello world&#34;&#93;&#41;
&#160;
# Set shell=true so we can use a simple string for the command
return_code = subprocess.call&#40;&#34;echo hello world&#34;, shell=True&#41;
&#160;
# subprocess.call() is equivalent to using subprocess.Popen() and wait()
proc = subprocess.Popen&#40;&#34;echo hello world&#34;, shell=True&#41;
return_code = proc.wait&#40;&#41; [...]]]></description>
			<content:encoded><![CDATA[<p>Some examples using the subprocess python module.</p>
<p>Make a simple system call:</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="python geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;">#! /usr/bin/env python</span></span>
<span style="color: #ff7700;font-weight:bold;color: #729FCF;">import</span> <span style="color: #dc143c;color: #729FCF;">subprocess</span>
<span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;"># Use a sequence of args</span></span>
return_code = <span style="color: #dc143c;color: #729FCF;">subprocess</span>.<span class="me1"><span style="color: #35CECE;">call</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#91;</span></span><span style="color: #483d8b;color: #AD7FA8;">&quot;echo&quot;</span>, <span style="color: #483d8b;color: #AD7FA8;">&quot;hello world&quot;</span><span class="br0"><span style=" color: #cccccc;">&#93;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
&nbsp;
<span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;"># Set shell=true so we can use a simple string for the command</span></span>
return_code = <span style="color: #dc143c;color: #729FCF;">subprocess</span>.<span class="me1"><span style="color: #35CECE;">call</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #483d8b;color: #AD7FA8;">&quot;echo hello world&quot;</span>, shell=<span style="color: #008000;color: #729FCF;">True</span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
&nbsp;
<span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;"># subprocess.call() is equivalent to using subprocess.Popen() and wait()</span></span>
proc = <span style="color: #dc143c;color: #729FCF;">subprocess</span>.<span class="me1"><span style="color: #35CECE;">Popen</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #483d8b;color: #AD7FA8;">&quot;echo hello world&quot;</span>, shell=<span style="color: #008000;color: #729FCF;">True</span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
return_code = proc.<span class="me1"><span style="color: #35CECE;">wait</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;"># wait for process to finish so we can get the return code</span></span></pre></div></div>

<p>Control stderr and stdout:</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="python geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;">#! /usr/bin/env python</span></span>
<span style="color: #ff7700;font-weight:bold;color: #729FCF;">import</span> <span style="color: #dc143c;color: #729FCF;">subprocess</span>
<span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;"># Put stderr and stdout into pipes</span></span>
proc = <span style="color: #dc143c;color: #729FCF;">subprocess</span>.<span class="me1"><span style="color: #35CECE;">Popen</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #483d8b;color: #AD7FA8;">&quot;echo hello stdout; echo hello stderr &gt;&amp;2&quot;</span>, \
        shell=<span style="color: #008000;color: #729FCF;">True</span>, stderr=<span style="color: #dc143c;color: #729FCF;">subprocess</span>.<span class="me1"><span style="color: #35CECE;">PIPE</span></span>, stdout=<span style="color: #dc143c;color: #729FCF;">subprocess</span>.<span class="me1"><span style="color: #35CECE;">PIPE</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
return_code = proc.<span class="me1"><span style="color: #35CECE;">wait</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;"># Read from pipes</span></span>
<span style="color: #ff7700;font-weight:bold;color: #729FCF;">for</span> line <span style="color: #ff7700;font-weight:bold;color: #729FCF;">in</span> proc.<span class="me1"><span style="color: #35CECE;">stdout</span></span>:
    <span style="color: #ff7700;font-weight:bold;color: #729FCF;">print</span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #483d8b;color: #AD7FA8;">&quot;stdout: &quot;</span> + line.<span class="me1"><span style="color: #35CECE;">rstrip</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span style="color: #ff7700;font-weight:bold;color: #729FCF;">for</span> line <span style="color: #ff7700;font-weight:bold;color: #729FCF;">in</span> proc.<span class="me1"><span style="color: #35CECE;">stderr</span></span>:
    <span style="color: #ff7700;font-weight:bold;color: #729FCF;">print</span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #483d8b;color: #AD7FA8;">&quot;stderr: &quot;</span> + line.<span class="me1"><span style="color: #35CECE;">rstrip</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2010/07/python-subprocess-module-examples/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Password-less SSH Login</title>
		<link>http://www.moosechips.com/2010/07/password-less-ssh-login/</link>
		<comments>http://www.moosechips.com/2010/07/password-less-ssh-login/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 21:23:33 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=598</guid>
		<description><![CDATA[
ssh-copy-id moose@moosechips.com

If you get ERROR: No identities found, you need to create a ssh key. (Create one without a password when prompted.)

ssh-keygen -t rsa

Then run ssh-copy-id again.
If your remote user has a different login name, you can setup a ssh config file so it will use the right user name.  Create a text file [...]]]></description>
			<content:encoded><![CDATA[
<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">ssh-copy-id moose<span style=" color: #cccccc;">@</span>moosechips.com</pre></div></div>

<p>If you get <code>ERROR: No identities found</code>, you need to create a ssh key. (Create one without a password when prompted.)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">ssh-keygen</span> <span style="color: #660033;color: #cccccc;">-t</span> rsa</pre></div></div>

<p>Then run <code>ssh-copy-id</code> again.</p>
<p>If your remote user has a different login name, you can setup a ssh config file so it will use the right user name.  Create a text file at <code>~/.ssh/config</code> with</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="text geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">Host moosechips.com
  User moose</pre></div></div>

<p>Now you can login via ssh</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">ssh</span> moosechips.com</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2010/07/password-less-ssh-login/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Running Mathematica Over SSH Using Cygwin</title>
		<link>http://www.moosechips.com/2010/04/running-mathematica-over-ssh-using-cygwin/</link>
		<comments>http://www.moosechips.com/2010/04/running-mathematica-over-ssh-using-cygwin/#comments</comments>
		<pubDate>Fri, 02 Apr 2010 17:59:51 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<category><![CDATA[cygwin]]></category>

		<category><![CDATA[error]]></category>

		<category><![CDATA[font]]></category>

		<category><![CDATA[mathematica]]></category>

		<category><![CDATA[ssh]]></category>

		<category><![CDATA[wolfram]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=583</guid>
		<description><![CDATA[When trying to run Mathematica over SSH using Cygwin, you will probably get some error message like

ssh -Y user@host
mathematica
xset: bad font path element (#23), possible causes are:
   Directory does not exist or has wrong permissions
   Directory missing fonts.dir
   Incorrect font server address or syntax

This is because you need to [...]]]></description>
			<content:encoded><![CDATA[<p>When trying to run Mathematica over SSH using Cygwin, you will probably get some error message like</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="shell geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">ssh -Y user@host
mathematica
xset: bad font path element (#23), possible causes are:
   Directory does not exist or has wrong permissions
   Directory missing fonts.dir
   Incorrect font server address or syntax</pre></div></div>

<p>This is because you need to install the Mathematica fonts into Cygwin&#8217;s X server. This solution worked for me using the latest Cygwin 1.7.2: <span id="more-583"></span></p>
<ol>
<li>Download the linux fonts from <a href="http://support.wolfram.com/technotes/latestfonts.html">Wolfram&#8217;s latest Mathematica fonts</a> into your Cygwin home <code>C:\cygwin\home\username</code>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">wget</span> http:<span style=" color: #cccccc;">//</span>support.wolfram.com<span style=" color: #cccccc;">/</span>technotes<span style=" color: #cccccc;">/</span>MathematicaV7FontsLinux.tar.gz</pre></div></div>

</li>
<li>Unzip the fonts

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">tar</span> xvfz MathematicaV7FontsLinux.tar.gz</pre></div></div>

</li>
<li>You should have a Fonts folder now with subfolders TTF, SVG, etc inside. All the subfolders need to be copied into <code>/usr/share/fonts</code> so you end up with <code>/usr/share/fonts/TTF/, /usr/share/fonts/SVG/</code>, etc.

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #7a0874; font-weight: bold;color: #729FCF;">cd</span> Fonts
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">cp</span> <span style=" color: #cccccc;">*</span> <span style=" color: #cccccc;">/</span>usr<span style=" color: #cccccc;">/</span>share<span style=" color: #cccccc;">/</span>fonts</pre></div></div>

</li>
<li>Exit and restart your Cygwin/X server. </li>
</ol>
<p>References:<br />
<a href="https://wiki.lepp.cornell.edu/lepp/bin/view/Computing/CygwinXorg">https://wiki.lepp.cornell.edu/lepp/bin/view/Computing/CygwinXorg</a><br />
<a href="http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-error-font-eof">http://x.cygwin.com/docs/faq/cygwin-x-faq.html#q-error-font-eof</a><br />
<a href="http://handyfloss.wordpress.com/2006/06/20/mathematica-fonts-error">http://handyfloss.wordpress.com/2006/06/20/mathematica-fonts-error</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2010/04/running-mathematica-over-ssh-using-cygwin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Install Gitweb to a Subdirectory</title>
		<link>http://www.moosechips.com/2010/03/install-gitweb-to-a-subdirectory/</link>
		<comments>http://www.moosechips.com/2010/03/install-gitweb-to-a-subdirectory/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 04:21:59 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=573</guid>
		<description><![CDATA[Reach gitweb at a subdirectory, i.e. &#8220;http://moosechips.com/gitweb&#8221;.  The gitweb README and INSTALL files come with instructions on setting up access to your root web directory, but chances are you&#8217;re already using that for your homepage.  Here&#8217;s the setup for installing to a subdirectory.  (This worked for me with git-1.7.0.1)

Install git.

wget http://kernel.org/pub/software/scm/git/git-1.7.0.2.tar.bz2
tar xvfj [...]]]></description>
			<content:encoded><![CDATA[<p>Reach gitweb at a subdirectory, i.e. &#8220;http://moosechips.com/gitweb&#8221;.  The gitweb README and INSTALL files come with instructions on setting up access to your root web directory, but chances are you&#8217;re already using that for your homepage.  Here&#8217;s the setup for installing to a subdirectory.  (This worked for me with git-1.7.0.1)<br />
<span id="more-573"></span><br />
Install git.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">wget</span> http:<span style=" color: #cccccc;">//</span>kernel.org<span style=" color: #cccccc;">/</span>pub<span style=" color: #cccccc;">/</span>software<span style=" color: #cccccc;">/</span>scm<span style=" color: #cccccc;">/</span>git<span style=" color: #cccccc;">/</span>git-1.7.0.2.tar.bz2
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">tar</span> xvfj git-1.7.0.2.tar.bz2
<span style="color: #7a0874; font-weight: bold;color: #729FCF;">cd</span> git-1.7.0.2.tar.bz2
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">make</span> <span style="color: #007800;color: #cccccc;">prefix</span>=<span style=" color: #cccccc;">/</span>usr<span style=" color: #cccccc;">/</span><span style="color: #7a0874; font-weight: bold;color: #729FCF;">local</span> all doc info
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">make</span> <span style="color: #007800;color: #cccccc;">prefix</span>=<span style=" color: #cccccc;">/</span>usr<span style=" color: #cccccc;">/</span><span style="color: #7a0874; font-weight: bold;color: #729FCF;">local</span> <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">install</span> install-doc install-html install-info</pre></div></div>

<p>Install gitweb to <code>/var/www/gitweb</code>.  </p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">make</span> <span style="color: #007800;color: #cccccc;">prefix</span>=<span style=" color: #cccccc;">/</span>usr<span style=" color: #cccccc;">/</span><span style="color: #7a0874; font-weight: bold;color: #729FCF;">local</span> gitweb<span style=" color: #cccccc;">/</span>gitweb.cgi
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">mkdir</span> <span style=" color: #cccccc;">/</span>var<span style=" color: #cccccc;">/</span>www<span style=" color: #cccccc;">/</span>gitweb
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">cp</span> gitweb<span style=" color: #cccccc;">/</span>git<span style=" color: #cccccc;">*</span> <span style=" color: #cccccc;">/</span>var<span style=" color: #cccccc;">/</span>www<span style=" color: #cccccc;">/</span>gitweb</pre></div></div>

<p>Create a file <code>/var/www/gitweb/gitweb_config</code></p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="perl geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;"># use absolute paths</span></span>
<span style="color: #0000ff;color: #cccccc;">$logo</span><span style=" color: #cccccc;">=</span><span style="color: #ff0000;color: #AD7FA8;">&quot;/gitweb/gitlogo.png&quot;</span>;
<span style="color: #0000ff;color: #cccccc;">$stylesheet</span><span style=" color: #cccccc;">=</span><span style="color: #ff0000;color: #AD7FA8;">&quot;/gitweb/gitweb.css&quot;</span>;
<span style="color: #0000ff;color: #cccccc;">$favicon</span> <span style=" color: #cccccc;">=</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;/gitweb/git-favicon.png&quot;</span>;
<span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;"># enable human readable URLs</span></span>
<span style="color: #0000ff;color: #cccccc;">$feature</span><span class="br0"><span style=" color: #cccccc;">&#123;</span></span><span style="">'pathinfo'</span><span class="br0"><span style=" color: #cccccc;">&#125;</span></span><span class="br0"><span style=" color: #cccccc;">&#123;</span></span><span style="">'default'</span><span class="br0"><span style=" color: #cccccc;">&#125;</span></span> <span style=" color: #cccccc;">=</span> <span class="br0"><span style=" color: #cccccc;">&#91;</span></span><span class="nu0"><span style="color: #FCE94F;">1</span></span><span class="br0"><span style=" color: #cccccc;">&#93;</span></span>;</pre></div></div>

<p>Add some lines to your <code>httpd.conf</code></p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="none geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"># Allow gitweb to be accessed at
# server.address.com/gitweb
Alias /gitweb /var/www/gitweb
# Files are actually in /var/www/gitweb
&lt;Directory /var/www/gitweb&gt;
# Enable CGI's
    Options ExecCGI Indexes FollowSymLinks
    AddHandler cgi-script cgi
&nbsp;
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be &quot;All&quot;, &quot;None&quot;, or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
    AllowOverride All
&nbsp;
# Controls who can get stuff from this server.
    Order allow,deny
    Allow from all
&nbsp;
# Use the gitweb.cgi interface by default
    DirectoryIndex gitweb.cgi
&nbsp;
# Rewrite addresses
    RewriteEngine On
# Tell Apache that addresses are in the /gitweb subfolder
    RewriteBase /gitweb
# If the address is an actual file (e.g. /gitweb/gitweb.css)
# keep the address
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
# Else, pass the address path to gitweb.cgi
    RewriteRule ^.* gitweb.cgi/$0 [L,PT]
&lt;/Directory&gt;</pre></div></div>

<p>Restart your server.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> <span style=" color: #cccccc;">/</span>etc<span style=" color: #cccccc;">/</span>init.d<span style=" color: #cccccc;">/</span>httpd restart</pre></div></div>

<p>Reference:<br />
<a href="http://ask.metafilter.com/120273/Getting-redirects-to-work-in-Apache-for-Gitweb">Getting redirects to work in Apache for Gitweb</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2010/03/install-gitweb-to-a-subdirectory/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing Ffmpeg Binary In Windows</title>
		<link>http://www.moosechips.com/2009/08/installing-ffmpeg-binary-in-windows/</link>
		<comments>http://www.moosechips.com/2009/08/installing-ffmpeg-binary-in-windows/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 20:17:40 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<random>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=560</guid>
		<description><![CDATA[Instructions:

Get the latest build from the arrozcru autobuilds page
Unzip the folder into C:/Program Files/ffmpeg
Add C:/Program Files/ffmpeg/bin to your system&#8217;s PATH environment variable

Optional libx264 preset setup:
If you use libx264 presets (by using the -vpre flag) you need to do the following setup.

Create a HOME environment variable for your user pointing to your home directory.  (e.g. [...]]]></description>
			<content:encoded><![CDATA[<h3>Instructions:</h3>
<ol>
<li>Get the latest build from the <a href="http://ffmpeg.arrozcru.org/autobuilds/">arrozcru autobuilds page</a></li>
<li>Unzip the folder into <strong>C:/Program Files/ffmpeg</strong></li>
<li>Add <strong>C:/Program Files/ffmpeg/bin</strong> to your system&#8217;s <strong>PATH</strong> environment variable</li>
</ol>
<h3>Optional libx264 preset setup:</h3>
<p>If you use libx264 presets (by using the <strong>-vpre</strong> flag) you need to do the following setup.</p>
<ol>
<li>Create a <strong>HOME </strong>environment variable for your user pointing to your home directory.  (e.g. for Vista <strong>C:/Users/moose</strong> or for XP <strong>C:/Documents and Settings/moose</strong> )</li>
<li>Create a <strong>.ffmpeg</strong> folder in your home directory</li>
<li>Copy the preset files from <strong>C:/Program Files/ffmpeg/share/*.ffpreset</strong> into <strong>%HOME%/.ffmpeg</strong></li>
<li>Now you can open a command prompt and use ffmpeg.  :D (e.g. This is my <a href="http://vimeo.com">Vimeo</a> video conversion command.  <strong>ffmpeg -i input.mov -vcodec libx264 -vpre hq -crf 24 -g 25 -acodec libmp3lame -ab 192k -ar 44100 output.mp4</strong> )</li>
</ol>
<p>*note: libfaac is not included in the build since libfaac is considered to be a non-free plugin.  :(</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/08/installing-ffmpeg-binary-in-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Linux Font DPI Help from Mozilla</title>
		<link>http://www.moosechips.com/2009/05/linux-font-dpi-help-from-mozilla/</link>
		<comments>http://www.moosechips.com/2009/05/linux-font-dpi-help-from-mozilla/#comments</comments>
		<pubDate>Tue, 12 May 2009 22:10:25 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=541</guid>
		<description><![CDATA[Thanks to Mozilla for providing excellent linux font DPI support.
On my Gentoo setup, I added a Xft.dpi setting go my ~/.Xdefaults file.  Now my fonts look normal again.  :)

Xft.dpi: 108

Before:

After:

]]></description>
			<content:encoded><![CDATA[<p>Thanks to Mozilla for providing excellent <a href="http://www.mozilla.org/unix/dpi.html">linux font DPI support</a>.</p>
<p>On my Gentoo setup, I added a Xft.dpi setting go my ~/.Xdefaults file.  Now my fonts look normal again.  :)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="config geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">Xft.dpi: 108</pre></div></div>

<h3>Before:</h3>
<p><img src="http://www.moosechips.com/wp-content/uploads/2009/05/screenshot-fonts-before.png" alt="screenshot-fonts-before" title="screenshot-fonts-before" width="603" height="164" class="alignnone size-full wp-image-557" /></p>
<h3>After:</h3>
<p><img src="http://www.moosechips.com/wp-content/uploads/2009/05/screenshot-fonts-after.png" alt="screenshot-fonts-after" title="screenshot-fonts-after" width="603" height="144" class="alignnone size-full wp-image-558" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/05/linux-font-dpi-help-from-mozilla/feed/</wfw:commentRss>
		</item>
		<item>
		<title>X and Hal on Gentoo</title>
		<link>http://www.moosechips.com/2009/05/x-and-hal-on-gentoo/</link>
		<comments>http://www.moosechips.com/2009/05/x-and-hal-on-gentoo/#comments</comments>
		<pubDate>Mon, 11 May 2009 00:25:14 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=527</guid>
		<description><![CDATA[Instructions for installing xorg-server and hal on gentoo.
I&#8217;m writing this because the gentoo documentation for X setup is very outdated.  Gentoo now uses xorg 1.5 which uses hal to setup devices automatically instead of having to configure /etc/X11/xorg.conf.  The Xorg 1.5 update guide might be a little helpful, but it&#8217;s missing some info [...]]]></description>
			<content:encoded><![CDATA[<p>Instructions for installing xorg-server and hal on gentoo.</p>
<p>I&#8217;m writing this because the gentoo documentation for <a href="http://www.gentoo.org/doc/en/xorg-config.xml">X setup</a> is very outdated.  Gentoo now uses xorg 1.5 which uses hal to setup devices automatically instead of having to configure /etc/X11/xorg.conf.  The <a href="http://www.gentoo.org/proj/en/desktop/x/x11/xorg-server-1.5-upgrade-guide.xml">Xorg 1.5 update guide</a> might be a little helpful, but it&#8217;s missing some info and is a bit vague in places.</p>
<h3>Xorg-server 1.5 setup</h3>
<p>Make sure your kernel is compiled with Event interface support.  (If not, see <a href="http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&#038;chap=7">Gentoo Handbook: Configuring the kernel</a> for help recompiling your kernel)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="none geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">Device Drivers ---&gt;
&nbsp;
Input device support ---&gt;
&nbsp;
--- Input device support
[*]     Event interface</pre></div></div>

<p>Add X and hal USE flags (the &#8220;&#8211;alpha-order&#8221; is optional, but I like to keep my USE flags organized)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">flagedit <span style="color: #660033;color: #cccccc;">--alpha-order</span> +hal +X</pre></div></div>

<p>(or equivalently with euse.  euse is from the app-portage/gentoolkit package)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">euse <span style="color: #660033;color: #cccccc;">-E</span> hal X</pre></div></div>

<p>Add to /etc/make.conf</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #007800;color: #cccccc;">INPUT_DEVICES</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;evdev&quot;</span>
<span class="co0"><span style="color: #666666; font-style: italic; color: #81D962;"># Change the video driver to match your video card</span></span>
<span class="co0"><span style="color: #666666; font-style: italic; color: #81D962;"># or install a bunch and let hal choose</span></span>
<span style="color: #007800;color: #cccccc;">VIDEO_DRIVER</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;nv nvidia radeon radeonhd intel sis via vesa fbdev&quot;</span></pre></div></div>

<p>Install xorg-server (which will also install hal since the hal USE flag is now enabled)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">emerge <span style="color: #660033;color: #cccccc;">-av</span> xorg-server</pre></div></div>

<p>Add hal policy files so hal can auto-detect your devices.  Doesn&#8217;t hurt to add them all, hal will figure out what it needs.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">cp</span> <span style=" color: #cccccc;">/</span>usr<span style=" color: #cccccc;">/</span>share<span style=" color: #cccccc;">/</span>hal<span style=" color: #cccccc;">/</span>fdi<span style=" color: #cccccc;">/</span>policy<span style=" color: #cccccc;">/</span>10osvendor<span style=" color: #cccccc;">/*</span> <span style=" color: #cccccc;">/</span>etc<span style=" color: #cccccc;">/</span>hal<span style=" color: #cccccc;">/</span>fdi<span style=" color: #cccccc;">/</span>policy</pre></div></div>

<p>Add hald to startup and start hald</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">rc-config add hald default
<span style=" color: #cccccc;">/</span>etc<span style=" color: #cccccc;">/</span>init.d<span style=" color: #cccccc;">/</span>hald start</pre></div></div>

<p>Don&#8217;t need any /etc/X11/xorg.conf file</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">mv</span> <span style=" color: #cccccc;">/</span>etc<span style=" color: #cccccc;">/</span>X11<span style=" color: #cccccc;">/</span>xorg.conf <span style=" color: #cccccc;">/</span>etc<span style=" color: #cccccc;">/</span>X11<span style=" color: #cccccc;">/</span>xorg.conf.bak</pre></div></div>

<p>Now startx</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">startx</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/05/x-and-hal-on-gentoo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Intel 4965 Wireless on Gentoo</title>
		<link>http://www.moosechips.com/2009/05/intel-4965-wireless-on-gentoo/</link>
		<comments>http://www.moosechips.com/2009/05/intel-4965-wireless-on-gentoo/#comments</comments>
		<pubDate>Sun, 10 May 2009 23:19:56 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=521</guid>
		<description><![CDATA[I recently configured the wireless on my X61 Tablet for Gentoo.  I have a Intel 4965 AGN wireless card.

lspci &#124; grep -i wireless
03:00.0 Network Controller: Intel Corporation PRO/Wireless 4965 AG or AGN Network Connection &#40;rev 61&#41;

Relevant kernel options (from gentoo-sources 2.6.28-r5 kernel)

Device Drivers  ---&#62;
  &#91;*&#93; Network device support  ---&#62;
   [...]]]></description>
			<content:encoded><![CDATA[<p>I recently configured the wireless on my X61 Tablet for Gentoo.  I have a Intel 4965 AGN wireless card.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">lspci</span> | <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">grep</span> <span style="color: #660033;color: #cccccc;">-i</span> wireless
03:<span class="nu16"><span style="color: #FCE94F;">00.0</span></span> Network Controller: Intel Corporation PRO<span style=" color: #cccccc;">/</span>Wireless <span class="nu0"><span style="color: #FCE94F;">4965</span></span> AG or AGN Network Connection <span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">rev</span> <span class="nu0"><span style="color: #FCE94F;">61</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span></pre></div></div>

<p>Relevant kernel options (from gentoo-sources 2.6.28-r5 kernel)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">Device Drivers  ---<span style=" color: #cccccc;">&gt;</span>
  <span class="br0"><span style=" color: #cccccc;">&#91;</span></span><span style=" color: #cccccc;">*</span><span class="br0"><span style=" color: #cccccc;">&#93;</span></span> Network device support  ---<span style=" color: #cccccc;">&gt;</span>
    Wireless LAN  ---<span style=" color: #cccccc;">&gt;</span>
      <span class="br0"><span style=" color: #cccccc;">&#123;</span></span><span style=" color: #cccccc;">*</span><span class="br0"><span style=" color: #cccccc;">&#125;</span></span> Intel Wireless Wifi Core
      <span style=" color: #cccccc;">&lt;</span>M<span style=" color: #cccccc;">&gt;</span> Intel Wireless WiFi Next Gen AGN
        <span class="br0"><span style=" color: #cccccc;">&#91;</span></span><span style=" color: #cccccc;">*</span><span class="br0"><span style=" color: #cccccc;">&#93;</span></span>   Intel Wireless WiFi 4965AGN</pre></div></div>

<p>Install wpa_supplicant and wireless-tools</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">emerge <span style="color: #660033;color: #cccccc;">-av</span> wpa_supplicant wireless-tools</pre></div></div>

<p>Create symlink so Gentoo will initialize the wlan0 at startup</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #7a0874; font-weight: bold;color: #729FCF;">cd</span> <span style=" color: #cccccc;">/</span>etc<span style=" color: #cccccc;">/</span>init.d
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">ln</span> <span style="color: #660033;color: #cccccc;">-s</span> net.lo net.wlan0</pre></div></div>

<p>/etc/conf.d/net</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #007800;color: #cccccc;">modules</span>=<span class="br0"><span style=" color: #cccccc;">&#40;</span></span> <span style="color: #ff0000;color: #AD7FA8;">&quot;wpa_supplicant&quot;</span> <span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span style="color: #007800;color: #cccccc;">iwconfig_wlan0</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;mode managed&quot;</span>
<span style="color: #007800;color: #cccccc;">wpa_supplicant_wlan0</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;-Dwext&quot;</span></pre></div></div>

<p>/etc/wpa_supplicant/wpa_supplicant.conf</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #007800;color: #cccccc;">ctrl_interface</span>=<span style="color: #007800;color: #cccccc;">DIR</span>=<span style=" color: #cccccc;">/</span>var<span style=" color: #cccccc;">/</span>run<span style=" color: #cccccc;">/</span>wpa_supplicant <span style="color: #007800;color: #cccccc;">GROUP</span>=wheel
&nbsp;
<span style="color: #007800;color: #cccccc;">network</span>=<span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
  <span style="color: #007800;color: #cccccc;">ssid</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;MySSID&quot;</span>
  <span style="color: #007800;color: #cccccc;">scan_ssid</span>=<span class="nu0"><span style="color: #FCE94F;">1</span></span>
  <span style="color: #007800;color: #cccccc;">key_mgmt</span>=WPA-PSK
  <span style="color: #007800;color: #cccccc;">psk</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;password&quot;</span>
  <span style="color: #007800;color: #cccccc;">priority</span>=<span class="nu0"><span style="color: #FCE94F;">5</span></span>
<span class="br0"><span style=" color: #cccccc;">&#125;</span></span></pre></div></div>

<p>I was getting <code>SCICSIFFLAG File Not Found</code> errors when trying to bring up my wlan0 interface.  A look at the dmesg log revealed that the iwlagn module was trying to access iwlwifi-4965-2.ucode, so I emerged iwl4965-ucode to fix that.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">emerge <span style="color: #660033;color: #cccccc;">-av</span> iwl4965-ucode</pre></div></div>

<p>Reinitialize the interface to see if everything worked</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style=" color: #cccccc;">/</span>etc<span style=" color: #cccccc;">/</span>init.d<span style=" color: #cccccc;">/</span>net.wlan0 restart</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/05/intel-4965-wireless-on-gentoo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Bootable Gparted USB Stick</title>
		<link>http://www.moosechips.com/2009/05/bootable-gparted-usb-stick/</link>
		<comments>http://www.moosechips.com/2009/05/bootable-gparted-usb-stick/#comments</comments>
		<pubDate>Fri, 08 May 2009 03:17:46 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=497</guid>
		<description><![CDATA[Creating a bootable usb stick with the Gparted live iso in Ubuntu.  Gparted is a graphical partition editor which can resize, move, copy, create, delete your hard drive partitions.
Overview:

Format your usb stick to Fat16 and make it bootable using gparted.
Install the gparted-live*.iso using unetbootin.  (unetbootin also automatically installs the syslinux bootloader)
Reinstall syslinux onto [...]]]></description>
			<content:encoded><![CDATA[<p>Creating a bootable usb stick with the <a href="http://gparted.sourceforge.net/index.php">Gparted</a> live iso in Ubuntu.  Gparted is a graphical partition editor which can resize, move, copy, create, delete your hard drive partitions.</p>
<h3>Overview:</h3>
<ul>
<li>Format your usb stick to Fat16 and make it bootable using gparted.</li>
<li>Install the gparted-live*.iso using unetbootin.  (unetbootin also automatically installs the syslinux bootloader)</li>
<li>Reinstall syslinux onto usb stick.  (<a href="http://gparted.sourceforge.net/liveusb.php">Gparted&#8217;s live cd requires syslinux newer than ver 3.71</a>.  Currently (May 7 2009) Ubuntu 9.04 Jaunty has syslinux 3.63.  Use <code>apt-cache show syslinux | grep "^Filename"</code> to check Ubuntu&#8217;s version)</ul>
<h3>Installation Steps</h3>
<p>1. Install gparted and unetbootin</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">install</span> gparted unetbootin</pre></div></div>

<p>2. Download the <a href="http://sourceforge.net/project/showfiles.php?group_id=115843&#038;package_id=271779">gparted live iso</a> and the latest <a href="http://www.kernel.org/pub/linux/utils/boot/syslinux/">syslinux</a>.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">wget</span> http:<span style=" color: #cccccc;">//</span>superb-west.dl.sourceforge.net<span style=" color: #cccccc;">/</span>sourceforge<span style=" color: #cccccc;">/</span>gparted<span style=" color: #cccccc;">/</span>gparted-live-0.4.4-1.iso
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">wget</span> http:<span style=" color: #cccccc;">//</span>www.kernel.org<span style=" color: #cccccc;">/</span>pub<span style=" color: #cccccc;">/</span>linux<span style=" color: #cccccc;">/</span>utils<span style=" color: #cccccc;">/</span>boot<span style=" color: #cccccc;">/</span>syslinux<span style=" color: #cccccc;">/</span>syslinux-3.80.tar.bz2</pre></div></div>

<p>3. Insert your usb stick into the computer, and copy any files you want to save to your hard drive.  You will be reformatting your stick and will lose all the files on the usb drive.</p>
<p>4. Run gparted.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> gparted</pre></div></div>

<p>Select your usb drive.  (Probably something like /dev/sdc).  Right click on the partition and select <strong>Unmount</strong> to unmount the drive.  Format the drive to <strong>Fat16</strong> and <strong>apply</strong>.  Then make the usb drive bootable by going to <strong>Manage Flags</strong> and selecting the <strong>boot</strong> flag. </p>
<p><img src="http://www.moosechips.com/wp-content/uploads/2009/05/screenshot-gparted.png" alt="screenshot-gparted" title="screenshot-gparted" width="785" height="292" class="alignnone size-full wp-image-512" /></p>
<p>Exit gparted.</p>
<p>5. Remount your usb drive by unplugging and replugging your usb stick.</p>
<p>6. Run unetbootin</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">unetbootin</pre></div></div>

<p>Select <strong>Diskimage ISO</strong> and locate the gparted-*.iso that you downloaded.  Make sure the correct partition is selected at the bottom and click OK.</p>
<p><img src="http://www.moosechips.com/wp-content/uploads/2009/05/screenshot-unetbootin.png" alt="screenshot-unetbootin" title="screenshot-unetbootin" width="534" height="389" class="alignnone size-full wp-image-513" /></p>
<p>Don&#8217;t reboot yet.  Just exit unetbootin.</p>
<p>7. Now, you would be done, except that Ubuntu&#8217;s syslinux is version 3.63 and the gparted live iso requires at least syslinux version 3.71, so you need to reinstall syslinux onto your usb stick.</p>
<p>Unpack the syslinux tarball you downloaded.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">tar</span> xjvf syslinux-3.80.tar.bz2</pre></div></div>

<p>Now install syslinux onto your usb stick</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #7a0874; font-weight: bold;color: #729FCF;">cd</span> syslinux-<span class="nu16"><span style="color: #FCE94F;">3.80</span></span><span style=" color: #cccccc;">/</span>linux
<span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> .<span style=" color: #cccccc;">/</span>syslinux <span style="color: #660033;color: #cccccc;">-s</span> <span style=" color: #cccccc;">/</span>dev<span style=" color: #cccccc;">/</span>sdc1</pre></div></div>

<p>8. Now you&#8217;re done.  Reboot using your new gparted bootable usb stick.</p>
<h3>End Notes:</h3>
<p>This method should work on other bootable isos too.</p>
<p>You could try to use Fat32 if your motherboard supports booting from Fat32 USB devices.  Fat16 is generally more compatible though.</p>
<p>If your USB stick is bigger than the the allowable Fat16 size (2gb), make two partitions: first a 1-2gb Fat16 partition for your boot drive, and a second Fat32 partition with the rest of the space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/05/bootable-gparted-usb-stick/feed/</wfw:commentRss>
		</item>
		<item>
		<title>grep and less with color</title>
		<link>http://www.moosechips.com/2009/04/grep-and-less-with-color/</link>
		<comments>http://www.moosechips.com/2009/04/grep-and-less-with-color/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 01:06:46 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=487</guid>
		<description><![CDATA[Add these lines to your ~/.bashrc to make colorful grep &#124; less output.

alias grep='grep --color=always'
export LESS='-R'

]]></description>
			<content:encoded><![CDATA[<p>Add these lines to your ~/.bashrc to make colorful grep | less output.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #7a0874; font-weight: bold;color: #729FCF;">alias</span> <span style="color: #007800;color: #cccccc;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">grep</span></span>=<span style="color: #ff0000;color: #AD7FA8;">'grep --color=always'</span>
<span style="color: #7a0874; font-weight: bold;color: #729FCF;">export</span> <span style="color: #007800;color: #cccccc;">LESS</span>=<span style="color: #ff0000;color: #AD7FA8;">'-R'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/04/grep-and-less-with-color/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Basename and Dirname</title>
		<link>http://www.moosechips.com/2009/04/basename-and-dirname/</link>
		<comments>http://www.moosechips.com/2009/04/basename-and-dirname/#comments</comments>
		<pubDate>Fri, 10 Apr 2009 21:15:36 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<code>]]></category>

		<category><![CDATA[basename]]></category>

		<category><![CDATA[boost]]></category>

		<category><![CDATA[c++]]></category>

		<category><![CDATA[cpp]]></category>

		<category><![CDATA[dirname]]></category>

		<category><![CDATA[example]]></category>

		<category><![CDATA[filesystem]]></category>

		<category><![CDATA[libgen.h]]></category>

		<category><![CDATA[path]]></category>

		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=445</guid>
		<description><![CDATA[Often the unix commands basename and dirname are useful in shell scripts, but how do you use these in c or c++?.
The C way: libgen.h
If you&#8217;re working in c, the posix header libgen.h provides dirname and basename functions, with some limitations: They only work with char *, and dirname will modify the char * you [...]]]></description>
			<content:encoded><![CDATA[<p>Often the unix commands basename and dirname are useful in shell scripts, but how do you use these in c or c++?.</p>
<h3>The C way: libgen.h</h3>
<p>If you&#8217;re working in c, the posix header <strong>libgen.h</strong> provides dirname and basename functions, with some limitations: They only work with char *, and dirname will modify the char * you pass into it so you need to make a copy of your original path if you wish to keep it.  Example code:</p>
<p>
<div class="wp_syntax"><div class="wp-syntax-code"><pre class="c geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// libgen_example.c</span></span>
<span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Demonstrate libgen.h usage and pitfalls</span></span>
<span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Compile:  gcc -g -o libgen_example libgen_example.c</span></span>
<span class="co2"><span style="color: #339933;">#include</span></span>
<span style=" color: #cccccc;">&lt;</span>libgen.<span class="me1"><span style="color: #35CECE;">h</span></span><span style=" color: #cccccc;">&gt;</span> <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">//basename and dirname</span></span>
<span class="co2"><span style="color: #339933;">#include &lt;string.h&gt; //strlen and strcpy</span></span>
<span class="co2"><span style="color: #339933;">#include &lt;stdio.h&gt; //printf</span></span>
<span class="co2"><span style="color: #339933;">#include &lt;stdlib.h&gt; //malloc</span></span>
&nbsp;
<span style="color: #35CECE;">int</span> main<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #35CECE;">int</span> argc<span style=" color: #cccccc;">,</span> <span style="color: #35CECE;">char</span><span style=" color: #cccccc;">*</span> argv<span class="br0"><span style=" color: #cccccc;">&#91;</span></span><span class="br0"><span style=" color: #cccccc;">&#93;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Demonstrate how dirname changes the path you input to it</span></span>
    <span style="color: #35CECE;">char</span> path<span class="br0"><span style=" color: #cccccc;">&#91;</span></span><span class="br0"><span style=" color: #cccccc;">&#93;</span></span> <span style=" color: #cccccc;">=</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;default/path/to/nowhere.txt&quot;</span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;path='%s'<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span> path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span> dir <span style=" color: #cccccc;">=</span> dirname<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;path='%s'  dir='%s'<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span> path<span style=" color: #cccccc;">,</span> dir<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span> base <span style=" color: #cccccc;">=</span> basename<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;path='%s'  dir='%s'  base='%s'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span>
           path<span style=" color: #cccccc;">,</span> dir<span style=" color: #cccccc;">,</span> base<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Since dirname changed path, base is now &quot;to&quot;</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// instead of &quot;nowhere.txt&quot; as we might have expected.</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Output:</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// path='default/path/to/nowhere.txt'</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// path='default/path/to'  dir='default/path/to'</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// path='default/path/to'  dir='default/path/to'  base='to'</span></span>
&nbsp;
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">//========</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Demonstrate c string copying</span></span>
    <span style="color: #35CECE;">const</span> <span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span> another_path <span style=" color: #cccccc;">=</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;another/path&quot;</span>;
    <span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span> modifiable_copy <span style=" color: #cccccc;">=</span> <span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>malloc<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>strlen<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>another_path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span style=" color: #cccccc;">+</span> <span class="nu0"><span style="color: #FCE94F;">1</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    strcpy<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>modifiable_copy<span style=" color: #cccccc;">,</span> another_path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span> another_dir <span style=" color: #cccccc;">=</span> dirname<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>modifiable_copy<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;another_path='%s'<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span> another_path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;modifiable_copy='%s'<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span> modifiable_copy<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;another_dir='%s'<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span> another_dir<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// note that after this free, another_dir is now also</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// invalid since it pointed to the modifiable_copy's memory</span></span>
    free<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>modifiable_copy<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Output:</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// another_path='another/path'</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// modifiable_copy='another'</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// another_dir='another'</span></span>
&nbsp;
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">//========</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// const strings declared as char * can cause segfaults</span></span>
    <span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span> char_pointer_path <span style=" color: #cccccc;">=</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;char/pointer/path&quot;</span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;char_pointer_path='%s'<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span> char_pointer_path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
&nbsp;
    <span style="color: #35CECE;">char</span> <span style=" color: #cccccc;">*</span> char_pointer_dir <span style=" color: #cccccc;">=</span> dirname<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>char_pointer_path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <a href="http://www.opengroup.org/onlinepubs/009695399/functions/printf.html"><span style="color: #000066;color: #729FCF;">printf</span></a><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;char_pointer_path='%s' char_pointer_dir='%s'<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style=" color: #cccccc;">,</span>
           char_pointer_path<span style=" color: #cccccc;">,</span> char_pointer_dir<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Output:</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// char_pointer_path='char/pointer/path'</span></span>
    <span class="co1"><span style="color: #666666; font-style: italic; color: #81D962;">// Segmentation fault</span></span>
<span class="br0"><span style=" color: #cccccc;">&#125;</span></span></pre></div></div>

</p>
<h3>The C++ way: boost::filesystem</h3>
<p>If you&#8217;re looking for a better c++ solution,  see the <a href="http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/index.htm#tutorial">c++ boost filesystem library.</a> <strong>boost::filesystem::path.parent_path()</strong> can be used like dirname and <strong>boost::filesystem::path.filename()</strong> acts like basename.</p>
<p>The <strong>boost::filesystem</strong> library also has many <a href="http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html">other useful functions</a> for dealing with files and paths  (e.g. <strong>fs::complete(path)</strong> for obtaining an absolute path, <strong>fs::exists(path)</strong> will check if the path exists, <strong>fs::create_directories(path)</strong>, <strong>fs::remove(path)</strong>, <strong>fs::copy_file(from,to)</strong> name a few).  Note that some of these are functions are boost::filesystem::path methods and some are in boost::filesystem.  According to <a href="http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/faq.htm">the faq</a>, operations done by the operating system are provided in <a href="http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html#Non-member-functions">boost::filesystem functions</a>, but functions just performed on the lexical path (just path string manipulations) are provided as <a href="http://www.boost.org/doc/libs/1_38_0/libs/filesystem/doc/reference.html#basic_path-modifiers">boost::filesystem::path methods</a>.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="cpp geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co1"><span style="color: #666666; color: #81D962;">// filesystem_example.cpp</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// Demonstrate using boost::filesystem</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// Compile:  g++ -I /usr/local/include/boost-1_38/ -L /usr/local/lib -lboost_filesystem-gcc41-mt-1_38 -o filesystem_example filesystem_example.cpp</span></span>
<span class="co2"><span style="color: #339900;">#include &lt;boost/filesystem.hpp&gt;</span></span>
<span class="co2"><span style="color: #339900;">#include &lt;iostream&gt;</span></span>
<span style="color: #0000ff;color: #729FCF;">namespace</span> fs <span style=" color: #cccccc;">=</span> boost<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">filesystem</span></span>;
&nbsp;
<span style="color: #35CECE;">int</span> main<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #35CECE;">int</span> argc, <span style="color: #35CECE;">char</span><span style=" color: #cccccc;">*</span> argv<span class="br0"><span style=" color: #cccccc;">&#91;</span></span><span class="br0"><span style=" color: #cccccc;">&#93;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
    fs<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">path</span></span> pathname<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #FF0000;color: #AD7FA8;">&quot;default/path/to/nowhere.txt&quot;</span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">string</span></span> dirname  <span style=" color: #cccccc;">=</span> pathname.<span class="me1"><span style="color: #35CECE;">parent_path</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>.<span class="me1"><span style="color: #35CECE;">string</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
    std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">string</span></span> basename <span style=" color: #cccccc;">=</span> pathname.<span class="me1"><span style="color: #35CECE;">filename</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
&nbsp;
    std<span style=" color: #cccccc;">::</span><a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;pathname = &quot;</span> <span style=" color: #cccccc;">&lt;&lt;</span> pathname <span style=" color: #cccccc;">&lt;&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">endl</span></span>;
    std<span style=" color: #cccccc;">::</span><a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;dirname = &quot;</span> <span style=" color: #cccccc;">&lt;&lt;</span> dirname <span style=" color: #cccccc;">&lt;&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">endl</span></span>;
    std<span style=" color: #cccccc;">::</span><a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;basename = &quot;</span> <span style=" color: #cccccc;">&lt;&lt;</span> basename <span style=" color: #cccccc;">&lt;&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">endl</span></span>;
    <span class="co1"><span style="color: #666666; color: #81D962;">// Output:</span></span>
    <span class="co1"><span style="color: #666666; color: #81D962;">// pathname = default/path/to/nowhere.txt</span></span>
    <span class="co1"><span style="color: #666666; color: #81D962;">// dirname = default/path/to</span></span>
    <span class="co1"><span style="color: #666666; color: #81D962;">// basename = nowhere.txt</span></span>
&nbsp;
    std<span style=" color: #cccccc;">::</span><a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">endl</span></span>;
    std<span style=" color: #cccccc;">::</span><a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;extension = &quot;</span> <span style=" color: #cccccc;">&lt;&lt;</span> pathname.<span class="me1"><span style="color: #35CECE;">extension</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span style=" color: #cccccc;">&lt;&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">endl</span></span>;
    std<span style=" color: #cccccc;">::</span><a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;complete = &quot;</span> <span style=" color: #cccccc;">&lt;&lt;</span> fs<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">complete</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>pathname<span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span style=" color: #cccccc;">&lt;&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">endl</span></span>;
    std<span style=" color: #cccccc;">::</span><a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;exists = &quot;</span> <span style=" color: #cccccc;">&lt;&lt;</span> <span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>fs<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">exists</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>pathname<span class="br0"><span style=" color: #cccccc;">&#41;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span style=" color: #cccccc;">?</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;true&quot;</span> <span style=" color: #cccccc;">:</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;false&quot;</span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span style=" color: #cccccc;">&lt;&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">endl</span></span>;
    <span class="co1"><span style="color: #666666; color: #81D962;">// Output:</span></span>
    <span class="co1"><span style="color: #666666; color: #81D962;">// extension = .txt</span></span>
    <span class="co1"><span style="color: #666666; color: #81D962;">// complete = /home/moose/default/path/to/nowhere.txt</span></span>
    <span class="co1"><span style="color: #666666; color: #81D962;">// exists = false</span></span>
<span class="br0"><span style=" color: #cccccc;">&#125;</span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/04/basename-and-dirname/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Emacs Experimentation</title>
		<link>http://www.moosechips.com/2009/04/emacs-experimentation/</link>
		<comments>http://www.moosechips.com/2009/04/emacs-experimentation/#comments</comments>
		<pubDate>Tue, 07 Apr 2009 18:43:04 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=414</guid>
		<description><![CDATA[My experiences as a [g]vim user trying out emacs.
Day 1:
Emacs commands
Running emacs was no problem, as it was already installed from Fedora&#8217;s repository.  Reading through some emacs tutorials, I found Emacs For VI Users very helpful.  Probably my most used  vi commands are delete line (dd), yank line (yy), and put (p or P). [...]]]></description>
			<content:encoded><![CDATA[<p>My experiences as a [g]vim user trying out emacs.</p>
<h2>Day 1:</h2>
<h4>Emacs commands</h4>
<p>Running emacs was no problem, as it was already installed from Fedora&#8217;s repository.  Reading through some emacs tutorials, I found <a href="http://www.elmindreda.org/emacs.html">Emacs For VI Users</a> very helpful.  Probably my most used  vi commands are delete line (dd), yank line (yy), and put (p or P).  Emacs  confusingly uses &#8220;yank&#8221;  to describe the  vi equivalent &#8220;put&#8221; command of inserting saved text into the document.  Getting used to the sequences of ctrl / alt + key is strange when I&#8217;m used to the efficient vi commands.  &#8221;yy&#8221; becomes &#8220;Ctrl+a  Ctrl+k Ctrl+k Ctrl+/&#8221;.</p>
<h4>Tab behavior</h4>
<p>Started trying to edit some c++ files using emacs, but found that the default tabbing behavior was messing up my indentation.  The default emacs uses 2 spaces per indentation, and will use the tab key to automatically indent code instead of inserting a tab character.  I like to tab-indent my code and view it as 4 spaces / tab.  This was frustratingly difficult to solve, as emacs has so many options, and many of the emacs options have cryptic names and unclear descriptions.  I finally found some sane lines to put into my ~/.emacs file from <a href="http://infolab.stanford.edu/~manku/dotemacs.html">Emacs Tips N Tricks For Everybody</a>.  The</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="lisp geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>global<span style=" color: #cccccc;">-</span>set<span style=" color: #cccccc;">-</span>key <span style="color: #ff0000;color: #AD7FA8;">&quot;<span style="color: #000099; font-weight: bold;">\C</span>-m&quot;</span> 'newline<span style=" color: #cccccc;">-</span>and<span style=" color: #cccccc;">-</span>indent<span class="br0"><span style=" color: #cccccc;">&#41;</span></span></pre></div></div>

<p>line is really nice to emulate vi&#8217;s autoindent feature.  <a href="http://student.northpark.edu/pemente/emacs_tabs.htm">Understanding GNU Emacs and Tabs</a> is also useful for understanding emacs&#8217;s special tabbing behavior.</p>
<h2>Day 2:</h2>
<h4>Antialiased fonts</h4>
<p>Discovered that emacs 23 supports antialiased fonts, but there&#8217;s no stable release yet, and no Fedora 8 rpm.  So, I downloaded the source from cvs and built.  Now running</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">emacs --<span style="color: #007800;color: #cccccc;">font</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;monospace-10&quot;</span></pre></div></div>

<p>works, and emacs looks great.</p>
<h4>Start in background</h4>
<p>I wrote a bash wrapper to always start emacs in the background (similar to gvim) with the monospace font.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co0"><span style="color: #666666; font-style: italic; color: #81D962;">#!/bin/bash</span></span>
<span class="co0"><span style="color: #666666; font-style: italic; color: #81D962;"># start emacs in the background with the monospace font</span></span>
<span style="color: #7a0874; font-weight: bold;color: #729FCF;">exec</span> emacs-23.0.92.1 --<span style="color: #007800;color: #cccccc;">font</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;monospace-10&quot;</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;$@&quot;</span> <span style=" color: #cccccc;">&amp;</span></pre></div></div>

<p>My ~/.bashrc has an alias to run this wrapper.  (I put the wrapper in ~/bin/emacs)</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co0"><span style="color: #666666; font-style: italic; color: #81D962;"># .bashrc alias</span></span>
<span style="color: #7a0874; font-weight: bold;color: #729FCF;">alias</span> <span style="color: #007800;color: #cccccc;">emacs</span>=<span style="color: #ff0000;color: #AD7FA8;">&quot;~/bin/emacs&quot;</span></pre></div></div>

<h4>Matlab files</h4>
<p>Opening a matlab .m file tries to use the ObjC mode.  You can add the matlab mode to emacs using the matlab.el file from <a href="http://matlab-emacs.sourceforge.net/">matlab-emacs</a>.  I put the file at ~/.emacs_addons/matlab.el and added these lines to my ~/.emacs file:</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="lisp geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;">; Add addons dir to path</span></span>
<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #b1b100;color: #729FCF;">setq</span> load<span style=" color: #cccccc;">-</span>path
      <span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #b1b100;color: #729FCF;">append</span> <span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #b1b100;color: #729FCF;">list</span> <span style="color: #b1b100;color: #729FCF;">nil</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;~/.emacs_addons&quot;</span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
              load<span style=" color: #cccccc;">-</span>path<span class="br0"><span style=" color: #cccccc;">&#41;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span class="co1"><span style="color: #808080; font-style: italic; color: #81D962;">; Add matlab.el module</span></span>
<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>autoload 'matlab<span style=" color: #cccccc;">-</span>mode <span style="color: #ff0000;color: #AD7FA8;">&quot;matlab&quot;</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;Enter MATLAB mode.&quot;</span> t<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #b1b100;color: #729FCF;">setq</span> auto<span style=" color: #cccccc;">-</span>mode<span style=" color: #cccccc;">-</span>alist <span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #b1b100;color: #729FCF;">cons</span> '<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span style="color: #ff0000;color: #AD7FA8;">&quot;<span style="color: #000099; font-weight: bold;">\\</span>.m<span style="color: #000099; font-weight: bold;">\\</span>'&quot;</span> . matlab<span style=" color: #cccccc;">-</span>mode<span class="br0"><span style=" color: #cccccc;">&#41;</span></span> auto<span style=" color: #cccccc;">-</span>mode<span style=" color: #cccccc;">-</span>alist<span class="br0"><span style=" color: #cccccc;">&#41;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span class="br0"><span style=" color: #cccccc;">&#40;</span></span>autoload 'matlab<span style=" color: #cccccc;">-</span>shell <span style="color: #ff0000;color: #AD7FA8;">&quot;matlab&quot;</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;Interactive MATLAB mode.&quot;</span> t<span class="br0"><span style=" color: #cccccc;">&#41;</span></span></pre></div></div>

<h4>Regular expressions</h4>
<p>Emacs offers search and replace with regular expressions using the Ctrl-Alt-% command, with some <a href="http://xahlee.org/emacs/emacs_regex.html">caveats</a></p>
<h4>Tab bar</h4>
<p>Opening multiple files in emacs puts each file into a buffer, but there is no [g]vim/firefox-like tab bar which shows the open files.  You have to go through the list of buffers or split your window.  But at least there is the <a href="http://www.emacswiki.org/emacs/TabBarMode">TabBar</a> mode addon.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2009/04/emacs-experimentation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Linux: Find Motherboard Information</title>
		<link>http://www.moosechips.com/2008/11/linux-find-motherboard-information/</link>
		<comments>http://www.moosechips.com/2008/11/linux-find-motherboard-information/#comments</comments>
		<pubDate>Wed, 19 Nov 2008 22:51:16 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<linux>]]></category>

		<category><![CDATA[dmidecode]]></category>

		<category><![CDATA[find]]></category>

		<category><![CDATA[information]]></category>

		<category><![CDATA[manufacturer]]></category>

		<category><![CDATA[motherboard]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=409</guid>
		<description><![CDATA[Find the manufacturer and version of your motherboard with this command:

sudo dmidecode &#124; grep &#34;Base Board&#34; -A 13

Example output:

Base Board Information
        Manufacturer: ASUSTeK Computer INC.
        Product Name: Maximus Formula
        Version: Rev 1.xx
   [...]]]></description>
			<content:encoded><![CDATA[<p>Find the manufacturer and version of your motherboard with this command:</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span style="color: #c20cb9; font-weight: bold;color: #729FCF;">sudo</span> dmidecode | <span style="color: #c20cb9; font-weight: bold;color: #729FCF;">grep</span> <span style="color: #ff0000;color: #AD7FA8;">&quot;Base Board&quot;</span> <span style="color: #660033;color: #cccccc;">-A</span> <span class="nu0"><span style="color: #FCE94F;">13</span></span></pre></div></div>

<p>Example output:</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="bash geshicode" id="geshiid" style="font-family:monospace;color: #FFF;">Base Board Information
        Manufacturer: ASUSTeK Computer INC.
        Product Name: Maximus Formula
        Version: Rev 1.xx
        Serial Number: XXXXXXXXXXX
        Asset Tag: To Be Filled By O.E.M.
        Features:
                Board is a hosting board
                Board is replaceable
        Location In Chassis: To Be Filled By O.E.M.
        Chassis Handle: 0x0003
        Type: Motherboard
        Contained Object Handles: 0</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2008/11/linux-find-motherboard-information/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Election 2008</title>
		<link>http://www.moosechips.com/2008/11/election-2008/</link>
		<comments>http://www.moosechips.com/2008/11/election-2008/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 18:10:54 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<links>]]></category>

		<category><![CDATA[2008]]></category>

		<category><![CDATA[ap]]></category>

		<category><![CDATA[biden]]></category>

		<category><![CDATA[election]]></category>

		<category><![CDATA[google]]></category>

		<category><![CDATA[map]]></category>

		<category><![CDATA[news]]></category>

		<category><![CDATA[palin]]></category>

		<category><![CDATA[polls]]></category>

		<category><![CDATA[president]]></category>

		<category><![CDATA[results]]></category>

		<category><![CDATA[vote]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=396</guid>
		<description><![CDATA[A few sites to keep updated on election day:
Google Election Maps Shows live and historic results, polls, and Palin and Biden&#8217;s life journey
Google Election 2008 News Information on voting and election news
AP Election 2008 News Election news and webcasts
CNN Election Results

]]></description>
			<content:encoded><![CDATA[<p>A few sites to keep updated on election day:</p>
<p><a href="http://maps.google.com/help/maps/elections/">Google Election Maps</a> Shows live and historic results, polls, and Palin and Biden&#8217;s life journey</p>
<p><a href="http://www.google.com/2008election/">Google Election 2008 News</a> Information on voting and election news</p>
<p><a href="http://www.ap.org/elections2008/">AP Election 2008 News</a> Election news and webcasts</p>
<p><a href="http://election.cbsnews.com/election2008/">CNN Election Results</a></p>
<p><script src="http://www.gmodules.com/ig/ifr?url=http://general-election-2008.googlecode.com/svn/trunk/results-gadget.xml&amp;up_state=us&amp;up_race=President&amp;up_countdown=1&amp;synd=open&amp;w=620&amp;h=480&amp;title=2008+Election+Results+from+Google&amp;lang=all&amp;country=ALL&amp;border=%23ffffff%7C3px%2C1px+solid+%23999999&amp;output=js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2008/11/election-2008/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Gcc C++ Hash Classes With Strings</title>
		<link>http://www.moosechips.com/2008/10/using-gcc-c-hash-classes-with-strings/</link>
		<comments>http://www.moosechips.com/2008/10/using-gcc-c-hash-classes-with-strings/#comments</comments>
		<pubDate>Fri, 31 Oct 2008 01:54:33 +0000</pubDate>
		<dc:creator>moosechips</dc:creator>
		
		<category><![CDATA[<code>]]></category>

		<category><![CDATA[c++]]></category>

		<category><![CDATA[example]]></category>

		<category><![CDATA[gcc]]></category>

		<category><![CDATA[hash]]></category>

		<category><![CDATA[hash table]]></category>

		<category><![CDATA[hash_map]]></category>

		<category><![CDATA[hash_set]]></category>

		<category><![CDATA[std]]></category>

		<category><![CDATA[string]]></category>

		<category><![CDATA[__gnu_cxx]]></category>

		<guid isPermaLink="false">http://www.moosechips.com/?p=387</guid>
		<description><![CDATA[So even though hash_map and hash_set aren&#8217;t a part of the C++ standard, there are still implementations included with the gcc compiler.  You have to include  or  and a little magic to get them to work properly with std::string keys.

// Example code using a hash_set with std::string keys on gcc
// Example based [...]]]></description>
			<content:encoded><![CDATA[<p>So even though hash_map and hash_set aren&#8217;t a part of the C++ standard, there are still implementations included with the gcc compiler.  You have to include <ext/hash_map> or <ext/hash_set> and a little magic to get them to work properly with std::string keys.</p>

<div class="wp_syntax"><div class="wp-syntax-code"><pre class="cpp geshicode" id="geshiid" style="font-family:monospace;color: #FFF;"><span class="co1"><span style="color: #666666; color: #81D962;">// Example code using a hash_set with std::string keys on gcc</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// Example based on hash_set code from &quot;6.7 Using Hashed Containers&quot;</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// in O'Reilly C++ Cookbook by Stephens, Diggins, Turkanis &amp; Cogswell  (2006)</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// and gcc fix from post http://gcc.gnu.org/ml/libstdc++/2002-04/msg00107.html</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// Tested with g++ 4.1.2</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// Compile with:</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// g++ -o hash hash.cpp</span></span>
<span class="co1"><span style="color: #666666; color: #81D962;">// Kristi Tsukida &lt;kristi.tsukida at gmail dot com&gt; 30-10-2008</span></span>
&nbsp;
<span class="co2"><span style="color: #339900;">#include &lt;iostream&gt;</span></span>
<span class="co2"><span style="color: #339900;">#include &lt;string&gt;</span></span>
<span class="co2"><span style="color: #339900;">#include &lt;ext/hash_set&gt;</span></span>
&nbsp;
<span style="color: #0000ff;color: #729FCF;">using</span> <span style="color: #0000ff;color: #729FCF;">namespace</span> std;
<span class="co1"><span style="color: #666666; color: #81D962;">// The __gnu_cxx namespace contains the hash_set since it's not standard c++</span></span>
<span style="color: #0000ff;color: #729FCF;">using</span> <span style="color: #0000ff;color: #729FCF;">namespace</span> __gnu_cxx;
&nbsp;
<span class="co1"><span style="color: #666666; color: #81D962;">// This is the magic that will allow the usage of string keys in the hash</span></span>
<span style="color: #0000ff;color: #729FCF;">namespace</span> __gnu_cxx
<span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
        <span style="color: #0000ff;color: #729FCF;">template</span><span style=" color: #cccccc;">&lt;&gt;</span> <span style="color: #35CECE;">struct</span> hash<span style=" color: #cccccc;">&lt;</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">string</span></span> <span style=" color: #cccccc;">&gt;</span>
        <span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
                <span style="color: #35CECE;">size_t</span> operator<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span> <span style="color: #35CECE;">const</span> std<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">string</span></span><span style=" color: #cccccc;">&amp;</span> x <span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span style="color: #35CECE;">const</span>
                <span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
                        <span style="color: #0000ff;color: #729FCF;">return</span> hash<span style=" color: #cccccc;">&lt;</span> <span style="color: #35CECE;">const</span> <span style="color: #35CECE;">char</span><span style=" color: #cccccc;">*</span> <span style=" color: #cccccc;">&gt;</span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span> x.<span class="me1"><span style="color: #35CECE;">c_str</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span> <span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
                <span class="br0"><span style=" color: #cccccc;">&#125;</span></span>
        <span class="br0"><span style=" color: #cccccc;">&#125;</span></span>;
<span class="br0"><span style=" color: #cccccc;">&#125;</span></span>
&nbsp;
<span class="co1"><span style="color: #666666; color: #81D962;">// must specify the hash&lt;string&gt; hash function</span></span>
<span style="color: #35CECE;">typedef</span> hash_set<span style=" color: #cccccc;">&lt;</span>string, hash<span style=" color: #cccccc;">&lt;</span>string<span style=" color: #cccccc;">&gt;</span> <span style=" color: #cccccc;">&gt;</span> string_hash_set;
&nbsp;
<span style="color: #35CECE;">int</span> main<span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
<span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
	string_hash_set hs;
&nbsp;
	string s <span style=" color: #cccccc;">=</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;bravo&quot;</span>;
	hs.<span class="me1"><span style="color: #35CECE;">insert</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>s<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
	s <span style=" color: #cccccc;">=</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;alpha&quot;</span>;
	hs.<span class="me1"><span style="color: #35CECE;">insert</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>s<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
	s <span style=" color: #cccccc;">=</span> <span style="color: #FF0000;color: #AD7FA8;">&quot;charlie&quot;</span>;
	hs.<span class="me1"><span style="color: #35CECE;">insert</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>s<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>;
&nbsp;
	<span style="color: #0000ff;color: #729FCF;">for</span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span>string_hash_set<span style=" color: #cccccc;">::</span><span class="me2"><span style="color: #35CECE;">const_iterator</span></span> p <span style=" color: #cccccc;">=</span> hs.<span class="me1"><span style="color: #35CECE;">begin</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>; p<span style=" color: #cccccc;">!</span><span style=" color: #cccccc;">=</span> hs.<span class="me1"><span style="color: #35CECE;">end</span></span><span class="br0"><span style=" color: #cccccc;">&#40;</span></span><span class="br0"><span style=" color: #cccccc;">&#41;</span></span>; <span style=" color: #cccccc;">++</span>p<span class="br0"><span style=" color: #cccccc;">&#41;</span></span>
	<span class="br0"><span style=" color: #cccccc;">&#123;</span></span>
		<a href="http://www.cplusplus.com/cout"><span style="color: #0000dd;color: #729FCF;">cout</span></a> <span style=" color: #cccccc;">&lt;&lt;</span> <span style=" color: #cccccc;">*</span>p <span style=" color: #cccccc;">&lt;&lt;</span> endl;
	<span class="br0"><span style=" color: #cccccc;">&#125;</span></span>
&nbsp;
<span class="br0"><span style=" color: #cccccc;">&#125;</span></span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.moosechips.com/2008/10/using-gcc-c-hash-classes-with-strings/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
