How To Find Time Complexity Of An Algorithm

The most common metric for calculating time complexity is Big O notation. This removes all constant factors so that the running time can be estimated in relation to N as N approaches infinity. In general you can think of it like this: statement; Is constant. The running time of the statement will not change in relation to N. for (i = 0; i < N; i++) statement; Is linear. The running time of the loop is directly proportional to N....

February 10, 2023 · 2 min · 420 words · Lucius Chen

Refactoring Code

How To Find Time Complexity Of An Algorithm Language JavaScript Refactoring

February 10, 2023 · 1 min · 11 words · Lucius Chen

Refactoring Condition statements

前端网络请求回调中经常会根据后端返回的不同 code 进行不同的业务处理。 if (res.data.code === "0000") { //do something } else if (res.data.code === "0001") { //do something } else if (res.data.code === "0002") { //do something } else { //do something } 简单应用 const statusCode =...

February 10, 2023 · 1 min · 485 words · Lucius Chen

Refactoring Promise chains with async/await

const setDelay = (millisecond) => { return new Promise((resolve, reject) => { if (typeof millisecond != "number") reject(new Error("参数必须是number类型")); setTimeout(() => { resolve(`我延迟了${mi...

February 10, 2023 · 1 min · 425 words · Lucius Chen

Blending Modes(Figma)

平时使用这个功能的时候都是逐个点击各个「混合模式(blending modes)」试看效果。下面就解释一下各个「混合模式」的工作原理。 Figure 1: DanHollick-1583080119068807168-20221020_205807-img1 简...

December 4, 2022 · 3 min · 1090 words · Lucius Chen

EasyUI

提交完成后关闭当前 Tab,刷新「父级」Tab。 增加如下方法在工具类中。 function reloadTabGrid(title){ if ($("#frm_center" ).tabs('exists', title)) { $( '#frm_center').tabs('select' , title); window.top.reload_Abnormal_Monitor.call(); } } 在需要刷新的「父级」Tab 页面中添加。 window.top["reload_Abnormal_Monitor"]=function(){ $('#tt').datagrid(...

December 4, 2022 · 1 min · 408 words · Lucius Chen

Replace text in Calibre

Readwise Reader 中无法识别中文批注版本 Epub 中的行内批注,为了更好的在 Readwise Reader 中阅读,以及当初在 Calibre 中阅读时批注,不好将批注内容很好的分地复制出来,所以需要将批注...

December 4, 2022 · 4 min · 1916 words · Lucius Chen

Index

B-Tree 和 B+ Tree 的不同 B-Tree B+Tree All internal nodes and leaf nodes contain data pointers along with keys. Only leaf nodes contain data pointers along with keys, internal nodes contain keys only. There are no duplicate keys. Duplicate keys are present in this, all internal nodes are also present at leaves. Leaf nodes are not linked to each other. Leaf nodes are linked to each other. Sequential...

December 4, 2022 · 4 min · 1749 words · Lucius Chen

MVCC

December 4, 2022 · 0 min · 0 words · Lucius Chen

Photoshop Techniques

去除双下巴 钢笔将需要去除的双下巴以及下巴下方的脖子部分圈取出来 CMD+Enter 将路径转为选区。 根据实际情况适当羽化几个像素 CMD+j 复制两层 选中复制出的两个图层中...

December 4, 2022 · 1 min · 164 words · Lucius Chen