Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Jupyter Notebook Support in Bitbucket

GitHub has built-in support for Jupyter Notebooks. Bitbucket supports Jupyter Notebooks via a fileview addon. It works on both publick and private notebooks. Follow the steps below to install the addon.

  1. Click on your avatar in the lower left corner on your homepage of Bitbucket.

    Bitbucket Menu

  2. Select the option App marketplace …

Boolean Values in C++

  1. Boolean expressions are evaluated from left to right (the same in Java), so it is totally OK to write code like

    if(a < x.size() && x[a]){
        ...
    }
    

    where x is a vector.

  2. There is no &&= and ||= operators in C++, instead you can use &= and |=. Though &= and |= are not specially for …

Advanced Use of "head" and "tail"

It is suggested that you use Python instead of Shell to manipulate text files!!

Besides passing an unsigned integer as parameter to the option -n, you can also pass a signed integer to it. When a signed integer is passed to -n, it means from/to (inclusive/exclusive similar to …

Configure SSH to Use a Proxy Server

Suppose you have a production server that you want to visit via SSH, however, it is not accessible directly. Instead, you have to visit it from a bastion/proxy server. You can configure SSH to use the bastion/proxy server when visiting the production server.

Host <production_server>
ProxyCommand ssh <proxy_server …