Long Luo's Life Notes

每一天都是奇迹

By Long Luo

目前大致读过的一些DK书籍

Big Ideas Simply Explained

The Art Book (Big Ideas Simply Explained)

The Bible Book (Big Ideas Simply Explained)

The Law Book (Big Ideas Simply Explained)

The Medicine Book (Big Ideas Simply Explained)

The Movie Book (Big Ideas Simply Explained)

DK English

English for Everyone - Business English - Level 1 Course Book

English for Everyone - Business English - Practice Book Level 2

English for Everyone - English Idioms by Thomas Booth, Jenny Wilson

English for Everyone - Level 1 Beginner - Course Book by Rachel Harding, Tim Bowen, Susan Barduhn

English for Everyone - Level 3 Intermediate - Practice Book

English for Everyone English Vocabulary Builder

English for Everyone Junior 5 Words a Day

DK Witness

阅读全文 »

By Long Luo

从2013年注册了Github 账号开始,一直断断续续上传了自己写的很多项目,但Star数和Fork数并不多,目前来看,最多的居然是这个10年前学习Java时的练手项目: Java网络聊天室的设计与实现

网络聊天室 项目绝大部分代码其实是拷贝一个学习项目,最近重新看了下,项目源码很多都不符合编程规范,作为初学者入门学习还是可以的,就5个class,方便入门,但可以学到Java Socket编程、Java Swing、多线程编程等。

目前来看,这个项目还存在很大问题:

  1. 代码不符合编程规范问题;
  2. 同一台PC无法启动多个客户端等;
  3. UI交互界面ugly;
  4. 无法修改昵称、用户头像等;
  5. 用户间私聊;
  6. 用户间群聊;
  7. 用户自定义头像等; ……

这些功能全部做完还是需要一定时间和精力的,这些将在后续一一完善。

By Long Luo

一、 Math

1.1 PreCalculus

PreCalculus

1.2 Calculus

《Calculus Better Explained: A Guide to Developing Lasting Intuition》 ,力荐

《Calculus》 James Stewart版

《Calculus》Ron Larson版

1.3 Algebra

《线性代数及其应用》

《线性代数应该这样学》

《Algebra and Trigonometry》

1.4 视频教程

3Blue1Brown的部分数学教学视频:

微积分的本质 - 系列合集

线性代数的本质 - 系列合集

二、 Physics

物理是我很喜欢的一门课程,是认识这个世界的一门学科。 这段时间相当于重新复习及学习了下大学物理

看完了下列视频:

2.1 曹则贤先生讲座

  1. 曹则贤2020跨年开讲:什么是量子力学?【新年悟理】

  2. 曹则贤2021跨年开讲:什么是相对论?【新年悟理】

  3. 曹则贤:工业革命的物理基础——兼论对工业4.0的启发

2.2 中科院 学不分科 系列讲座

总共有10期,时间精力关系目前只看了其中几期:

物理学终极迷思:时间是什么?【学不分科第1期】

“情感大师”曹则贤:谁引诗·情到碧霄【学不分科第3期】

曹则贤:从数学方程到大自然的花样【学不分科第6期】

曹则贤:花叶序背后的数学物理【学不分科第8期】

2.3 中国科学院《云里·悟理》系列物理微课【悟理学院】

总共30期,重点看了其中几期:

【云里·悟理05】生命体系里的物理——生物物理初步

【云里·悟理09】时间和空间——物质的“舞台”

【云里·悟理14】闻声识人——声音的物理

【云里·悟理15】如汤探冷热——热的历史与热力学第零定律

【云里·悟理21】物理?生理?心理?——光与视觉

【云里·悟理27】时间的箭头——热力学第二定律

阅读全文 »

By Long Luo

之前 个人网站 文章阅读次数存储一直在 Leancloud 上,由于去年国内版要求网站必须备案才能使用之后,个人网站的浏览次数一直是不可用状态。几个月前切换到国际版,但是切换之后浏览次数一直是空白null值,正常应该是0,数据也不会更新。

后台查看Counter数据,也一直是没有数据的状态。当时花费了时间去检查,试图找到问题所在,当时还是怀疑LeanCloud国际版后台接口API的问题,但一直没能解决这个问题。

今天下午从原理入手,分析每个可能的步骤,找到了问题原因,在此记录下解决问题的过程。

如何显示阅读次数?

网站使用的是Hexo + Next主题,可以使用3种方式显示阅读次数:1. Leancloud; 2. FireStore; 3. Busuanzi

FireStore由于需要翻墙,尝试过发现不可行;

Busuanzi虽然也可以,设置之后发现首页数据显示紊乱,而且不准,使用了一段时间之后放弃;

LeanCloud是最合适的,数据也可以很方便的进行迁移。

在Next主题配置_config.yml文件中,可以设置使用哪种计数方式。注意文章阅读次数只能设置一个为true,否则页面会显示多个阅读次数。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
leancloud_visitors:
enable: true
app_id: # <your app id> hdPFnwkCdbHRj5Q3OQk5vNJQ-gzGzoHsz
app_key: # <your app key> p2mNUdDbqxrxOYMjs1xiS0zM

# Another tool to show number of visitors to each article.
# Visit https://console.firebase.google.com/u/0/ to get apiKey and projectId.
# Visit https://firebase.google.com/docs/firestore/ to get more information about firestore.
firestore:
enable: false
collection: articles # Required, a string collection name to access firestore database
apiKey: # Required
projectId: # Required

# Show Views / Visitors of the website / page with busuanzi.
# For more information: http://ibruce.info/2015/04/04/busuanzi/
busuanzi_count:
enable: true
total_visitors: true
total_visitors_icon: fa fa-user
total_views: true
total_views_icon: fa fa-eye
post_views: false
post_views_icon: fa fa-eye

如何读写阅读次数的?

这里以LeanCloud为例来说明阅读次数是如何读写的。首先打开 网站首页 ,查看源代码:

1
2
3
4
5
<span class="post-meta-item-icon">
<i class="far fa-eye"></i>
</span>
<span class="post-meta-item-text">阅读次数:</span>
<span class="leancloud-visitors-count"></span>

可以看出,阅读次数是通过leancloud-visitors-count这个class的值来显示的,搜索leancloud-visitors-count可以在网页的js代码中找到:

1
2
3
4
function leancloudSelector(url) {
url = encodeURI(url);
return document.getElementById(url).querySelector('.leancloud-visitors-count');
}

那么这段js代码在哪里呢?

阅读全文 »

By Long Luo

Hugo vs. Hexo

目前我的个人网站使用的是: Hexo + Next Theme ,这也是目前很多个人网站的配置。

Hugo 官网号称是最快的网站框架,构建速度快,因为我的文章数比较多,以后考虑切换成 Hugo,今天花了点时间来学习了下。

以下是学习过程:

Hugo使用指南

下载Hugo

因为是Windows 10系统,先去下载:https://github.com/gohugoio/hugo/releases

选择Windows版本,下载之后解压,解压可以得到 hugo.exe ,将 hugo.exe所在文件路径添加到Windows的Path变量中:

1
2
E:\Website>hugo version
hugo v0.82.0-9D960784+extended windows/amd64 BuildDate=2021-03-21T17:28:04Z VendorInfo=gohugoio

创建站点项目

以我为例, 假设要创建站点存放在 F:\Hugo\Website\ 目录中,在命令行中切换到该目录下执行:

1
2
E:\Website>hugo new site mywebsite
Congratulations! Your new Hugo site is created in E:\Website\mywebsite.

出现上述信息,创建出了mywebsite站点项目,其文件列表如下:

1
2
3
4
5
6
7
8
9
10
2021/03/28  15:52    <DIR>          .
2021/03/28 15:52 <DIR> ..
2021/03/28 15:51 <DIR> archetypes
2021/03/28 16:09 103 config.toml
2021/03/28 16:12 <DIR> content
2021/03/28 15:51 <DIR> data
2021/03/28 15:51 <DIR> layouts
2021/03/28 15:52 <DIR> resources
2021/03/28 15:51 <DIR> static
2021/03/28 16:08 <DIR> themes

添加主题

有了文件之后,还无法构建网站,因为hugo默认是没有主题文件的。这里选取一个简洁的主题

1
git clone https://github.com/yihui/hugo-prose.git themes/prose

当前项目目录内打开 config.toml 配置文件,在最后添加一行 theme = "prose" ,即将这个网站设置为 prose 主题。

运行站点

在站点项目内执行命令 hugo server -D

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
E:\Website\mywebsite>hugo server -D
Start building sites …

| EN
-------------------+-----
Pages | 10
Paginator pages | 0
Non-page files | 0
Static files | 4
Processed images | 0
Aliases | 1
Sitemaps | 1
Cleaned | 0

Built in 30 ms
Watching for changes in E:\Website\mywebsite\{archetypes,content,data,layouts,static,themes}
Watching for config changes in E:\Website\mywebsite\config.toml
Environment: "development"
Serving pages from memory
Running in Fast Render Mode. For full rebuilds on change: hugo server --disableFastRender
Web Server is available at http://localhost:1313/ (bind address 127.0.0.1)
Press Ctrl+C to stop

然后在浏览器界面中输入:http://localhost:1313/

如果顺利打开之后,出现了Hugo网站界面,那说明安装好了!

不过这个时候还是没有内容的,因为我们还没有添加内容:-)

阅读全文 »
0%