Author | Logan

  1. SSL Certificate

    I would like to run shellinabox and my private blog system through HTTPS protocol. However, an SSL certificate is really expensive, thus I decided to run our own certificate authority and distribute my cacert.pem through GitHub Pages.

    In general, running a certificate authority requires three steps:

    1. Create a RSA …

    More

  2. C++ std::list Operations

    To sort the doubly linked list std::list, we can simply call the sort() member function. For example,

    #include <iostream>
    #include <list>
    
    int main() {
      std::list<int> xs{5, 4, 3, 2, 1};
    
      xs.sort();  // Sort the std::list!
    
      for (auto &x : xs) {
        std::cout << x << std::endl;
      }
    }
    

    We can't …

    More

  3. C++ Associative Container and Iterator Validness

    I used to believe that iterators will be invalidated after calling the member functions insert() or erase() of containers. Thus, I would adopt a conservative approach:

    1. Create a temporary container.
    2. Copy the elements which I would like to keep to the temporary container.
    3. Swap the container.

    For example, to remove …

    More

  4. Git Merge Base and Checkout

    Today I have learned two different usages of git command. First, to list the least common ancestor of two refs, we may use following command:

    $ git merge-base --octopus <commit_1> <commit_2> ... <commit_n>
    

    Please notice that --octopus is mandatory; otherwise, git will create a hypothetical commit M, which merges …

    More

  5. Soundness and Completeness of the Type System

    In the section 6 of Programming Languages course, Dan Grossman discussed about the soundness and the completeness of the type system. He said that:

    • A type-system is sound implies that all of type-checked programs are correct (in the other words, all of the incorrect program can't be type checked), i …

    More

  6. First Post

    After using Blogger for several years, I decided to switch to Pelican and GitHub Pages. I feel it will be much easier to write down my thoughts, notes, and ideas with reStructuredText. As a result, I can update the blog more frequently.

    In the foreseeable future, I will start to …

    More

« Prev Page 7 / 7