Ben Chuanlong Du's Blog

And let it direct your passion with reason.

List Running Jupyter Notebook Servers

You can list running Jupyter Notebook servers using the following command.

jupyter notebook list

It works well most of the time. However, if the servers are launched using the root account (e.g., in a Docker container), you might encounter issues. In this case, a better alternative is to list …

Generating YYYYMM Formatted Dates Using Python

import monthdelta as md
import datetime as dt
import math as math

def quarter(month):
    return int(math.ceil(month/3.0))
#end def

d0 = md.date.today()
dates = [d0 + md.monthdelta(i) for i in range(1, 20)]
yyyymms = [d.year*100 + d.month for d in dates]
yymms …

String in Different Programming Languages

A string is essentially a sequence of characters. This is how string is implemented in many programming languages (string in Java is different). For this reason, you can operate string like an array in some programming languages. This post is a shallow summary on strings in different programming languages. For …

Automated Phone Bill Using Ruby Program

I have decided to try different programming languages. I learn Python a month ago. I would like to say that Python is great scripting language. The only thing I do not like so far is inconsistent about methods and functions. It is annoying to remember whether a call should be …