--> After open Django shell
from django.apps import apps
for _class in apps.get_models():
if _class.__name__.startswith('Historycal'):
continue
globals()[_class.__name__] = _class
import random | |
import datetime | |
def remove_accents(input_str): | |
import unicodedata | |
nfkd_form = unicodedata.normalize('NFKD', input_str) | |
return u"".join([c for c in nfkd_form if not unicodedata.combining(c)]) | |
def replace_space_and_remove_accent(text): |
On windows 10 or 11, you can run the command winget install GnuWin32.Make in the command line or | |
powershell to quickly install it. Than you can use the command make. | |
p.s.: | |
You might have to add C:\Program Files (x86)\GnuWin32\bin to the windows environmental variable PATH | |
to enable quick access to the command (thanks for the JobaDiniz on this note). | |
There is no need to install choco anymore. | |
Link: https://stackoverflow.com/questions/32127524/how-to-install-and-use-make-in-windows#:~:text=On%20windows%2010,install%20choco%20anymore. |
--> After open Django shell
from django.apps import apps
for _class in apps.get_models():
if _class.__name__.startswith('Historycal'):
continue
globals()[_class.__name__] = _class
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
version: '3.8' | |
services: | |
postgresql: | |
image: 'postgres:latest' | |
ports: | |
- 5432:5432 | |
environment: | |
POSTGRES_USER: username # The PostgreSQL user (useful to connect to the database) | |
POSTGRES_PASSWORD: password # The PostgreSQL password (useful to connect to the database) |
version: "3.8" | |
services: | |
rabbitmq3: | |
container_name: rabbitmq-data | |
image: rabbitmq:3.8-management-alpine | |
environment: | |
- RABBITMQ_DEFAULT_USER=admin | |
- RABBITMQ_DEFAULT_PASS=admin | |
- TZ=Asia/Ho_Chi_Minh | |
volumes: |
# Request: | |
thumb=Form(..., description='thumb'), | |
# Nhận request và chỉnh sửa lại file | |
up = {'thumb': (str(thumb.filename), await thumb.read())} | |
# Gửi qua api, | |
response = requests.post('url-endpoint', | |
data=data, files=up | |
) |
Cập nhật (12/10/2021): Bản ghi chú này có sai lệch, nhất là về mental models. Mental models không chỉ là sai lệch trong lĩnh vực tâm lý (được đề cập chủ yếu trong nội dung này) mà là nhóm công cụ tư duy tổng quát (meta skill). Gần đây, tình cờ mình được biết về một ngôi trường được Elon Musk đầu tư nhằm thay đổi cách học và tiếp cận hiện đại. Một trong đó có bao gồm dạy về mental models: Synthesis. Nguồn thông tin chính xác về đầy đủ nhất mọi người nên xem tại Mental Models: The Best Way to Make Intelligent Decisions (~100 Models Explained).
Tự dưng muốn viết về chủ đề này nên viết cho vui. Dạo này, mình đọc nhiều sách về tâm lý. Vì lý do này đến lý do khác dẫn đến thấy thú vị về chủ đề này. Tiêu biểu nhất đó là thiên kiến/thiên vị (bias). Một chủ đề nghe chừng vô thưởng vô phạt. Nhưng sau thời gian tìm hiểu, mình khám phá ra nhiều điều thú vị liên quan đến nó. Thiên kiến ảnh hưởng đến bản thân mọi người nhiều h
@Id | |
@GeneratedValue(strategy = GenerationType.AUTO) | |
@Column(name = "id", updatable = false, nullable = false) | |
private Long id; |
@Id | |
@Column(name = "id", updatable = false, nullable = false) | |
private Long id; |