<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-9016105</id><updated>2012-01-05T00:32:26.463-06:00</updated><category term='C#'/><category term='C++'/><category term='Windows XP'/><category term='Reflection'/><category term='Visual Studio'/><category term='whitelist'/><category term='Boost'/><category term='VS 2005'/><category term='STL'/><category term='internet filter'/><title type='text'>heifner</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>72</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-9016105.post-8794859056533739535</id><published>2011-06-06T14:31:00.000-05:00</published><updated>2011-06-06T14:31:48.567-05:00</updated><title type='text'>Coding Font</title><content type='html'>I'm setting up a new work computer today.  8 cores, 8 GB RAM (nice).&lt;br /&gt;&lt;br /&gt;I needed to download my favorite font for Visual Studio.  I like &lt;a href="http://www.proggyfonts.com/index.php?menu=download"&gt;Coding Font Tobi&lt;/a&gt;, which can be found here: &lt;a href="http://www.proggyfonts.com/"&gt;http://www.proggyfonts.com/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="separator" style="clear: both; text-align: center;"&gt;&lt;a href="http://www.proggyfonts.com/download/example_coding_font_tobi.gif" imageanchor="1" style="clear:left; float:left;margin-right:1em; margin-bottom:1em"&gt;&lt;img border="0" height="74" width="270" src="http://www.proggyfonts.com/download/example_coding_font_tobi.gif" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-8794859056533739535?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/8794859056533739535/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=8794859056533739535' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/8794859056533739535'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/8794859056533739535'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2011/06/coding-font.html' title='Coding Font'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-2505841180164306957</id><published>2010-08-16T14:11:00.004-05:00</published><updated>2010-08-16T15:03:39.372-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows XP'/><title type='text'>Create Windows XP Pro SP3 OEM Install CD</title><content type='html'>How to create a Windows XP Pro SP3 OEM install CD with IE8 and many of the latest security updates.&lt;br /&gt;&lt;br /&gt;1. Grab a valid Windows install CD.  In my case, a OEM install CD since I wanted to use the COA sticker product id on the computer box.  The OEM stickers all were Windows XP Pro on Dell computers.  You can use an existing Dell Windows XP Pro CD, or contact Dell for one, or download one (not sure if the downloaded CDs are legal).  See &lt;a href="http://www.technibble.com/how-to-tell-what-type-of-windows-xp-cd-or-license-key-you-have/"&gt;http://www.technibble.com/how-to-tell-what-type-of-windows-xp-cd-or-license-key-you-have/&lt;/a&gt; on how to determine what type of windows license key you have.&lt;br /&gt;&lt;br /&gt;2. Copy the CD onto your computer for modification.&lt;br /&gt;&lt;br /&gt;3. Use &lt;a href="http://www.nliteos.com/"&gt;nLite&lt;/a&gt; to modify the CD and add the components you want.  In my case I wanted to add SP3, latest security updates, and IE8.&lt;br /&gt;&lt;br /&gt;4. Addons including IE8 can be found here: &lt;a href="http://www.winaddons.com/nlite-addons/"&gt;http://www.winaddons.com/nlite-addons/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;5. The latest security updates can be found here: &lt;a href="http://www.ryanvm.net/msfn/updatepack-sp3.html"&gt;http://www.ryanvm.net/msfn/updatepack-sp3.html&lt;/a&gt;  These can be used with the latest nLite, just follow the RyanVM nLite integration instructions on the RyanVM site.  Even with these latest security updates, I found that windows still wants to download and install many additional updates.  But at least this will be less than it would be without it.&lt;br /&gt;&lt;br /&gt;6. Add the IE8 add on from the nLite add on site above.  You can add others but be careful to not add more than will fit on a single CD.  If you have a DVD drive on your install computer and a DVD burner available then you can add all kinds of additional software from the addon site.  You can also integrate the universal drivers if you have room (see below).  Since my computers only had CDRom drives, I had to keep it small.&lt;br /&gt;&lt;br /&gt;7. One problem with installing Windows is drivers for existing hardware.  For example the network card, audio, and video was not setup during the windows install on my Dells.  This is particularly frustrating since you can't access the internet to download drivers.  However, a very nice solution is to use DriverPacks found here: &lt;a href="http://driverpacks.net/"&gt;http://driverpacks.net/&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;7a. Download the driver packs base: &lt;a href="http://driverpacks.net/applications/latest"&gt;http://driverpacks.net/applications/latest&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;7b. Download all the driver packs for your version of Windows: &lt;a href="http://driverpacks.net/driverpacks/latest"&gt;http://driverpacks.net/driverpacks/latest&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;7C. Run DriversPack Base.  I created a Stand Alone Driver Disk and put it on a usb thumbdrive.  This worked amazingly well.  After the Windows install I just hooked up the usb thumbdrive and ran DP_Install_Tool.cmd.  It takes awhile to run, but when it is finished all hardware had updated drivers and worked without issue.  It installed missing audio drivers, network card drivers, and video drivers.  It really is quite amazing.  You can even run it multiple times.  I ran it after throwing a wireless network card in one computer and after adding a usb wireless adapter in another, in both cases it installed the needed drivers.  I plan on keeping it around for those cases where you have a network card, video card, usb wireless adapter, etc but don't have the driver cd.  It is easier than trying to find the correct driver on the web.&lt;br /&gt;&lt;br /&gt;8. Create a installer for all the free applications you want installed using &lt;a href="http://ninite.com/"&gt;Ninite&lt;/a&gt;.  This is nice because it creates a click free install for as many applications as you want.  The only drawback is the free version requires each computer to download the applications.  However, you can kick it off and forget about it, so not a big deal.  The installer can be included on the Windows XP CD by just putting it in the directory before creating the ISO image using nLite or just throw it on a usb thumbdrive.  The installer is small since it downloads all the applications from the web.  If the install fails for some reason (in my case unplugging the network switch during the install), then just go the ninite site and create another installer for the pieces that did not install.  Or just kick off the full install again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-2505841180164306957?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/2505841180164306957/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=2505841180164306957' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/2505841180164306957'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/2505841180164306957'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2010/08/create-windows-xp-pro-sp3-oem-install.html' title='Create Windows XP Pro SP3 OEM Install CD'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-7421098711603951264</id><published>2010-06-08T08:10:00.002-05:00</published><updated>2010-06-08T08:31:47.422-05:00</updated><title type='text'>Visual Studio 2008 IntelliSense Tips</title><content type='html'>Recently started working with Visual Studio 2008 again.  Unfortunately my current project is restricted to 2008 and we can't yet upgrade to Visual Studio 2010.&lt;br /&gt;&lt;br /&gt;Visual Studio 2008's C++ IntelliSense is a big improvement over Visual Studio 2005, however at times I find it still has difficulties showing popup info and going to definition.  If you search for these types of problems you find many people advising deleting *.ncb and rebuilding.  After some trial and errors and hints from Microsoft sites about potential parser problems, I can offer the following advice which has worked great for me for solving these types of issues.&lt;br /&gt;&lt;br /&gt;If the "Go To Definition" goes to the declaration instead of the method definition, then make sure the declaration does not use any immediately undeclared types.  By immediate I mean in the header file itself.  Pre-compiled headers do not seem to count.&lt;br /&gt;&lt;br /&gt;For example:&lt;pre&gt;&lt;code&gt;&lt;br /&gt;  void foo(const string&amp;amp; str, ostream&amp;amp; os);&lt;br /&gt;  // should be:&lt;br /&gt;  void foo(const std::string&amp;amp; str, std::ostream&amp;amp; os);&lt;br /&gt;&lt;br /&gt;  // make sure A is forward declared, or included&lt;br /&gt;  void foo(const A&amp;amp; a);&lt;br /&gt;&lt;br /&gt;  // make sure Temp and A are forward declared,&lt;br /&gt;  //   class A;&lt;br /&gt;  //   template &amp;lt;class X&amp;gt; class Temp;&lt;br /&gt;  void foo(Temp&amp;lt;A&amp;gt;&amp;amp; t);&lt;br /&gt;&lt;/code&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-7421098711603951264?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/7421098711603951264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=7421098711603951264' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/7421098711603951264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/7421098711603951264'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2010/06/visual-studio-2008-intellisense-tips.html' title='Visual Studio 2008 IntelliSense Tips'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-6392838552306741886</id><published>2008-04-10T12:36:00.005-05:00</published><updated>2008-04-10T13:44:44.177-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++ array size determination - Part 2</title><content type='html'>In my last post I showed &lt;a href="http://heifner.blogspot.com/2008/04/c-array-size-determination.html"&gt;how to create a template function to determine the size of a C++ array&lt;/a&gt; and promised to show how to create a template that will work with a type instead of a variable.&lt;br /&gt;&lt;br /&gt;Lets start by looking at a struct template that through specialization we can use to capture the number of elements in an array.&lt;pre&gt;  template &amp;lt;typename T&amp;gt;&lt;br /&gt;  struct array_info&lt;br /&gt;  {&lt;br /&gt;  };&lt;/pre&gt;This just names a template that we will specialize for arrays, like so:&lt;pre&gt;  template &amp;lt;typename T, size_t N&amp;gt;&lt;br /&gt;  struct array_info&amp;lt;T[N]&amp;gt;&lt;br /&gt;  {&lt;br /&gt;    typedef T type;&lt;br /&gt;    enum { size = N };&lt;br /&gt;  };&lt;br /&gt;&lt;/pre&gt;Now we have a template that for arrays will enable us to get to the size and type of elements in the array.  This can be used like so:&lt;pre&gt;  typedef int IntArray[10];&lt;br /&gt;  size_t s = array_info&amp;lt;IntArray&amp;gt;::size; // s == 10&lt;/pre&gt;Or like so:&lt;pre&gt;  float floatArray[array_info&amp;lt;IntArray&amp;gt;::size];&lt;/pre&gt;If we try something other than an array we get a compiler error.&lt;pre&gt;  size_t s = array_info&amp;lt;int*&amp;gt;::size; // error&lt;br /&gt;&lt;/pre&gt;Generates a compiler error similar to:&lt;pre&gt;  error: 'size' is not a member of '&amp;lt;unnamed&amp;gt;::array_info&amp;lt;int*&amp;gt;'&lt;/pre&gt;This is nice, but the real power is in using this with other templates.  Even though I'm working with arrays one of the apis I'm using returns a pointer instead of an array reference.  I know the type (which includes its length) so I wanted to take advantage of that.  Here I use the array_info in an equal method to determine the length:&lt;pre&gt;  template &amp;lt;typename A, typename T&amp;gt;&lt;br /&gt;  bool equal(const T* lhs, const T* rhs)&lt;br /&gt;  {&lt;br /&gt;    // Use 'typename array_info&amp;lt;A&amp;gt;::type' instead of 'T' so that compiler&lt;br /&gt;    // verifies A and T types match up.&lt;br /&gt;    const typename array_info&amp;lt;A&amp;gt;::type* const end = &amp;amp;lhs[array_info&amp;lt;A&amp;gt;::size];&lt;br /&gt;    return std::equal(&amp;amp;lhs[0], end, rhs, &amp;equal_to&amp;lt;T&amp;gt;);&lt;br /&gt;  }&lt;/pre&gt;This template can then be used like so:&lt;pre&gt;  equal&amp;lt;IntArray&amp;gt;(lhs.getVal(), rhs.getVal());&lt;/pre&gt;That is not syntax you get to use everyday.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-6392838552306741886?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/6392838552306741886/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=6392838552306741886' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6392838552306741886'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6392838552306741886'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/04/c-array-size-determination-part-2.html' title='C++ array size determination - Part 2'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-9120732378609321236</id><published>2008-04-10T10:02:00.006-05:00</published><updated>2008-04-10T13:34:23.816-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++ array size determination</title><content type='html'>My current project has me working with C-style C++ arrays.  In order to make things easier and safer I created some helper templates.&lt;br /&gt;&lt;br /&gt;Lets start with finding the the number of elements in an array.  The conventional C way would be to use sizeof like:&lt;pre&gt;  sizeof(array)/sizeof(array[0])&lt;/pre&gt;I'm not a big fan of this approach.  I have seen production code by seasoned C++ developers that looks like this:&lt;pre&gt;  const char* tmp = 0;&lt;br /&gt;  // ...&lt;br /&gt;  int size = sizeof(tmp)/sizeof(tmp[0]);&lt;/pre&gt;Of course this is sometimes hidden behind a macro:&lt;pre&gt;  #define array_size(array) (sizeof(array)/sizeof(array[0]))&lt;br /&gt;  // ...&lt;br /&gt;  int size = array_size(tmp);&lt;/pre&gt;Either way, this gives the wrong answer.  The developer, of course, is not interested in what the size of a pointer to an element divided by the size of an element is.&lt;br /&gt;&lt;br /&gt;So, can we do better?  Actually, yes, we can.&lt;pre&gt;  template &amp;lt;typename T, size_t N&amp;gt;&lt;br /&gt;  inline&lt;br /&gt;  size_t array_size(const T (&amp;amp;lhs)[N])&lt;br /&gt;  {&lt;br /&gt;    return N;&lt;br /&gt;  }&lt;/pre&gt;Here we pass an array by reference to array_size() that extracts the size of the array and returns it.  I talked briefly about &lt;a href="http://heifner.blogspot.com/2005/06/c-reference-to-array.html"&gt;array passing&lt;/a&gt; a few years ago.&lt;br /&gt;&lt;br /&gt;We can now use it like so:&lt;pre&gt;  int ia[10];&lt;br /&gt;  size_t s = array_size(ia); // s == 10&lt;/pre&gt;And if we try to use this with a pointer like so:&lt;pre&gt;  const char* tmp = 0;&lt;br /&gt;  // ...&lt;br /&gt;  size_t s = array_size(tmp); // error&lt;/pre&gt;We get a compiler error similar to:&lt;pre&gt;  error: no matching function for call to 'array_size(const char*&amp;amp;)'&lt;/pre&gt;Very nice.&lt;br /&gt;&lt;br /&gt;However, sizeof can also be used with a type instead of a variable.  In my next post, I'll show how we can create a template that will work with a type instead of a variable.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-9120732378609321236?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/9120732378609321236/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=9120732378609321236' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/9120732378609321236'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/9120732378609321236'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/04/c-array-size-determination.html' title='C++ array size determination'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-7451270815664475154</id><published>2008-04-02T06:56:00.002-05:00</published><updated>2008-04-02T07:13:43.291-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Boost'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>BoostCon'08</title><content type='html'>I'm speaking on &lt;a href="http://www.boostcon.com/program#schedule.heifner-threading-with-boost"&gt;Boost.Thread&lt;/a&gt; this year at &lt;a href="http://www.boostcon.com/program"&gt;BoostCon'08&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Here is the announcement from the Boost mailing list:&lt;br /&gt;&lt;br /&gt;Reminder: early registration for BoostCon'08 closes Monday, April 7.&lt;br /&gt;It's still not too late to avoid the late registration fee for what may&lt;br /&gt;be the finest C++ event of 2008.&lt;br /&gt;&lt;br /&gt;For the 2nd annual Boost C++ libraries conference, we've put together a&lt;br /&gt;fantastic program crowned by a keynote address from Bjarne Stroustrup.&lt;br /&gt;In addition to existing Boost libraries, we're covering technology of&lt;br /&gt;interest to any C++ developer trying to stay on the cutting edge,&lt;br /&gt;including hands-on sessions with features from the upcoming 2nd version&lt;br /&gt;of the C++ standard.  This year we've also added a collection of short&lt;br /&gt;"author's corner" sessions for those of you who want an inside&lt;br /&gt;perspective on how advanced libraries are developed.  See&lt;br /&gt;&lt;a href="http://www.boostcon.com/program"&gt;http://www.boostcon.com/program&lt;/a&gt; for details.&lt;br /&gt;&lt;br /&gt;BoostCon 2008 will be hosted at Aspen Center for Physics, one of the&lt;br /&gt;most beautiful meeting sites in the world, and a great venue for&lt;br /&gt;collaboration and discovery.  The combination of a relaxed pace and&lt;br /&gt;intense inquiry made BoostCon'07 an event to remember, and we expect no&lt;br /&gt;less for this year.  Please visit &lt;a href="http://www.boostcon.com/registration"&gt;http://www.boostcon.com/registration&lt;/a&gt;&lt;br /&gt;to register.&lt;br /&gt;&lt;br /&gt;Thanks!&lt;br /&gt;&lt;br /&gt;-- The BoostCon Planning Committee&lt;br /&gt;&lt;br /&gt;David Abrahams&lt;br /&gt;Beman Dawes&lt;br /&gt;Jeff Garland&lt;br /&gt;Joel de Guzman&lt;br /&gt;Eric Niebler&lt;br /&gt;Sean Parent&lt;br /&gt;Jeremy Siek&lt;br /&gt;Matthias Troyer&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-7451270815664475154?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.boostcon.com/home' title='BoostCon&apos;08'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/7451270815664475154/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=7451270815664475154' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/7451270815664475154'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/7451270815664475154'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/04/boostcon08.html' title='BoostCon&apos;08'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-5991351844148963041</id><published>2008-03-31T21:27:00.004-05:00</published><updated>2008-03-31T23:15:09.376-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='Boost'/><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Building Boost 1.35.0</title><content type='html'>Seems I always have troubles building &lt;a href="http://www.boost.org/"&gt;Boost&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;To start I followed the big '&lt;a href="http://www.boost.org/users/download/"&gt;Get Boost&lt;/a&gt;' button on the right side of &lt;a href="http://www.boost.org/"&gt;boost.org&lt;/a&gt;; thinking, 'That sure is obvious'.  That link takes you to a download page with &lt;a href="http://www.boost.org/users/news/version_1_35_0"&gt;boost version 1.35.0&lt;/a&gt; right at the top.  It shows the new libs with 'Detail' and 'Download'.  I took a few seconds to read the new libs section and clicked on &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=8041&amp;release_id=587936"&gt;download&lt;/a&gt;.  This took me to sourceforge.net where they have the source code only release.  Well, I knew that &lt;a href="http://www.boost-consulting.com/"&gt;Boost Consulting&lt;/a&gt; has  maintained an installer for Windows assuming you are using boost with Visual Studio.  So I jumped over to their &lt;a href="http://www.boost-consulting.com/products/free"&gt;boost installer site&lt;/a&gt;, only to find that they don't have one yet for 1.35.0.&lt;br /&gt;&lt;br /&gt;No problem, I'll just go back and grab the source code from sourceforge.net and follow the instructions in the &lt;a href="http://www.boost.org/doc/libs/1_35_0/more/getting_started/index.html"&gt;getting started document&lt;/a&gt;.  I kicked off the download and started looking for the getting started document.  After a while, I figure I must be crazy, because I can't find it.  I finally do a google search in order to find it.  Still thinking I must have just missed it, I went back and followed every link on the right of the the main boost site.  It is not under 'Introduction' or any other of the sections.  I finally did locate it, it is on the main page on the left under 'GETTING STARTED'.  Funny how you can look right past something like that.&lt;br /&gt;&lt;br /&gt;So now I figure all I have to do is follow the getting started guide to build boost.&lt;br /&gt;&lt;br /&gt;Step 1. Get Boost.  I already did that.  My download had already completed from sourceforge.net.  I unziped it (actually un-7zed it) to c:\boost\boost_1_35_0\.&lt;br /&gt;&lt;br /&gt;Step 2. Explain Boost Distribution.  Ok, nothing new here.&lt;br /&gt;&lt;br /&gt;Step 3. Header only libs.  Right, header only libs are nice.  Just compile and go.  However, Boost.Thread among others need to be compiled.&lt;br /&gt;&lt;br /&gt;Step 4. Build with a header only lib.  Been there done that many times.  There are sub-steps for building with Visual Studio.  I always use &lt;a href="http://www.ociweb.com/products/mpc"&gt;MPC&lt;/a&gt;, so this is not useful to me.  I plan to create a separate post or two about building boost applications with MPC.  When you see how easy it is to use MPC with Boost, I doubt that you will use anything else.&lt;br /&gt;&lt;br /&gt;Step 5. Building Boost libraries.  Alright, here we go.&lt;br /&gt;&lt;br /&gt;Step 5.1. Install Boost libraries.  Yeah, thats what I wanted to do to start with.  However, Boost Consulting has not yet put out an installer for 1.35.0.&lt;br /&gt;&lt;br /&gt;Step 5.2. Build from source.&lt;br /&gt;&lt;br /&gt;Step 5.2.1. Get &lt;a href="http://sourceforge.net/project/showfiles.php?group_id=7586&amp;package_id=72941"&gt;bjam&lt;/a&gt;.  I put the executable in c:\boost\boost_1_35_0\.&lt;br /&gt;&lt;br /&gt;Step 5.2.2. Identify toolset.  I want: msvc.&lt;br /&gt;&lt;br /&gt;Step 5.2.3. Select a build directory.  It says this is not necessary.&lt;br /&gt;&lt;br /&gt;Step 5.2.4. Invoke bjam.  This is where I got in trouble.  I tried various combinations of commands/arguments to bjam.  I must have tried to build 3-4 times.  Finally I settled on the following after looking at bjam --help.&lt;br /&gt;&lt;pre&gt;cd c:\boost\boost_1_35_0&lt;br /&gt;bjam --build-type=complete --prefix="c:\boost\boost_1_35_0" install&lt;/pre&gt;Seems like I should have included --toolset=msvc, but I forgot and it picked msvc-8.0 anyway.  &lt;br /&gt;&lt;br /&gt;This worked for me creating a c:\boost\boost_1_35_0\lib directory as the rest of the getting started document assumes.  Actually the getting started doc has it under C:\Program Files\boost\boost_1_35_0\lib, but I like c:\boost\boost_1_35_0\lib better.  &lt;br /&gt;&lt;br /&gt;After the build you can delete the c:\boost\boost_1_35_0\bin.v2 directory to free up space.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-5991351844148963041?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/5991351844148963041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=5991351844148963041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/5991351844148963041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/5991351844148963041'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/03/building-boost-1350.html' title='Building Boost 1.35.0'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-8652748479848557073</id><published>2008-03-21T15:29:00.003-05:00</published><updated>2008-03-21T15:58:47.859-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Windows XP'/><title type='text'>Windows XP Daylight Savings Time Problem</title><content type='html'>On March 11, 2008 I had to turn off Windows XP automatic synchronization with an internet time server because the time was wrong on my laptop.  I manually set the time and forgot about it.  Yesterday I realized that my email message times were off by one hour.  I looked at one of my sent emails and it had "Date: Fri, 21 Mar 2008 14:39:48 -0600".  I googled and figured out that since I'm in CDT this should be -0500.  As a matter of fact emails sent to me from those I work with did in fact have this in the message header: "Fri, 21 Mar 2008 14:34:36 -0500 (CDT)".  I couldn't figure out why my machine wasn't updated for the new daylight savings time begin date.  I have all the latest Windows XP updates.&lt;br /&gt;&lt;br /&gt;I talked to our system admin at &lt;a href="http://www.ociweb.com/"&gt;OCI&lt;/a&gt; and he said I needed to apply this update:&lt;a href="http://http://support.microsoft.com/kb/928388"&gt;928388&lt;/a&gt;.  I downloaded it, but it said that it was already applied.  After digging around some more I found the following &lt;a href="http://support.microsoft.com/kb/914387"&gt;"How to configure daylight saving time for Microsoft Windows operating systems"&lt;/a&gt;. I followed the steps which require you to create and apply a registry file and create and run a vbs script.  That fixed the problem.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-8652748479848557073?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/8652748479848557073/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=8652748479848557073' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/8652748479848557073'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/8652748479848557073'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/03/windows-xp-daylight-savings-time.html' title='Windows XP Daylight Savings Time Problem'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-4232993606415982680</id><published>2008-03-10T15:11:00.003-05:00</published><updated>2008-03-10T15:38:49.595-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>std::for_each with C-style arrays</title><content type='html'>Although std::for_each is most often used with the standard containers, it can also be used with C-style arrays.  Take for example the following:&lt;pre&gt;#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;#include &amp;lt;functional&amp;gt;&lt;br /&gt;// ...&lt;br /&gt;WriterTask writer[NumThreads];&lt;br /&gt;std::for_each(writer, writer+NumThreads, &lt;br /&gt;   std::mem_fun_ref(&amp;WriterTask::activate));&lt;br /&gt;// ...&lt;br /&gt;std::for_each(writer, writer+NumThreads, &lt;br /&gt;   std::mem_fun_ref(&amp;WriterTask::join));&lt;/pre&gt;Or if you prefer:&lt;pre&gt;std::for_each(&amp;writer[0], &amp;writer[NumThreads],&lt;br /&gt;   std::mem_fun_ref(&amp;WriterTask::activate));&lt;/pre&gt;Compare the above with the explicit for loop:&lt;pre&gt;for (int i = 0; i &amp;lt; NumThreads; ++i) {&lt;br /&gt;   writer[i].activate();&lt;br /&gt;}&lt;/pre&gt;I'm not completely convinced that the std::for_each case is more readable.  However, I liked it better than the for loop for some test cases I was writing.  It collapsed a number of subsequent for loops down into one line statements making it clearer the intent of the test.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-4232993606415982680?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/4232993606415982680/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=4232993606415982680' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/4232993606415982680'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/4232993606415982680'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/03/stdforeach-with-c-style-arrays.html' title='std::for_each with C-style arrays'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-6919149293313537780</id><published>2008-02-29T13:51:00.003-06:00</published><updated>2008-02-29T15:02:43.351-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Visual Studio'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>std::min and std::max</title><content type='html'>Today I typed the following:&lt;br /&gt;&lt;pre&gt;int t = (std::max)(timeout, lagtime);&lt;/pre&gt;&lt;br /&gt;Why did I put parentheses around std::max?  Because windows.h defines (among other things) a max and a min macro.  If you include windows.h the above code will not compile.  For example the following:&lt;br /&gt;&lt;pre&gt;#include "windows.h"&lt;br /&gt;#include &amp;lt;algorithm&amp;gt;&lt;br /&gt;&lt;br /&gt;void foo() {&lt;br /&gt;    int i = 5;&lt;br /&gt;    int j = 7;&lt;br /&gt;    int x = std::max(i,j);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;Will produce the following error with Visual Studio C++ 2005:&lt;br /&gt;&lt;pre&gt;1&gt;test.cpp(7) : error C2589: '(' : illegal token on right side of '::'&lt;br /&gt;1&gt;test.cpp(7) : error C2143: syntax error : missing ';' before '::'&lt;/pre&gt;&lt;br /&gt;There are a number of ways to work around windows.h defining these two macros.&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt;Use alternative names defined in windows.h.&lt;pre&gt;int x = _cpp_max(i,j);&lt;br /&gt;int y = _cpp_min(i,j);&lt;/pre&gt;This is not portable; only works on Windows.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Define NOMINMAX before including windows.h.  This might break existing code that assumes NOMINMAX is not defined.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Don't use std::min and std::max.  Instead use the tertiary operator like so: &lt;pre&gt;int x = i &amp;gt; j ? i : j; // max(i,j)&lt;br /&gt;int y = i &amp;lt; j ? i : j; // min(i,j)&lt;/pre&gt;This is portable but not as readable and more error prone.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Use using statements to make the code portable:&lt;pre&gt;using std::min;&lt;br /&gt;using std::max;&lt;br /&gt;int x = max(i,j);&lt;br /&gt;int y = min(i,j);&lt;/pre&gt;This works but requires two more lines of code.  You could also just use 'using namespace std;' but that might pull in more than you want.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Use std::min&amp;lt;int&amp;gt; and std::max&amp;lt;int&amp;gt;&lt;pre&gt;int x = std::max&amp;lt;int&amp;gt;(i,j);&lt;br /&gt;int y = std::min&amp;lt;int&amp;gt;(i,j);&lt;/pre&gt;This requires you to specify the type.  However in some cases this actually helps.  For example:&lt;pre&gt;int i = 5;&lt;br /&gt;unsigned int j = 7;&lt;br /&gt;int x = (std::max)(i,j);&lt;br /&gt;int y = (std::min)(i,j);&lt;/pre&gt;Note the 'unsigned'. Generates the following errors:&lt;pre&gt;1&gt;test.cpp(7) : error C2780: 'const _Ty &amp;std::max(const _Ty &amp;,const _Ty &amp;,_Pr)' : &lt;br /&gt;expects 3 arguments - 2 provided&lt;br /&gt;1&gt;        c:\program files\microsoft visual studio 8\vc\include\xutility(3190) :&lt;br /&gt;see declaration of 'std::max'&lt;br /&gt;1&gt;test.cpp(7) : error C2782: 'const _Ty &amp;std::max(const _Ty &amp;,const _Ty &amp;)' :&lt;br /&gt;template parameter '_Ty' is ambiguous&lt;br /&gt;1&gt;        c:\program files\microsoft visual studio 8\vc\include\xutility(3182) :&lt;br /&gt;see declaration of 'std::max'&lt;br /&gt;1&gt;        could be 'unsigned int'&lt;br /&gt;1&gt;        or 'int'&lt;/pre&gt;By explicitly specifying type via &amp;lt;int&amp;gt; you remove the ambiguity.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt;Use (std::min) and (std::max)&lt;pre&gt;int i = 5;&lt;br /&gt;int j = 7;&lt;br /&gt;int x = (std::max)(i,j);&lt;br /&gt;int y = (std::min)(i,j);&lt;/pre&gt;This works (as does the std::max&amp;lt;int&amp;gt;) because the C++ preprocessor requires '(' as the next preprocessing token following the macro name to preform the macro expansion.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-6919149293313537780?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/6919149293313537780/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=6919149293313537780' title='11 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6919149293313537780'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6919149293313537780'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/02/stdmin-and-stdmax.html' title='std::min and std::max'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>11</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-1555156175552395321</id><published>2008-02-28T08:38:00.003-06:00</published><updated>2008-02-28T09:09:06.367-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++ if variable initialization</title><content type='html'>All C++ programmer know that a variable can be initialized within the definition of a for statement like so:&lt;br /&gt;&lt;pre&gt;for (int i = 0; i &amp;lt; 9; ++i) {  &lt;br /&gt;   std::cout &amp;lt;&amp;lt; i &amp;lt;&amp;lt; '\n';&lt;br /&gt;}&lt;/pre&gt;However, many do not know that the same can be done in an if statement.  For example:&lt;br /&gt;&lt;pre&gt;if (Foo* f = dynamic_cast&amp;lt;Foo*&gt;(a)) {&lt;br /&gt;  f-&gt;doSomething();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// f is not available here.&lt;/pre&gt;You should always define your variables to have the smallest possible scope.  This technique allows you to pull your local if variables into the if statement thereby reducing their visibility.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-1555156175552395321?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/1555156175552395321/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=1555156175552395321' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1555156175552395321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1555156175552395321'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/02/c-if-variable-initialization.html' title='C++ if variable initialization'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-6559664471118728622</id><published>2008-02-25T09:55:00.005-06:00</published><updated>2008-02-25T10:47:57.415-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='STL'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>std::fill_n</title><content type='html'>Many of the tests I have been writing lately involve creating min/max/misc. values to send across our messaging system.  It dawned on me today that the for loops I have been writing could be better expressed with std::fill_n.  For example take the following loop:&lt;br /&gt;&lt;pre&gt;std::vector&amp;lt;std::string&gt; strSeq;&lt;br /&gt;const int MAX_STRSEQ_SIZE = 31;&lt;br /&gt;for (int i = 0; i &amp;lt; MAX_STRSEQ_SIZE; ++i)&lt;br /&gt;  strSeq.push_back("0123456789");&lt;/pre&gt;This can be better written using the standard template library:&lt;br /&gt;&lt;pre&gt;std::vector&amp;lt;std::string&gt; strSeq;&lt;br /&gt;const int MAX_STRSEQ_SIZE = 31;&lt;br /&gt;std::fill_n(std::back_inserter(strSeq), MAX_STRSEQ_SIZE, &lt;br /&gt;            "0123456789");&lt;/pre&gt;Although this isn't really any shorter than the original for loop, I believe it reads better.&lt;br /&gt;&lt;br /&gt;Lets review std::fill_n():&lt;br /&gt;&lt;pre&gt;template&amp;lt;typename ForwardIter, typename Size, typename T&gt;&lt;br /&gt;fill_n(ForwardIter begin, Size n, const T&amp; value);&lt;/pre&gt;std::fill_n takes three arguments: ForwardIter, Size, and T.  ForwardIter is designed to take an iterator pointing to where to begin filling.  However, since std::fill_n assumes there is room in the container we use std::back_inserter() to adapt the assignment operator into a push_back on our container.  Size is how many of T to assign and T is the value to assign.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-6559664471118728622?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/6559664471118728622/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=6559664471118728622' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6559664471118728622'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6559664471118728622'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/02/stdfilln.html' title='std::fill_n'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-3320982275090679095</id><published>2008-02-22T09:28:00.002-06:00</published><updated>2008-02-22T09:41:37.747-06:00</updated><title type='text'>Next-Gen PC Design Competition</title><content type='html'>I you have not already done so, hop over and check out some of these great designs and vote for you favorite.  &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.nextgendesigncomp.com/"&gt;Next-Gen PC Design Competition&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I voted for the &lt;a href="http://www.nextgendesigncomp.com/entrydetail.aspx?id=904"&gt;FluxPC&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-3320982275090679095?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.nextgendesigncomp.com/' title='Next-Gen PC Design Competition'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/3320982275090679095/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=3320982275090679095' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/3320982275090679095'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/3320982275090679095'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/02/next-gen-pc-design-competition.html' title='Next-Gen PC Design Competition'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-6880534077556624966</id><published>2008-02-20T09:11:00.002-06:00</published><updated>2008-02-20T09:16:40.764-06:00</updated><title type='text'>Providence Christian Academy Website</title><content type='html'>Since moving to Pensacola in June 2007 my kids old school, &lt;a href="http://www.pcastl.org"&gt;Providence Christian Academy&lt;/a&gt; has redone their website from when I maintained it.  Here is a link to the old version &lt;a href="http://web.archive.org/web/20070412232139/http://www.pcastl.org/"&gt;Providence Christian Academy&lt;/a&gt;.  I think the current one is better than the one I hacked together.  &lt;br /&gt;&lt;br /&gt;What do you think?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-6880534077556624966?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.pcastl.org' title='Providence Christian Academy Website'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/6880534077556624966/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=6880534077556624966' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6880534077556624966'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/6880534077556624966'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/02/providence-christian-academy-website.html' title='Providence Christian Academy Website'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-2518966835144326338</id><published>2008-02-11T07:52:00.001-06:00</published><updated>2008-02-13T10:25:38.636-06:00</updated><title type='text'>Internet Browser Crashing</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Update&lt;/span&gt;: &lt;br /&gt;It now appears re-installing Java did not fix my problems.  My crashes are back and they are worse than ever.  I'm beginning to think it may be a hardware problem.  I booted with a Knoppix Linux CD and tried Firefox from there.  It also crashed multiple times.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Original Post&lt;/span&gt;:&lt;br /&gt;For many months I have suffered from an unstable Windows XP.  Firefox, IE, Safari, Opera, Thunderbird, Windows Media Player, QuickBooks, and every other program that dared attempt to access the internet would periodically crash (Microsoft Debug Window) or simply just disappear.  If I attempted to debug using Visual Studio 7.1 or 8, Visual Studio would crash with a Microsoft Debug Window (not very helpful).  I looked in the event viewer many times but never found anything.  I ran many different kinds of virus and spyware removal tools.  Nothing could be found to fix my problems.  I, of course, Googled my problem many times and never found anything.&lt;br /&gt;&lt;br /&gt;The most annoying thing was doing my online banking (and having the browser crash while trying to purchase something).  I was unable to access Bank of America from any browser except Safari.  Safari would also crash, just less often.  Other browsers might work for a few pages but would always crash more often than Safari.  IE was the worse.  I could hardly go to any pages without IE crashing.  Firefox (my browser of choice) was mostly stable.  It however would crash multiple times a day.  This was bearable because Firefox would restart exactly where I left it with all my tabs ready to go.&lt;br /&gt;&lt;br /&gt;I kept telling myself that I would re-install Windows XP when my current project ended.  I didn't want to risk making it worse since I use VSClient and VNC everyday to access a remote computer for work.  VNC never crashed.&lt;br /&gt;&lt;br /&gt;However, the other day I started doing my taxes.  I have used TurboTax online for many years.  So I fire up Firefox and access TurboTax only to have it crash almost immediately.  Same for Safari.  Ugh!  It was the straw that broke the camels back.  I dug out my Windows XP CD and kicked off a re-install.  Hours later, I finally have Windows XP reinstalled.  This was after having to call Microsoft to activate Windows XP since the activation window crashed trying to access the internet.  Not a good sign.  And as you may have guessed by now, this didn't help one bit.  The only difference I saw was that the icons in Bloglines have now disappeared; replaced with the text 'expand folder' and 'collapse folder'.&lt;br /&gt;&lt;br /&gt;Now I'm really frustrated.  I just knew the re-install of Windows XP would fix the problem.  At this point I'm starting to think the only remedy will be to start from scratch with a clean install of Windows XP (or maybe Linux).  However, I use Visual Studio and QuickBooks and other Windows only applications.&lt;br /&gt;&lt;br /&gt;Back to Googling.  I ran across this site: &lt;a href="http://en.allexperts.com/q/Microsoft-Internet-Explorer-1054/IE-crashes-certain-web.htm"&gt;IE crashes at certain web-sites&lt;/a&gt;.  It recommends re-installing Java.  So I follow their link and grab &lt;a href="http://java.com/en/download/windows_manual.jsp"&gt;Java&lt;/a&gt; and re-install it.  This seems to fix most, but not quite all, of my problems.  I can now access TurboTax and Bank of America from Firefox without it ever crashing.&lt;br /&gt;&lt;br /&gt;I re-installed Java about a week ago.  Firefox has only crashed on me twice since then.  Thunderbird has crashed a few times (this might not be related, not sure).  QuickBooks now can access the internet (very important since I had to register it).  Windows Media Player has not crashed since.  And IE seems to actually work now.  I use Firefox almost exclusively, however.  So I think I'm mostly back to normal.  I assume other folks have a few crashes here and there.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-2518966835144326338?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/2518966835144326338/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=2518966835144326338' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/2518966835144326338'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/2518966835144326338'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2008/02/internet-browser-crashing.html' title='Internet Browser Crashing'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-1590407507529106994</id><published>2007-04-20T21:38:00.001-05:00</published><updated>2008-07-08T15:22:28.709-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='whitelist'/><category scheme='http://www.blogger.com/atom/ns#' term='internet filter'/><title type='text'>Simple whitelist Internet filter</title><content type='html'>How to limit access to Internet websites so that only specified websites are allowed?&lt;br /&gt;&lt;br /&gt;If you have a Linux machine available, you can use squid to setup a whitelist.  This is a very effective and easily setup.&lt;br /&gt;&lt;br /&gt;Modify squid's /etc/squid.conf as follows:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  acl white dstdomain "/etc/squid/whitelist"&lt;br /&gt;  http_access deny !white &lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Create the /etc/squid/whitelist file and add domain names like .pcastl.org one per line.&lt;br /&gt;&lt;br /&gt;Setup your router to only allow your Linux box access to the Internet.  This is normally done my adding a allow list of MAC addresses.  Then configure all other machines on your network to point to the Linux box as there web proxy.&lt;br /&gt;&lt;br /&gt;See the following link for &lt;a href="http://enterprise.linux.com/article.pl?sid=07/02/06/1752220&amp;from=rss"&gt;detail instructions&lt;/a&gt; about setting up the proxy.  Note if all you want is a whitelist then you don't need SquidGuard.  Also note the config lines in this article are incorrect.  Use the ones I show above.&lt;br /&gt;&lt;br /&gt;If you want your other machines to be able to access email then use &lt;a href="http://www.boutell.com/rinetd/"&gt;rinetd&lt;/a&gt; to redirect some port on the Linux box to your mail server and setup all other machines on the network to point to the Linux box as their mail server.  You could alternatively setup iptables rules, but rinetd is much simpler to setup.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-1590407507529106994?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/1590407507529106994/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=1590407507529106994' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1590407507529106994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1590407507529106994'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2007/04/simple-whitelist-internet-filter.html' title='Simple whitelist Internet filter'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-9102809914316790842</id><published>2007-04-19T13:44:00.000-05:00</published><updated>2007-04-19T13:52:35.462-05:00</updated><title type='text'>Move to Pensacola, FL</title><content type='html'>As announced today on the company internal 'The OCI/Advantage Business Summary':&lt;br /&gt;&lt;br /&gt;Kevin Heifner is planning on moving his family to Pensacola, Florida in the third quarter of this year. The move was promoted by family desires related to his children attending a specialized school. Kevin will continue to support OCI from Florida.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-9102809914316790842?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/9102809914316790842/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=9102809914316790842' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/9102809914316790842'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/9102809914316790842'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2007/04/move-to-pensacola-fl.html' title='Move to Pensacola, FL'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-1708743483856211596</id><published>2007-04-08T20:05:00.000-05:00</published><updated>2007-04-08T20:18:17.867-05:00</updated><title type='text'>5 Things About Myself</title><content type='html'>I was blog tagged by &lt;a href="http://www.weiqigao.com/blog/"&gt;Weiqi Gao&lt;/a&gt;.  I'm not really sure what that means, but I will follow the lead of others and tell 5 things that you probably don't know about me.&lt;br /&gt;&lt;br /&gt;1.  I think I was a freshman in high school when I built a bomb that almost killed me.  Actually it was suppose to be a rocket, but it didn't quite go as planned.  I took an empty CO2 cartridge (the kind used for beebee guns) and stuffed it full of match heads.  I put the CO2 cartridge in a PVC pipe and lit it.  I'm fortunate that it was a very cold day and I had many layers of clothes on.  My clothes were full of holes and it is only the grace of God that kept me from killing myself.  Only one piece of PVC pipe made it into my right arm.  I still have the scar from where they cut it out.  Also the side of my folks garage siding is still perforated with holes.&lt;br /&gt;&lt;br /&gt;2.  In my small high school (graduating class of 50) I was the school high jumper in track-n-field.  My personal best was 5'10" which was over my height of 5'8".  I also participated in a school record in the 440 yard relay.&lt;br /&gt;&lt;br /&gt;3.  I wouldn't say I'm a big music fan.  I own very few CDs.  Normally I listen to classical while driving.  However, I do like the band &lt;a href="http://www.third-day.com/"&gt;Third Day&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;4.  My first computer was an Apple II+ my dad bought when I was in grade school.  I thaught myself to program Apple Basic by listening to tapes that came with the computer.&lt;br /&gt;&lt;br /&gt;5.  Many of you know that I'm a 'born again Christian'.  I align myself with the &lt;a href="http://en.wikipedia.org/wiki/Reformed_churches"&gt;Reformed Christian faith&lt;/a&gt;.  One of my favorite books is: &lt;a href="http://www.ccel.org/ccel/boettner/predest.html"&gt;The Reformed Doctrine of Predestination by Loraine Boettner&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-1708743483856211596?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/1708743483856211596/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=1708743483856211596' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1708743483856211596'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1708743483856211596'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2007/04/5-things-about-myself.html' title='5 Things About Myself'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-2638731374435040093</id><published>2007-04-06T17:42:00.000-05:00</published><updated>2007-04-06T17:47:00.620-05:00</updated><title type='text'>Iridium One of 21 Biggest Technology Flops</title><content type='html'>For those who worked on the Iridium project, you may find it interesting that Iridium made ComputerWorld's list of &lt;a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&amp;articleId=9012345&amp;source=rss_news50"&gt;21 Biggest Technology Flops&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-2638731374435040093?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/2638731374435040093/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=2638731374435040093' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/2638731374435040093'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/2638731374435040093'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2007/04/iridium-one-of-21-biggest-technology.html' title='Iridium One of 21 Biggest Technology Flops'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-8817084603431973575</id><published>2007-02-28T19:40:00.000-06:00</published><updated>2007-02-28T19:48:12.276-06:00</updated><title type='text'>int to String under Managed C++</title><content type='html'>I have been doing a little managed C++ at work the last couple of days.  Did you know you could do this:&lt;br /&gt;&lt;br /&gt;    System::String^ str = gcnew System::String("");&lt;br /&gt;    str += 5;&lt;br /&gt;    System::Console::WriteLine(str); // prints: 5&lt;br /&gt;&lt;br /&gt;or simply:&lt;br /&gt;&lt;br /&gt;    System::String^ str = "";&lt;br /&gt;    str += 5;&lt;br /&gt;    System::Console::WriteLine(str); // prints: 5&lt;br /&gt;&lt;br /&gt;or even:&lt;br /&gt;&lt;br /&gt;    System::String^ str;&lt;br /&gt;    str += 5;&lt;br /&gt;    System::Console::WriteLine(str); // prints: 5&lt;br /&gt;&lt;br /&gt;The 5 is converted to a String for you.  After working with C++ for so many years without a simple way to convert an int to a string this is nice.  Might not seem like that big a deal, but these little things add up.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-8817084603431973575?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/8817084603431973575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=8817084603431973575' title='5 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/8817084603431973575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/8817084603431973575'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2007/02/int-to-string-under-managed-c.html' title='int to String under Managed C++'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>5</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-1135790356577756953</id><published>2007-02-28T19:20:00.000-06:00</published><updated>2007-02-28T19:24:50.944-06:00</updated><title type='text'>CityDesk on Vista</title><content type='html'>I use CityDesk to maintain my kid's school website: &lt;a href="http://www.pcastl.org"&gt;Providence Christian Academy&lt;/a&gt;.  It would not run under Vista because it needed the &lt;a href="http://www.microsoft.com/downloads/details.aspx?familyid=b769a4b8-48ed-41a1-8095-5a086d1937cb&amp;displaylang=en"&gt;DHTML Editing Control&lt;/a&gt;.  However, a quick download and install and I was up and running again.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-1135790356577756953?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/1135790356577756953/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=1135790356577756953' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1135790356577756953'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/1135790356577756953'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2007/02/citydesk-on-vista.html' title='CityDesk on Vista'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-3921749259824551047</id><published>2007-02-28T19:04:00.000-06:00</published><updated>2007-02-28T19:15:53.604-06:00</updated><title type='text'>Firefox on Vista</title><content type='html'>As some of you know, I have started using Windows Vista Business on my work laptop.  I received a free version for participating in Power Together campaign.  I prefer Firefox to IE, even IE7, so I wanted to make it the default browser on Vista.  I looked around and it appears that many people are having problems getting this to work.  Here is what I did:&lt;br /&gt;&lt;br /&gt;- Run Firefox as Administrator by right-clicking on the icon in the Quick Launch Toolbar.&lt;br /&gt;- Select Tools-&gt;Options-&gt;MainTab&lt;br /&gt;- Click "Check Now" button under System Defaults.&lt;br /&gt;- Indicate you want Firefox as the default browser.&lt;br /&gt;- Close Firefox (remember you are running as Administrator.&lt;br /&gt;&lt;br /&gt;Works great.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-3921749259824551047?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/3921749259824551047/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=3921749259824551047' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/3921749259824551047'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/3921749259824551047'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2007/02/firefox-on-vista.html' title='Firefox on Vista'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-9182104961326279334</id><published>2006-12-22T12:14:00.000-06:00</published><updated>2006-12-22T12:39:09.536-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Reflection'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><title type='text'>Logging Method Name in C#</title><content type='html'>&lt;pre&gt;&lt;br /&gt;logMessage("functionName",  "something bad happened");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Yes the above works if IF *if* you remember to update "functionName".  However, remembering to update the parameter after copying from another method is often not done.  It is also a pain and not necessary.  A little reflection easily solves this problem:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;// start one up so that we don't get the current&lt;br /&gt;// method but the one that called this one&lt;br /&gt;StackFrame sf = new StackFrame(1, true);&lt;br /&gt;System.Reflection.MethodBase mb = sf.GetMethod();&lt;br /&gt;string methodName = mb != null ? mb.Name : "";&lt;br /&gt;// fileName can be null, if unable to determine&lt;br /&gt;string fileName = sf.GetFileName();&lt;br /&gt;// we only want the filename not the complete path&lt;br /&gt;if (fileName != null) fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1);&lt;br /&gt;int lineNumber = sf.GetFileLineNumber();&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;However the above does not work if you are using RichException or other proxies.  So something a bit more complicated is needed:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;private StackFrame GetCallingStackFrame()&lt;br /&gt;{&lt;br /&gt;    // Determine the method that called the one that is calling this one.&lt;br /&gt;    // This is not just two up the Stack because of RichException support.&lt;br /&gt;    StackFrame sf = null;&lt;br /&gt;    // Start at 2.  1 for this one and another for the one above that.&lt;br /&gt;    StackTrace st = new StackTrace(2, true);&lt;br /&gt;    Type thisType = GetType();&lt;br /&gt;    foreach (StackFrame sfi in st.GetFrames())&lt;br /&gt;    {&lt;br /&gt;        // Find a calling method that is not part of this log class but is part&lt;br /&gt;        // of the same Namespace.&lt;br /&gt;        Type callType = sfi.GetMethod().DeclaringType;&lt;br /&gt;        if (callType != thisType &amp;&amp;amp;&lt;br /&gt;            callType.Namespace == thisType.Namespace &amp;&amp;amp;&lt;br /&gt;            !callType.IsInterface)&lt;br /&gt;        {&lt;br /&gt;            sf = sfi;&lt;br /&gt;            break;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    return sf;&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;This can then be used like so:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;StackFrame sf = GetCallingStackFrame();&lt;br /&gt;if (sf != null) // if found add info to log message&lt;br /&gt;{&lt;br /&gt;    System.Reflection.MethodBase mb = sf.GetMethod();&lt;br /&gt;    string methodName = mb != null ? mb.Name : "";&lt;br /&gt;    string fileName = sf.GetFileName();&lt;br /&gt;    if (fileName != null) fileName = fileName.Substring(fileName.LastIndexOf('\\') + 1);&lt;br /&gt;    int lineNumber = sf.GetFileLineNumber();&lt;br /&gt;&lt;br /&gt;    if (fileName != null)&lt;br /&gt;    {&lt;br /&gt;         strMsg = fileName + "(" + lineNumber + ") - " + methodName + " - " + strMsg;&lt;br /&gt;    }&lt;br /&gt;    else&lt;br /&gt;    {&lt;br /&gt;         strMsg = "unknown - " + methodName + " - " + strMsg;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-9182104961326279334?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/9182104961326279334/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=9182104961326279334' title='6 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/9182104961326279334'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/9182104961326279334'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/12/logging-method-name-in-c.html' title='Logging Method Name in C#'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>6</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-116668079611822515</id><published>2006-12-20T23:54:00.000-06:00</published><updated>2006-12-20T23:59:56.120-06:00</updated><title type='text'>WRT54GL with Thibor's HyperWRT QoS setup</title><content type='html'>I have been using Vonage's VOIP with my &lt;a href="http://heifner.blogspot.com/2006/09/10-steps-to-setup-wrt54gl-with-thibors.html"&gt;WRT54GL setup with Thibor's HyperWRT&lt;/a&gt; as outlined in my previous post.  It has been working without any problems.&lt;br /&gt;&lt;br /&gt;I realized that I never did post my QoS setup.  So here it is:&lt;br /&gt;&lt;br /&gt;Priority  Name Information          &lt;br /&gt;Medium POP3 ---  &lt;br /&gt;Medium DNS ---  &lt;br /&gt;Medium SMTP ---  &lt;br /&gt;Medium Http ---  &lt;br /&gt;Medium SSH ---  &lt;br /&gt;High Skype ---  &lt;br /&gt;Medium Yahoo Messenger ---  &lt;br /&gt;Medium MSN Messenger ---  &lt;br /&gt;Medium AOL Messenger ---  &lt;br /&gt;Low Bittorrent ---  &lt;br /&gt;Low MSN File Transfers ---  &lt;br /&gt;Low FTP ---  &lt;br /&gt;Highest Vonage VT2442 MAC xx:xx:xx:xx:xx:xx&lt;br /&gt;Low Port 8080 Port 8080 - 8080&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-116668079611822515?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/116668079611822515/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=116668079611822515' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/116668079611822515'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/116668079611822515'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/12/wrt54gl-with-thibors-hyperwrt-qos.html' title='WRT54GL with Thibor&apos;s HyperWRT QoS setup'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-115724915312964806</id><published>2006-09-02T20:59:00.000-05:00</published><updated>2006-09-02T23:54:13.826-05:00</updated><title type='text'>10 Steps to setup WRT54GL with Thibor's HyperWRT</title><content type='html'>In my previous post I discussed the problems I am having with Vonage VOIP.  In short I have been having problems with choppy, one-way, dropped audio.  I'm attempting to fix this by installing a LinkSys WRT54GL with third party firmware.  The third party firmware should allow me to setup QoS (Quality of Service) prioritization for the VOIP router.  Currently I have the following setup:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Charter-Cable-Modem &lt;br /&gt;    -&gt; WRT54GL &lt;br /&gt;          -&gt; Vonage-Motorola-VT2442 -&gt; telephone&lt;br /&gt;          -&gt; Wireless Network&lt;br /&gt;          -&gt; Wired Network&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;I have not yet setup the QoS.  I'll outline those steps in a future post.&lt;br /&gt;&lt;br /&gt;Here are the steps I followed for setting up my WRT54GL with Thibor's HyperWRT firmware.&lt;br /&gt;&lt;br /&gt;Steps:&lt;br /&gt;&lt;br /&gt;1. Order WRT54GL LinkSys router from Amazon.&lt;br /&gt;&lt;iframe src="http://rcm.amazon.com/e/cm?t=kevinheifnesh-20&amp;o=1&amp;p=8&amp;l=as1&amp;asins=B000BTL0OA&amp;fc1=000000&amp;IS2=1&amp;lt1=_blank&amp;lc1=0000ff&amp;bc1=000000&amp;bg1=ffffff&amp;f=ifr" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"&gt;&lt;/iframe&gt;  (If your RSS reader does not display a link to Amazon, please visit &lt;a href="http://heifner.blogspot.com/"&gt;my blog&lt;/a&gt;).&lt;br /&gt;&lt;br /&gt;2. Choose third party firmware to use.  &lt;a href="http://en.wikipedia.org/wiki/WRT54G"&gt;Here&lt;/a&gt; is a good spot to start looking.  I decided to go with &lt;a href="http://www.thibor.co.uk/"&gt;Thibor's HyperWRT&lt;/a&gt; because it is based on the original firmware and provided all the extra features I wanted.  Check out the &lt;a href="http://www.thibor.co.uk/#features"&gt;feature list&lt;/a&gt;.  Also there are really good directions &lt;a href="http://vonage.nmhoy.net/wrt54gl.html"&gt;here&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;3. Download the firmware.  Nate at vonage.nmhoy.net recommends version 14 of Thibor.  However it is not clear from his site or the Thibor site which of the version 14 to use for the WRT54GL.  I figured I would go with the latest version.  I can always downgrade to version 14 in the future if I want.  Since I'm upgrading from the stock firmware I downloaded &lt;a href="http://www.thibor.co.uk/files/firmware/Hyperwrt_G_Thibor15c.zip"&gt;this one&lt;/a&gt;.  I verified that the S/N of my WRT54GL started with CL7A or CL7B (mine was CL7B).&lt;br /&gt;&lt;br /&gt;4. Open Amazon box and remove router.  Remove the "Run CD First before connecting cables" sticker.  Kind of scary to completely ignore the directions but I didn't order this router to use the firmware that came with it.&lt;br /&gt;&lt;br /&gt;5. Give the router power and connect it to your computer via a wired connection (I used port #1).  Do not hook it up to your cable modem yet.  That will come later.    &lt;br /&gt;&lt;br /&gt;6. Navigate Internet Explorer (I use Firefox normally, but it is best to be safe) to: http://192.168.1.1.  I had to first do a ipconfig /renew since I was connected to my existing wireless when I started.  Login using blank userid and password: admin.&lt;br /&gt;&lt;br /&gt;7. I started with a factory reset.  Since it is from the factory it seems like that wouldn't been necessary, but once again I figure better safe than sorry.  Go to Administration - Factory Defaults.&lt;br /&gt;&lt;br /&gt;8. Install firmware downloaded above.  Unzip the firmware.  Go to Administration - Firmware Upgrade.  Select the unziped bin file: Hyperwrt_G_Thibor15c.bin.  Be patient and do not interrupt the upload.  Once the upload is complete you should see: "Firmware Version: v4.71.1, Hyperwrt 2.1b1 + Thibor15c" in the upper right hand corner.  Restart Internet explorer to clear out its cache.  Go to Administration - Factory Defaults and select "Clear NVRAM, restore factory defaults".&lt;br /&gt;&lt;br /&gt;9. Setup your router.  Here is what I did:&lt;br /&gt;9a. Administration - Management: Changed password, SSHD enabled, changed SSHD ports, remote management disabled.&lt;br /&gt;9b. Setup - Basic Setup: Changed router name, max DHCP clients: 10, changed to central standard time.  Since I have a cable modem I left it on the default of DHCP.  If you have PPPoE or something else then you will of course have to change this.&lt;br /&gt;9c. Wireless - Basic Wireless Setup: Changed SSID&lt;br /&gt;9d. Wireless - Advanced Wireless Setup: Transmit Power: 67% (I'll try this for now)&lt;br /&gt;9e. Security - Firewall: checked Block Portscans&lt;br /&gt;9f. That's enough to get us started.  I'll be posting more about configuration later.&lt;br /&gt;&lt;br /&gt;10. Add the WRT54GL to your network.  I hooked the WRT54GL router to my cable/dsl modem; hooked the Motorola VT2442 Vonage device to port #1 of the WRT54GL; hooked my wired computers to the WRT54GL and turned everything back on.&lt;br /&gt;&lt;br /&gt;My network is back up and working.  The Vonage phone is working (I have not tested yet with a large file upload in progress).  Its late and I'm going to bed...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-115724915312964806?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/115724915312964806/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=115724915312964806' title='23 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115724915312964806'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115724915312964806'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/09/10-steps-to-setup-wrt54gl-with-thibors.html' title='10 Steps to setup WRT54GL with Thibor&apos;s HyperWRT'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>23</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-115681586159756502</id><published>2006-08-28T20:06:00.000-05:00</published><updated>2006-08-28T20:44:21.636-05:00</updated><title type='text'>Vonage VOIP Saga</title><content type='html'>We recently switched from ATT DSL to &lt;a href="http://www.charter.com/products/highspeed/highspeed.aspx"&gt;Charter Cable&lt;/a&gt; for Internet. My bother-in-law has had cable modems for years and I have always enjoyed the speed when over at his house. So when my SBC DSL contract ran out I signed up for Charter Cable. So far I have been pleased.&lt;br /&gt;&lt;br /&gt;Now that we were free of DSL, we could sign up for VOIP.  I went with &lt;a href="http://vonage.com/"&gt;Vonage&lt;/a&gt; because it is popular and I knew some folks that were using it and they didn't have any complaints.&lt;br /&gt;&lt;br /&gt;I also had decided to try out a online backup program called &lt;a href="http://www.elephantdrive.com/"&gt;ElephantDrive&lt;/a&gt;. It turns out that ElephantDrive sucks up all the outgoing bandwidth it can get its hands on (makes sense because it was doing a complete backup). My initial backup took weeks since I didn't let it run all the time.  BTW, I was trying ElephantDrive because it was free.  It is still in Beta and I wouldn't recommend it at this time since it sucks the life out of your machine when it runs and it takes forever to do a backup.  However, it makes an excellent test program for using available upload bandwidth.&lt;br /&gt;&lt;br /&gt;What I quickly discovered is the WRTP54G router that I paid extra for because I wanted to upgrade from my old 802.11b to 802.11g didn't prioritize my line so that VOIP worked. It is suppose to and Vonage tech-support tried their hardest to configure it to, but they just couldn't get a good outgoing connection when ElephantDrive was running. I kept getting &lt;a href="http://www.vonage.com/learn_center.php?article=942&amp;category=46&amp;amp;nav=4"&gt;Choppy, One-way, Dropped Audio&lt;/a&gt;.  Finally advanced tech-support told me that I just couldn't run a program like this and expect good audio.  Well, I didn't believe it.  I knew that this could be done by prioritizing the packets using QoS.  Actually, to be fair, I did finally get a hold of an advanced tech-support person who confirmed that you would need a high-end non-consumer grade router to accomplish what I was attempting to do.&lt;br /&gt;&lt;br /&gt;After a number of calls and hours on the phone with tech-support and customer service, I convinced Vonage to replace my WRTP54G with a Motorola VT2442.  I wanted to switch to the VT2442 not because I think it will provide better QoS, but so that I could get my $50 back that I paid extra for the WRTP54G.  My VT2442 should come today.  &lt;br /&gt;&lt;br /&gt;I took the $50 and put it toward a WRT54GL.  The 'L' stands for Linux.  The WRT54GL allows you to add third-party firmware.  So my plan is to implement this &lt;a href="http://vonage.nmhoy.net/"&gt;solution&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Stay tuned as I attempt to get good VOIP while running file uploads at the same time.&lt;br /&gt;&lt;br /&gt;If I get it to work I plan on posting step by step instructions.  Although the link above does a good job of that already.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-115681586159756502?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/115681586159756502/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=115681586159756502' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115681586159756502'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115681586159756502'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/08/vonage-voip-saga.html' title='Vonage VOIP Saga'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-115532343243122111</id><published>2006-08-11T14:04:00.000-05:00</published><updated>2006-12-22T12:40:53.165-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='VS 2005'/><category scheme='http://www.blogger.com/atom/ns#' term='C#'/><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>VS 2005 Debugging C++ and C#</title><content type='html'>I was having problems attempting to step into a C# method from C++ using Visual Studio 2005.  I asked Charles if he was able to get it to work and he said that he wasn't but that it should be possible.  A few minutes later he had found this:&lt;br /&gt;&lt;br /&gt;A handy trick when debugging C++ and C# in VS 2005...&lt;br /&gt;&lt;br /&gt;For a project, go to Properties-&gt;Debugging and set the Debugger Type to Mixed from Auto.  It now properly detects the associated languages, so one can step into a C# call from C++ and back.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-115532343243122111?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/115532343243122111/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=115532343243122111' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115532343243122111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115532343243122111'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/08/vs-2005-debugging-c-and-c.html' title='VS 2005 Debugging C++ and C#'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-115523964342107172</id><published>2006-08-10T14:38:00.000-05:00</published><updated>2006-08-15T11:43:06.293-05:00</updated><title type='text'>Emacs style indent line</title><content type='html'>One of the best features that Emacs provides is auto-formating of source code.  When I moved to developing in Visual Studio 6, Justin provided the following macro that I mapped to the tab key that provided the same behavior.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Sub EmacsTab()&lt;br /&gt; ext = GetFileExt(ActiveDocument.FullName)&lt;br /&gt; if ext = "cpp" or ext = "h" or ext = "cxx" or ext = "hxx" or ext = "hpp" Then&lt;br /&gt; With ActiveDocument.Selection&lt;br /&gt;    If .BottomLine &gt; .TopLine Then&lt;br /&gt;     .SmartFormat&lt;br /&gt;   Else&lt;br /&gt;     col = .CurrentColumn&lt;br /&gt;     .StartOfLine dsFirstText&lt;br /&gt;     first = .CurrentColumn&lt;br /&gt;     .Indent&lt;br /&gt;     .SmartFormat&lt;br /&gt;     If col &gt; first Then&lt;br /&gt;       .MoveTo .CurrentLine, col&lt;br /&gt;     End If&lt;br /&gt;   End If&lt;br /&gt; End With&lt;br /&gt; Else&lt;br /&gt;   ActiveDocument.Selection.Indent&lt;br /&gt; End If&lt;br /&gt;End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;When I moved to Visual Studio .Net 2003, the above macro no longer worked.  So the following was created.  Unfortunately you can no longer map the tab key, so I mapped it to ctrl-;.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    Sub EmacsStyleIndentLine()&lt;br /&gt;        Dim ts As TextSelection = DTE.ActiveWindow.Selection&lt;br /&gt;        ts.SelectLine()&lt;br /&gt;        ts.SmartFormat()&lt;br /&gt;        ts.WordRight()&lt;br /&gt;    End Sub&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Recently I moved to Visual Studio .Net 2005 and have been doing some C# coding.  I found the above macro does not seem to work.  Today I changed it to the following which appears to work just fine.&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;    Sub EmacsStyleIndentLine()&lt;br /&gt;        With DTE.ActiveDocument.Selection&lt;br /&gt;            .LineUp()&lt;br /&gt;            .EndOfLine()&lt;br /&gt;            .Delete()&lt;br /&gt;            .NewLine()&lt;br /&gt;            .LineDown()&lt;br /&gt;            DTE.ExecuteCommand("Edit.FormatSelection")&lt;br /&gt;        End With&lt;br /&gt;    End Sub&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-115523964342107172?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/115523964342107172/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=115523964342107172' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115523964342107172'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/115523964342107172'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/08/emacs-style-indent-line.html' title='Emacs style indent line'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-114649816387223308</id><published>2006-05-01T10:38:00.000-05:00</published><updated>2006-05-01T10:42:43.883-05:00</updated><title type='text'>RTSJ - The Real-Time Specification for Java</title><content type='html'>The latest &lt;a href="http://www.ociweb.com/articles/publications/jnb.html"&gt;Java News Brief&lt;/a&gt; by Don Busch is about RTSJ - The Real-Time Specification for Java.  I had the opportunity to review and make comments before Don put the finishing touches on the article.  Its a &lt;a href="http://www.ociweb.com/jnb/jnbMay2006.html"&gt;nice overview of Real-Time Java&lt;/a&gt;.  Check it out.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-114649816387223308?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.ociweb.com/jnb/jnbMay2006.html' title='RTSJ - The Real-Time Specification for Java'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/114649816387223308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=114649816387223308' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/114649816387223308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/114649816387223308'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/05/rtsj-real-time-specification-for-java.html' title='RTSJ - The Real-Time Specification for Java'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-114375520878216101</id><published>2006-03-30T15:31:00.000-06:00</published><updated>2006-03-30T15:46:48.796-06:00</updated><title type='text'>Command Prompt Here from Visual Studio</title><content type='html'>I use the explorer &lt;a href="http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx"&gt;command prompt here&lt;/a&gt; capability all the time.&lt;br /&gt;&lt;br /&gt;Today I was working in Visual Studio and thought wouldn't it be nice if you could just right click on a Solution Explorer file and select "Command Prompt Here".  Well, I didn't find out how to do that, but I figured out how to do something even better.  Add the command prompt as an External Tool. &lt;br /&gt;&lt;br /&gt;Its rather easy to create an External Tool that opens a command prompt.  Just select Tools.. External Tools...&lt;br /&gt;&lt;br /&gt;Title: CommandPrompt&lt;br /&gt;Command: c:\windows\system32\cmd.exe&lt;br /&gt;Initial directory: $(ProjectDir)&lt;br /&gt;&lt;br /&gt;Thats all there is to it.  This will open a command prompt in the current project directory.&lt;br /&gt;&lt;br /&gt;Now lets add one that opens a windows explorer to the project directory.&lt;br /&gt;&lt;br /&gt;Title: Explorer&lt;br /&gt;Command: explorer&lt;br /&gt;Arguments: $(ProjectDir)&lt;br /&gt;&lt;br /&gt;After you have created these external tools, you can then setup a shortcut or customize your menu to place them on the main menu.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-114375520878216101?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/114375520878216101/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=114375520878216101' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/114375520878216101'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/114375520878216101'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/03/command-prompt-here-from-visual-studio.html' title='Command Prompt Here from Visual Studio'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-114058157765310088</id><published>2006-02-21T21:59:00.000-06:00</published><updated>2006-02-21T22:12:57.666-06:00</updated><title type='text'>Boost Training Opportunities In St. Louis</title><content type='html'>I'm still finishing up the course, but OCI has started advertising the class.&lt;br /&gt;&lt;br /&gt;Boost is a quickly growing and widely utilized Open Source C++ collection of libraries that provide tomorrow's C++ today.  Boost allows developers to more quickly develop high performance production ready tailored applications.  Many of the libraries are either already part of the draft &lt;a href="http://www.open-std.org/jtc1/sc22/wg21/"&gt;C++ Standards Committee's Library Technical Report (TR1)&lt;/a&gt; or are proposed for the upcoming TR2.&lt;br /&gt;&lt;br /&gt;I'll be covering the following Boost libraries.&lt;br /&gt;&lt;br /&gt;Boost Test Library&lt;br /&gt;Boost Conversion Library&lt;br /&gt;Boost Smart_ptr Library&lt;br /&gt;Boost Container Library&lt;br /&gt;Boost Bind Library&lt;br /&gt;Boost Function Library&lt;br /&gt;Boost Lambda Library&lt;br /&gt;Boost Thread Library&lt;br /&gt;Boost Regex Library&lt;br /&gt;and more...&lt;br /&gt;&lt;br /&gt;The first class is scheduled for April 26 - 28, 2006 with three more offerings in 2006.  OCI offers onsite training as well.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.ociweb.com/education/services/descrip/escp08-01.html"&gt;Boost Training Class&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-114058157765310088?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.ociweb.com/education/services/descrip/escp08-01.html' title='Boost Training Opportunities In St. Louis'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/114058157765310088/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=114058157765310088' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/114058157765310088'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/114058157765310088'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2006/02/boost-training-opportunities-in-st.html' title='Boost Training Opportunities In St. Louis'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-113401727615016566</id><published>2005-12-07T22:38:00.000-06:00</published><updated>2005-12-07T22:47:56.163-06:00</updated><title type='text'>Memory Management &amp; Embedded Databases</title><content type='html'>There is an &lt;a href="http://devnet.developerpipeline.com/documents/s=9849/q=1/ddj0512m/0512m.html"&gt;interesting article&lt;/a&gt; in the December, 2005 issue of Dr. Dobb's Journal about various memory management schemes in C++ written by the creators of &lt;a href="http://heifner.blogspot.com/2005/01/mcobjects-extremedb.html"&gt;eXtremeDB&lt;/a&gt;.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-113401727615016566?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://devnet.developerpipeline.com/documents/s=9849/q=1/ddj0512m/0512m.html' title='Memory Management &amp; Embedded Databases'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/113401727615016566/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=113401727615016566' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/113401727615016566'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/113401727615016566'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/12/memory-management-embedded-databases.html' title='Memory Management &amp; Embedded Databases'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-112605723764589922</id><published>2005-09-06T19:37:00.000-05:00</published><updated>2005-09-06T20:40:37.663-05:00</updated><title type='text'>Threads Cannot be Implemented as a Library</title><content type='html'>&lt;a href="http://www.weiqigao.com/blog/"&gt;Weiqi Gao&lt;/a&gt; has a &lt;a href="http://www.weiqigao.com/blog/2005/09/06/threads_cannot_be_implemented_as_a_library.html"&gt;post&lt;/a&gt; by the same name.  I followed the post to the &lt;a href="http://www.hpl.hp.com/techreports/2004/HPL-2004-209.pdf"&gt;original source&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;If you are a multi-threaded developer using C or C++, I think you will find this article very interesting.&lt;br /&gt;&lt;br /&gt;Here are a few items that jumped out at me:&lt;br /&gt;&lt;ul&gt;&lt;br /&gt;&lt;li&gt; Given the following:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;thread 1 -&gt; x = 1; r1 = y;&lt;br /&gt;thread 2 -&gt; y = 1; r2 = x;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Sequential consistent memory model would say that either r1 or r2 would have a value of 1 after execution.  However the author of the article has this to say about sequential consistent memory, "In practice, it appears unlikely that such a restrictive memory model can be implemented with reasonable performance on conventional architectures." [Hans J. Boehm]&lt;br /&gt;&lt;br /&gt;It turns out that r1 == r2 == 0 is perfectly valid for the above.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Rewriting of adjacent data such that:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;struct { char a; char b; } x = { 'x', 'y' };&lt;br /&gt;&lt;br /&gt;thread 1 -&gt; x.a = 'k';&lt;br /&gt;thread 2 -&gt; x.b = 'h';&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It is valid for x.a == 'x' and x.b == 'y', because load and store can happen on different threads at the same time because they are in the same "memory location", where "memory location" is not defined.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;li&gt; Global data.&lt;br /&gt;&lt;br /&gt;Rewriting of adjacent memory even allows for adjacent global variables outside of a struct declaration. "Since linkers may, and commonly do, reorder globals, this implies that an update to any global variable may potentially read and rewrite any  other global variable." [Hans J. Boehm]&lt;br /&gt;&lt;br /&gt;As I often say in my C++ classes, "never, ever, never use a global variable, and when you can't avoid it, still don't use one."  Of course the real problem here is not global variables.&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ul&gt;&lt;br /&gt;The paper goes on to discuss the importance of language support and clear specification of the memory model for correct multi-threaded programs.  The author and others are working toward addressing these issues in the C++ standard similar to how they were addressed in Java.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-112605723764589922?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/112605723764589922/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=112605723764589922' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/112605723764589922'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/112605723764589922'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/09/threads-cannot-be-implemented-as.html' title='Threads Cannot be Implemented as a Library'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-112117842177629765</id><published>2005-07-12T09:22:00.000-05:00</published><updated>2005-07-12T09:27:01.776-05:00</updated><title type='text'>Windows: How to capture stdout from a spawned child process</title><content type='html'>The below code is similar to my last post.  However, it *does* work on Windows while  the previous code only works on Unix.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  std::string command = ...;&lt;br /&gt;&lt;br /&gt;  ACE_Process_Options opt;&lt;br /&gt;&lt;br /&gt;  // The child process to spawn.&lt;br /&gt;  opt.command_line(command.c_str());&lt;br /&gt;&lt;br /&gt;  // Define the two handles for the pipe,&lt;br /&gt;  // fd[0] will be used for stdin&lt;br /&gt;  // fd[1] will be used for stdout.&lt;br /&gt;  ACE_HANDLE fd[2];&lt;br /&gt;&lt;br /&gt;  // Create a pipe from the two file handles.&lt;br /&gt;  // Pipe between stdin and stdout.&lt;br /&gt;  // fd[0] &lt;-&gt; fd[1]&lt;br /&gt;  if (ACE_OS::pipe(fd) == -1)&lt;br /&gt;   ACE_DEBUG ((LM_ERROR, "%p\n", "pipe failed")); &lt;br /&gt;&lt;br /&gt;  // Set the stdin and stdout of the process to our file handles.&lt;br /&gt;  // fd[0] is used for stdin, fd[1] is used for stdout.&lt;br /&gt;  opt.set_handles(fd[0] /*stdin*/, fd[1] /*stdout*/);&lt;br /&gt;&lt;br /&gt;  // Spawn the child process.&lt;br /&gt;  ACE_Process proc;&lt;br /&gt;  if (proc.spawn(opt) == -1) &lt;br /&gt;    ACE_DEBUG ((LM_ERROR, "%p\n", "spawn failed"));&lt;br /&gt;&lt;br /&gt;  // Wait for the process to finish.&lt;br /&gt;  ACE_exitcode exitcode = 0;&lt;br /&gt;  proc.wait(&amp;exitcode);&lt;br /&gt;  &lt;br /&gt;  // After fork:&lt;br /&gt;  //   fd[0]  &lt;-&gt; fd[1]        child&lt;br /&gt;  //   fd'[0] &lt;-&gt; fd'[1]       parent&lt;br /&gt;&lt;br /&gt;  // Need to close parent stdout or parent will be trying to read from it forever.&lt;br /&gt;  // With stdout closed parent will get EOF from the child so that the parent &lt;br /&gt;  // will know the child is done.&lt;br /&gt;  if (ACE_OS::close(fd[1]) == -1) &lt;br /&gt;    ACE_DEBUG ((LM_ERROR, "%p\n", "close stdout"));&lt;br /&gt;&lt;br /&gt;  // After close:&lt;br /&gt;  //   fd[0]  &lt;-&gt; fd[1]        child&lt;br /&gt;  //   fd'[0] &lt;-&gt;              parent&lt;br /&gt;  // which leaves our (parent) stdin piped to child's stdout&lt;br /&gt;  &lt;br /&gt;  // set_handles() dups the handles, so make sure they are released.&lt;br /&gt;  opt.release_handles();&lt;br /&gt;&lt;br /&gt;  // Read from parent's stdin, which is connected&lt;br /&gt;  // to the child's stdout.&lt;br /&gt;  std::string child_stdout;&lt;br /&gt;  const size_t BUFFSIZE = 1024;&lt;br /&gt;  char buf[BUFFSIZE + 1];&lt;br /&gt;  ssize_t n = 0;&lt;br /&gt;  while ((n = ACE_OS::read(fd[0], buf, BUFFSIZE)) &gt; 0) {&lt;br /&gt;    buf[n] = 0;&lt;br /&gt;    child_stdout.append(buf, n);&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  // Close stdin.&lt;br /&gt;  if (ACE_OS::close(fd[0]) == -1) &lt;br /&gt;    ACE_DEBUG ((LM_ERROR, "%p\n", "close stdin"));&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-112117842177629765?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/112117842177629765/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=112117842177629765' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/112117842177629765'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/112117842177629765'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/07/windows-how-to-capture-stdout-from.html' title='Windows: How to capture stdout from a spawned child process'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-112087790348066410</id><published>2005-07-08T21:52:00.000-05:00</published><updated>2005-07-12T09:16:41.903-05:00</updated><title type='text'>How to capture stdout from a spawned child process</title><content type='html'>A recent post to ace-users reminded me how hard it was for me to figure out how to capture stdout from a spawned child process in C++.  After much research and trial and error, I came up with the following which uses ACE.&lt;br /&gt;&lt;br /&gt;Update 7/12/2005: The below code does not work on Windows because Windows does not allow redirection of stdout/stderr to sockets which is what ACE_Pipe uses.  See my next post for code that does work on Windows.&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  std::string command = ...;&lt;br /&gt;&lt;br /&gt;  ACE_Process_Options opt;&lt;br /&gt;&lt;br /&gt;  // The child process to spawn.&lt;br /&gt;  opt.command_line(command.c_str());&lt;br /&gt;&lt;br /&gt;  // Define the two handles for the pipe,&lt;br /&gt;  // fd[0] will be used for stdin&lt;br /&gt;  // fd[1] will be used for stdout.&lt;br /&gt;  ACE_HANDLE fd[2];&lt;br /&gt;&lt;br /&gt;  // Create a pipe from the two file handles.&lt;br /&gt;  // Pipe between stdin and stdout.&lt;br /&gt;  // fd[0] &lt;-&gt; fd[1]&lt;br /&gt;  ACE_Pipe pipe(fd);&lt;br /&gt;&lt;br /&gt;  // Set the stdin and stdout of the process to our file handles.&lt;br /&gt;  // fd[0] is used for stdin, fd[1] is used for stdout.&lt;br /&gt;  opt.set_handles(fd[0] /*stdin*/, fd[1] /*stdout*/);&lt;br /&gt;&lt;br /&gt;  // Spawn the child process.&lt;br /&gt;  ACE_Process proc;&lt;br /&gt;  if (proc.spawn(opt) == -1) ACE_DEBUG ((LM_ERROR, "%p\n", "spawn failed"));&lt;br /&gt;&lt;br /&gt;  // After fork:&lt;br /&gt;  //   fd[0]  &lt;-&gt; fd[1]        child&lt;br /&gt;  //   fd'[0] &lt;-&gt; fd'[1]       parent&lt;br /&gt;&lt;br /&gt;  // Need to close parent stdout or parent will be trying to read from it forever.&lt;br /&gt;  // With stdout closed parent will get EOF from the child so that the parent &lt;br /&gt;  // will know the child is done.&lt;br /&gt;  if (ACE_OS::close(fd[1]) == -1) ACE_DEBUG ((LM_ERROR, "%p\n", "close stdout"));&lt;br /&gt;&lt;br /&gt;  // After close:&lt;br /&gt;  //   fd[0]  &lt;-&gt; fd[1]        child&lt;br /&gt;  //   fd'[0] &lt;-&gt;              parent&lt;br /&gt;  // which leaves our (parent) stdin piped to child's stdout&lt;br /&gt;  &lt;br /&gt;  // set_handles() dups the handles, so make sure they are released.&lt;br /&gt;  opt.release_handles();&lt;br /&gt;&lt;br /&gt;  // Read from parent's stdin, which is connected&lt;br /&gt;  // to the child's stdout.&lt;br /&gt;  std::string child_stdout;&lt;br /&gt;  const size_t BUFFSIZE = 1024;&lt;br /&gt;  char buf[BUFFSIZE + 1];&lt;br /&gt;  ssize_t n = 0;&lt;br /&gt;  while ((n = ACE_OS::read(fd[0], buf, BUFFSIZE)) &gt; 0) {&lt;br /&gt;    buf[n] = 0;&lt;br /&gt;    child_stdout.append(buf, n);&lt;br /&gt;  } &lt;br /&gt;&lt;br /&gt;  ACE_exitcode exitcode = 0;&lt;br /&gt;  proc.wait(&amp;exitcode);&lt;br /&gt;  &lt;br /&gt;  // Close stdin.&lt;br /&gt;  if (ACE_OS::close(fd[0]) == -1) ACE_DEBUG ((LM_ERROR, "%p\n", "close stdin"));&lt;br /&gt;&lt;br /&gt;  // Close the pipe, pipe destructor does not close the pipe.&lt;br /&gt;  pipe.close();&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-112087790348066410?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/112087790348066410/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=112087790348066410' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/112087790348066410'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/112087790348066410'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/07/how-to-capture-stdout-from-spawned.html' title='How to capture stdout from a spawned child process'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111816632074830197</id><published>2005-06-07T11:10:00.001-05:00</published><updated>2008-02-25T10:44:12.322-06:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++ reference to an array</title><content type='html'>A number of years ago I remember learning how to pass a reference to an array of fixed size to a function in C++.  The C++ Primer by Stan Lippman and Josee Lajoie discuss how to do this in section 7.3 (Functions - Argument Passing).  It looks like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  void foo(int (&amp;refArr)[10])&lt;br /&gt;  {&lt;br /&gt;     size_t size = sizeof(refArr); // returns 10*sizeof(int)&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Today Jonathan asked how to return a reference to an array of fixed size.  I took a quick look at the spec and saw that returning a reference to an array is allowed, but I couldn't find how.&lt;br /&gt;&lt;br /&gt;Well, it turns out that is looks like this:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;  const int (&amp;getArray() const)[10]&lt;br /&gt;  {&lt;br /&gt;    return array_;&lt;br /&gt;  }&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Fun!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111816632074830197?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111816632074830197/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111816632074830197' title='10 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111816632074830197'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111816632074830197'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/06/c-reference-to-array.html' title='C++ reference to an array'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>10</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111660442452198552</id><published>2005-05-20T10:49:00.000-05:00</published><updated>2005-05-20T10:53:44.526-05:00</updated><title type='text'>Top ranking on google for "c++ spec"</title><content type='html'>I was looking at traffic to my blog and noticed that a google search for "c++ spec" has my blog as the top site, specifically this article: "&lt;a href="http://heifner.blogspot.com/2005/03/ansi-c-spec-quote.html"&gt;c++ spec&lt;/a&gt;".&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111660442452198552?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.google.com/search?hl=en&amp;q=c%2B%2B+spec&amp;btnG=Google+Search' title='Top ranking on google for &quot;c++ spec&quot;'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111660442452198552/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111660442452198552' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111660442452198552'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111660442452198552'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/05/top-ranking-on-google-for-c-spec.html' title='Top ranking on google for &quot;c++ spec&quot;'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111645741535764834</id><published>2005-05-18T17:01:00.000-05:00</published><updated>2008-04-10T09:57:55.188-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>ComboTimer from Java to C++</title><content type='html'>A few weeks back I started work of a port from Java to C++ of the ObjectRepository.  The ObjectRepository (OR) is a load-balancing NameService like CORBA service that &lt;a href="http://www.ociweb.com"&gt;OCI&lt;/a&gt; developed for a client a couple of years ago.  The client open-sourced it and I decided to create a C++ version of it.  One of the first classes that I ported was the ComboTimer.  Justin wrote the original Java version, so the design is his.  He also made some good suggestions for improvements that I incorporated into the C++ version below.&lt;br /&gt;&lt;br /&gt;I welcome comments about the implementation, specifically about any threading issues.&lt;br /&gt;&lt;br /&gt;I will attempt to post more about the ObjectRepository in the future.&lt;br /&gt;&lt;br /&gt;== File ComboTimer.java ==&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;/*&lt;br /&gt; * Created on Nov 21, 2003&lt;br /&gt; * Copyright 2003 Object Computing, Inc.&lt;br /&gt; */&lt;br /&gt;package ObjectRepository;&lt;br /&gt;&lt;br /&gt;import java.util.Timer;&lt;br /&gt;import java.util.TimerTask;&lt;br /&gt;&lt;br /&gt;/**&lt;br /&gt; * This timer class allows scheduling of two related timeouts, one short and&lt;br /&gt; * one long. The second timeout is used as a maximum. The first call to&lt;br /&gt; * reset() schedules both timeouts, and subsequent calls to reset() will&lt;br /&gt; * cancel the short timeout and reschedule it.&lt;br /&gt; *&lt;br /&gt; * If either timeout is &lt;= 0, it is disabled.&lt;br /&gt; * The max timeout must be &gt;= the short timeout.&lt;br /&gt; * Example:&lt;br /&gt; * ComboTimer ct = new ComboTimer(cb, 50, 5000);&lt;br /&gt; * This creates a timer that will callback 50ms after the first call to&lt;br /&gt; * reset(). If, for example, reset() is called every 40ms, the timer will&lt;br /&gt; * callback 5s after the first call to reset().&lt;br /&gt; * It's expected that this timer will be used to allow files to be written&lt;br /&gt; * during a period of inactivity, but with a maximum age to prevent much&lt;br /&gt; * data loss in the event of a crash.&lt;br /&gt; *&lt;br /&gt; * Any call to save() or cancel() will stop both timers.&lt;br /&gt; *&lt;br /&gt; * Internally a separate thread is used for the timers.&lt;br /&gt; */&lt;br /&gt;public final class ComboTimer {&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Implement this interface to handle the timer event. There is no way to&lt;br /&gt;     * distinguish which timeout occurred.&lt;br /&gt;     */&lt;br /&gt;    public interface Callback {&lt;br /&gt;        public void run();&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    private final class Timeout extends TimerTask {&lt;br /&gt;        public void run() {&lt;br /&gt;            ComboTimer.this.cancel();&lt;br /&gt;            if (cb_ != null) {&lt;br /&gt;                cb_.run();&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    // Setting false in the Timer constructor means that&lt;br /&gt;    // the timer thread will prevent the main application from&lt;br /&gt;    // exiting. This is typically desired, but can be a problem&lt;br /&gt;    // if the application using the combotimer doesn't remember&lt;br /&gt;    // to cancel() it before exiting.&lt;br /&gt;    private Timer tmr_ = new Timer(true);&lt;br /&gt;    private final Callback cb_;&lt;br /&gt;    private Timeout to_ = new Timeout();&lt;br /&gt;    private Timeout max_ = new Timeout();&lt;br /&gt;    private int ms_ = 0;&lt;br /&gt;    private int max_ms_ = 0;&lt;br /&gt;    private boolean is_set_ = false;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;     * Schedule the Callback in ms milliseconds, with a maximum timeout&lt;br /&gt;     * of max_ms milliseconds.&lt;br /&gt;     * Specify 0 for either timer to disable that timer.&lt;br /&gt;     */&lt;br /&gt;    public ComboTimer(Callback cb, int ms, int max_ms) {&lt;br /&gt;        if (cb == null) {&lt;br /&gt;            throw new IllegalArgumentException("Callback == null is not allowed.");&lt;br /&gt;        }&lt;br /&gt;        cb_ = cb;&lt;br /&gt;        ms_ = ms;&lt;br /&gt;        max_ms_ = max_ms;&lt;br /&gt;        is_set_ = false;&lt;br /&gt;        if (ms_ &lt; 0) {&lt;br /&gt;            ms_ = 0;&lt;br /&gt;        }&lt;br /&gt;        if (max_ms_ &gt; 0 &amp;&amp; max_ms_ &lt; ms_) {&lt;br /&gt;            max_ms_ = ms_;&lt;br /&gt;            ms_ = 0;&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    /**&lt;br /&gt;     * The first time this method is called, both timeouts (if &gt; 0) are&lt;br /&gt;     * scheduled. Each subsequent call resets the short timeout.&lt;br /&gt;     * Once a timeout event occurs the state of the ComboTimer resets, and&lt;br /&gt;     * the next call to this method will act as the first.&lt;br /&gt;     */&lt;br /&gt;    public synchronized void reset() {&lt;br /&gt;        if (tmr_ == null) {&lt;br /&gt;            return;&lt;br /&gt;        }&lt;br /&gt;        if (ms_ &gt; 0) {&lt;br /&gt;            to_.cancel();&lt;br /&gt;            to_ = new Timeout();&lt;br /&gt;            tmr_.schedule(to_, ms_);&lt;br /&gt;        }&lt;br /&gt;        if (!is_set_) {&lt;br /&gt;            is_set_ = true;&lt;br /&gt;            if (max_ms_ &gt; 0) {&lt;br /&gt;                max_.cancel();&lt;br /&gt;                max_ = new Timeout();&lt;br /&gt;                tmr_.schedule(max_, max_ms_);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    /**&lt;br /&gt;     * Cancel both timeouts, resetting the ComboTimer to its initial state.&lt;br /&gt;     */&lt;br /&gt;    public synchronized void cancel() {&lt;br /&gt;        if (tmr_ == null) {&lt;br /&gt;            return;&lt;br /&gt;        }&lt;br /&gt;        is_set_ = false;&lt;br /&gt;        to_.cancel();&lt;br /&gt;        max_.cancel();&lt;br /&gt;    }&lt;br /&gt;    /**&lt;br /&gt;     * Cancel both timeouts, and kill the timer thread. Once this method&lt;br /&gt;     * is called, the ComboTimer is no longer useable.&lt;br /&gt;     */&lt;br /&gt;    public synchronized void close() {&lt;br /&gt;        if (tmr_ == null) {&lt;br /&gt;            return;&lt;br /&gt;        }&lt;br /&gt;        tmr_.cancel();&lt;br /&gt;        tmr_ = null;&lt;br /&gt;    }&lt;br /&gt;    /**&lt;br /&gt;     * Check to see if the timeout(s) have been scheduled.&lt;br /&gt;     */&lt;br /&gt;    public synchronized boolean isSet() {&lt;br /&gt;        return is_set_;&lt;br /&gt;    }&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;== File ComboTimer.h ==&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;// Copyright (c) 2005 by Kevin Heifner. heifner at ociweb dot com.&lt;br /&gt;// Permission is granted to use this code without restriction &lt;br /&gt;// so long as this copyright notice appears in all source files.&lt;br /&gt;&lt;br /&gt;#ifndef OR_COMBOTIMER_H&lt;br /&gt;#define OR_COMBOTIMER_H&lt;br /&gt;&lt;br /&gt;#include "OR_Export.h"&lt;br /&gt;#include "ace/Timer_Queue.h"&lt;br /&gt;#include "ace/Reactor.h"&lt;br /&gt;#include "ace/Thread_Manager.h"&lt;br /&gt;#include "boost/function.hpp"&lt;br /&gt;&lt;br /&gt;namespace OR {&lt;br /&gt;&lt;br /&gt;  /**&lt;br /&gt;  * This timer class allows scheduling of two related timeouts, one short and&lt;br /&gt;  * one long. The second timeout is used as a maximum. The first call to&lt;br /&gt;  * reset() schedules both timeouts, and subsequent calls to reset() will&lt;br /&gt;  * cancel the short timeout and reschedule it.&lt;br /&gt;  *&lt;br /&gt;  * If either timeout is == 0, it is disabled.&lt;br /&gt;  * The max timeout must be &gt;= the short timeout.&lt;br /&gt;  * Example:&lt;br /&gt;  * ComboTimer ct(cb, ACE_Time_Value(10), ACE_Time_Value(60));&lt;br /&gt;  * This creates a timer that will callback 10sec after the first call to&lt;br /&gt;  * reset(). If, for example, reset() is called every 5secs, the timer will&lt;br /&gt;  * callback 60secs after the first call to reset().&lt;br /&gt;  *&lt;br /&gt;  * cancel() will stop both timers.&lt;br /&gt;  *&lt;br /&gt;  * Provide a Callback function object.  There is no way to&lt;br /&gt;  * distinguish which timeout occurred, although that could be easily&lt;br /&gt;  * added.&lt;br /&gt;  *&lt;br /&gt;  * Internally a separate thread is used for the timers.&lt;br /&gt;  */&lt;br /&gt;  class OR_Export ComboTimer {&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    // pointer to function of form: void foo();&lt;br /&gt;    typedef boost::function&lt;void()&gt; Callback_t;&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;    * Schedule the Callback.&lt;br /&gt;    * Specify 0 for either timer to disable that timer.&lt;br /&gt;    * Spawns separate thread, but timer does not start until&lt;br /&gt;    * reset() is called.&lt;br /&gt;    * @throw std::invalid_argument if maxTime &lt; shortTime.&lt;br /&gt;    */&lt;br /&gt;    ComboTimer(&lt;br /&gt;      Callback_t callback, &lt;br /&gt;      const ACE_Time_Value&amp; shortTime, &lt;br /&gt;      const ACE_Time_Value&amp; maxTime = ACE_Time_Value(0)&lt;br /&gt;      );&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;    * Calls fini()&lt;br /&gt;    */&lt;br /&gt;    ~ComboTimer();&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;    * The first time this method is called, both timeouts (if &gt; 0) are&lt;br /&gt;    * scheduled. Each subsequent call resets the short timeout.&lt;br /&gt;    * Once a timeout event occurs the state of the ComboTimer resets, and&lt;br /&gt;    * the next call to this method will act as the first.&lt;br /&gt;    */&lt;br /&gt;    void reset();&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;    * Cancel both timeouts, resetting the ComboTimer to its initial state.&lt;br /&gt;    */&lt;br /&gt;    void cancel();&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;    * Cancel both timeouts, and kill the timer thread. Once this method&lt;br /&gt;    * is called, the ComboTimer is no longer useable.&lt;br /&gt;    */&lt;br /&gt;    void fini();&lt;br /&gt;&lt;br /&gt;    /**&lt;br /&gt;    * Check to see if the timeout(s) have been scheduled.&lt;br /&gt;    */&lt;br /&gt;    bool scheduled() const;&lt;br /&gt;&lt;br /&gt;  private:&lt;br /&gt;    // Calls run()&lt;br /&gt;    static ACE_THR_FUNC_RETURN thr_func(void* arg);&lt;br /&gt;    // The worker thread's main loop.&lt;br /&gt;    void run();&lt;br /&gt;&lt;br /&gt;    friend class TimerHandler;&lt;br /&gt;    class TimerHandler : public ACE_Event_Handler {&lt;br /&gt;    public:&lt;br /&gt;      explicit TimerHandler(ComboTimer&amp; ct)&lt;br /&gt;        : ct_(ct) &lt;br /&gt;      {}&lt;br /&gt;      // Method which is called back by the Reactor when timeout occurs.&lt;br /&gt;      virtual int handle_timeout(const ACE_Time_Value&amp; tv, const void* arg);&lt;br /&gt;    private:&lt;br /&gt;      ComboTimer&amp; ct_;&lt;br /&gt;    };&lt;br /&gt;&lt;br /&gt;    typedef ACE_Guard&lt;ACE_Thread_Mutex&gt; TGuard;&lt;br /&gt;&lt;br /&gt;  private:&lt;br /&gt;    ACE_Reactor reactor_;&lt;br /&gt;    Callback_t cb_;&lt;br /&gt;    const ACE_Time_Value shortTime_;&lt;br /&gt;    const ACE_Time_Value maxTime_;&lt;br /&gt;    long shortTimerId_;&lt;br /&gt;    long maxTimerId_;&lt;br /&gt;    int threadGroupId_;&lt;br /&gt;    mutable ACE_Thread_Mutex mtx_;&lt;br /&gt;    // reactor_ has to live longer than timerHandler_&lt;br /&gt;    // because the timerHandler_ destructor calls back&lt;br /&gt;    // on the reactor_.&lt;br /&gt;    TimerHandler timerHandler_;&lt;br /&gt;&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;} // namespace OR&lt;br /&gt;&lt;br /&gt;#endif // OR_COMBOTIMER_H&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;== File ComboTimer.cpp ==&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;&lt;br /&gt;// Copyright (c) 2005 by Kevin Heifner. heifner at ociweb dot com.&lt;br /&gt;// Permission is granted to use this code without restriction &lt;br /&gt;// so long as this copyright notice appears in all source files.&lt;br /&gt;&lt;br /&gt;#include "ObjectRepository_pch.h"&lt;br /&gt;&lt;br /&gt;#include "ComboTimer.h"&lt;br /&gt;#include &lt;stdexcept&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OR::ComboTimer::ComboTimer(&lt;br /&gt;  Callback_t cb, &lt;br /&gt;  const ACE_Time_Value&amp; shortTime, &lt;br /&gt;  const ACE_Time_Value&amp; maxTime&lt;br /&gt;  )&lt;br /&gt;  : reactor_()&lt;br /&gt;  , cb_(cb)&lt;br /&gt;  , shortTime_(shortTime)&lt;br /&gt;  , maxTime_(maxTime)&lt;br /&gt;  , shortTimerId_(-1)&lt;br /&gt;  , maxTimerId_(-1)&lt;br /&gt;  , threadGroupId_(-1)&lt;br /&gt;  , mtx_()&lt;br /&gt;  , timerHandler_(*this)&lt;br /&gt;{&lt;br /&gt;  if (maxTime_.msec() &gt; 0 &amp;&amp; maxTime_ &lt; shortTime_) {&lt;br /&gt;    throw std::invalid_argument("maxTime &lt; shortTime");&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  TGuard g(mtx_);&lt;br /&gt;  threadGroupId_ = ACE_Thread_Manager::instance()-&gt;spawn(thr_func, this);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;OR::ComboTimer::~ComboTimer()&lt;br /&gt;{&lt;br /&gt;  fini();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void&lt;br /&gt;OR::ComboTimer::fini()&lt;br /&gt;{&lt;br /&gt;  mtx_.acquire();&lt;br /&gt;  long shortTimerId = shortTimerId_;&lt;br /&gt;  long maxTimerId = maxTimerId_;&lt;br /&gt;  int threadGroupId = threadGroupId_;&lt;br /&gt;  mtx_.release();&lt;br /&gt;&lt;br /&gt;  reactor_.cancel_timer(shortTimerId);&lt;br /&gt;  reactor_.cancel_timer(maxTimerId);&lt;br /&gt;  // This should not be necessary because the reactor_&lt;br /&gt;  // is destroyed after timerHandler_.&lt;br /&gt;  timerHandler_.reactor(0);&lt;br /&gt;  // If this is called before run_reactor_event_loop(), which&lt;br /&gt;  // is possible if you create and then quickly destroy, then&lt;br /&gt;  // end_reactor_event_loop() deactivates the reactor so that&lt;br /&gt;  // run_reactor_event_loop() just returns, which is what we want.&lt;br /&gt;  reactor_.end_reactor_event_loop();&lt;br /&gt;  // Wait for the worker thread to exit.&lt;br /&gt;  // Using wait_grp because it does not interact with ACE_Object_Manager.&lt;br /&gt;  // We want to wait even if we are at program shutdown.&lt;br /&gt;  ACE_Thread_Manager::instance()-&gt;wait_grp(threadGroupId);&lt;br /&gt;&lt;br /&gt;  mtx_.acquire();&lt;br /&gt;  maxTimerId_ = shortTimerId_ = threadGroupId_ = -1;&lt;br /&gt;  mtx_.release();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;ACE_THR_FUNC_RETURN &lt;br /&gt;OR::ComboTimer::thr_func(void* arg)&lt;br /&gt;{&lt;br /&gt;  try {&lt;br /&gt;    OR::ComboTimer&amp; worker = *static_cast&lt;OR::ComboTimer*&gt;(arg);&lt;br /&gt;    worker.run();&lt;br /&gt;  } catch (std::exception&amp;) {&lt;br /&gt;    // todo: log exception&lt;br /&gt;  }&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void&lt;br /&gt;OR::ComboTimer::run()&lt;br /&gt;{&lt;br /&gt;  // The reactor checks to see that it is the owner thread when calling&lt;br /&gt;  // the handle_timeout so we must tell it we are the owning thread.&lt;br /&gt;  reactor_.owner(ACE_Thread::self());&lt;br /&gt;  // Don't call reactor_.reset_reactor_event_loop() because&lt;br /&gt;  // if end_reactor_event_looop is called first then we&lt;br /&gt;  // don't want to run.&lt;br /&gt;  reactor_.run_reactor_event_loop();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;int&lt;br /&gt;OR::ComboTimer::TimerHandler::handle_timeout(const ACE_Time_Value&amp; /*tv*/, const void* /*arg*/)&lt;br /&gt;{&lt;br /&gt;  // Make sure user exception does not cause us to die.&lt;br /&gt;  try {&lt;br /&gt;    ct_.cancel();&lt;br /&gt;    ct_.cb_();&lt;br /&gt;  } catch (std::exception&amp;) {&lt;br /&gt;    // todo: need to log, or somehow handle exception&lt;br /&gt;  }&lt;br /&gt;  return 0;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void &lt;br /&gt;OR::ComboTimer::reset() &lt;br /&gt;{&lt;br /&gt;  mtx_.acquire();&lt;br /&gt;  long shortTimerId = shortTimerId_;&lt;br /&gt;  long maxTimerId = maxTimerId_;&lt;br /&gt;  mtx_.release();&lt;br /&gt;&lt;br /&gt;  bool scheduled = maxTimerId != -1;&lt;br /&gt;&lt;br /&gt;  if (shortTime_.msec() &gt; 0) {&lt;br /&gt;    reactor_.cancel_timer(shortTimerId);&lt;br /&gt;    shortTimerId = &lt;br /&gt;      reactor_.schedule_timer(&lt;br /&gt;      &amp;timerHandler_, // ACE_Event_Handler&lt;br /&gt;      0, // argument sent to handle_timeout()&lt;br /&gt;      shortTime_ // set timer to go off with delay&lt;br /&gt;      ); &lt;br /&gt;  }&lt;br /&gt;  if (!scheduled) {&lt;br /&gt;    if (maxTime_.msec() &gt; 0) {&lt;br /&gt;      reactor_.cancel_timer(maxTimerId);&lt;br /&gt;      maxTimerId = &lt;br /&gt;        reactor_.schedule_timer(&lt;br /&gt;        &amp;timerHandler_, // ACE_Event_Handler&lt;br /&gt;        0, // argument sent to handle_timeout()&lt;br /&gt;        maxTime_ // set timer to go off with delay&lt;br /&gt;        ); &lt;br /&gt;    }&lt;br /&gt;  }&lt;br /&gt;&lt;br /&gt;  mtx_.acquire();&lt;br /&gt;  shortTimerId_ = shortTimerId;&lt;br /&gt;  maxTimerId_ = maxTimerId;&lt;br /&gt;  mtx_.release();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;void &lt;br /&gt;OR::ComboTimer::cancel() &lt;br /&gt;{&lt;br /&gt;  mtx_.acquire();&lt;br /&gt;  long shortTimerId = shortTimerId_;&lt;br /&gt;  long maxTimerId = maxTimerId_;&lt;br /&gt;  mtx_.release();&lt;br /&gt;&lt;br /&gt;  reactor_.cancel_timer(shortTimerId);&lt;br /&gt;  reactor_.cancel_timer(maxTimerId);&lt;br /&gt;&lt;br /&gt;  mtx_.acquire();&lt;br /&gt;  maxTimerId_ = shortTimerId_ = -1;&lt;br /&gt;  mtx_.release();&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;bool &lt;br /&gt;OR::ComboTimer::scheduled() const&lt;br /&gt;{&lt;br /&gt;  TGuard g(mtx_);&lt;br /&gt;  return maxTimerId_ != -1;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;== Unit test: ComboTimer_UT.cpp ==&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;#include "ut_pch.h"&lt;br /&gt;&lt;br /&gt;#include "unittester.h"&lt;br /&gt;#include "ObjectRepository/ComboTimer.h"&lt;br /&gt;#include "boost/bind.hpp"&lt;br /&gt;#include &lt;iostream&gt;&lt;br /&gt;&lt;br /&gt;namespace {&lt;br /&gt;&lt;br /&gt;  int callbackCalled = 0;&lt;br /&gt;&lt;br /&gt;  struct Callback {&lt;br /&gt;    void operator()() {&lt;br /&gt;      ++callbackCalled;&lt;br /&gt;    }&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;  struct CTCallback {&lt;br /&gt;    CTCallback() : called(0) {}&lt;br /&gt;    void operator()() {&lt;br /&gt;      ++called;&lt;br /&gt;    }&lt;br /&gt;    int called;&lt;br /&gt;  };&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;namespace UnitTest {&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  class ComboTimer_UT : public cppunit::Test&lt;ComboTimer_UT&gt; {&lt;br /&gt;  private:&lt;br /&gt;    static bool register_tests() {&lt;br /&gt;      add(&amp;ComboTimer_UT::testStartStop, "ComboTimer_UT::testStartStop");&lt;br /&gt;      add(&amp;ComboTimer_UT::testShortTimer, "ComboTimer_UT::testShortTimer");&lt;br /&gt;      add(&amp;ComboTimer_UT::testMaxTimer, "ComboTimer_UT::testMaxTimer");&lt;br /&gt;      add(&amp;ComboTimer_UT::testCancel, "ComboTimer_UT::testCancel");&lt;br /&gt;      add(&amp;ComboTimer_UT::testException, "ComboTimer_UT::testException");&lt;br /&gt;      add(&amp;ComboTimer_UT::testCallback, "ComboTimer_UT::testCallback");&lt;br /&gt;      return true;&lt;br /&gt;    }&lt;br /&gt;    static bool tests_registered;&lt;br /&gt;&lt;br /&gt;  public:&lt;br /&gt;&lt;br /&gt;    virtual void setup() {&lt;br /&gt;      callbackCalled = 0;&lt;br /&gt;    }&lt;br /&gt;    virtual void teardown() {}&lt;br /&gt;&lt;br /&gt;    void testStartStop() {&lt;br /&gt;      Callback cb;&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,1), ACE_Time_Value(0,2));&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,1), ACE_Time_Value(0,2));&lt;br /&gt;        ct.fini();&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,1));&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,0));&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,1), ACE_Time_Value(0,2));&lt;br /&gt;        ct.fini();&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(2), ACE_Time_Value(20));&lt;br /&gt;        ct.reset();&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(2), ACE_Time_Value(20));&lt;br /&gt;        ct.reset();&lt;br /&gt;        ct.reset();&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(2), ACE_Time_Value(20));&lt;br /&gt;        ct.cancel();&lt;br /&gt;        ct.reset();&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(2), ACE_Time_Value(20));&lt;br /&gt;        ct.reset();&lt;br /&gt;        ct.cancel();&lt;br /&gt;        ct.fini();&lt;br /&gt;        ct.fini();&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    void testShortTimer() {&lt;br /&gt;      Callback cb;&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,1000), ACE_Time_Value(20));&lt;br /&gt;        ct.reset();&lt;br /&gt;        bool reset = false;&lt;br /&gt;        for (int i = 0; i &lt; 1000; ++i) {&lt;br /&gt;          if (callbackCalled == 1 &amp;&amp; !reset) {&lt;br /&gt;            ct.reset();&lt;br /&gt;            reset = true;&lt;br /&gt;          }&lt;br /&gt;          if (callbackCalled == 2) break;&lt;br /&gt;          ACE_OS::thr_yield();&lt;br /&gt;          ACE_OS::sleep(ACE_Time_Value(0,1000));&lt;br /&gt;        }&lt;br /&gt;        assertEqual(callbackCalled, 2);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    void testMaxTimer() {&lt;br /&gt;      Callback cb;&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,3000), ACE_Time_Value(0,5000));&lt;br /&gt;        for (int i = 0; i &lt; 1000; ++i) {&lt;br /&gt;          ct.reset();&lt;br /&gt;          ACE_OS::sleep(ACE_Time_Value(0,1000));&lt;br /&gt;          ct.reset();&lt;br /&gt;          if (callbackCalled &gt; 0) break;&lt;br /&gt;        }&lt;br /&gt;        assertTrue(callbackCalled &gt; 0);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    void testCancel() {&lt;br /&gt;      Callback cb;&lt;br /&gt;      {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(0,1000), ACE_Time_Value(0,2000));&lt;br /&gt;        ct.reset();&lt;br /&gt;        ct.cancel();&lt;br /&gt;        ACE_OS::thr_yield();&lt;br /&gt;        ACE_OS::sleep(ACE_Time_Value(0,5000));&lt;br /&gt;        assertEqual(callbackCalled, 0);&lt;br /&gt;&lt;br /&gt;        ct.reset();&lt;br /&gt;        for (int i = 0; i &lt; 1000; ++i) {&lt;br /&gt;          ACE_OS::thr_yield();&lt;br /&gt;          ACE_OS::sleep(ACE_Time_Value(0,1000));&lt;br /&gt;          if (callbackCalled &gt; 0) break;&lt;br /&gt;        }&lt;br /&gt;        assertTrue(callbackCalled &gt; 0);&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    void testException() {&lt;br /&gt;      Callback cb;&lt;br /&gt;      try {&lt;br /&gt;        OR::ComboTimer ct(cb, ACE_Time_Value(3), ACE_Time_Value(2));&lt;br /&gt;        failTest("expected exception");&lt;br /&gt;      } catch (std::invalid_argument&amp;) {&lt;br /&gt;      }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;    void testCallback() {&lt;br /&gt;      CTCallback cb;&lt;br /&gt;      OR::ComboTimer ct(boost::ref(cb), ACE_Time_Value(0,1000), ACE_Time_Value(0,2000));&lt;br /&gt;      ct.reset();&lt;br /&gt;      for (int i = 0; i &lt; 1000; ++i) {&lt;br /&gt;        ACE_OS::thr_yield();&lt;br /&gt;        ACE_OS::sleep(ACE_Time_Value(0,1000));&lt;br /&gt;        if (cb.called &gt; 0) break;&lt;br /&gt;      }&lt;br /&gt;      assertTrue(cb.called &gt; 0);&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;  };&lt;br /&gt;&lt;br /&gt;  bool ComboTimer_UT::tests_registered = ComboTimer_UT::register_tests();&lt;br /&gt;&lt;br /&gt;} // namespace UnitTest&lt;br /&gt;&lt;br /&gt;&lt;/pre&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111645741535764834?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111645741535764834/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111645741535764834' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111645741535764834'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111645741535764834'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/05/combotimer-from-java-to-c.html' title='ComboTimer from Java to C++'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111535174979567718</id><published>2005-05-05T22:18:00.000-05:00</published><updated>2005-05-05T22:55:49.826-05:00</updated><title type='text'>Problems moving hard drive</title><content type='html'>I just finished what I thought would be a 15 minute task.  Turns out that I spent a couple of hours trying to move a hard drive from one dead machine to another.  As I have mentioned before, I try to keep the computers running at &lt;a href="http://www.pcastl.org"&gt;Providence Christian Academy in St. Louis MO&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Yesterday the machine (Windows 2000 Pro) we use for attendance and Peachtree started turning itself off after a few minutes of run time.  I figure there is something wrong with the power supply or the motherboard.  I had an extra computer and figured I would just grab the hard drive from the dying machine and move it to the extra computer.  I assumed it would just be a matter of swapping the hard drive and restarting the machine.  Since these are old Dell machines, swapping the hard drive is really easy.  I really like the Dell cases, they are easy to get into and the parts are easy to change.  &lt;br /&gt;&lt;br /&gt;Anyway, swapping the hard drives was easy but when I tried to boot with the hard drive from the dead machine I got a blue screen of death:&lt;br /&gt;&lt;br /&gt;***STOP: 0x0000007B&lt;br /&gt;INACCESSIBLE_BOOT_DEVICE &lt;br /&gt;&lt;br /&gt;The hard drive worked in the old machine, so I wondered what could be the problem.  I tried a number of things from running chkdsk to doing a Windows 2000 rescue.  Nothing worked.  I did find a Microsoft &lt;a href="http://support.microsoft.com/default.aspx?scid=kb;en-us;883114"&gt;article&lt;/a&gt; about what to do when this happens, but it didn't help.  Finally, I found the following article, followed the directions, and it solved the problem.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.mostlycreativeworkshop.com/article11.html"&gt;Move an IDE Drive w/Windows 2000 or XP to A New System&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Yeah!&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111535174979567718?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.mostlycreativeworkshop.com/article11.html' title='Problems moving hard drive'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111535174979567718/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111535174979567718' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111535174979567718'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111535174979567718'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/05/problems-moving-hard-drive.html' title='Problems moving hard drive'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111247462272877967</id><published>2005-04-02T14:36:00.000-06:00</published><updated>2005-04-02T14:43:42.730-06:00</updated><title type='text'>I want to plug my Prius in.</title><content type='html'>Looks like I'm not the only one that wants to plug his Prius in at night.  I really like my Prius, I just wish it would get better gas mileage.  For all the complicated technology it seems like I should get better than 40-45 mpg.  I'm hopeful that when I have to replace my batteries I will be able to replace them with better versions that will allow for more stealth driving and better mpg.  I'm also hopeful that the replacement of the batteries will be many years from now.&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;a href="http://www.nytimes.com/2005/04/02/business/02plug.html?ex=1113109200&amp;en=fccf373dbb3ee42d&amp;ei=5070"&gt;Hybrid-Car Tinkerers Scoff at No-Plug-In Rule&lt;/a&gt;&lt;br /&gt;By DANNY HAKIM&lt;br /&gt;&lt;br /&gt;The idea of making hybrid cars that can be plugged in to wall outlets is supported by a diverse group of interests, from neoconservatives to utilities.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111247462272877967?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.nytimes.com/2005/04/02/business/02plug.html?ex=1113109200&amp;en=fccf373dbb3ee42d&amp;ei=5070' title='I want to plug my Prius in.'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111247462272877967/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111247462272877967' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111247462272877967'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111247462272877967'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/04/i-want-to-plug-my-prius-in.html' title='I want to plug my Prius in.'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111223625188787062</id><published>2005-03-30T20:19:00.000-06:00</published><updated>2005-03-30T20:30:51.890-06:00</updated><title type='text'>Lessons from economics</title><content type='html'>Katie sent me an email a few months back that she thought I would enjoy.  It is titled &lt;a href="http://www.hillsdale.edu/imprimis/default.htm"&gt;The Entrepreneur As American Hero&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Professor Walter E. Williams discusses how free market forces benefit the average consumer and finishes up with what he calls Williams' Law.&lt;br /&gt;&lt;blockquote&gt;Whenever the profit incentive is missing, the probability that peoples wants can be safely ignored is the greatest. If a poll were taken asking people which services they are most satisfied with and which they are most dissatisfied with, for-profit organizations (supermarkets, computer companies and video stores) would dominate the first list while non-profit organizations (schools, offices of motor vehicle registration) would dominate the latter. In a free economy, the pursuit of profits and serving people are one and the same. No one argues that the free enterprise system is perfect, but its the closest we will come here on Earth.&lt;/blockquote&gt;&lt;br /&gt;I completely agree.  It is time we start eliminating government run schools.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111223625188787062?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.hillsdale.edu/imprimis/default.htm' title='Lessons from economics'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111223625188787062/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111223625188787062' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111223625188787062'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111223625188787062'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/03/lessons-from-economics.html' title='Lessons from economics'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111186310425264398</id><published>2005-03-26T12:45:00.000-06:00</published><updated>2005-03-26T12:58:12.890-06:00</updated><title type='text'>Free Boxes from USPS</title><content type='html'>I'm visiting my folks and my mother just received a shipment of boxes that she ordered from the USPS.  She has been selling items on eBay and needed some boxes to ship the items.  Turns out she was able to order the boxes from the USPS for free with free delivery.  The same boxes that you pay for at the post office you can get for free.  Here is the &lt;a href="http://shop.usps.com/cgi-bin/vsbv/postal_store_non_ssl/display_products/productCategory.jsp?prodCatCursor=8&amp;passFlag=2&amp;fromSearch=yes"&gt;link&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Update: Just noticed that the link does not work.  To find the items just search for supplies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111186310425264398?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://shop.usps.com/cgi-bin/vsbv/postal_store_non_ssl/display_products/productCategory.jsp?prodCatCursor=8&amp;passFlag=2&amp;fromSearch=yes' title='Free Boxes from USPS'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111186310425264398/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111186310425264398' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111186310425264398'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111186310425264398'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/03/free-boxes-from-usps.html' title='Free Boxes from USPS'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111119411967945554</id><published>2005-03-18T18:49:00.000-06:00</published><updated>2005-03-18T19:01:59.683-06:00</updated><title type='text'>if wallet || purse stolen then ...</title><content type='html'>I received an email from my Mortgage broker (&lt;a href="http://www.accutira.com"&gt;Accutira&lt;/a&gt;) today.  It had some good advice that I would like to share.  &lt;br /&gt;&lt;br /&gt;A number of years ago Misty was a victim of identity theft.  Some lady in North County decided to use Misty's identity to buy a Sprint phone, go on a shopping spree at Home Depot (or maybe it was HQ, don't remember and it doesn't matter), and others.  We found out about it when a collection agency called.  It was a nightmare.&lt;br /&gt;&lt;br /&gt;Anyway here is the advice...&lt;br /&gt;&lt;br /&gt;We've all heard horror stories of fraud committed when a name, credit card, address, and/or social security number is stolen.  Here's the information you need should it happen to you or someone you know. &lt;br /&gt;&lt;br /&gt;&lt;b&gt;First...&lt;/b&gt; photo copy everything you carry in your wallet.  When the time comes and you do have to cancel your cards, you'll have the account numbers and phone numbers to contact immediately.  Keep this in a secure place you can get access to easily.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Second...&lt;/b&gt; file a police report immediately in the jurisdiction where it was stolen.  This proves to credit providers that you were diligent and is a first step toward any investigation if there is one.&lt;br /&gt;&lt;br /&gt;&lt;b&gt;Third (and most important)...&lt;/b&gt;Call the three national credit reporting agencies immediately and place a fraud alert on your name and social security number.  The alert means that any company that checks your credit knows your information was stolen and they have to contact you by phone to authorize new credit.&lt;br /&gt;&lt;br /&gt;The numbers to report fraud to the big 3 are:&lt;pre&gt;&lt;br /&gt;   Equifax     800.525.6285   &lt;br /&gt;   Experian    888.397.3742&lt;br /&gt;   Trans Union 800.680.7289&lt;/pre&gt;&lt;br /&gt;The fraud line for the Social Security Administration is 800-269-0271.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111119411967945554?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111119411967945554/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111119411967945554' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111119411967945554'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111119411967945554'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/03/if-wallet-purse-stolen-then.html' title='if wallet || purse stolen then ...'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111117515697975777</id><published>2005-03-18T13:40:00.000-06:00</published><updated>2008-04-10T09:57:55.188-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>Ansi C++ Spec Quote</title><content type='html'>I was looking up a question for Dan about explicit template specialization in the ANSI C++ Spec and noticed the following:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;When writing a specialization, be careful about its location; or to make it compile will be such a trial as to kindle its &lt;a href="http://www.answers.com/self-immolation&amp;r=67"&gt;self-immolation&lt;/a&gt;.&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111117515697975777?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111117515697975777/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111117515697975777' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111117515697975777'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111117515697975777'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/03/ansi-c-spec-quote.html' title='Ansi C++ Spec Quote'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-111031737121618041</id><published>2005-03-08T15:17:00.000-06:00</published><updated>2008-04-10T09:58:58.631-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++ Test Coverage</title><content type='html'>I've been working on additional functional tests this week for my current project.  Dan was working with me this morning when he asked about C++ test coverage tools.  I have never used one for C++, so we did the obvious thing and googled for it.&lt;br /&gt;&lt;br /&gt;Turns out that gcc comes with gcov.&lt;br /&gt;&lt;br /&gt;1) Add the following option to the environment. &lt;pre&gt;&lt;br /&gt;    export CPPFLAGS="-fprofile-arcs -ftest-coverage"&lt;/pre&gt;&lt;br /&gt;2) Compile as normal&lt;br /&gt;3) Run your tests.&lt;br /&gt;4) gcov -l -c FileName.cpp&lt;br /&gt;5) vi FileName.cpp.gcov and search for "######"&lt;br /&gt;&lt;br /&gt;"######" indicate lines that were never executed.&lt;br /&gt;&lt;br /&gt;It is simple and easy to use.&lt;br /&gt;&lt;br /&gt;Here is an example of the output of gcov:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;                    11:    9:  for (i = 0; i &lt; 10; i++)&lt;br /&gt;                    10:   10:    total += i;&lt;br /&gt;                     -:   11:&lt;br /&gt;                     1:   12:  if (total != 45)&lt;br /&gt;                 #####:   13:    printf ("Failure\n");&lt;br /&gt;                     -:   14:  else&lt;br /&gt;                     1:   15:    printf ("Success\n");&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;Line #13 above was never executed.  Line #9 was executed 11 times.  You can also have it output percentages.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-111031737121618041?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/111031737121618041/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=111031737121618041' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111031737121618041'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/111031737121618041'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/03/c-test-coverage.html' title='C++ Test Coverage'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110930537936541405</id><published>2005-02-24T22:18:00.000-06:00</published><updated>2005-02-24T22:22:59.366-06:00</updated><title type='text'>SQLite</title><content type='html'>I just came accross SQLite.  Looks like a nice simple to use relational database.  Has anyone used it before?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110930537936541405?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.sqlite.org/index.html' title='SQLite'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110930537936541405/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110930537936541405' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110930537936541405'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110930537936541405'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/02/sqlite.html' title='SQLite'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110644043568854441</id><published>2005-01-22T18:02:00.000-06:00</published><updated>2005-01-22T18:37:56.000-06:00</updated><title type='text'>How to re-create a website in 10 hours</title><content type='html'>I decided it was time that our &lt;a href="http://www.pcastl.org/"&gt;Classical Christian School&lt;/a&gt;, &lt;a href="http://www.pcastl.org/"&gt;Providence Christian Academy&lt;/a&gt;, had a new website design. I knew very little about html and nothing about css style sheets when I started. I'm quite pleased with the result. I still want to add some pictures to the site, but other than that I think it looks pretty good. Please let me know what you think. I would love to hear any suggestions for improvements.&lt;br /&gt;&lt;br /&gt;I began the re-design by downloading &lt;a href="http://www.fogcreek.com/CityDesk"&gt;CityDesk&lt;/a&gt;, grabbing one of the example templates, and playing with the included style sheet. It took two nights, about 10 hours, to redesign the site even while learning css.&lt;br /&gt;&lt;br /&gt;I was talking to &lt;a href="http://www.weiqigao.com/blog"&gt;Weiqi&lt;/a&gt; about this over lunch a few days back and he was asking about CityDesk. I'm using the free edition which allows you to manage up to 50 files. CityDesk does not have a great html editor, what it does have is the ability to build a template that can be applied to all of your pages so that they all look alike and can be easily changed. It also makes it easy to publish the website. What I wish it had was CVS like history for your pages. If I hit the 50 page max for the free edition, I'll probably just write a perl script to do what the template in CityDesk does for me and use CVS. As a matter of fact, I'm tempted to do that now just so I can have the ability to keep history information. Then it would just be a matter of getting a ftp client that can publish the site easily (I'm sure there are plenty to pick from.)&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110644043568854441?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110644043568854441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110644043568854441' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110644043568854441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110644043568854441'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/01/how-to-re-create-website-in-10-hours.html' title='How to re-create a website in 10 hours'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110582681937232412</id><published>2005-01-15T16:05:00.000-06:00</published><updated>2005-01-15T16:06:59.373-06:00</updated><title type='text'>The Top 100 Things I'd Do If I Ever Became An Evil Overlord</title><content type='html'>I think I read this years ago, but Rob pointed it out to me again on Friday.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110582681937232412?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.eviloverlord.com/lists/overlord.html' title='The Top 100 Things I&apos;d Do If I Ever Became An Evil Overlord'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110582681937232412/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110582681937232412' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110582681937232412'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110582681937232412'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/01/top-100-things-id-do-if-i-ever-became.html' title='The Top 100 Things I&apos;d Do If I Ever Became An Evil Overlord'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110541367632211788</id><published>2005-01-10T21:15:00.000-06:00</published><updated>2005-01-10T21:21:16.323-06:00</updated><title type='text'>Concurrency Revolution</title><content type='html'>Herb Sutter has a very good article in C/C++ User's Journal on the &lt;a href="http://pluralsight.com/blogs/hsutter/archive/2004/12/17/3957.aspx"&gt;Concurrency Revolution&lt;/a&gt;. As he sees it, multithreaded development is the next big 'thing' since OO development. He talks about how chip manufacturers are looking at other ways to speed up processing since increasing clock speed has suddenly hit a wall.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110541367632211788?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://pluralsight.com/blogs/hsutter/archive/2004/12/17/3957.aspx' title='Concurrency Revolution'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110541367632211788/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110541367632211788' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110541367632211788'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110541367632211788'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/01/concurrency-revolution.html' title='Concurrency Revolution'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110513214597983692</id><published>2005-01-07T15:01:00.000-06:00</published><updated>2005-01-07T15:09:05.980-06:00</updated><title type='text'>chkdsk often on NTFS</title><content type='html'>chkdsk is not something I ever do unless there is a problem.  However, I ran chkdsk on one of my machines at work on accident.&lt;br /&gt;&lt;br /&gt;[You might ask how that is possible. Well for my last post I wanted to make sure I spelled the command correctly (remember I don't run the command very often) and hit return after I did the command completion.]&lt;br /&gt;&lt;br /&gt;Anyway, I was surprised to see that it found problems that needed to be corrected. So I ran it on my laptop for fun, and it also needed to fix some problems. I also ran it on my home machine and it also needed some problems fixed.&lt;br /&gt;&lt;br /&gt;So, it appears that chkdsk should be ran fairly often to find and fix problems.&lt;br /&gt;&lt;br /&gt;Go ahead and run it yourself and let me know if it finds anything on your machine that needs to be fixed.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110513214597983692?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110513214597983692/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110513214597983692' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110513214597983692'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110513214597983692'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/01/chkdsk-often-on-ntfs.html' title='chkdsk often on NTFS'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110503915804524669</id><published>2005-01-06T13:15:00.000-06:00</published><updated>2005-01-08T01:29:14.260-06:00</updated><title type='text'>Rescue contents of a sick hard drive</title><content type='html'>How to rescue the contents of a sick hard drive without spending any money. Or why you need a copy of &lt;a href="http://www.knoppix.org/"&gt;Knoppix&lt;/a&gt; laying around. Knoppix is a bootable linux CD that runs completely off the CD.&lt;br /&gt;Rob's daughter's laptop would only boot part way into Windows XP and then halt. Windows recovery couldn't fix the problem and it looked like the hard drive was dieing (chkdsk was failing, etc.) So the next thing we tried was booting Linux using Knoppix. Once Knoppix booted up we did the following:&lt;br /&gt;&lt;br /&gt;1. Attempted to mount the drive... that failed with something about bad drive type.&lt;br /&gt;&lt;br /&gt;2. Attempted to use partimage to backup the drive... that failed with similar error.&lt;br /&gt;&lt;br /&gt;3. Ran badblocks on the drive and got intermittent indications of bad blocks.&lt;br /&gt;(Then Jonathan stepped in and did the following.)&lt;br /&gt;4. He used raw dd to copy the contents of the drive over the network to another machine running Knoppix.&lt;br /&gt;&lt;pre&gt;   for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18; do&lt;br /&gt;      dd if=/dev/hda of=/mnt/other/rob_dd.img.$i skip=`echo $i * 2097152  bc` count=2097152;&lt;br /&gt;   done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;(2097152 is 1GB divided by 512bytes - the sector size)&lt;br /&gt;&lt;br /&gt;5. He then concatenated the files together.&lt;br /&gt;&lt;pre&gt;   for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18; do&lt;br /&gt;     cat /mnt/other/rob_dd.img.$i &amp;gt;&amp;gt; /mnt/other/rob_dd.img;&lt;br /&gt;     rm /mnt/other/rob_dd.img.$i;&lt;br /&gt;   done&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;6. Next, mount the file as a drive using Linux's loopback device. The gory details of using &lt;a href="http://trekweb.com/~jasonb/articles/linux_loopback.html"&gt;Linux's loopback device&lt;/a&gt; are explained by this &lt;a href="http://trekweb.com/~jasonb/articles/linux_loopback.html"&gt;link&lt;/a&gt;. Since the drive only had one partition which started at sector 63, the offset was 63 * 512 bytes =&gt; 32256 bytes.&lt;br /&gt;&lt;pre&gt;   mount -o loop,offset=32256 -t ntfs  rob_dd.img /mnt/rob_dd&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;7. cd /mnt/rob_dd&lt;br /&gt;&lt;br /&gt;8. Copy all the data you want from the "drive".&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110503915804524669?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110503915804524669/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110503915804524669' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110503915804524669'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110503915804524669'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/01/rescue-contents-of-sick-hard-drive.html' title='Rescue contents of a sick hard drive'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110416917392233963</id><published>2005-01-05T11:39:00.000-06:00</published><updated>2005-01-05T11:21:31.703-06:00</updated><title type='text'>McObject's eXtremeDB</title><content type='html'>I'm quoted in a &lt;a href="http://www.mcobject.com/casestudy_obj.shtml"&gt;case study&lt;/a&gt; of &lt;a href="http://www.mcobject.com/"&gt;McObject's eXtremeDB&lt;/a&gt;.  Some of the quotes are even mine :)&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110416917392233963?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.mcobject.com/index.php' title='McObject&apos;s eXtremeDB'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110416917392233963/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110416917392233963' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110416917392233963'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110416917392233963'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/01/mcobjects-extremedb.html' title='McObject&apos;s eXtremeDB'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110486585883158570</id><published>2005-01-04T13:05:00.000-06:00</published><updated>2005-01-04T13:10:58.830-06:00</updated><title type='text'>Opening winmail.dat</title><content type='html'>I just received an attachment as winmail.dat.  This &lt;a href="http://www.magicwinmail.net/wmparser/"&gt;free util&lt;/a&gt; was able to open it.  Just drag the winmail.dat onto the &lt;a href="http://www.magicwinmail.net/wmparser/"&gt;wmparser&lt;/a&gt; icon and it presents a simple GUI for viewing the contents. In my case I was able to extract the embedded Microsoft Word document.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110486585883158570?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.magicwinmail.net/wmparser/' title='Opening winmail.dat'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110486585883158570/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110486585883158570' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110486585883158570'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110486585883158570'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2005/01/opening-winmaildat.html' title='Opening winmail.dat'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110437322027378587</id><published>2004-12-29T20:10:00.000-06:00</published><updated>2004-12-29T20:20:20.273-06:00</updated><title type='text'>Backup entire blog</title><content type='html'>One of Blogger's FAQs is "&lt;a href="http://help.blogger.com/bin/answer.py?answer=130&amp;topic=12"&gt;How do I create a backup of my entire blog?&lt;/a&gt;" However, that looked too complicated to be of any use.  Here is what I do:&lt;br /&gt;&lt;br /&gt;cd blogbackup&lt;br /&gt;wget --timestamping --recursive heifner.blogspot.com&lt;br /&gt;&lt;br /&gt;wget is available for linux/unix/&lt;a href="http://www.cygwin.com/"&gt;cygwin &lt;/a&gt;and even &lt;a href="http://www.google.com/search?q=wget"&gt;windows&lt;/a&gt;.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110437322027378587?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110437322027378587/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110437322027378587' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110437322027378587'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110437322027378587'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/backup-entire-blog.html' title='Backup entire blog'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110425188142765429</id><published>2004-12-28T10:32:00.000-06:00</published><updated>2005-01-08T01:20:27.153-06:00</updated><title type='text'>functor vs function object</title><content type='html'>It appears that I have been using the term "functor" incorrectly. This is from an email posted on Boost-users list by Jeff Flinn, he quotes a letter to the editor of C++ Report:&lt;br /&gt;&lt;blockquote&gt;Here's the low-down, to which any mathematician would attest:&lt;br /&gt;&lt;br /&gt;A function is a transformation that maps an element to an element.&lt;br /&gt;A functional is a transformation that maps a function to an element.&lt;br /&gt;A functor is a transformation that maps a function to a function. (The truth functions in propositional logic are also sometimes called functors.)&lt;br /&gt;&lt;br /&gt;Simple, isn't it? We seem to use the first one correctly, but not the other two. What people commonly call a functor (thanks to Dr. Coplien, shame!) is what the C++ Standard calls a function object. It seems some people like to use "functional" to mean the same thing. Shame again! A function object is simply that, an instance of a class that behaves like a function by virtue of its operator(). Some function objects, like bind2nd, do behave like functors, in that they take a function object as input and return a function object as output. Only these deserve the functor moniker, although you may prefer "function object adaptor" (or is it spelled "adapter" &lt;span class="moz-smiley-s1"&gt;&lt;span style="font-size:+0;"&gt; :-) &lt;/span&gt;&lt;/span&gt;, as denoted in the C++ Standard.&lt;/blockquote&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110425188142765429?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://heifner.blogspot.com/2004/12/condition-variable-spurious-wakeup.html' title='functor vs function object'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110425188142765429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110425188142765429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110425188142765429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110425188142765429'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/functor-vs-function-object.html' title='functor vs function object'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110424553734651660</id><published>2004-12-28T08:19:00.000-06:00</published><updated>2007-02-16T08:27:07.237-06:00</updated><title type='text'>Win2VNC</title><content type='html'>I just received a new machine at work (AMD Athlon 64 3200+ 2.2 GHz 1 GB RAM). Its main purpose is to be a Windows build machine for my current project, but I'm also using it for my day to day development work as well, because it is really fast.&lt;br /&gt;&lt;br /&gt;I've become accustomed to using two monitors. My laptop and a 21 in. Sony CRT. I love high resolution so I run my laptop at 1600x1200 and the CRT at 1920x1440. However, the new machine put me in a dilemma: how do I use the new machine but still have two monitors.&lt;br /&gt;&lt;br /&gt;First thing I tried was using Window's Remote Desktop to connect to the new machine from my laptop. However, Remote Desktop is limited to 1600x1200 and I wanted 1920x1440. So next I tried various versions of VNC (UltraVNC, TightVNC-unstable, RealVNC), but they where all too slow at 1920x1440.&lt;br /&gt;&lt;br /&gt;Jason suggested that I try &lt;a href="http://fredrik.hubbe.net/win2vnc.html"&gt;Win2VNC&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;What does Win2VNC do? From the website: "This program will let you use two screens on two different computers as if they were connected to the same computer." Run a version of VNC server on one machine and run Win2VNC as a client on another. When the mouse moves off one screen it appears on the other allowing you to control both machines using the same keyboard and mouse. You see the updates on the actual machine's display. Its kind of like having a KVM switch that is triggered by the mouse moving off the screen.&lt;br /&gt;&lt;br /&gt;The only problem that I found was that the mouse wheel didn't work.  However, using this version of &lt;a href="http://win2vnc.sourceforge.net/index.html"&gt;Win2VNC&lt;/a&gt; fixes that problem.&lt;br /&gt;&lt;br /&gt;Of course, now I have two machines capable of running two monitors.  All I need now is some more monitors. :)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110424553734651660?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.deboer.gmxhome.de/index.html' title='Win2VNC'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110424553734651660/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110424553734651660' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110424553734651660'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110424553734651660'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/win2vnc.html' title='Win2VNC'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110394745408494130</id><published>2004-12-24T22:01:00.000-06:00</published><updated>2004-12-24T22:04:14.086-06:00</updated><title type='text'>Merry Christmas</title><content type='html'>Don't forget to set aside a &lt;a href="http://www.cyberhymnal.org/htm/s/i/silntnit.htm"&gt;silent moment&lt;/a&gt; to reflect on God's gift to us.  Have a merry Christmas and may God bless you and your family.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110394745408494130?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.cyberhymnal.org/htm/s/i/silntnit.htm' title='Merry Christmas'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110394745408494130/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110394745408494130' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110394745408494130'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110394745408494130'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/merry-christmas.html' title='Merry Christmas'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110394606112090060</id><published>2004-12-24T20:51:00.000-06:00</published><updated>2004-12-24T21:42:44.816-06:00</updated><title type='text'>Condition variable spurious wakeup</title><content type='html'>&lt;a href="http://www.weiqigao.com/blog/2004/12/24/1103918583000.html"&gt;Weiqi's year end review&lt;/a&gt; mentioned his &lt;a href="http://www.weiqigao.com/blog/2004/04/27/1083125026000.html"&gt;spurious wakeup blog entry&lt;/a&gt; that he wrote in April. Jonathan and I were talking about this a few weeks back. I was reviewing his code and commented on the importance of checking your condition when you wakeup because of spurious wakeups. So if you are using &lt;a href="http://www.dre.vanderbilt.edu/Doxygen/Beta/ace/classACE__Condition.html"&gt;ACE condition variable&lt;/a&gt; you need to make sure you do something like:&lt;pre&gt;&lt;br /&gt;ACE_Guard&amp;lt;ACE_Thread_Mutex&amp;gt; guard(mutex_);&lt;br /&gt;while (value != expected_value)&lt;br /&gt;  condition_.wait();&lt;/pre&gt;&lt;br /&gt;The cool thing is that boost's &lt;a href="http://www.boost.org/doc/html/condition.html"&gt;condition variable&lt;/a&gt; wait() method takes a predicate functor to handle spurious wakeup.&lt;pre&gt;&lt;br /&gt; struct CompareVariable {&lt;br /&gt;    bool operator()() const { &lt;br /&gt;       return value_ != expected_value_; &lt;br /&gt;    }&lt;br /&gt;    int value_, expected_value_;&lt;br /&gt; } pred;&lt;br /&gt;&lt;br /&gt; boost::mutex::scoped_lock guard(mutex_);&lt;br /&gt; condition.wait(guard, pred);&lt;/pre&gt;&lt;br /&gt;The &lt;pre&gt;   condition.wait(guard, pred);&lt;/pre&gt; above is equivalent to &lt;pre&gt;   while (!pred())wait(lock);&lt;/pre&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110394606112090060?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.weiqigao.com/blog/2004/12/24/1103918583000.html' title='Condition variable spurious wakeup'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110394606112090060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110394606112090060' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110394606112090060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110394606112090060'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/condition-variable-spurious-wakeup.html' title='Condition variable spurious wakeup'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110368165775288271</id><published>2004-12-21T19:58:00.000-06:00</published><updated>2004-12-21T20:14:17.753-06:00</updated><title type='text'>Turning on ACE debugging</title><content type='html'>I was trying to figure out how to turn on ACE debugging the other day. I didn't have my ACE Programmer's Guide with me and I wasn't finding it via Google. All the examples I found talked about how to change code to enable ACE debug statements, but I knew that it could be done through configuration. Turns out you need the following in your svc.conf file:&lt;br /&gt;&lt;br /&gt;dynamic Logger Service_Object* ACE:_make_ACE_Logging_Strategy() "-s log.txt -f STDOUT|STDERR|OSTREAM|VERBOSE -p DEBUG"&lt;br /&gt;&lt;br /&gt;This is discussed in section 3.8 (page 73) of ACE Programmer Guide and at this link: &lt;a href="http://www.cs.wustl.edu/%7Eschmidt/ACE-netsvcs.html#logging-strategy-overview"&gt;Logging Strategy Service&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110368165775288271?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.cs.wustl.edu/~schmidt/ACE-netsvcs.html#logging-strategy-overview' title='Turning on ACE debugging'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110368165775288271/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110368165775288271' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110368165775288271'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110368165775288271'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/turning-on-ace-debugging.html' title='Turning on ACE debugging'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110359701615584811</id><published>2004-12-20T20:11:00.000-06:00</published><updated>2008-04-10T09:59:28.345-05:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='C++'/><title type='text'>C++ Convert int to string</title><content type='html'>On my current project at &lt;a href="http://www.ociweb.com/"&gt;work&lt;/a&gt;, we have been focusing on speed. Its interesting to think about how many &lt;a href="http://www.google.com/search?hl=en&amp;q=microseconds+in+second&amp;amp;btnG=Search"&gt;microseconds&lt;/a&gt; (or nanoseconds) it takes to do something. I hope to post over the next few weeks some performance comparisons between various techniques in C++.&lt;br /&gt;&lt;br /&gt;My laptop which I'll be running the tests on is a Mobile Intel Pentium 4M 2200 MHz with 768 MB DDR SDRAM. I'll be compiling with Microsoft Visual C++ 7.1 in release mode. The tests are simple iteration tests running the same code over and over again a 1000 times. I know that this is not representative of real performance do to caching affects, but even this simple testing can be eye opening.&lt;br /&gt;&lt;br /&gt;Today lets look at boost::lexical_cast&lt;std::string&gt;. We use &lt;a href="http://boost.org/"&gt;boost&lt;/a&gt; and &lt;a href="http://www.theaceorb.com/product/aboutace.html"&gt;ACE&lt;/a&gt; on our current project. lexical_cast is a way of converting between strings and other types (actually it is a generic way of converting to/from more than just strings). So if I wanted to convert 23 to "23" I can do this:&lt;br /&gt;&lt;br /&gt;std::string twentythree = boost::lexical_cast&lt;std::string&gt;(23);&lt;br /&gt;&lt;br /&gt;If I do this on my laptop it runs in about &lt;a href="http://www.google.com/search?complete=1&amp;hl=en&amp;amp;lr=&amp;q=7+microseconds+in+second&amp;amp;btnG=Search"&gt;7 microseconds&lt;/a&gt;.  Not too bad.  However, if I use a C approach and do the following:&lt;br /&gt;&lt;br /&gt;  char buf[20];&lt;br /&gt;  ACE_OS::sprintf(buf, "%d", 23);&lt;br /&gt;&lt;br /&gt;It runs in 0.3 microseconds, which, I think you would agree, is better.&lt;br /&gt;&lt;br /&gt;The lexical_cast is safer and more general but is it worth the difference?  I would say it depends.&lt;br /&gt;&lt;br /&gt;So why is lexical_cast so much slower?  Well, its because it uses std::stringstream.  Take a look at the following:&lt;br /&gt;&lt;br /&gt;  std::stringstream ss;&lt;br /&gt;ss &lt;&lt; 23;  &lt;br /&gt;&lt;br /&gt;The above takes 6.7 microseconds, which is clearly most of the effort of lexical_cast.  &lt;/std::string&gt;&lt;/std::string&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110359701615584811?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110359701615584811/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110359701615584811' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110359701615584811'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110359701615584811'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/c-convert-int-to-string.html' title='C++ Convert int to string'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110270664888907954</id><published>2004-12-10T13:21:00.000-06:00</published><updated>2004-12-10T13:24:08.890-06:00</updated><title type='text'>Google Suggest</title><content type='html'>Jonathan just pointed out &lt;a href="http://labs.google.com/"&gt;Google's latest&lt;/a&gt;:  &lt;a href="http://www.google.com/webhp?complete=1&amp;hl=en"&gt;Google Suggest&lt;/a&gt;.&lt;br /&gt;&lt;span style="font-style: italic;"&gt;"As you type your search, Google offers keyword suggestions in     real time"&lt;br /&gt;&lt;/span&gt;&lt;font&gt;&lt;br /&gt;Try it out, I think you will like it...&lt;br /&gt;&lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110270664888907954?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.google.com/webhp?complete=1&amp;hl=en' title='Google Suggest'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110270664888907954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110270664888907954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110270664888907954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110270664888907954'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/google-suggest.html' title='Google Suggest'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110265504674950216</id><published>2004-12-09T23:01:00.000-06:00</published><updated>2004-12-09T23:04:06.750-06:00</updated><title type='text'>Rob Smith Blog</title><content type='html'>In case you didn't get the email, &lt;a href="http://robsmith1976.blogspot.com"&gt;Rob Smith&lt;/a&gt; started a blog. Rob is a up and coming star at &lt;a href="http://www.ociweb.com"&gt;OCI&lt;/a&gt;. It will be interesting to see what he has to say.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110265504674950216?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://robsmith1976.blogspot.com' title='Rob Smith Blog'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110265504674950216/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110265504674950216' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110265504674950216'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110265504674950216'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/rob-smith-blog.html' title='Rob Smith Blog'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110222200475952805</id><published>2004-12-04T22:39:00.000-06:00</published><updated>2004-12-04T22:46:44.760-06:00</updated><title type='text'>Beware of Methodologies</title><content type='html'>I just read again Joel's &lt;strong&gt;&lt;a href="http://www.joelonsoftware.com/articles/fog0000000024.html"&gt;Big Macs vs. The Naked Chef&lt;/a&gt;&lt;/strong&gt; article.  I agree completely with Joel's commentary, but I wonder if it is because I want so much to agree with the idea that highly skilled individuals can never be replaced.&lt;br /&gt;&lt;br /&gt;Let me think...&lt;br /&gt;&lt;br /&gt;Yep, that does sound right.  This is why I believe &lt;a href="http://www.ociweb.com"&gt;OCI&lt;/a&gt; has been successful.  Higher a bunch of really smart people, and run with it.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110222200475952805?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.joelonsoftware.com/articles/fog0000000024.html' title='Beware of Methodologies'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110222200475952805/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110222200475952805' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110222200475952805'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110222200475952805'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/beware-of-methodologies.html' title='Beware of Methodologies'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110211715870334975</id><published>2004-12-03T17:20:00.000-06:00</published><updated>2004-12-03T17:41:25.360-06:00</updated><title type='text'>Toyota's mobility concepts</title><content type='html'>I saw the following on Gizmodo. The following link has some very interesting pages on &lt;a href="http://www.toyota.co.jp/en/news/04/1203_1b.html"&gt;Toyota's concept "Robots"&lt;/a&gt;.  It doesn't give a top speed for the car like "robot", but does have some interesting descriptions.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="http://www.gizmodo.com/gadgets/images/toyota_iwalk_iunit.jpg" alt="toyota_iwalk_iunit.jpg image" class="center border" height="260" width="398" /&gt;&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110211715870334975?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.toyota.co.jp/en/news/04/1203_1a.html' title='Toyota&apos;s mobility concepts'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110211715870334975/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110211715870334975' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110211715870334975'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110211715870334975'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/toyotas-mobility-concepts.html' title='Toyota&apos;s mobility concepts'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110211457947047743</id><published>2004-12-03T16:50:00.000-06:00</published><updated>2004-12-03T16:56:19.470-06:00</updated><title type='text'>Google index updated</title><content type='html'>Google has updated their index so that the first link for "&lt;a href="http://heifner.blogspot.com"&gt;Kevin Heifner&lt;/a&gt;" now points to this blog instead of &lt;a href="http://www.pcastl.org"&gt;Providence Christian Academy&lt;/a&gt; (&lt;a href="http://www.pcastl.org"&gt;Classical Christian School in St. Louis&lt;/a&gt;).  My employer &lt;a href="http://www.ociweb.com"&gt;OCI&lt;/a&gt; still shows up below &lt;a href="http://www.pcastl.org"&gt;Providence School&lt;/a&gt;, but its nice that "&lt;a href="http://heifner.blogspot.com"&gt;Kevin Heifner&lt;/a&gt;" now goes to this blog.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110211457947047743?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://heifner.blogspot.com/' title='Google index updated'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110211457947047743/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110211457947047743' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110211457947047743'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110211457947047743'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/google-index-updated.html' title='Google index updated'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110211373257281097</id><published>2004-12-03T16:32:00.000-06:00</published><updated>2004-12-03T16:42:12.573-06:00</updated><title type='text'>SWIG</title><content type='html'>&lt;a href="http://www.weiqigao.com/blog"&gt;Weiqi&lt;/a&gt; pointed out &lt;a href="http://www.swig.org/"&gt;SWIG&lt;/a&gt; (Simplified Wrapper and Interface Generator) to me today.&lt;br /&gt;&lt;br /&gt;What is SWIG?&lt;br /&gt;&lt;br /&gt;SWIG is a code generation tool that connects programs written in C and C++ with a variety of other programming languages including Perl, Python, Tcl/Tk, Ruby, C#, Common Lisp (Allegro CL), Java, Modula-3, OCAML and various implementations of Scheme. SWIG is most commonly used to create high-level interpreted or compiled programming environments, user interfaces, and as a tool for testing and prototyping C/C++ software. SWIG may be freely used, distributed, and modified for commercial and non-commercial use.&lt;br /&gt;&lt;br /&gt;Looks very interesting!&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110211373257281097?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.swig.org/' title='SWIG'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110211373257281097/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110211373257281097' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110211373257281097'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110211373257281097'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/12/swig.html' title='SWIG'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110186660849168205</id><published>2004-11-30T19:52:00.000-06:00</published><updated>2004-11-30T20:03:28.490-06:00</updated><title type='text'>Halo 2</title><content type='html'>I finished Halo 2 last night.  Now I can get some sleep.  Let me jump on the bandwagon and say that this is the greatest game ever.  I'm now going to try in heroic mode and save up my pennies to get Xbox live so that Justin and I can play online.&lt;br /&gt;&lt;br /&gt;My only complaint about the game is that I couldn't hear the voices.  Even if I turned up the volume to deafening levels.  After finishing the game I turned off my dolby pro logic and it seemed to help a little, but then you don't have the surround sound.  Its hard to follow the action if you can't hear the directions.  Anyone else have this problem?&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110186660849168205?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='related' href='http://www.xbox.com/en-US/halo2/' title='Halo 2'/><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110186660849168205/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110186660849168205' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110186660849168205'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110186660849168205'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/11/halo-2.html' title='Halo 2'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110134875536892209</id><published>2004-11-24T19:51:00.000-06:00</published><updated>2004-11-24T20:12:35.370-06:00</updated><title type='text'>How Google works</title><content type='html'>I was checking the site stats for my kid's school website  &lt;a href="http://www.pcastl.org"&gt;Providence Christian Academy&lt;/a&gt; and noticed that three Google hits were from "kevin heifner".  I thought that was odd since my name does not appear anywhere on the site (or the source for the site).  I then googled for "kevin heifner" and was surprised to find that the number one link for my name was &lt;a href="http://www.pcastl.org"&gt;www.pcastl.org&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;So how could the number one link for my name be a &lt;a href="http://www.pcastl.org"&gt;Christian School in St. Louis&lt;/a&gt; that does not contain my name?  Its not like my name does appear on other sites.  So why would www.pcastl.org be number one on the list? &lt;br /&gt;&lt;br /&gt;Well...  Recently I posted to &lt;a href="http://www.weiqigao.com/blog"&gt;Weiqi's Blog&lt;/a&gt; and since I didn't have a webpage of my own, I just used the website of &lt;a href="http://www.pcastl.org"&gt;Providence&lt;/a&gt;.  It turns out that Google uses the words used to link to a page to match search phrases.  So since "kevin heifner" was used to link to &lt;a href="http://www.pcastl.org"&gt;www.pcastl.org&lt;/a&gt;, Google setup their index so when someone searches for "kevin heifner" it lists &lt;a href="http://www.pcastl.org"&gt;www.pcastl.org&lt;/a&gt; as the number one link.&lt;br /&gt;&lt;br /&gt;So it should be possible to get Google to list the www.pcastl.org for searches such as: &lt;a href="http://www.pcastl.org"&gt;Christian School St. Louis&lt;/a&gt; or &lt;a href="http://www.pcastl.org"&gt;Christian Education St. Louis&lt;/a&gt; or &lt;a href="http://www.pcastl.org"&gt;Christian K-12 School&lt;/a&gt; by creating links like those of this sentence.  All I need to do now is wait for the google-bots to find this page and see what happens.&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110134875536892209?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110134875536892209/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110134875536892209' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110134875536892209'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110134875536892209'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/11/how-google-works.html' title='How Google works'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110088132882669141</id><published>2004-11-19T10:16:00.000-06:00</published><updated>2004-11-19T10:22:08.826-06:00</updated><title type='text'>Syndication feed</title><content type='html'>&lt;a href="http://www.semanticnoise.com"&gt;James McMurry&lt;/a&gt; asks:&lt;br /&gt;&lt;blockquote&gt;I'm glad to see you're going to have a blog, but where's the syndication feed?&lt;/blockquote&gt;I think that it is:&lt;br /&gt;&lt;a href="http://heifner.blogspot.com/atom.xml" target="_blank"&gt;&lt;blockquote&gt;http://heifner.blogspot.com/atom.xml&lt;/blockquote&gt;&lt;/a&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt; &lt;pre wrap=""&gt;&lt;/pre&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110088132882669141?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110088132882669141/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110088132882669141' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110088132882669141'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110088132882669141'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/11/syndication-feed.html' title='Syndication feed'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110081504236287116</id><published>2004-11-18T15:47:00.000-06:00</published><updated>2004-11-18T15:57:22.363-06:00</updated><title type='text'>Real-time design patterns</title><content type='html'>I'm teaching OOAD/DP (Object Oriented Analysis and Design) and (Object Oriented Design Patterns) this week in Dewitt (East Syracuse), NY. One of my students asked about resourses for real-time design patterns, so I shot a quick email to my fellow developers at OCI.&lt;br /&gt;&lt;br /&gt;Chris Cleeland had this to say:&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;I just stumbled across &lt;a class="moz-txt-link-freetext" href="http://www.eventhelix.com/RealtimeMantra/Patterns/"&gt;http://www.eventhelix.com/RealtimeMantra/Patterns/&lt;/a&gt;  &lt;span style="font-family:monospace;"&gt;&lt;/span&gt;which looks like an interesting collection of realtime-related patterns--and it's free.&lt;/blockquote&gt;In response to my question about &lt;span style="font-style: italic;"&gt;Real-Time Design Patterns&lt;/span&gt; by Bruce Powel Douglass, Mike Martinez had this to say:&lt;br /&gt;&lt;blockquote&gt;I am in the process of reading it.  So far it appears pretty &lt;br /&gt;thorough.  It addresses the major issues of real time software, which &lt;br /&gt;are not normally considered with most pattern treatments. &lt;br /&gt;&lt;br /&gt;I would recommend the book on the basis of the application of patterns &lt;br /&gt;to the RT domain.&lt;/blockquote&gt;Anyone else have any comments?&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;blockquote&gt;&lt;/blockquote&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110081504236287116?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110081504236287116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110081504236287116' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110081504236287116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110081504236287116'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/11/real-time-design-patterns.html' title='Real-time design patterns'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-110081439339889373</id><published>2004-11-18T15:44:00.000-06:00</published><updated>2004-11-18T15:46:33.396-06:00</updated><title type='text'>Weiqi found my blog</title><content type='html'>Weiqi Gao has this blog listed as one of his "Blogs I read".  The question is how did he discover that it exists.  I've sent an email to him to find out...&lt;br /&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-110081439339889373?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/110081439339889373/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=110081439339889373' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110081439339889373'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/110081439339889373'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/11/weiqi-found-my-blog.html' title='Weiqi found my blog'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-9016105.post-109962344359993455</id><published>2004-11-04T20:55:00.000-06:00</published><updated>2004-11-04T20:57:23.600-06:00</updated><title type='text'>Start of Blog</title><content type='html'>Well, I finally decided to start a blog.  Please stay tuned for actual content in the future.&lt;br /&gt; &lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/9016105-109962344359993455?l=heifner.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://heifner.blogspot.com/feeds/109962344359993455/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=9016105&amp;postID=109962344359993455' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/109962344359993455'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/9016105/posts/default/109962344359993455'/><link rel='alternate' type='text/html' href='http://heifner.blogspot.com/2004/11/start-of-blog.html' title='Start of Blog'/><author><name>Kevin Heifner</name><uri>http://www.blogger.com/profile/08934215964720154954</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='32' src='http://bp0.blogger.com/_jdkVCPMDh_4/SAUcSDBls0I/AAAAAAAAAE4/EHmhyePvHZM/S220/heifnerk48.png'/></author><thr:total>0</thr:total></entry></feed>
