<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>dalzhim.github.io</title>
    <description></description>
    <link>https://dalzhim.github.io/</link>
    <atom:link href="https://dalzhim.github.io/feed.xml" rel="self" type="application/rss+xml"/>
    <pubDate>Wed, 11 Apr 2018 07:31:02 +0000</pubDate>
    <lastBuildDate>Wed, 11 Apr 2018 07:31:02 +0000</lastBuildDate>
    <generator>Jekyll v3.7.3</generator>
    
      <item>
        <title>Trust your tooling</title>
        <description>When faced with weird results coming from everyday tools, it can be very tempting to discard those results in disbelief by calling it a bug. The fact that those weird results are rare occurrences, that they may be not reproducible in the developer’s environment, and most importantly, that the developer cannot understand how to explain them, are strong incentives to discard those reports. And yet, it is very important to fight the urge to mistrust your tools because in most occurrences, they are absolutely right.

</description>
        <pubDate>Wed, 11 Apr 2018 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2018/04/11/Trust-your-tooling/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2018/04/11/Trust-your-tooling/</guid>
        
        <category>c++</category>
        
        
      </item>
    
      <item>
        <title>Improving the Enum Class Bitmask</title>
        <description>Back in 2016, I wrote &lt;a href=&quot;https://dalzhim.github.io/2016/02/16/enum-class-bitfields/&quot;&gt;a blog post&lt;/a&gt; about enum class bitfields that was influenced by &lt;a href=&quot;https://www.justsoftwaresolutions.co.uk/cplusplus/using-enum-classes-as-bitfields.html&quot;&gt;Anthony William’s blog post&lt;/a&gt; about the very same topic: how to painlessly enable bitmask operators with the &lt;code class=&quot;highlighter-rouge&quot;&gt;enum class&lt;/code&gt; feature that was introduced with C++11 for increased type safety and convenience. After using this in production code for a while, the amount of programming errors related to implicit conversions has diminished as usage has increased and legacy code has slowly converted. Yet, even by using this tool, I managed to write buggy code such as the following.
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;rouge-gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;rouge-code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;auto&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;someMask&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;someMask&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;myEnum&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;someEnumerator&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Fri, 11 Aug 2017 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2017/08/11/Improving-the-enum-class-bitmask/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2017/08/11/Improving-the-enum-class-bitmask/</guid>
        
        <category>c++</category>
        
        
      </item>
    
      <item>
        <title>A Custom Iterator Class for Interval Containers</title>
        <description>I wrote an article two years ago about a peculiar usage of Boost.ICL with a &lt;code class=&quot;highlighter-rouge&quot;&gt;DomainType&lt;/code&gt; that changes (dynamically) at runtime. That domain could be described as the elements of a container ordered according to a strict weak relationship. The implementation I offered worked, but it suffered a few weaknesses. The present article will go over the various weaknesses and offer a new implementation that addresses those issues. If you want to skim over the previous implementation, you can find it &lt;a href=&quot;https://github.com/Dalzhim/ArticleDynamicFiniteDomain/blob/fb45ca0b805aeb2a3eaac3619bdf318fbd80fbb4/main.cpp&quot;&gt;on Github over here&lt;/a&gt;.

</description>
        <pubDate>Sat, 29 Jul 2017 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2017/07/29/A-custom-iterator-class-for-interval-containers/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2017/07/29/A-custom-iterator-class-for-interval-containers/</guid>
        
        <category>c++</category>
        
        <category>boost</category>
        
        
      </item>
    
      <item>
        <title>SVN to Git Transition Problems</title>
        <description>Source control is an extremely valuable tool most developers use nowadays and to me, both the commidity of making it easier to work with a team and keeping a complete history of changes made to the source code are very important features it delivers. Git is a tool that has gained a lot of marketshare in the source control ecosystem over the years, and with good reason : its design is very good and is more efficient for multiple workflows such as branching and contributing code to projects without being part of that project’s team. This post isn’t meant to argue about git over svn though. It’s about things that can go wrong, without anyone noticing, while migrating an existing codebase from svn to git.

</description>
        <pubDate>Sat, 13 May 2017 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2017/05/13/svn-to-git-transition-problems/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2017/05/13/svn-to-git-transition-problems/</guid>
        
        <category>git</category>
        
        <category>svn</category>
        
        <category>tools</category>
        
        
      </item>
    
      <item>
        <title>Compiling Facebook's Proxygen on OS X</title>
        <description>The Proxygen library, from Facebook, allows the C++ programmer to program on both ends of the HTTP protocol : client and server. The library runs on Linux and has been used in production by Facebook for a few years before it was open sourced in november 2014. This should be considered a serious option as it delivers incredible performance to process HTTP requests on the server side.

</description>
        <pubDate>Wed, 27 Apr 2016 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2016/04/27/compiling-facebooks-proxygen-on-os-x/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2016/04/27/compiling-facebooks-proxygen-on-os-x/</guid>
        
        <category>c++</category>
        
        
      </item>
    
      <item>
        <title>Enum class bitfields</title>
        <description>C++11's addition of scoped enumeration has given us the ability to create stronger types that can't be accidentally converted between integer types and enumeration types.
&lt;div class=&quot;language-cpp highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;&lt;table class=&quot;rouge-table&quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td class=&quot;rouge-gutter gl&quot;&gt;&lt;pre class=&quot;lineno&quot;&gt;1
2
3
4
5
6
&lt;/pre&gt;&lt;/td&gt;&lt;td class=&quot;rouge-code&quot;&gt;&lt;pre&gt;&lt;span class=&quot;k&quot;&gt;enum&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;e&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;kEnumerator1&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;kEnumerator2&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;
&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;kEnumerator2&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;c1&quot;&gt;// implicit conversion
&lt;/span&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

</description>
        <pubDate>Tue, 16 Feb 2016 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2016/02/16/enum-class-bitfields/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2016/02/16/enum-class-bitfields/</guid>
        
        <category>c++</category>
        
        
      </item>
    
      <item>
        <title>Memory Corruption Through One Definition Rule (ODR) Violation</title>
        <description>Memory corruption is the symptom of a program that writes into the wrong memory location. There are a few different classes of bugs that can lead to memory corruption such as uninitialized memory, dangling pointers and buffer overflows. Recently, I’ve discovered a variety I had never seen before, which I’d consider a subclass of buffer overflows. Here’s the short story.

</description>
        <pubDate>Thu, 05 Nov 2015 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2015/11/05/memory-corruption-through-one-definition-rule-odr-violation/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2015/11/05/memory-corruption-through-one-definition-rule-odr-violation/</guid>
        
        <category>c++</category>
        
        
      </item>
    
      <item>
        <title>Predicate Creation Techniques for Standard Algorithms</title>
        <description>Predicates are functions that return a boolean result upon being called. A predicate example is a function &lt;code class=&quot;highlighter-rouge&quot;&gt;bool isToday(Date&amp;amp; date)&lt;/code&gt; which returns if the supplied date object corresponds to the current day or not. The Standard Template Library (STL) has many algorithms to which predicates can be supplied : &lt;code class=&quot;highlighter-rouge&quot;&gt;count_if&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;find_if&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;copy_if&lt;/code&gt;, &lt;code class=&quot;highlighter-rouge&quot;&gt;remove_if&lt;/code&gt;, etc. You might have noticed the examples I have given share the suffix &lt;code class=&quot;highlighter-rouge&quot;&gt;_if&lt;/code&gt; which hints to the presence of an argument which is a predicate. In this article, I will go over many different ways to implement a predicate that can be supplied to the STL algorithms in order to extract some elements from a collection. First, here is the collection that will be filtered :

</description>
        <pubDate>Sat, 22 Aug 2015 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2015/08/22/predicate-creation-techniques-for-standard-algorithms/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2015/08/22/predicate-creation-techniques-for-standard-algorithms/</guid>
        
        <category>c++</category>
        
        <category>stl</category>
        
        
      </item>
    
      <item>
        <title>Boost interval_map with a Dynamic Finite Domain</title>
        <description>I have been exploring some particular use cases with boost ICL’s interval_map in order to map values to intervals based on a dynamic finite domain. I would like to share what I have learned in the process so I will start with a quick overview of a few concepts of the ICL and then show some code snippets to get it working.

</description>
        <pubDate>Thu, 06 Aug 2015 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2015/08/06/boost-interval_map-with-a-dynamic-finite-domain/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2015/08/06/boost-interval_map-with-a-dynamic-finite-domain/</guid>
        
        <category>c++</category>
        
        <category>boost</category>
        
        
      </item>
    
      <item>
        <title>Auto Layout and NSScrollView</title>
        <description>Apple’s auto layout guide states that constraints cannot be set to cross a view within the hierarchy if it sets the bounds manually using a &lt;code class=&quot;highlighter-rouge&quot;&gt;-[NSView layout]&lt;/code&gt; or &lt;code class=&quot;highlighter-rouge&quot;&gt;-[UIView layoutSubviews]&lt;/code&gt; override. It is also not possible to cross a view that has a bounds transform such as the &lt;code class=&quot;highlighter-rouge&quot;&gt;NSScrollView&lt;/code&gt;. What this means, is that because the constraints aren’t aware of the bounds transform or the manual manipulations on the frame property of a view, a hierarchy of views where the ancestor A containing a &lt;code class=&quot;highlighter-rouge&quot;&gt;NSScrollView&lt;/code&gt; S which in turn contains a child C cannot set constraints on C that are related to A. S acts as a barrier for the constraint system.

</description>
        <pubDate>Tue, 07 Jul 2015 00:00:00 +0000</pubDate>
        <link>https://dalzhim.github.io/2015/07/07/auto-layout-and-nsscrollview/</link>
        <guid isPermaLink="true">https://dalzhim.github.io/2015/07/07/auto-layout-and-nsscrollview/</guid>
        
        <category>objc</category>
        
        
      </item>
    
  </channel>
</rss>
