1
2
3
4
5
6
from tqdm import tqdm

for i in range(range(10), ncols=10):
"""
Your code here.
"""

ncols will determine the length of process bar.

This is a template of argparse.

1
2
3
4
5
6
7
import argparse
parser = argparse.ArgumentParser(description="description of this script")
parser.add_argument('--parameter','-p',type=int, default='1', help='epoch')
args = parser.parse_args()

parameter = args.parameter
print(parameter)

or

1
2
3
4
5
parser = argparse.ArgumentParser(description="description of this script")
parser.add_argument('--querID','-id',type=str, help='Query ID')

args = parser.parse_args().__dict__
print(args)

Pass boolean flag via

1
2
parser.add_argument('--flag', action="store_true", help="this is your boolean value")
# enable this flag via: python test.py --flag

python script.py -h to show the help of parameters.

np.where seems to be an important function that need to be noticed.

Two examples to show its function.

  1. np.where(condition, x, y)

    1
    2
    3
    4
    5
    6
    7
    >>> import numpy as np
    >>> x = np.mat([1,2,3])
    >>> x
    matrix([[1, 2, 3]])
    >>> y = np.where(x > 1, 0, x)
    >>> y
    array([[1, 0, 0]])
  2. np.where(condition)

    1
    2
    3
    4
    5
    6
    7
    >>> import numpy as np
    >>> x = np.mat([1,2,3])
    >>> x
    matrix([[1, 2, 3]])
    >>> y = np.where(x > 1)
    >>> y
    (array([0, 0]), array([1, 2]))

This project can be build successfully. But it can not run in Xcode(13.2.1).

'/opt/homebrew/Cellar/glfw/3.3.6/lib/libglfw.3.3.dylib' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?))

The problem is the .dylib you used is not signed by apple. You can choose to codesign the lib, otherwise you can choose not to sign the project.

GO TO TARGETS->Build Settings->Code Signing Identity->Others. In default, it is '-'. Just delete it.

太阳好哥哥在拉仇恨,刚刚飞渡起手准备给拉达冈上一课。没想到是被服务器上了一课。

Put your unziped file in:

/Applications/Blender.app/Contents/Resources/3.0/scripts/addons

Enable add-on:

Blender->Edit->Preferences->Add-ons

Search your add-on and enable it.

Apps:

Network Monitor, VPN, The Unarchiver, 迅雷, IINA, Keynotes, Pages, GoodNotes, Words, Excel, Typora, Final Cut Pro X, Steam, Chrome, QQ, Notion, AltServer, Microsoft Remote Desktop, VScode, Developer, Xcode

Development:

Conda, Hexo, oh-my-zsh, vim color scheme, homebrew, clang

PyTorch, tensorflow-apple

Embedding a technique widely used in Recommender System. The first time I met it, it confuesd me for a long time. Now let me take 5 minutes to tell you what is Embedding. It will be just a brief introduction without going to details.

Read more »
0%