WeiNote

yyrcd

web

TA

pl

2020

Mar 07

2020

May 25

TODO

  • add overlay at show page
  • add name by filename if name is empty
  • 时间格式

2020

May 23

mysqlclient

linux

sudo apt-get install build-essential libmysqlclient-dev
pip install mysqlclient

mac

brew install mysql-client
pip install mysqlclient

2020

May 21

缓存方式: 获取:a.mp4?dandruff=adfjaldasdfasdf 读取:a.mp4

2020

May 20

少数派网页开启暗黑模式

window.localStorage.setItem('darkMode', 2)

2020

May 20

2020

May 12

游戏

等待发售

2020

May 11

  tell application "System Events"
    -- https://eastmanreference.com/complete-list-of-applescript-key-codes
    key code 3 using {command down, control down} -- cmd+ctrl+f
  end tell

2020

May 08

Check safari Reading list

2020

May 05

X: 24
T: Clouds Thicken
C: Paul Rosen
S: Copyright 2005, Paul Rosen
M: 6/8
L: 1/8
Q: 3/8=116
R: Creepy Jig
K: Em
|"C" C2 "D" D2 "E" E2 "F" F2 G2 A2 B2 "CDEFGAB"|adfadfga|
|abcdefg|ABCDEFG|ABCDEFG|

2020

May 03

汇率

100w 日元 == 6.5w 人民币 1w 日元 == 650 人民币 100 日元 == 6.5 人民币 15 日元 == 1 人民币

2020

May 03

2020

May 02

Click a button every 10 seconds

refresh_bnt = document.getElementsByClassName("el-button--primary")[0]
setInterval(function () {refresh_bnt.click();}, 10000);

2020

Apr 27

2020

Apr 25

Linux 硬盘

格式化硬盘

Ubuntu16.04挂载新硬盘并格式化硬盘

$ lsblk -f
sda                                                             
├─sda1      vfat     EFI   67E3-17ED                            
└─sda2      hfsplus  data  1217e44e-a8e9-3cc1-9a42-f2fef205f037 
sdb                                                             
└─sdb1      ext4           a4d98232-7849-4f50-812d-32b99451380c 
nvme0n1                                                         
├─nvme0n1p1 vfat           393B-1943                            /boot/efi
└─nvme0n1p2 ext4           5cd74521-33de-438d-9273-420609266079 /

Mount exFAT

Command

sudo mount -t exfat /dev/sdb2 /media/hdd

Or in /etc/fstab

/dev/sdb2 /media/hdd exfat rw,async,umask=0 0 0

2020

Apr 23

Weinote 书写习惯

# Weinote 书写习惯

序号

### 序号

  • H2, H3, H5 有
  • H1, H4, H6 没有

字号相同

### 字号相同

  • H3 - H4
  • H5 - H6

长文章:

### 长文章

  • H1 用于长文章的大标题
  • H2 H3 用于长文章的小标题

短文章

### 短文章

  • H1H4 用于短文的大标题
  • H3 用于短文的小标题

2020

Apr 23

Regex

Extract text from makdown url

function remove_link_from_md(str) {
  var regex = /\[([^\]]+?)\]\([^)]+\)/g;
  str = str.replace(regex, "$1");
  return str;
}
str = "- [adfadf](af) \n- [adb](adfadfb)"
result = remove_link_from_md(str)
console.log(result)
// - adfadf 
// - adb

remove illegal charactor

name = "jfkadldjf 12 029834 &12 ajsdlkf!"
var name_ = name
name_ = name_.replace(/[~`!@#$%^&*(){}\[\];:"'<,.>?\/\\|_+=-]/g, '')
name_ = name_.replace(/\s|\"/g, "-");

2020

Apr 20

WeiBlog

Sketch

Why not merge into weinote?

Weinote should not be tracked by google analytics. Weinote and Weiblog should be seperated, 更有仪式感。 庞大的生态系统,并不一定是好事。

Fist Priority

  • 学一下react
  • like https://immmmm.com/zan-by-leancloud-cn/
  • Backup keep 30 most recent backups
  • 导出为markdown gitadd gitcommit
  • url post_id
    如果不指定: 001
    指定:001_n2s
    限制在999篇,应该够了。
    archive被隐藏,但知道url可以访问。
    hide完全被隐藏,知道url也不可以访问。
  • pv count: goatcount

Not priority

Comment (might continue vanila?)

Weinote

n2s

必须用python写,数据处理

Hugo

Hello Friend — A simple theme for Hugo joway/hugo-theme-yinyang: a black-white theme for Hugo. Joway's Blog 天空的城

2020

Apr 12

Dash Grid example

fig1 = html.Div([dcc.Graph(figure=getfig1(), id="fig1")], className="eight columns")
sliders1 = html.Div([
    html.Label('The value for k (in $ Å^{-\;1} $)'),
    dcc.Slider(id='fig1_k_slider', min=1, max=15, value=4, marks={str(x): str(x) for x in np.arange(1, 16, 1)}, step=1),
    html.Label('the maximum value for x (in Å)'),
    dcc.Slider(id='fig1_xmax_slider', min=1, max=15, value=5, marks={str(x): str(x) for x in np.arange(1, 16, 1)}, step=1),],
                    className="four  columns")
fullfig1 = html.Div([fig1, sliders1], className="row")

2020

Apr 10

Mathjax 3

<script>
MathJax = {
  tex: {
    inlineMath: [['$', '$']]
  }
};
</script>

<script id="MathJax-script" async
  src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-chtml.js">
</script>

2020

Apr 09

alias以,开头

2020

Apr 09

2020

Apr 09

Generate Table of Content

var headers = ["h1", "h2", "h3", "h4"]

for (var i=0, h; h=headers[i]; i++) {  
  var tags = document.getElementsByTagName(h);
  a = ''
  for (var j=0, hi; hi=tags[j]; j++) {
    a += `<a href="#${hi.id}"> ${hi.innerHTML} </a>\n<br>`
  }
  console.log(a)
}

2020

Apr 08

Scale bokeh in supervisord

[program:tornado_web_demo]
numprocs=4
numprocs_start=1
command=python /home/me/www/demo.py --port=80%(process_num)02d
process_name=%(program_name)s%(process_num)d

gunicorn部署Flask服务 - 简书

2020

Apr 08

bilibili 收益

 10w 播放  300 ¥
 20w 播放  800 ¥
 50w 播放 2000 ¥
150w 播放 3500 ¥

2020

Apr 06

2020

Apr 01

2020

Mar 30

2020

Mar 20

2020

Mar 14

2020

Mar 13

2020

Mar 10

2020

Mar 08

Shortcuts

Chrome

Crtl + Shift + Del: Delete current suggestion from 地址栏

Terminal

Ctrl + W 删除你键入的最后一个单词 Ctrl + U 可以删除行内光标所在位置之前的内容 Ctrl + K 可以删除光标至行尾的所有内

Youdao-Alfred

Cmd + Enter Pronounce

Safari

Ctrl + R: Reader Mode in safari default is Shift + cmd + R

mac

option + cmd + H: hide all

2020

Mar 08

2020

Mar 06

Abbreviation

  • IR Intermediate Representations (IR)
  • TBD To Be Determined
  • a.k.a. Aka Also known as
  • BLAS Basic Linear Algebra Subprograms
  • GPU Graphics Processing Unit
  • CPU Central Processing Unit
  • misc miscellaneous

2020

Mar 03

2020

Mar 01

瑜伽动作: 两种最基本的瑜伽动作:downward dog 和 child pose。把这两个动作保持一分钟,你就会看到效果。

2020

Feb 24

Weinote Colorful Font

  • Red Green Purple Yellow
<span style="color: red"> Red </span>
<span style="color: #3fff11"> Green </span>
<span style="color: #ff6ffa"> Purple </span>
<span style="color: #ffdf69"> Yellow </span>

Markdown Superscript and Subscript

Emin<sup>Maj7</sup> 
H<sub>2</sub>O  CO<sub>2</sub>

EminMaj7 H2O CO2

2020

Feb 20

2020

Feb 09

2020

Feb 04

Birthday Paradox

n is the number of students in a class

import numpy as np
import matplotlib.pyplot as plt

def prob(n):
    p = 1
    for i in range(n):
        p *= (365-i)/365
    return p

def prob_list(x):
    result = []
    for n in x:
        result.append(prob(n))
    return np.array(result)

x = np.linspace(1, 100, num=100, dtype=int)

plt.plot(x, prob_list(x), label='P (no same birtyday)')
plt.plot(x,1 - prob_list(x), label='P (same birtyday)')
plt.title('Birthday Paradox')
plt.legend()
plt.show()

2020

Feb 03

algorithm steps:

  1. check input
  2. check boundary (<= or >=)
  3. length (counts) and index a[length-1]

2020

Jan 09

一个有意思的网站 Neal.fun The Size of Space

2020

Jan 06

2019

2019

Dec 27

- /mnt/hdd/richard/mongo/mongo:/data/db

2019

Dec 24

max value for num_e

# max
db.getCollection("ani-1x-631gd").find({}).sort({num_e: -1}).limit(1)  
# min
db.getCollection("ani-1x-631gd").find({}).sort({num_e: +1}).limit(1)  

2019

Dec 20

2019

Dec 20

2019

Dec 20

2019

Nov 29

2019

Nov 28

2019

Nov 28

>db.stats()
{
    "db" : "test",
    "collections" : 5,
    "views" : 0,
    "objects" : 53829,
    "avgObjSize" : 43.555,
    "dataSize" : 2344556121,
    "storageSize" :3124416336,
    "numExtents" : 0,
    "indexes" : 7,
    "indexSize" : 8096876,
    "ok" : 1
}
  • dataSize The total size in bytes of the uncompressed data held in this database.
  • storageSize The total amount of disk space allocated to all collections in the database.

Mongo IS USING RAM! wiredTiger

2019

Nov 26

richard@pc~> df -h
Filesystem      Size  Used Avail Use% Mounted on
dev              40G     0   40G   0% /dev
run              40G  1.9M   40G   1% /run
/dev/nvme0n1p4  1.4T  961G  447G  69% /
tmpfs            40G     0   40G   0% /dev/shm
tmpfs            40G     0   40G   0% /sys/fs/cgroup
tmpfs            40G  5.8M   40G   1% /tmp
/dev/nvme0n1p4  1.4T  961G  447G  69% /mnt/nvme
/dev/nvme0n1p4  1.4T  961G  447G  69% /home
/dev/nvme0n1p4  1.4T  961G  447G  69% /root
/dev/nvme0n1p4  1.4T  961G  447G  69% /var/lib/docker
/dev/sdb2       3.4T  934G  2.3T  29% /mnt/hdd
tmpfs           7.9G   12K  7.9G   1% /run/user/1001 

2019

Nov 18

Slater not Slator

2019

Nov 15

2019

Nov 08

Mongo commands runtime larger than 200

{'wb97mv.pre1.runtime': {$gte: 200}}

total_energy is null

{'wb97mv.wb97md3bj.total_energy': null}

2019

Nov 04

he = psi4.geometry("""
H
""")
psi4.set_options({'guess': 'core',
                  'basis': 'cc-pvdz',
                  'scf_type': 'pk',
                  'e_convergence': 1e-8,
                  'reference': 'uhf'})
psi4.energy('SCF')

2019

Nov 03

GiB vs GB

2019

Nov 02

Shift + Opt + M - copy current tab as markdown url

2019

Oct 16

High Performance Computing (HPC) and parallel programming

  1. OpenMp
  2. MPI

2019

Oct 07

NAMES

  1. Federico (M)
  2. Y(sh)amila (F)
  3. Nilu (F)
  4. Pierre Louis (M) (French)

2019

Oct 04

Show two image one line at weinote (Not usable on mobile)

<p class="img" style="display: inline-flex;">
<img width=49% src="imglink">
<img width=49% src="imglink">
</p>
<p class="img" style="display: inline-flex;">
<img width=49%  height=initial src="https://yyrcd-1256568788.cos.na-siliconvalley.myqcloud.com/yyrcd/2019-05-02-IMG_1303_HDR.jpg">
<img width=49%  height=initial src="https://yyrcd-1256568788.cos.na-siliconvalley.myqcloud.com/yyrcd/2019-05-02-IMG_1479_HDR.jpg">
</p>

2019

Oct 03

2019

Sep 29

Table template

|      |      |      |
| :--- | :--: | ---: |
|      |      |      |
|      |      |      |

2019

Sep 23

EMAIL

  1. Thanks for your prompt reply!

2019

Sep 15

Gas for one round trip to ST Augustine is about 16$, about 6.75 gallon (2.37$/g) MPG (Mile per Gallon) is around 25

2019

Sep 09

VSCode Shortcuts

Code > Preferences > Keyboard Shortcuts > keybindings.json (see image above)

[
    {
        "key": "ctrl+shift+tab",
        "command": "workbench.action.previousEditor"
    },
    {
        "key": "ctrl+tab",
        "command": "workbench.action.nextEditor"
    },
]

2019

Sep 02

2019

Aug 31

鸡胸肉怎么做好吃?

(Due to the connectivity issue of AWS us-east-1 (mlab status), wiki is currently not avaliable. This is a temporary place for wiki.

2019

Aug 16

Car

  • Oil change today (every 3000miles)
  • Air engine filter changed today. (every 15000miles)

2019

Aug 13

2019

Aug 12

2019

Aug 12

macOS 应用开发 Swift 入门教程 - 菜鸟

感觉还是html最简单啊。。

2019

Aug 10

大乱斗

皮卡丘

ZeRo

零基础攻略 电玩部落

  • (上B)的作用:当角色处于浮空状态时,各种招式的形态都会发生变化,其中大部分上必杀技将能提供一段向上的位移。
  • 闪避通过肩键+左/右完成,能够在水平方向上进行位移并且躲避敌人的伤害。
  • 下+A:
  • 奔跑时按A
  • 连按A

2019

Jul 14

Nullboard Notes

2019

Jul 13

Alfred Youdao cmd + enter 发音

2019

Jun 23

nmap secure jupyter

2019

Jun 16

2018

2018

Dec 07

如何练习发声

面部

  • 笑肌
  • 嘶 练习
  • 张大嘴巴,做出咬苹果的姿式
  • 努嘴
  • 用舌头顶左边腮帮子

腹部

  • 站直,挺胸,深呼吸
  • 腹部使劲

伪声