<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Han writes stuffs here</title>
    <description>Algorithms, Math, Rants</description>
    <link>https://hanyou.dev</link>
    <atom:link href="https://hanyou.dev/feed.xml" rel="self" type="application/rss+xml" />
    
      <item>
        <title>PTRACE_O_TRACEEXEC in ptrace</title>
        <description>
          
          ptrace’s manpage is a little confusing about the effect of the PTRACE_O_TRACEEXEC option: First we have, If the PTRACE_O_TRACEEXEC option is not in effect, all successful calls to execve(2) by the traced process will cause it to be sent a SIGTRAP signal, giving the parent a chance to gain control...
        </description>
        <pubDate>Thu, 16 Jan 2020 08:19:00 -0700</pubDate>
        <link>https://hanyou.dev/2020-01-16-ptrace-o-traceexec/</link>
        <guid isPermaLink="true">https://hanyou.dev/2020-01-16-ptrace-o-traceexec/</guid>
      </item>
    
      <item>
        <title>A Visualized Distributed Algorithm Playground</title>
        <description>
          
          Play and experiment with your favorite distributed algorithms! Everything visualized.




    No script link: dist.hanyou.dev

        </description>
        <pubDate>Sun, 08 Sep 2019 04:32:00 -0600</pubDate>
        <link>https://hanyou.dev/2019-09-08-dist-demo/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-09-08-dist-demo/</guid>
      </item>
    
      <item>
        <title>Type of `flip id`</title>
        <description>
          
          What is the type of flip id? \[ flip :: (a \rightarrow b \rightarrow c) \rightarrow (b \rightarrow a \rightarrow c) \\ id :: x \rightarrow x \] Because id is the parameter of flip, we can solve \[ (a \rightarrow (b \rightarrow c)) \sim (x \rightarrow x) \] to...
        </description>
        <pubDate>Sun, 25 Aug 2019 01:14:00 -0600</pubDate>
        <link>https://hanyou.dev/2019-08-25-flip-id/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-08-25-flip-id/</guid>
      </item>
    
      <item>
        <title>Amortized LRU Cache (Now WITHOUT Linked List!)</title>
        <description>
          
          As you probably know LRU cache is a common interview question. Just for the record, I know that the canonical way of doing this is using a hashmap with a linked list, but to implement a generic linked list correctly is somewhat unpleasant when there are special cases such as...
        </description>
        <pubDate>Mon, 03 Jun 2019 11:51:00 -0600</pubDate>
        <link>https://hanyou.dev/2019-06-03-amortized-lru/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-06-03-amortized-lru/</guid>
      </item>
    
      <item>
        <title>Covering a Boolean Matrix with Minimum Number of Rectangles</title>
        <description>
          
          The problem (by @rubyleehs): Suppose we have a boolean matrix. How do we use the fewest (maybe overlapping) rectangles to cover all the true cells and none of the false cells? Given a $n\times n$ matrix, obviously the lowerbound of this problem is $O(n^2)$. So that’s what we are aiming...
        </description>
        <pubDate>Mon, 08 Apr 2019 06:27:30 -0600</pubDate>
        <link>https://hanyou.dev/2019-04-08-minimum-maxtrix-cover/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-04-08-minimum-maxtrix-cover/</guid>
      </item>
    
      <item>
        <title>Nested Chairman Tree (Functional Segment Tree), and Beyond</title>
        <description>
          
          Recently I ran into one (of the millions of variations of) sequence maintainence problem (BZOJ3065). We need to support insertion/deletion, and querying the $k$th smallest element in a given interval. Hzwer seems to have come up with a solution that involves a scapegoat-tree-nested segment tree, which I can’t say confidently...
        </description>
        <pubDate>Wed, 03 Apr 2019 16:27:06 -0600</pubDate>
        <link>https://hanyou.dev/2019-04-03-nested-functional-segment-tree/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-04-03-nested-functional-segment-tree/</guid>
      </item>
    
      <item>
        <title>Notes on GHC (1) - The Core Language</title>
        <description>
          
          Introduction I have been working on ES.hs for a month or two. ES.hs is a compiler that compiles Haskell to ES6 code. There are already a few options out there: there is GHCJS, which takes over after the LLVM phase. This renders communication with Javascript not very straightforward but in...
        </description>
        <pubDate>Mon, 04 Mar 2019 09:49:59 -0700</pubDate>
        <link>https://hanyou.dev/2019-03-04-ghc-notes-1/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-03-04-ghc-notes-1/</guid>
      </item>
    
      <item>
        <title>What does Haskell RankNTypes do? (1) - Semantics</title>
        <description>
          
          Consider this function: tuple2Int :: (x -&amp;gt; Int) -&amp;gt; (a, b) -&amp;gt; (Int, Int) tuple2Int f (a, b) = (f a, f b) …which wouldn’t work. Why? Because of f a, the type checker deduces that x~a (x is equivalent to a); because of f b, the type checker also...
        </description>
        <pubDate>Tue, 26 Feb 2019 15:33:26 -0700</pubDate>
        <link>https://hanyou.dev/2019-02-26-haskell-rankntype-1/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-02-26-haskell-rankntype-1/</guid>
      </item>
    
      <item>
        <title>Be Careful of Direct-Indexing and Modifying C++ Containers Simultaneously</title>
        <description>
          
          There was this weird C++ bug I encountered, minimally reproducible by #include &amp;lt;iostream&amp;gt; #include &amp;lt;vector&amp;gt; std::vector&amp;lt;int&amp;gt; vec; int alloc(){ vec.push_back(0); return vec.size(); } int main(){ vec.push_back(0); vec[0] = alloc(); std::cout &amp;lt;&amp;lt; vec[0] &amp;lt;&amp;lt; std::endl; } After the first line of main, vec has size 1. In the second line of...
        </description>
        <pubDate>Tue, 26 Feb 2019 14:19:27 -0700</pubDate>
        <link>https://hanyou.dev/2019-02-26-cpp-alloc-access/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-02-26-cpp-alloc-access/</guid>
      </item>
    
      <item>
        <title>Yet Another Method to Generate Permutations</title>
        <description>
          
          There are tons of methods to generate every permutation of some elements. And here’s another intuitive and efficient (beats 98.00% of submissions on LeetCode) one I came up with. Suppose we have $N$ elements $a_1, a_2 … a_N$ and $answer$ is a 1-index (yeah, burn me) list sized $n!$ (so...
        </description>
        <pubDate>Wed, 06 Feb 2019 04:58:54 -0700</pubDate>
        <link>https://hanyou.dev/2019-02-06-yet-another-combination-gen/</link>
        <guid isPermaLink="true">https://hanyou.dev/2019-02-06-yet-another-combination-gen/</guid>
      </item>
    
  </channel>
</rss>
