Skip to main content

wKevin

前天的工具优化了一下:

  • 输出的改为 markdown 表格: 这下拷贝到 blog 就更方便了。那今天就看看 web 框架的对比数据吧。
  • 处理 License 为空的情况。
  • 直接把 markdown link url 放进去。

这里的 Web 框架不包括 Web Server(HTTP Server、CGI Server……),也不包括微服务框架,仅是 MVC 层面上的框架。

还是按 star 数量排序。

Go

NOProjectNameStar/kFork/kSize/MCreateDateLatestPushLicenseRepo
1gin74.87.83.22014-06(10)2024-03-17mitgin-gonic/gin
2beego30.75.611.42012-02(12)2024-03-12otherbeego/beego
3echo28.22.26.42015-03(9)2024-03-13mitlabstack/echo
4iris24.82.517.82016-01(8)2024-03-13bsd-3-clausekataras/iris
5gf10.71.5119.62017-06(7)2024-03-17mitgogf/gf
6bud5.50.225.72022-04(2)2023-11-24mitlivebud/bud
7hertz4.60.42.72022-05(2)2024-03-10apache-2.0cloudwego/hertz
8algernon2.60.157.72015-03(9)2024-03-10bsd-3-clausexyproto/algernon

-------- 采样时间: 2024-03-20

wKevin

最近有个新项目,要重新选型 Admin 系统,但发现 https://www.githubcompare.com/ 频频异常,就自己写了个脚本,从 https://api.github.com/repos/... 下获取数据,然后抓取出自己关心的字段,再做横向对比。

数据抓取结果如下:

仅前端 & VUE3 & TS

ProjectName          CreateDate  LatestPush  Star/k  Fork/k  Size/M  License  Repo
vue-vben-admin 2020-07(4) 2024-03-15 21.7 5.9 23.2 mit vbenjs/vue-vben-admin
vue-manage-system 2016-11(7) 2024-01-12 18.1 5.9 3.1 mit lin-xin/vue-manage-system
vue-pure-admin 2020-11(3) 2024-03-17 13.2 2.5 192.6 mit pure-admin/vue-pure-admin
Geeker-Admin 2022-04(2) 2024-03-04 6.1 1.3 28.5 mit HalseySpicy/Geeker-Admin
naive-ui-admin 2021-07(3) 2024-03-04 4.5 0.8 1.3 mit jekip/naive-ui-admin
yudao-ui-admin-vue3 2023-02(1) 2024-03-01 0.9 0.4 10.2 mit yudaocode/yudao-ui-admin-vue3
-------- 采样时间: 2024-03-18

wKevin

将 rust 标准库中的几个常用类型的方法安装第一个入参(即:Move、借用、可变借用)分组整理,以便开发时做个参考。

Type(..)(self..)(&self..)(&mut self..)
Cowfrom()into_owned()to_mut()
Cellfrom()
from_mut()
new()
into_inner()set()
get()
take()
replace()
get_mut()
RefCellfrom()
new()
into_inner()borrow()
borrow_mut()
take()
replace()
get_mut()
Vecfrom()
new()
with_capacity()
into_boxed_slice()len()
capacity()
is_empyt()
insert()
append()
push()
pop()
remove()
drain()
clear()
splice()
reserve()
resize()
shrink_to()
truncate()
BTreeMapfrom()
new()
into_keys()
range()
get()
len()
keys()
values()
iter()
get_key_value()
first_key_value()
last_key_value()
contains_key()
is_empyt()
insert()
append()
extend
retain()
remove()
pop_first()
pop_last()
entry()
first_entry()
last_entry()
HashMapfrom()
new()
keys()
into_keys()
capacity()
get()
len()
values()
iter()
is_empty()
insert()
extend
retain()
drain()
remove()
remove_entry()
reserve()
entry()
Boxfrom()
new()
leak()
pin()
downcast()
split()
borrow()borrow_mut()
consume()
read_line()

wKevin

std::borrow::Cow 是个枚举,包含 2 个变体(rust 中枚举的元素称为 Variant,变体)Borrowed、Owned,一般理解为代表对资源、数据的两种状态:借用、拥有所有权。

pub enum Cow<'a, B>
where
B: 'a + ToOwned + ?Sized,
{
Borrowed(&'a B),
Owned(<B as ToOwned>::Owned),
}

两种状态,比较难理解,其实是从使用用途来说的,具体到代码中后面会看到并不难理解。

matplotlib 中作图时常遇到中文显示乱码的问题,本文探索一下原因,并在文末给出一个通用的解决方案。

import os
import matplotlib as mpl
import matplotlib.pyplot as plt

mpl.FontManager

matplotlib 中有个字体管理类,可以查询、添加、删除字体,包括系统安装、matplotlib 安装、用户自己安装的 3 类字体。

fm = mpl.font_manager.FontManager()
print(len(fm.ttflist))
print(fm.ttflist[0])
print(len(fm.afmlist))
print(fm.afmlist[0])

print(f"manager 找到了 {len(fm.ttflist)} 个 ttf 字体,{len(fm.afmlist)} 个 afm 字体。")
551
FontEntry(fname='/data/kevin/workspace/venv/venv310/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/ttf/DejaVuSans-Bold.ttf', name='DejaVu Sans', style='normal', variant='normal', weight=700, stretch='normal', size='scalable')
138
FontEntry(fname='/data/kevin/workspace/venv/venv310/lib/python3.10/site-packages/matplotlib/mpl-data/fonts/afm/putb8a.afm', name='Utopia', style='normal', variant='normal', weight='bold', stretch='normal', size='scalable')
manager 找到了 551 个 ttf 字体,138 个 afm 字体。

wKevin

熟悉 ViT(Vision Transformer)训练视觉模型的基本原理以及其典型方法(如 MAE,Mask Autoencoding)

文中以下面形式引用 ChatGPT 答复:

  • 提问

ChatGPT 的回答


  • ViT 模型出现的时间、paper、提出人

ViT 模型是由 Anish Athalye、Nicholas Carlini 和 David Wagner 等人于 2020 年在《Advances in Neural Information Processing Systems》会议上发布的论文**《An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale》**中提出的。该论文开创性地将 Transformer 应用于计算机视觉领域,提出了一种名为 Vision Transformer(ViT)的模型,用于图像分类等计算机视觉任务。

paper 链接:http://arxiv.org/abs/2010.11929: v1(2020.10), v2(2021.6)

wKevin

我是从 3 月的 ChatGPT 爆发才开始关注大模型的,经过一番手忙脚乱的注册 openai 的 id、使用其 python sdk 后,这才开始转入对 LLM 的观察和学习上来。

2018 年学过 CNN、RNN 后除了在视觉上做了一些产品外,NLP 基本没接触,所以对 Transformer、ViT 都略过了,忽然被 ChatGPT 刺激了一下,才发现 Transformer 除了 NLP,也已经横扫 CV 了,效果超过 NN。那好吧,赶紧补课,把 LLM 学起来。