MoonLab - TIL

This is where i store my today-i-learned

You may also wannna visit my blog

Browse by tags

Welcome

#python Python String Format - Sep 26, 2024

f-strings (Python 3.6+) name = "Alice" age = 30 formatted_string = f"My name is {name} and I am {age} years old." str.format() name = "Bob" age = 25 formatted_string = "My name is {} and I am {} years old.".format(name, age) Percent % formatting name = "Charlie" age = 22 formatted_string = "My name is %s and I am %d years old.

#python Python Types - Sep 25, 2024

Collection Data Types get length: len(dict) List list = [10, 20, 30] Lists are used to store multiple items in a single variable. ordered changeable allow duplicate values Tuple Set Dictionary dict = { "a": "abc", "year": 1986 } not allow duplicate values - Dictionaries cannot have two items with the same key.

#python Python Virtual Environment - Sep 25, 2024

因为有时候需要不同的python的版本来运行程序,所以就出现了版本管理器pyenv,类似于nodej

#system chkdsk 修复DiskGenius分区时Bitamp中有标记被使用的Cluster - Sep 25, 2024

chkdisk /f /x d: d: 是所需要修复的磁盘。

#javascript JavaScript Prototype Chain - Aug 14, 2024

prototype chain is inheritance mechanism in JavaScript. JavaScript objects have a link to prototype objects. When trying to access a property of an object, the property will not only be sought on the object, but on the prototype of the object. const o = { a: 1, b: 2, // __proto__ sets the [[Prototype]].

#vim Vim Configuration - Aug 13, 2024

I dont know its a good idea or bad idea to decide to use vim. I just wanna give it a try… List all the .vim files that Vim loads: :scriptnames In default, vim dont automaticalyy create ~/.vimrc :e $MYVIMRC open & edit the current .vimrc that you are using, then use Ctrl + G to view the path in status bar.

#linux Pacman Mirrorlist更新 - Aug 13, 2024

$ sudo pacman -Sy 出现了: error: failed retrieving file 'core.db' from mirror.f4st.host : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds error: failed retrieving file 'extra.db' from mirror.f4st.host : Operation too slow. Less than 1 bytes/sec transferred the last 10 seconds error: failed

#docker Linux 使用zsh - Aug 12, 2024

先查看当前的shell: $ echo $SHELL /bin/bash 安装zsh: $ sudo pacman -S zsh zsh-completions Making zsh the default shell List all installed shell: $ chsh -l 将/bin/zsh设

#docker Docker Volume迁移 - Aug 11, 2024

其实我一直都用不好docker,因为我的经验很少,直到现在我也没有遇到非使用docker不可的情况,

#linux ssh-keygen - Aug 11, 2024

When i used systemctl status sshd, i saw: Aug 11 03:41:35 NekoPara01 sshd[1045]: error: Could not load host key: /etc/ssh/ssh_host_ecdsa_key Aug 11 03:41:35 NekoPara01 sshd[1045]: error: Could not load host key: /etc/ssh/ssh_host_ed25519_key Use sudo ssh-keygen -A to generate all missing host keys.

Next >