【博客】一些想说的话

本文最后更新于:13 天前

一些关于博客想说的话


1. 为什么要写博客

默子其实也不知道,只是觉得学到一些技术,用博客记录下来,也算是对自己的一种总结吧。

同时还可以帮到更多的人,何乐而不为呢?


2. 为什么要用Hexo

折腾了这么久,发现还是这种静态博客框架比较简单方便,其他的框架玩着玩着就搞起了前后端训练,很难绷。

Github+Hexo+Next ,简直就是懒人一键建站最佳方案(当然,你得有一点点基础)。

关于之前折腾的框架,少说也有七八个了,常见的主流的,都玩过

这个博客从想法到部署,也就是30分钟的事情。(可能是已经折腾出了技术吧,哈哈哈哈,总之就是一个熟练工)


3. 为什么要用Github

虽然国内访问Github Pages速度不是很快,但没关系。默子预估能看到这篇文章的人,大概率都已经是技术力比较高的CS相关人士了。

手里没几把趁手的梯子,说得过去嘛


4. 之后的更新

这个纯纯随缘了,基本上想到什么就去更新什么。

在其他平台还有很多的文章,默子也会慢慢的迁移过来。(最好是整理之后,不然其他平台的文章现在太乱了)

有可能一天爆更10篇文章,也有可能两个星期没啥更新。毕竟,随缘博主是这样的,哈哈哈哈


5. 关于博客的一些想法

写博客,记录的自己,看的是别人。

所以,这里定一些小小的规矩,也是对自己的一种约束吧:

  1. 尽量少用ChatGPT来完成博客的写作
  2. 保持每个月至少有两篇文章更新,不能一断就断没影了
  3. 技术类的文章质量做到 Top 10% ,不能摸鱼划水
  4. 日常生活和点滴记录也可以发

7. 测试部分

H1标题

H2标题

H3标题

H4标题

H5标题
H6标题

加粗

斜体

删除线

下划线

==高亮==

引用:孔子曾经收过:学而时习之,不亦说乎?有朋自远方来,不亦乐乎?

  • 无序列表
  • 无序列表
    • 二极管
    • 三极管
      • NPN
      • PNP
  • 无序列表
  1. 有序列表
    1. 什么是量子力学
    2. 什么是相对论
    3. 什么是广义相对论
      1. 黑洞
      2. 白洞
      3. 虫洞
  2. 有序列表
  3. 有序列表
  • 任务列表
  • 任务列表
    • 任务列表
    • 任务列表

链接

图片
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//左偏树模版
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
int n, m, fa[N], ch[N][2], val[N], dis[N];
int find(int x) { return x == fa[x] ? x : fa[x] = find(fa[x]); }
int merge(int x, int y) {
if (!x || !y) return x | y;
if (val[x] > val[y] || (val[x] == val[y] && x > y)) swap(x, y);
ch[x][1] = merge(ch[x][1], y);
fa[ch[x][1]] = x;
if (dis[ch[x][0]] < dis[ch[x][1]]) swap(ch[x][0], ch[x][1]);
dis[x] = dis[ch[x][1]] + 1;
return x;
}
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) scanf("%d", &val[i]), fa[i] = i;
while (m--) {
int opt, x, y;
scanf("%d%d%d", &opt, &x, &y);
if (opt == 1) {
if (find(x) != find(y)) fa[find(x)] = find(y);
} else {
if (find(x) != find(y)) continue;
int fx = find(x), fy = find(y);
merge(fx, fy);
}
}
for (int i = 1; i <= n; i++) {
if (find(i) != i) continue;
printf("%d ", val[i]);
int x = ch[i][0], y = ch[i][1];
while (x) printf("%d ", val[x]), x = ch[x][0];
while (y) printf("%d ", val[y]), y = ch[y][0];
puts("");
}
return 0;
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# pytorch LSTM
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torch.utils.data import DataLoader
from torch.utils.data import Dataset
from torch.nn.utils.rnn import pad_sequence
import numpy as np
import pandas as pd

class MyDataset(Dataset):
def __init__(self, data, label):
self.data = data
self.label = label

def __getitem__(self, index):
return self.data[index], self.label[index]

def __len__(self):
return len(self.data)

class LSTM(nn.Module):
def __init__(self, input_size, hidden_size, num_layers, num_classes):
super(LSTM, self).__init__()
self.hidden_size = hidden_size
self.num_layers = num_layers
self.lstm = nn.LSTM(input_size, hidden_size, num_layers, batch_first=True)
self.fc = nn.Linear(hidden_size, num_classes)

def forward(self, x):
h0 = torch.zeros(self.num_layers, x.size(0), self.hidden_size).to(device)
c0 = torch.zeros(self.num_layers, x.size(0), self.hidden_size).to(device)
out, _ = self.lstm(x, (h0, c0))
out = self.fc(out[:, -1, :])
return out
# 超参数
num_classes = 2
batch_size = 100
learning_rate = 0.001
num_epochs = 5
# 数据集
train_data = pd.read_csv('train.csv')
test_data = pd.read_csv('test.csv')
train_data = train_data.values
test_data = test_data.values
# 划分训练集和验证集
train_data = train_data[:int(len(train_data) * 0.8)]
# 优化器
optimizer = optim.Adam(model.parameters(), lr=learning_rate)
# 损失函数
criterion = nn.CrossEntropyLoss()
# 训练
if __name__ == '__main__':
# Device configuration
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')



1
2
3
4
5
6
7
8
// 实现DOM的增删 改查
class Node {
constructor(value) {
this.value = value;
this.next = null;
}
}

数学公式测试:

\[\sum_{i=1}^{n}i=\frac{n(n+1)}{2}\]

\[ n \% m = 2^{n-1} \]

\[ \int_{a}^{b}f^{(3)}(t)dt \]

\[\begin{pmatrix}ax+1&1&0\\1&bx+2&1\\0&1&cx+3\end{pmatrix}\]

\[ c = (2^{7-n}-\frac{7e^{i\pi}}{6\pi})\frac{\pi}{n}+\mathrm{O}(n\lg{\lg{n}})\]

\[1 \leq a_i,b_i\leq max(n,m)\]

\[\sum\limits_{i=1}^{n}(x_i-y_i)^n\]

\[\prod\limits_{i=1}^{n(n-1)}(k_i+\frac{\sum\limits_{j-1}^{i}(x_i+y_i)^{\frac{3}{2}}}{e\ln{(i+1)}})-\epsilon\]

\[\dot{A_r} = \frac{\dot{x_0}}{\dot{x_i}} = \frac{\dot{A}}{1+\dot{A}\dot{F}}\]

\[f(\theta) = \frac{\sin{\theta}(\left|cos\right|)^{\frac{1}{2}}}{2\sin(\theta)+2}-2\sin{(\theta)}+2\]

\[\pi^{4}+\pi^{5}\approx e^{6}\]

\[\sqrt{1+2\sqrt{1+3\sqrt{1+4\sqrt{1+\dots}}}} = 3\]

\[\hat{f}(\xi) = \frac{1}{(2\pi)^\frac{d}{2}}\int_{\mathbb{R}^d}e^{-ix\xi}f(x)dx\]

\[\begin{bmatrix}1&2&3\\4&5&6\\7&8&9\end{bmatrix}\]

sequenceDiagram
    participant Alice
    participant Bob
    Alice->>John: Hello John, how are you?
    loop Healthcheck
        John->>John: Fight against hypochondria
    end
    Note right of John: Rational thoughts 
prevail! John-->>Alice: Great! John->>Bob: How about you? Bob-->>John: Jolly good!
gantt
dateFormat  YYYY-MM-DD
title 甘特时间轴
excludes weekdays 2014-01-10

section A section
Completed task            :done,    des1, 2014-01-06,2014-01-08
Active task               :active,  des2, 2014-01-09, 3d
Future task               :         des3, after des2, 5d
Future task2               :         des4, after des3, 5d
classDiagram
title 类图
Class01 <|-- AveryLongClass : Cool
Class03 *-- Class04
Class05 o-- Class06
Class07 .. Class08
Class09 --> C2 : Where am i?
Class09 --* C3
Class09 --|> Class07
Class07 : equals()
Class07 : Object[] elementData
Class01 : size()
Class01 : int chimp
Class01 : int gorilla
Class08 <--> C2: Cool label
journey
    title My working day
    section Go to work
      Make tea: 5: Me
      Go upstairs: 3: Me
      Do work: 1: Me, Cat
    section Go home
      Go downstairs: 5: Me
      Sit down: 5: Me

【博客】一些想说的话
https://histone.top/2023/05/81817ba7/
作者
默子
发布于
2023年5月4日 19:51
许可协议