This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
# Unit of loan time: year | |
# kind of amortization: equal loan payments and equal principal payments | |
loans=[[1000000,3.25,27],[990000,4.65,30]] # year1 <= year2 | |
total1,interest1,year1=loans[0][0],loans[0][1],loans[0][2] | |
total2,interest2,year2=loans[1][0],loans[1][1],loans[1][2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="mermaid"> | |
gantt | |
title Adding GANTT diagram functionality to mermaid | |
section A section | |
Completed task :done, des1, 2020-03-06, 2020-03-08 | |
Active task :active, des2, 2020-03-09, 1d | |
Future task : des3, after des2, 1d |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
 # 默认 | |
<div align="right"><img width="100" src="https://raw.githubusercontent.com/LfqGithub/LfqGithub.github.io/master/images/graphviz/example1.png"/></div> # 控制图片大小和位置 | |
<div align="center"><img height="400" src="https://raw.githubusercontent.com/LfqGithub/LfqGithub.github.io/master/images/image_name.png"/><figcaption>I am a caption</figcaption></div> # 添加 Caption |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
email = 995614183@qq.com | |
name = LfqGithub |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ~/.bashrc: executed by bash(1) for non-login shells. | |
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
# for examples | |
# If not running interactively, don't do anything | |
case $- in | |
*i*) ;; | |
*) return;; | |
esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
from colorlog import ColoredFormatter # pip3 install colorlog | |
LOG_LEVEL = logging.DEBUG | |
LOGFORMAT = " %(log_color)s%(levelname)-8s%(reset)s | %(log_color)s%(message)s%(reset)s" | |
# logging.basicConfig(filename='log') # save log in local file | |
logging.root.setLevel(LOG_LEVEL) | |
formatter = ColoredFormatter(LOGFORMAT) | |
stream = logging.StreamHandler() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2020-02-06 19:21:42,951 INFO : this is information) | |
2020-02-06 19:21:42,951 WARNING : this is warning message) | |
2020-02-06 19:21:42,951 ERROR : this is error message) | |
2020-02-06 19:21:42,951 CRITICAL: this is fatal message, it is same as logger.critical) | |
2020-02-06 19:21:42,951 CRITICAL: this is critcal message) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import sys | |
logger=logging.getLogger('learn-logging') | |
formatter=logging.Formatter('%(asctime)s %(levelname)-8s: %(message)s)') | |
file_handler=logging.FileHandler("example.log") | |
file_handler.formatter=formatter | |
console_handler=logging.StreamHandler(sys.stdout) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
import numpy as np | |
markers = [ | |
".", | |
",", | |
"o", | |
"v", | |
"^", | |
"<", |
NewerOlder