<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">
 
 <title>Sevenforge by Curtis Spencer</title>
 
 <link href="http://www.sevenforge.com/" />
 <updated>2009-11-12T19:45:17+00:00</updated>
 <id>http://www.sevenforge.com</id>
 <author>
   <name>Curtis Spencer</name>
   <email>curtis@sevenforge.com</email>
 </author>

 
 <link rel="self" href="http://feeds.feedburner.com/sevenforge" type="application/atom+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><entry>
   <title>Using Non-Standard Library Locations with cmake</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/MCa6xmrerKM/using-nonstandard-library-locations-with-cmake" />
   <updated>2009-10-28T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/10/28/using-nonstandard-library-locations-with-cmake</id>
   <content type="html">&lt;p&gt;I am currently running some builds on a shared host where I don't have root
access.  Unfortunately, this means that most of my 3rd party libraries are
installed in ~/local instead of in standard locations like /usr/ and /usr/local&lt;/p&gt;

&lt;p&gt;In my CMakeLists.txt, I have commands such as &lt;code&gt;FIND_LIBRARY&lt;/code&gt; and &lt;code&gt;FIND_PATH&lt;/code&gt;.
I didn't want to change those to use the machine dependent paths, but rather
control them with environment variables.&lt;/p&gt;

&lt;p&gt;So in order to get everything working smoothly, it proved to be pretty easy.&lt;/p&gt;

&lt;p&gt;I just added the following to my .bashrc&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CMAKE_PREFIX_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/local/
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LD_LIBRARY_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/local:&lt;span class="nv"&gt;$LD_LIBRARY_PATH&lt;/span&gt;
&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;LD_RUN_PATH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;~/local:&lt;span class="nv"&gt;$LD_LIBRARY_PATH&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Now cmake can find the nonstandard libraries and when I execute the program,
the libraries are dynamically loaded properly.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/MCa6xmrerKM" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/10/28/using-nonstandard-library-locations-with-cmake</feedburner:origLink></entry>
 
 <entry>
   <title>Stripping a Bad Revision from Mercurial</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/4gJvWLuCLNs/stripping-a-bad-revision-from-mercurial" />
   <updated>2009-10-21T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/10/21/stripping-a-bad-revision-from-mercurial</id>
   <content type="html">&lt;p&gt;Sometimes you do a &lt;code&gt;hg addremove; hg ci; hg push;&lt;/code&gt; when you aren't really thinking.  Here is the antidote.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$hg&lt;/span&gt; --config extensions.hgext.mq&lt;span class="o"&gt;=&lt;/span&gt; strip bad_revision_num
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This &lt;code&gt;hg&lt;/code&gt; command will strip the bad_revision_num and every consequent
revision.  If other developers have started pushing onto your bad repository, it
is an even bigger headache to strip that bad revision and keep the future
ones.  I haven't ran into that problem just yet, but I imagine a little work
with turning the revisions into patches and applying the cherry picked patches
would be one option.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/4gJvWLuCLNs" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/10/21/stripping-a-bad-revision-from-mercurial</feedburner:origLink></entry>
 
 <entry>
   <title>Adding rxvt-unicode to termcap on OSX</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/zyG0M2bcY0Y/adding-rxvt-unicode-to-termcap" />
   <updated>2009-08-31T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/08/31/adding-rxvt-unicode-to-termcap</id>
   <content type="html">&lt;p&gt;I recently installed rxvt-unicode using MacPorts on OSX.  However, when I was
doing some terminal related tasks such as using &lt;code&gt;screen&lt;/code&gt; I was getting errors
such as "Missing termcap entry for rxvt-unicode".  After digging through the
rxvt-unicode documentation, the following bash command install the appropriate
termcap entry.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;infocmp rxvt-unicode &amp;gt; /tmp/termcap
&lt;span class="nv"&gt;$ &lt;/span&gt;tic /tmp/termcap
&lt;/pre&gt;
&lt;/div&gt;

&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/zyG0M2bcY0Y" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/08/31/adding-rxvt-unicode-to-termcap</feedburner:origLink></entry>
 
 <entry>
   <title>The Pain of Connecting to WPA Wi-Fi on the Linux Command Line</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/SEatnkcKADM/connecting-to-wpa-wifi-on-the-command-line" />
   <updated>2009-07-28T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/07/28/connecting-to-wpa-wifi-on-the-command-line</id>
   <content type="html">&lt;p&gt;It is sometimes useful to be able to connect to a Wi-Fi access point without a heavyweight GUI, especially when installing packages before you have a desktop environment installed or getting a lonely home server on the grid without powerline networking.  I spent a while culling all the best information from various blog posts and howtos about connecting to wireless access points from the command line. I think I have come across a good mix.  Once you have a GUI, it is quite a bit easier to just use &lt;a href="http://http://wicd.sourceforge.net/" title="wicd"&gt;wicd&lt;/a&gt; or Gnome's Network Manager.&lt;/p&gt;

&lt;p&gt;I did this on Ubuntu Jaunty, but it should work on any distro with wpa_supplicant.&lt;/p&gt;

&lt;p&gt;First you want to figure out your network hardware configuration&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo lshw -C network
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;For example, &lt;code&gt;eth1&lt;/code&gt; showed up as my wireless network card's logical address.  So for the future examples, &lt;code&gt;eth1&lt;/code&gt; is synonymous with your wireless network interface.&lt;/p&gt;

&lt;p&gt;Next, you can get a list of the local access points using the following command:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo iwlist eth1 scan 
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;One example result is:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;eth1 Scan completed :
Cell 01 - Address: 00:19:E3:FA:38:95
ESSID:&lt;span class="s2"&gt;&amp;quot;MyEssid&amp;quot;&lt;/span&gt;
Mode:Managed
Frequency:2.462 GHz &lt;span class="o"&gt;(&lt;/span&gt;Channel 11&lt;span class="o"&gt;)&lt;/span&gt;
Quality:4/5  Signal level:-63 dBm  Noise level:-92 dBm
IE: IEEE 802.11i/WPA2 Version 1
    Group Cipher : TKIP
    Pairwise Ciphers &lt;span class="o"&gt;(&lt;/span&gt;2&lt;span class="o"&gt;)&lt;/span&gt; : CCMP TKIP
    Authentication Suites &lt;span class="o"&gt;(&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt; : PSK
IE: WPA Version 1
    Group Cipher : TKIP
    Pairwise Ciphers &lt;span class="o"&gt;(&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt; : TKIP
    Authentication Suites &lt;span class="o"&gt;(&lt;/span&gt;1&lt;span class="o"&gt;)&lt;/span&gt; : PSK
Encryption key:on
Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
          11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
          48 Mb/s; 54 Mb/s
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Now, we need to generate a wpa_supplicant configuration file based on the WPA access point we want to use&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;wpa_passphrase &lt;span class="s2"&gt;&amp;quot;MyEssid&amp;quot;&lt;/span&gt;
mypassword
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Take the resulting output and put it into /etc/wpa_supplicant.conf
The file should look something like this&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="c"&gt;# reading passphrase from stdin&lt;/span&gt;
&lt;span class="nv"&gt;network&lt;/span&gt;&lt;span class="o"&gt;={&lt;/span&gt;
  &lt;span class="nv"&gt;ssid&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;MySSID&amp;quot;&lt;/span&gt;
  &lt;span class="c"&gt;#psk=&amp;quot;mypassword&amp;quot;&lt;/span&gt;
  &lt;span class="nv"&gt;psk&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;949744ef68a32f47239b005309823712728ea8238928f6649e2a1be9c43cab
  &lt;span class="nv"&gt;proto&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;WPA
  &lt;span class="nv"&gt;key_mgmt&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;WPA-PSK
&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Now, you need to start running &lt;code&gt;wpa_supplicant&lt;/code&gt; using that configuration file as input&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo wpa_supplicant -D wext -c /etc/wpa_supplicant.conf -i eth1
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Once wpa_supplicant is running you need to run dhclient to get an ip address from the access point.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo dhclient eth1
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Now, if you want to save this so you don't have to do it again, put the following into your /etc/network/interfaces file:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;auto eth1
  iface eth1 inet static
  address 192.168.0.100
  netmask 255.255.255.0
  wireless-essid MyEssid
  pre-up wpa_supplicant -Bw -Dwext -ieth1 -c/etc/wpa_supplicant.conf
  post-down killall -q wpa_supplicant
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This is something that is a lot more complex than it should be...  In writing it down, I hope that the next time I need it, I should be able to reproduce it&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/SEatnkcKADM" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/07/28/connecting-to-wpa-wifi-on-the-command-line</feedburner:origLink></entry>
 
 <entry>
   <title>Meet Pillowtalk, an ANSI C API for CouchDB</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/wS6Jo-G9lYM/pillowtalk-ansi-c-api-for-couchdb" />
   <updated>2009-07-13T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/07/13/pillowtalk-ansi-c-api-for-couchdb</id>
   <content type="html">&lt;p&gt;For those that don't know, &lt;a href="http://couchdb.apache.org" title="CouchDB"&gt;CouchDB&lt;/a&gt; is
an exciting document oriented database that is built upon Erlang.  It uses JSON
as its data format and HTTP to communicate with clients.  These two features
are especially exciting because they create a platform agnostic way to pass
around data and a horizontally scalable communication mechanism.&lt;/p&gt;

&lt;h2&gt;Enter Pillowtalk&lt;/h2&gt;

&lt;p&gt;We have been doing some experimenting with CouchDB over at
&lt;a href="http://www.cruxlux.com" title="Cruxlux"&gt;Cruxlux&lt;/a&gt;, but a lot of our stack is in C.
Unfortunately, there wasn't a simple way to interact with CouchDB because the C
API was deprecated a while back.&lt;/p&gt;

&lt;p&gt;Pillowtalk is a C library built upon &lt;a href="http://curl.haxx.se/libcurl" title="libcurl"&gt;libcurl&lt;/a&gt;
for the HTTP communication and &lt;a href="http://lloyd.github.com/yajl/" title="yajl"&gt;yajl&lt;/a&gt;
for parsing and generating JSON.  I have tagged a 0.0.1 release for anyone who
wants to kick the tires over at github. Learn more about the library with an
&lt;a href="/pillowtalk/" title="Pillowtalk Home"&gt;example&lt;/a&gt;.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/wS6Jo-G9lYM" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/07/13/pillowtalk-ansi-c-api-for-couchdb</feedburner:origLink></entry>
 
 <entry>
   <title>Add Duration to FLV files using flvtool2</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/ilrFBbcqlVE/flvtool2-duration" />
   <updated>2009-02-17T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/02/17/flvtool2-duration</id>
   <content type="html">&lt;p&gt;I have been messing around with the &lt;a href="http://www.osflv.com" title="Open Source FLV Player"&gt;Open Source FLV Player&lt;/a&gt;, and I have found
that the FLV’s i was pointing it to didn’t have duration meta data.  That can
remedied by this simple shell command (as long as you have &lt;strong&gt;flvtool2&lt;/strong&gt; installed):&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;sudo gem install flvtool2
&lt;span class="nv"&gt;$ &lt;/span&gt;cat movie.flv | flvtool2 -U stdin movie.flv
&lt;/pre&gt;
&lt;/div&gt;

&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/ilrFBbcqlVE" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/02/17/flvtool2-duration</feedburner:origLink></entry>
 
 <entry>
   <title>Converting a Virtual PC .vhd to a Virtual Box .vdi</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/0Hd5RCSZX2M/virtual-pc" />
   <updated>2009-02-04T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/02/04/virtual-pc</id>
   <content type="html">&lt;p&gt;I had some Virtual PC images in .vhd that I wanted to convert to Virtual Box
.vdi files.  After some tracing through a few Google searches and some
experimentation of my own, the best way seems to be:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;qemu-img convert -O raw start.vhd intermediate.bin
&lt;span class="nv"&gt;$ &lt;/span&gt;vboxmanage convertdd intermediate.bin final.vdi
&lt;span class="nv"&gt;$ &lt;/span&gt;vboxmanage modifyvdi final.vdi compact
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Once you have the .vdi, I found that I had to enable APIC and IO-APIC to avoid
a blue screen of death in my windows Virtual PC images on startup.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/0Hd5RCSZX2M" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/02/04/virtual-pc</feedburner:origLink></entry>
 
 <entry>
   <title>Unicode Line Separator</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/OCXTww770WQ/unicode-line-separator" />
   <updated>2009-02-01T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2009/02/01/unicode-line-separator</id>
   <content type="html">&lt;p&gt;&lt;a href="http://www.fileformat.info/info/unicode/char/2028/index.htm" title="Unicode Line Separator"&gt;U+2028&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This little Unicode character gave me a run for my money today.  Hard to see,
it shows up as a space in every editor I tried, yet it caused JS
unterminated string errors when it was used in a JS string in Firefox.
Moral of the story, if you are using strings in Javascript, you gotta make
sure to remove these little buggers.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/OCXTww770WQ" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2009/02/01/unicode-line-separator</feedburner:origLink></entry>
 
 <entry>
   <title>How Rails Calculates the Cache-Busting Asset ID</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/RAKdq4F2E6g/cache-busting-asset-id" />
   <updated>2008-12-18T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/12/18/cache-busting-asset-id</id>
   <content type="html">&lt;p&gt;In &lt;strong&gt;asset_tag_helper.rb&lt;/strong&gt;, you find this code:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;rails_asset_id&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;asset_id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ENV&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;RAILS_ASSET_ID&amp;quot;&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt;
    &lt;span class="n"&gt;asset_id&lt;/span&gt;
  &lt;span class="k"&gt;else&lt;/span&gt;
    &lt;span class="n"&gt;path&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;ASSETS_DIR&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;source&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;exist?&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
      &lt;span class="no"&gt;File&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;mtime&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_i&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;to_s&lt;/span&gt;
    &lt;span class="k"&gt;else&lt;/span&gt;
      &lt;span class="s1"&gt;&amp;#39;&amp;#39;&lt;/span&gt;
    &lt;span class="k"&gt;end&lt;/span&gt;
  &lt;span class="k"&gt;end&lt;/span&gt;
&lt;span class="k"&gt;end&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/RAKdq4F2E6g" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/12/18/cache-busting-asset-id</feedburner:origLink></entry>
 
 <entry>
   <title>Debugging bjam's configuration</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/0mgaA0GTrkI/debugging-bjam-configuration" />
   <updated>2008-12-08T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/12/08/debugging-bjam-configuration</id>
   <content type="html">&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;bjam --debug-configuration
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This is useful if you think you are loading up a &lt;strong&gt;site-config.jam&lt;/strong&gt; or a
&lt;strong&gt;user-config.jam&lt;/strong&gt; that you shouldn’t be. I was getting the following error after
an upgrade to Intrepid Ibex:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;error: at /usr/share/boost-build/build/project.jam:825 
error: duplicate initialization of gcc with the following parameters: 
error: &lt;span class="nv"&gt;version&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; 4.3.2
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Then I was able to find that the &lt;strong&gt;site-config.jam&lt;/strong&gt; file in /etc/ was initializing gcc.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/0mgaA0GTrkI" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/12/08/debugging-bjam-configuration</feedburner:origLink></entry>
 
 <entry>
   <title>Ubuntu Developer Man Pages</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/L8Ek3a-Xrjk/ubuntu-developer-manpages" />
   <updated>2008-11-25T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/11/25/ubuntu-developer-manpages</id>
   <content type="html">&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;apt-get install manpages-dev
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Simple as that.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/L8Ek3a-Xrjk" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/11/25/ubuntu-developer-manpages</feedburner:origLink></entry>
 
 <entry>
   <title>fopen error "Value too large for defined data type"</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/286RwtaRtFc/fopen-value-too-large" />
   <updated>2008-11-20T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/11/20/fopen-value-too-large</id>
   <content type="html">&lt;p&gt;Was working with some large data files from Wikipedia in C, and got a NULL
pointer from &lt;code&gt;fopen&lt;/code&gt;.  After checking &lt;code&gt;strerror&lt;/code&gt;, I got the “Value too large
for defined data type.”  error.  The solution.  Put the following definition at
the top of your .c file and it will set you straight.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="cp"&gt;#define _FILE_OFFSET_BITS 64&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;

&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/286RwtaRtFc" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/11/20/fopen-value-too-large</feedburner:origLink></entry>
 
 <entry>
   <title>Rendering rhtml files to string without a controller</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/5fq8XVqR5w0/rendering-rhtml-to-string" />
   <updated>2008-10-29T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/10/29/rendering-rhtml-to-string</id>
   <content type="html">&lt;p&gt;Sometimes you need to pierce the MVC veil and render a view somewhere lower
level without an HTTP request, such as preemptively refreshing a cache without a client
request, or outputing rhtml to a static html file.   To preserve some of the
“Don’t repeat yourself mantra”, it would be nice to have a way to render an
.rhtml without a request/response.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="n"&gt;av&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="no"&gt;ActionView&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Base&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;Rails&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;Configuration&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;new&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;view_path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;av&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;assigns&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="ss"&gt;:item&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="vi"&gt;@item&lt;/span&gt;
&lt;span class="n"&gt;output&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;av&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;render&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;&amp;#39;controller/view&amp;#39;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Thanks to these blog posts: &lt;a href="http://blog.choonkeat.com/weblog/2006/08/rails-calling-r.html" title="ChoonKeat"&gt;Choonkeat&lt;/a&gt; and  &lt;a href="http://davetroy.blogspot.com/2008/02/actsasrenderer-brings-output-to-models.html" title="Acts as Renderer"&gt;acts_as_renderer&lt;/a&gt; for the inspiration.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/5fq8XVqR5w0" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/10/29/rendering-rhtml-to-string</feedburner:origLink></entry>
 
 <entry>
   <title>Tidy up XML on the Command Line</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/WyWAP3Lh_QU/tidy-up-xml-on-command-line" />
   <updated>2008-10-20T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/10/20/tidy-up-xml-on-command-line</id>
   <content type="html">&lt;p&gt;This is a useful snippet if you ever encounter some XML using &lt;code&gt;curl&lt;/code&gt; or &lt;code&gt;wget&lt;/code&gt; that
you want to format on the fly just for readability purposes.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;curl http://myxml.com/myxml.xml | tidy -xml -i -w 0
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;Don’t know how many people need to read XML on the command line out there, but
if you are doing any sort of XML parsing it may come in handy.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/WyWAP3Lh_QU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/10/20/tidy-up-xml-on-command-line</feedburner:origLink></entry>
 
 <entry>
   <title>Fine Tuning Valgrind Callgrind Critical Areas</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/GQtgHGWS1-Y/fine-tuning-valgrind-callgrind-critical-areas" />
   <updated>2008-10-09T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/10/09/fine-tuning-valgrind-callgrind-critical-areas</id>
   <content type="html">&lt;p&gt;Sometimes code that you want to optimize is deep inside your application and
you only want to focus callgrind on that snippet.  There are two steps here.
The first is to include the callgrind header file, which contains a few macros
to enable programmatic start/stop of valgrind instrumentation.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="cp"&gt;#include &amp;lt;valgrind/callgrind.h&amp;gt;&lt;/span&gt;

&lt;span class="c"&gt;/* Stuff */&lt;/span&gt;

&lt;span class="n"&gt;CALLGRIND_START_INSTRUMENTATION&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;do_something&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="n"&gt;CALLGRIND_STOP_INSTRUMENTATION&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c"&gt;/* More Stuff */&lt;/span&gt;
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;The next step involves calling valgrind with instrumentation turned off by
default.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;valgrind --tool&lt;span class="o"&gt;=&lt;/span&gt;callgrind --instr-atstart&lt;span class="o"&gt;=&lt;/span&gt;no bin/my_exec
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;When you close your executable, you should have a callgrind.out with just the
results of the &lt;code&gt;do_something()&lt;/code&gt; method, so you can focus your optimization
efforts there.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/GQtgHGWS1-Y" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/10/09/fine-tuning-valgrind-callgrind-critical-areas</feedburner:origLink></entry>
 
 <entry>
   <title>Attaching to Child Processes using gdb attach</title>
   <link href="http://feedproxy.google.com/~r/sevenforge/~3/IdzlF4iE-WU/attaching-to-child-processes-using-gdb-attach" />
   <updated>2008-09-30T00:00:00+00:00</updated>
   <id>http://www.sevenforge.com/2008/09/30/attaching-to-child-processes-using-gdb-attach</id>
   <content type="html">&lt;p&gt;I was working on a deviantly fishy segfault today that was introduced after I
added daemonization to an existing service of mine.  It turned out that the
daemonizing code chdir’ed to the root folder, so the relative paths in the
service no longer worked.  However, it was hard to detect this in the child
process as it silently failed.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Gdb Attach to the rescue!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Short story even shorter.  Simply run your daemonizing process, then do a &lt;code&gt;ps&lt;/code&gt; to
find out the PID, then use&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span class="o"&gt;(&lt;/span&gt;gdb&lt;span class="o"&gt;)&lt;/span&gt; attach &amp;lt;pid&amp;gt; 
&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;to connect to the process.  Then you can easily see the backtrace when it ends
up failing on you.&lt;/p&gt;

&lt;p&gt;Secondly, if you are having trouble attaching fast enough, just add a
&lt;code&gt;sleep(10)&lt;/code&gt; somewhere at the beginning the child process, so you can connect
fast enough.&lt;/p&gt;
&lt;img src="http://feeds.feedburner.com/~r/sevenforge/~4/IdzlF4iE-WU" height="1" width="1"/&gt;</content>
 <feedburner:origLink>http://www.sevenforge.com/2008/09/30/attaching-to-child-processes-using-gdb-attach</feedburner:origLink></entry>
 
 
</feed>
