Author | Logan

  1. Pelican and GitHub Pages

    Pelican has built-in support for GitHub Pages. However, I noticed that the ghp-import command might screw up the commit log if your GitHub Pages and your Pelican source code share the same branch name.

    According to the document of GitHub Pages, the user pages should be committed to master branch …

    More

  2. 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

  3. 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

  4. 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

  5. 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 commit_2 .. commit_n, and …

    More

  6. 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

  7. 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