Ben Chuanlong Du's Blog

It is never too late to learn.

Directly Initialize a Hashmap in Java

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

The following code snippet in Java 9+ initialize an immutable HashMap with up to 10 elements.

The Entry Widget in Tkinter

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. ttk.Entry is preferred over tk.Entry.

  2. ttk.Entry/tk.Entry does not have a set method to set the text directly. Instead, you have to first delete the text and …