Compare commits
35 Commits
192ef21b12
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| a699cd8439 | |||
| 0bb27b4b85 | |||
| 49572eb3a0 | |||
| 8b240e8654 | |||
| 7cfd111895 | |||
| 14a299f13f | |||
| bcf66aee48 | |||
| 92fa085399 | |||
| 30ad5027db | |||
| 6b5d9f232e | |||
| 875fb417a7 | |||
| efff4fc131 | |||
| dc75bd64f1 | |||
| 5ea5e3cba1 | |||
| ee2c51ff65 | |||
| f68c9071aa | |||
| 74ae58bd12 | |||
| 4bd598b0df | |||
| 456cd4e755 | |||
| aaeed68ca9 | |||
| b05bf011a4 | |||
| 8e22c02d6f | |||
| 26b63d45ab | |||
| 2c2ca13fdc | |||
| 0e03622db0 | |||
| 9b648efef4 | |||
| af3944558c | |||
| 25a2270e2e | |||
| f3993756fc | |||
| 8ddeba0de6 | |||
| 3dd2927bd2 | |||
| a03118ad68 | |||
| 167f6afe6a | |||
| dea546ddfa | |||
| 02130fba76 |
65
.idea/workspace.xml
generated
@@ -4,7 +4,9 @@
|
||||
<option name="autoReloadType" value="SELECTIVE" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="de9fa6e3-30cd-4bd9-9de2-e5d7f0390fc8" name="更改" comment="" />
|
||||
<list default="true" id="de9fa6e3-30cd-4bd9-9de2-e5d7f0390fc8" name="更改" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
@@ -14,11 +16,12 @@
|
||||
<option name="RECENT_TEMPLATES">
|
||||
<list>
|
||||
<option value="HTML File" />
|
||||
<option value="CSS File" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="Git.Settings">
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/themes/butterfly" />
|
||||
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$" />
|
||||
</component>
|
||||
<component name="GitHubPullRequestSearchHistory">{
|
||||
"lastFilter": {
|
||||
@@ -37,17 +40,22 @@
|
||||
"associatedIndex": 8
|
||||
}</component>
|
||||
<component name="ProjectId" id="2jxaBMaq32ZWf7XyMTBhC0qvzci" />
|
||||
<component name="ProjectLevelVcsManager">
|
||||
<ConfirmationsSetting value="2" id="Add" />
|
||||
</component>
|
||||
<component name="ProjectViewState">
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"ASKED_ADD_EXTERNAL_FILES": "true",
|
||||
"DefaultHtmlFileTemplate": "HTML File",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"git-widget-placeholder": ".invalid",
|
||||
"git-widget-placeholder": "master",
|
||||
"kotlin-language-version-configured": "true",
|
||||
"last_opened_file_path": "D:/JetBrainsToolProject/InteliJIDEA/qr-hexo",
|
||||
"last_opened_file_path": "D:/JetBrainsToolProject/IntelJ IDEA/qr-hexo/source/img",
|
||||
"list.type.of.created.stylesheet": "CSS",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.detected.package.tslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
@@ -60,11 +68,15 @@
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo" />
|
||||
<recent name="D:\JetBrainsToolProject\IntelJ IDEA\qr-hexo\source\img" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\source\img" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes\butterfly\source\img" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\static" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo" />
|
||||
</key>
|
||||
<key name="MoveFile.RECENT_KEYS">
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\source\_posts\net\jichang" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\source\css" />
|
||||
<recent name="D:\JetBrainsToolProject\InteliJIDEA\qr-hexo\themes" />
|
||||
</key>
|
||||
</component>
|
||||
@@ -99,8 +111,8 @@
|
||||
<component name="SharedIndexes">
|
||||
<attachedChunks>
|
||||
<set>
|
||||
<option value="bundled-jdk-9f38398b9061-39b83d9b5494-intellij.indexing.shared.core-IU-241.18034.62" />
|
||||
<option value="bundled-js-predefined-1d06a55b98c1-0b3e54e931b4-JavaScript-IU-241.18034.62" />
|
||||
<option value="bundled-jdk-9823dce3aa75-b114ca120d71-intellij.indexing.shared.core-IU-242.21829.142" />
|
||||
<option value="bundled-js-predefined-d6986cc7102b-7c0b70fcd90d-JavaScript-IU-242.21829.142" />
|
||||
</set>
|
||||
</attachedChunks>
|
||||
</component>
|
||||
@@ -114,10 +126,47 @@
|
||||
<updated>1722331046875</updated>
|
||||
<workItem from="1722331047325" duration="8230000" />
|
||||
<workItem from="1722339532652" duration="1879000" />
|
||||
<workItem from="1722346590186" duration="1768000" />
|
||||
<workItem from="1722385471856" duration="1455000" />
|
||||
<workItem from="1722405691335" duration="3656000" />
|
||||
<workItem from="1722472583002" duration="3928000" />
|
||||
<workItem from="1722495344547" duration="188000" />
|
||||
<workItem from="1722496451693" duration="5606000" />
|
||||
<workItem from="1722523547664" duration="231000" />
|
||||
<workItem from="1722525090581" duration="136000" />
|
||||
<workItem from="1722837934755" duration="1258000" />
|
||||
<workItem from="1722996243982" duration="2835000" />
|
||||
<workItem from="1723000171547" duration="657000" />
|
||||
<workItem from="1723000935915" duration="2478000" />
|
||||
<workItem from="1723076731245" duration="609000" />
|
||||
<workItem from="1723078072510" duration="1448000" />
|
||||
<workItem from="1723204368886" duration="2226000" />
|
||||
<workItem from="1723256861409" duration="2023000" />
|
||||
<workItem from="1723376828153" duration="28000" />
|
||||
<workItem from="1723864071920" duration="482000" />
|
||||
<workItem from="1723940011559" duration="166000" />
|
||||
<workItem from="1723996998009" duration="264000" />
|
||||
<workItem from="1726012925092" duration="988000" />
|
||||
<workItem from="1726065560220" duration="886000" />
|
||||
<workItem from="1726147233388" duration="6000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="TypeScriptGeneratedFilesManager">
|
||||
<option name="version" value="3" />
|
||||
</component>
|
||||
<component name="Vcs.Log.Tabs.Properties">
|
||||
<option name="TAB_STATES">
|
||||
<map>
|
||||
<entry key="MAIN">
|
||||
<value>
|
||||
<State />
|
||||
</value>
|
||||
</entry>
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="ADD_EXTERNAL_FILES_SILENTLY" value="true" />
|
||||
</component>
|
||||
</project>
|
||||
15
README.md
Normal file
@@ -0,0 +1,15 @@
|
||||
## 1. anzhiyu主题
|
||||
**dev server 启动**
|
||||
```shell
|
||||
hexo cl && hexo g && hexo s
|
||||
```
|
||||
|
||||
## 2. butterfly 主题
|
||||
**dev server 启动**
|
||||
```shell
|
||||
hexo server
|
||||
```
|
||||
**重新构建**
|
||||
```shell
|
||||
npm run build
|
||||
```
|
||||
@@ -1,28 +1,28 @@
|
||||
menu:
|
||||
# 文章:
|
||||
# 隧道: /archives/ || anzhiyu-icon-box-archive
|
||||
# 分类: /categories/ || anzhiyu-icon-shapes
|
||||
# 标签: /tags/ || anzhiyu-icon-tags
|
||||
文章:
|
||||
隧道: /archives/ || anzhiyu-icon-box-archive
|
||||
分类: /categories/ || anzhiyu-icon-shapes
|
||||
标签: /tags/ || anzhiyu-icon-tags
|
||||
|
||||
# 友链:
|
||||
# 友人帐: /link/ || anzhiyu-icon-link
|
||||
# 朋友圈: /fcircle/ || anzhiyu-icon-artstation
|
||||
# 留言板: /comments/ || anzhiyu-icon-envelope
|
||||
友链:
|
||||
友人帐: /link/ || anzhiyu-icon-link
|
||||
朋友圈: /fcircle/ || anzhiyu-icon-artstation
|
||||
留言板: /comments/ || anzhiyu-icon-envelope
|
||||
|
||||
# 我的:
|
||||
# 音乐馆: /music/ || anzhiyu-icon-music
|
||||
# 追番页: /bangumis/ || anzhiyu-icon-bilibili
|
||||
# 相册集: /album/ || anzhiyu-icon-images
|
||||
# 小空调: /air-conditioner/ || anzhiyu-icon-fan
|
||||
我的:
|
||||
音乐馆: /music/ || anzhiyu-icon-music
|
||||
追番页: /bangumis/ || anzhiyu-icon-bilibili
|
||||
相册集: /album/ || anzhiyu-icon-images
|
||||
小空调: /air-conditioner/ || anzhiyu-icon-fan
|
||||
|
||||
# 关于:
|
||||
# 关于本人: /about/ || anzhiyu-icon-paper-plane
|
||||
# 闲言碎语: /essay/ || anzhiyu-icon-lightbulb
|
||||
# 随便逛逛: javascript:toRandomPost() || anzhiyu-icon-shoe-prints1
|
||||
关于:
|
||||
关于本人: /about/ || anzhiyu-icon-paper-plane
|
||||
闲言碎语: /essay/ || anzhiyu-icon-lightbulb
|
||||
随便逛逛: javascript:toRandomPost() || anzhiyu-icon-shoe-prints1
|
||||
|
||||
# nav相关配置
|
||||
nav:
|
||||
enable: false
|
||||
enable: enable
|
||||
travelling: false
|
||||
clock: false
|
||||
menu:
|
||||
|
||||
@@ -25,7 +25,7 @@ menu:
|
||||
highlight_theme: mac # darker / pale night / light / ocean / mac / mac light / false
|
||||
highlight_copy: true # copy button
|
||||
highlight_lang: true # show the code language
|
||||
highlight_shrink: false # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
|
||||
highlight_shrink: none # true: shrink the code blocks / false: expand the code blocks | none: expand code blocks and hide the button
|
||||
highlight_height_limit: false # unit: px
|
||||
code_word_wrap: false
|
||||
|
||||
@@ -51,31 +51,31 @@ avatar:
|
||||
disable_top_img: false
|
||||
|
||||
# The banner image of home page
|
||||
index_img:
|
||||
index_img: /img/site01.jpg
|
||||
|
||||
# If the banner of page not setting, it will show the top_img
|
||||
default_top_img:
|
||||
default_top_img: /img/site01.jpg
|
||||
|
||||
# The banner image of archive page
|
||||
archive_img:
|
||||
archive_img: /img/site01.jpg
|
||||
|
||||
# If the banner of tag page not setting, it will show the top_img
|
||||
# note: tag page, not tags page (子標籤頁面的 top_img)
|
||||
tag_img:
|
||||
tag_img: /img/site01.jpg
|
||||
|
||||
# The banner image of tag page
|
||||
# format:
|
||||
# - tag name: xxxxx
|
||||
tag_per_img:
|
||||
tag_per_img: /img/site01.jpg
|
||||
|
||||
# If the banner of category page not setting, it will show the top_img
|
||||
# note: category page, not categories page (子分類頁面的 top_img)
|
||||
category_img:
|
||||
category_img: /img/site01.jpg
|
||||
|
||||
# The banner image of category page
|
||||
# format:
|
||||
# - category name: xxxxx
|
||||
category_per_img:
|
||||
category_per_img: /img/site01.jpg
|
||||
|
||||
cover:
|
||||
# display the cover or not (是否顯示文章封面)
|
||||
@@ -86,8 +86,8 @@ cover:
|
||||
# left/right/both
|
||||
position: both
|
||||
# When cover is not set, the default cover is displayed (當沒有設置cover時,默認的封面顯示)
|
||||
default_cover:
|
||||
- https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
|
||||
# default_cover:
|
||||
# - https://i.loli.net/2020/05/01/gkihqEjXxJ5UZ1C.jpg
|
||||
|
||||
# Replace Broken Images (替換無法顯示的圖片)
|
||||
error_img:
|
||||
@@ -96,7 +96,7 @@ error_img:
|
||||
|
||||
# A simple 404 page
|
||||
error_404:
|
||||
enable: true
|
||||
enable: false
|
||||
subtitle: 'Page Not Found'
|
||||
background: https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png
|
||||
|
||||
@@ -207,8 +207,8 @@ noticeOutdate:
|
||||
footer:
|
||||
owner:
|
||||
enable: true
|
||||
since: 2020
|
||||
custom_text: <a href="icp链接"><img class="icp-icon" src="icp图片"><span>备案号:xxxxxx</span></a>
|
||||
since: 2024
|
||||
custom_text: <a href="https://beian.miit.gov.cn/#/Integrated/recordQuery"><img class="icp-icon" src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png"><span>备案号:豫ICP备2023019300号</span></a>
|
||||
|
||||
# aside (側邊欄)
|
||||
# --------------------------------------
|
||||
@@ -224,7 +224,7 @@ aside:
|
||||
tag: false
|
||||
category: false
|
||||
card_author:
|
||||
enable: false
|
||||
enable: true
|
||||
description:
|
||||
button:
|
||||
enable: true
|
||||
@@ -232,7 +232,7 @@ aside:
|
||||
text: Follow Me
|
||||
link: https://github.com/shenjianz
|
||||
card_announcement:
|
||||
enable: false
|
||||
enable: true
|
||||
content: '一个简单快捷的文档知识点查阅网站'
|
||||
card_recent_post:
|
||||
enable: true
|
||||
@@ -344,7 +344,7 @@ rightside_item_order:
|
||||
|
||||
# MathJax
|
||||
mathjax:
|
||||
enable: false
|
||||
enable: true
|
||||
per_page: false
|
||||
|
||||
# KaTeX
|
||||
@@ -365,13 +365,13 @@ algolia_search:
|
||||
|
||||
# Local search
|
||||
local_search:
|
||||
enable: false
|
||||
enable: true
|
||||
# Preload the search data when the page loads.
|
||||
preload: false
|
||||
# Show top n results per article, show all results by setting to -1
|
||||
top_n_per_article: 1
|
||||
# Unescape html strings to the readable one.
|
||||
unescape: false
|
||||
unescape: true
|
||||
CDN:
|
||||
|
||||
# Docsearch
|
||||
@@ -641,10 +641,10 @@ text_align_justify: false
|
||||
# Website Background (設置網站背景)
|
||||
# can set it to color or image (可設置圖片 或者 顔色)
|
||||
# The formal of image: url(http://xxxxxx.com/xxx.jpg)
|
||||
background:
|
||||
|
||||
#background: /img/site01.jpg
|
||||
background: url(https://file.shenjianl.cn/assets/site.jpg)
|
||||
# Footer Background
|
||||
footer_bg: false
|
||||
footer_bg: transparent
|
||||
|
||||
# Add mask to header or footer (为 header 或 footer 添加黑色半透遮罩)
|
||||
mask:
|
||||
@@ -660,7 +660,7 @@ enter_transitions: true
|
||||
# Typewriter Effect (打字效果)
|
||||
# https://github.com/disjukr/activate-power-mode
|
||||
activate_power_mode:
|
||||
enable: false
|
||||
enable: true
|
||||
colorful: true # open particle animation (冒光特效)
|
||||
shake: true # open shake (抖動特效)
|
||||
mobile: false
|
||||
@@ -721,10 +721,10 @@ display_mode: light
|
||||
|
||||
# Beautify (美化頁面顯示)
|
||||
beautify:
|
||||
enable: false
|
||||
enable: true
|
||||
field: post # site/post
|
||||
title-prefix-icon: # '\f0c1'
|
||||
title-prefix-icon-color: # '#F47466'
|
||||
title-prefix-icon: '\f0c1'
|
||||
title-prefix-icon-color: '#F47466'
|
||||
|
||||
# Global font settings
|
||||
# Don't modify the following settings unless you know how they work (非必要不要修改)
|
||||
@@ -748,7 +748,7 @@ hr_icon:
|
||||
|
||||
# the subtitle on homepage (主頁subtitle)
|
||||
subtitle:
|
||||
enable: false
|
||||
enable: true
|
||||
# Typewriter Effect (打字效果)
|
||||
effect: true
|
||||
# Customize typed.js (配置typed.js)
|
||||
@@ -756,7 +756,7 @@ subtitle:
|
||||
typed_option:
|
||||
# source 調用第三方服務
|
||||
# source: false 關閉調用
|
||||
# source: 1 調用一言網的一句話(簡體) https://hitokoto.cn/
|
||||
# source: 1 調用一言網的一句話(簡體) https://hitokoto.cn/
|
||||
# source: 2 調用一句網(簡體) https://yijuzhan.com/
|
||||
# source: 3 調用今日詩詞(簡體) https://www.jinrishici.com/
|
||||
# subtitle 會先顯示 source , 再顯示 sub 的內容
|
||||
|
||||
10
_config.yml
@@ -4,17 +4,17 @@
|
||||
|
||||
# Site
|
||||
title: QuickReference
|
||||
subtitle: '实用知识文档'
|
||||
subtitle: '一份快捷简便的知识文档,查阅编程的细节'
|
||||
description: '一份快捷简便的文档,便于查阅编程的细节'
|
||||
keywords: doucment
|
||||
author: shenjianZ
|
||||
language: zh-Hans
|
||||
language: zh-CN
|
||||
timezone: 'Asia/Shanghai'
|
||||
|
||||
# URL
|
||||
## Set your site url here. For example, if you use GitHub Page, set url as 'https://username.github.io/project'
|
||||
url: http://rq.shenjianl.cn
|
||||
permalink: :year/:month/:day/:title/
|
||||
url: https://rq.shenjianl.cn
|
||||
permalink: posts/:abbrlink.html
|
||||
permalink_defaults:
|
||||
pretty_urls:
|
||||
trailing_index: true # Set to false to remove trailing 'index.md' from permalinks
|
||||
@@ -97,7 +97,7 @@ ignore:
|
||||
## Plugins: https://hexo.io/plugins/
|
||||
## Themes: https://hexo.io/themes/
|
||||
theme: butterfly
|
||||
|
||||
#theme: anzhiyu
|
||||
# Deployment
|
||||
## Docs: https://hexo.io/docs/one-command-deployment
|
||||
deploy:
|
||||
|
||||
301
package-lock.json
generated
@@ -8,10 +8,13 @@
|
||||
"name": "hexo-site",
|
||||
"version": "0.0.0",
|
||||
"dependencies": {
|
||||
"activate-power-mode": "^1.0.0",
|
||||
"hexo": "^7.0.0",
|
||||
"hexo-abbrlink": "^2.2.1",
|
||||
"hexo-generator-archive": "^2.0.0",
|
||||
"hexo-generator-category": "^2.0.0",
|
||||
"hexo-generator-index": "^3.0.0",
|
||||
"hexo-generator-searchdb": "^1.4.1",
|
||||
"hexo-generator-tag": "^2.0.0",
|
||||
"hexo-renderer-ejs": "^2.0.0",
|
||||
"hexo-renderer-marked": "^6.0.0",
|
||||
@@ -137,6 +140,11 @@
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/activate-power-mode": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/activate-power-mode/-/activate-power-mode-1.0.0.tgz",
|
||||
"integrity": "sha512-6AP7cCp5Ff7VaUKY805re11AlFg6ePInGlqq88v24Y5PvFl+6sD+WNiIZX8Uu35b8ZS9VyyTXP3znxuZ6EixGQ=="
|
||||
},
|
||||
"node_modules/agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz",
|
||||
@@ -1066,6 +1074,160 @@
|
||||
"url": "https://opencollective.com/hexo"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-abbrlink/-/hexo-abbrlink-2.2.1.tgz",
|
||||
"integrity": "sha512-yvazN7bbrIb7p8QU3nJ/8fbDmir1mFroYvUYcJz5xpc6DtszKggschmqZg6WNUdjhDBFyDwksrIUfwQnw0OOuA==",
|
||||
"dependencies": {
|
||||
"hexo-front-matter": "^1.0.0",
|
||||
"hexo-fs": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz",
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"dependencies": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/dom-serializer": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-1.4.1.tgz",
|
||||
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.0.1",
|
||||
"domhandler": "^4.2.0",
|
||||
"entities": "^2.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/cheeriojs/dom-serializer?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/dom-serializer/node_modules/entities": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz",
|
||||
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==",
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/domhandler": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-4.3.1.tgz",
|
||||
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.2.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 4"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domhandler?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/domutils": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz",
|
||||
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
|
||||
"dependencies": {
|
||||
"dom-serializer": "^1.0.1",
|
||||
"domelementtype": "^2.2.0",
|
||||
"domhandler": "^4.2.0"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/domutils?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/entities": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz",
|
||||
"integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q==",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/hexo-front-matter": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-front-matter/-/hexo-front-matter-1.0.0.tgz",
|
||||
"integrity": "sha512-Hn8IIzgWWnxYTekrjnA0rxwWMoQHifyrxKMqVibmFaRKf4AQ2V6Xo13Jiso6CDwYfS+OdA41QS5DG1Y+QXA5gw==",
|
||||
"dependencies": {
|
||||
"js-yaml": "^3.13.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/hexo-fs": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-fs/-/hexo-fs-3.1.0.tgz",
|
||||
"integrity": "sha512-SfoDH7zlU9Iop+bAfEONXezbNIkpVX1QqjNCBYpapilZR+xVOCfTEdlNixanrKBbLGPb2fXqrdDBFgrKuiVGQQ==",
|
||||
"dependencies": {
|
||||
"bluebird": "^3.5.1",
|
||||
"chokidar": "^3.0.0",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"hexo-util": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10.13.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/hexo-util": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-util/-/hexo-util-2.7.0.tgz",
|
||||
"integrity": "sha512-hQM3h34nhDg0bSe/Tg1lnpODvNkz7h2u0+lZGzlKL0Oufp+5KCAEUX9wal7/xC7ax3/cwEn8IuoU75kNpZLpJQ==",
|
||||
"dependencies": {
|
||||
"bluebird": "^3.5.2",
|
||||
"camel-case": "^4.0.0",
|
||||
"cross-spawn": "^7.0.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"highlight.js": "^11.0.1",
|
||||
"htmlparser2": "^7.0.0",
|
||||
"prismjs": "^1.17.1",
|
||||
"strip-indent": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/htmlparser2": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-7.2.0.tgz",
|
||||
"integrity": "sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==",
|
||||
"funding": [
|
||||
"https://github.com/fb55/htmlparser2?sponsor=1",
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/fb55"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"domelementtype": "^2.0.1",
|
||||
"domhandler": "^4.2.2",
|
||||
"domutils": "^2.8.0",
|
||||
"entities": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/js-yaml": {
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz",
|
||||
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
||||
"dependencies": {
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
},
|
||||
"bin": {
|
||||
"js-yaml": "bin/js-yaml.js"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-abbrlink/node_modules/sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
||||
},
|
||||
"node_modules/hexo-cli": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-cli/-/hexo-cli-4.3.2.tgz",
|
||||
@@ -1147,6 +1309,14 @@
|
||||
"node": ">=14"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-generator-searchdb": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-generator-searchdb/-/hexo-generator-searchdb-1.4.1.tgz",
|
||||
"integrity": "sha512-7m8IBpZbI6iKb2jRYxs4pghD6Ln8ylQSRGl6MIC4G9wws21vYSXSD8rvC3MoCO+pWBHs6E/mTA/rjG+p2AZfVg==",
|
||||
"dependencies": {
|
||||
"nunjucks": "^3.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/hexo-generator-tag": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-generator-tag/-/hexo-generator-tag-2.0.0.tgz",
|
||||
@@ -2869,6 +3039,11 @@
|
||||
"acorn": "^8.11.0"
|
||||
}
|
||||
},
|
||||
"activate-power-mode": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/activate-power-mode/-/activate-power-mode-1.0.0.tgz",
|
||||
"integrity": "sha512-6AP7cCp5Ff7VaUKY805re11AlFg6ePInGlqq88v24Y5PvFl+6sD+WNiIZX8Uu35b8ZS9VyyTXP3znxuZ6EixGQ=="
|
||||
},
|
||||
"agent-base": {
|
||||
"version": "6.0.2",
|
||||
"resolved": "https://registry.npmmirror.com/agent-base/-/agent-base-6.0.2.tgz",
|
||||
@@ -3544,6 +3719,124 @@
|
||||
"warehouse": "^5.0.1"
|
||||
}
|
||||
},
|
||||
"hexo-abbrlink": {
|
||||
"version": "2.2.1",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-abbrlink/-/hexo-abbrlink-2.2.1.tgz",
|
||||
"integrity": "sha512-yvazN7bbrIb7p8QU3nJ/8fbDmir1mFroYvUYcJz5xpc6DtszKggschmqZg6WNUdjhDBFyDwksrIUfwQnw0OOuA==",
|
||||
"requires": {
|
||||
"hexo-front-matter": "^1.0.0",
|
||||
"hexo-fs": "^3.1.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"argparse": {
|
||||
"version": "1.0.10",
|
||||
"resolved": "https://registry.npmmirror.com/argparse/-/argparse-1.0.10.tgz",
|
||||
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
|
||||
"requires": {
|
||||
"sprintf-js": "~1.0.2"
|
||||
}
|
||||
},
|
||||
"dom-serializer": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/dom-serializer/-/dom-serializer-1.4.1.tgz",
|
||||
"integrity": "sha512-VHwB3KfrcOOkelEG2ZOfxqLZdfkil8PtJi4P8N2MMXucZq2yLp75ClViUlOVwyoHEDjYU433Aq+5zWP61+RGag==",
|
||||
"requires": {
|
||||
"domelementtype": "^2.0.1",
|
||||
"domhandler": "^4.2.0",
|
||||
"entities": "^2.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"entities": {
|
||||
"version": "2.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/entities/-/entities-2.2.0.tgz",
|
||||
"integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"domhandler": {
|
||||
"version": "4.3.1",
|
||||
"resolved": "https://registry.npmmirror.com/domhandler/-/domhandler-4.3.1.tgz",
|
||||
"integrity": "sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==",
|
||||
"requires": {
|
||||
"domelementtype": "^2.2.0"
|
||||
}
|
||||
},
|
||||
"domutils": {
|
||||
"version": "2.8.0",
|
||||
"resolved": "https://registry.npmmirror.com/domutils/-/domutils-2.8.0.tgz",
|
||||
"integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==",
|
||||
"requires": {
|
||||
"dom-serializer": "^1.0.1",
|
||||
"domelementtype": "^2.2.0",
|
||||
"domhandler": "^4.2.0"
|
||||
}
|
||||
},
|
||||
"entities": {
|
||||
"version": "3.0.1",
|
||||
"resolved": "https://registry.npmmirror.com/entities/-/entities-3.0.1.tgz",
|
||||
"integrity": "sha512-WiyBqoomrwMdFG1e0kqvASYfnlb0lp8M5o5Fw2OFq1hNZxxcNk8Ik0Xm7LxzBhuidnZB/UtBqVCgUz3kBOP51Q=="
|
||||
},
|
||||
"hexo-front-matter": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-front-matter/-/hexo-front-matter-1.0.0.tgz",
|
||||
"integrity": "sha512-Hn8IIzgWWnxYTekrjnA0rxwWMoQHifyrxKMqVibmFaRKf4AQ2V6Xo13Jiso6CDwYfS+OdA41QS5DG1Y+QXA5gw==",
|
||||
"requires": {
|
||||
"js-yaml": "^3.13.1"
|
||||
}
|
||||
},
|
||||
"hexo-fs": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-fs/-/hexo-fs-3.1.0.tgz",
|
||||
"integrity": "sha512-SfoDH7zlU9Iop+bAfEONXezbNIkpVX1QqjNCBYpapilZR+xVOCfTEdlNixanrKBbLGPb2fXqrdDBFgrKuiVGQQ==",
|
||||
"requires": {
|
||||
"bluebird": "^3.5.1",
|
||||
"chokidar": "^3.0.0",
|
||||
"graceful-fs": "^4.1.11",
|
||||
"hexo-util": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"hexo-util": {
|
||||
"version": "2.7.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-util/-/hexo-util-2.7.0.tgz",
|
||||
"integrity": "sha512-hQM3h34nhDg0bSe/Tg1lnpODvNkz7h2u0+lZGzlKL0Oufp+5KCAEUX9wal7/xC7ax3/cwEn8IuoU75kNpZLpJQ==",
|
||||
"requires": {
|
||||
"bluebird": "^3.5.2",
|
||||
"camel-case": "^4.0.0",
|
||||
"cross-spawn": "^7.0.0",
|
||||
"deepmerge": "^4.2.2",
|
||||
"highlight.js": "^11.0.1",
|
||||
"htmlparser2": "^7.0.0",
|
||||
"prismjs": "^1.17.1",
|
||||
"strip-indent": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"htmlparser2": {
|
||||
"version": "7.2.0",
|
||||
"resolved": "https://registry.npmmirror.com/htmlparser2/-/htmlparser2-7.2.0.tgz",
|
||||
"integrity": "sha512-H7MImA4MS6cw7nbyURtLPO1Tms7C5H602LRETv95z1MxO/7CP7rDVROehUYeYBUYEON94NXXDEPmZuq+hX4sog==",
|
||||
"requires": {
|
||||
"domelementtype": "^2.0.1",
|
||||
"domhandler": "^4.2.2",
|
||||
"domutils": "^2.8.0",
|
||||
"entities": "^3.0.1"
|
||||
}
|
||||
},
|
||||
"js-yaml": {
|
||||
"version": "3.14.1",
|
||||
"resolved": "https://registry.npmmirror.com/js-yaml/-/js-yaml-3.14.1.tgz",
|
||||
"integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==",
|
||||
"requires": {
|
||||
"argparse": "^1.0.7",
|
||||
"esprima": "^4.0.0"
|
||||
}
|
||||
},
|
||||
"sprintf-js": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmmirror.com/sprintf-js/-/sprintf-js-1.0.3.tgz",
|
||||
"integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"hexo-cli": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-cli/-/hexo-cli-4.3.2.tgz",
|
||||
@@ -3604,6 +3897,14 @@
|
||||
"hexo-pagination": "3.0.0"
|
||||
}
|
||||
},
|
||||
"hexo-generator-searchdb": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-generator-searchdb/-/hexo-generator-searchdb-1.4.1.tgz",
|
||||
"integrity": "sha512-7m8IBpZbI6iKb2jRYxs4pghD6Ln8ylQSRGl6MIC4G9wws21vYSXSD8rvC3MoCO+pWBHs6E/mTA/rjG+p2AZfVg==",
|
||||
"requires": {
|
||||
"nunjucks": "^3.2.2"
|
||||
}
|
||||
},
|
||||
"hexo-generator-tag": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmmirror.com/hexo-generator-tag/-/hexo-generator-tag-2.0.0.tgz",
|
||||
|
||||
@@ -3,19 +3,22 @@
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "hexo generate",
|
||||
"build": "hexo clean && hexo generate",
|
||||
"clean": "hexo clean",
|
||||
"deploy": "hexo deploy",
|
||||
"server": "hexo server"
|
||||
"dev": "hexo server"
|
||||
},
|
||||
"hexo": {
|
||||
"version": "7.3.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"activate-power-mode": "^1.0.0",
|
||||
"hexo": "^7.0.0",
|
||||
"hexo-abbrlink": "^2.2.1",
|
||||
"hexo-generator-archive": "^2.0.0",
|
||||
"hexo-generator-category": "^2.0.0",
|
||||
"hexo-generator-index": "^3.0.0",
|
||||
"hexo-generator-searchdb": "^1.4.1",
|
||||
"hexo-generator-tag": "^2.0.0",
|
||||
"hexo-renderer-ejs": "^2.0.0",
|
||||
"hexo-renderer-marked": "^6.0.0",
|
||||
|
||||
154
public/404.html
@@ -1,154 +0,0 @@
|
||||
<!DOCTYPE html><html lang="zh-Hans" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>Page Not Found | QuickReference</title><meta name="author" content="shenjianZ"><meta name="copyright" content="shenjianZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="QuickReference">
|
||||
<meta property="og:url" content="http://rq.shenjianl.cn/404.html">
|
||||
<meta property="og:site_name" content="QuickReference">
|
||||
<meta property="og:description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||
<meta property="og:locale">
|
||||
<meta property="og:image" content="http://rq.shenjianl.cn/img/avatar.jpg">
|
||||
<meta property="article:author" content="shenjianZ">
|
||||
<meta property="article:tag" content="doucment">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:image" content="http://rq.shenjianl.cn/img/avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="http://rq.shenjianl.cn/404.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
|
||||
root: '/',
|
||||
algolia: undefined,
|
||||
localSearch: undefined,
|
||||
translate: undefined,
|
||||
noticeOutdate: undefined,
|
||||
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
|
||||
copy: {
|
||||
success: 'Copy Successful',
|
||||
error: 'Copy Error',
|
||||
noSupport: 'Browser Not Supported'
|
||||
},
|
||||
relativeDate: {
|
||||
homepage: false,
|
||||
post: false
|
||||
},
|
||||
runtime: 'days',
|
||||
dateSuffix: {
|
||||
just: 'Just now',
|
||||
min: 'minutes ago',
|
||||
hour: 'hours ago',
|
||||
day: 'days ago',
|
||||
month: 'months ago'
|
||||
},
|
||||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
Snackbar: undefined,
|
||||
infinitegrid: {
|
||||
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
|
||||
buttonText: 'Load More'
|
||||
},
|
||||
isPhotoFigcaption: false,
|
||||
islazyload: false,
|
||||
isAnchor: false,
|
||||
percent: {
|
||||
toc: true,
|
||||
rightside: false,
|
||||
},
|
||||
autoDarkmode: false
|
||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||
title: 'Page Not Found',
|
||||
isPost: false,
|
||||
isHome: false,
|
||||
isHighlightShrink: false,
|
||||
isToc: false,
|
||||
postUpdate: '2024-07-30 21:38:06'
|
||||
}</script><script>(win=>{
|
||||
win.saveToLocal = {
|
||||
set: (key, value, ttl) => {
|
||||
if (ttl === 0) return
|
||||
const now = Date.now()
|
||||
const expiry = now + ttl * 86400000
|
||||
const item = {
|
||||
value,
|
||||
expiry
|
||||
}
|
||||
localStorage.setItem(key, JSON.stringify(item))
|
||||
},
|
||||
|
||||
get: key => {
|
||||
const itemStr = localStorage.getItem(key)
|
||||
|
||||
if (!itemStr) {
|
||||
return undefined
|
||||
}
|
||||
const item = JSON.parse(itemStr)
|
||||
const now = Date.now()
|
||||
|
||||
if (now > item.expiry) {
|
||||
localStorage.removeItem(key)
|
||||
return undefined
|
||||
}
|
||||
return item.value
|
||||
}
|
||||
}
|
||||
|
||||
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script')
|
||||
script.src = url
|
||||
script.async = true
|
||||
script.onerror = reject
|
||||
script.onload = script.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
script.onload = script.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
|
||||
Object.keys(attr).forEach(key => {
|
||||
script.setAttribute(key, attr[key])
|
||||
})
|
||||
|
||||
document.head.appendChild(script)
|
||||
})
|
||||
|
||||
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
|
||||
const link = document.createElement('link')
|
||||
link.rel = 'stylesheet'
|
||||
link.href = url
|
||||
if (id) link.id = id
|
||||
link.onerror = reject
|
||||
link.onload = link.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
link.onload = link.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
document.head.appendChild(link)
|
||||
})
|
||||
|
||||
win.activateDarkMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
||||
}
|
||||
}
|
||||
win.activateLightMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
||||
}
|
||||
}
|
||||
const t = saveToLocal.get('theme')
|
||||
|
||||
if (t === 'dark') activateDarkMode()
|
||||
else if (t === 'light') activateLightMode()
|
||||
|
||||
const asideStatus = saveToLocal.get('aside-status')
|
||||
if (asideStatus !== undefined) {
|
||||
if (asideStatus === 'hide') {
|
||||
document.documentElement.classList.add('hide-aside')
|
||||
} else {
|
||||
document.documentElement.classList.remove('hide-aside')
|
||||
}
|
||||
}
|
||||
|
||||
const detectApple = () => {
|
||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||
document.documentElement.classList.add('apple')
|
||||
}
|
||||
}
|
||||
detectApple()
|
||||
})(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">Articles</div><div class="length-num">2</div></a><a href="/tags/"><div class="headline">Tags</div><div class="length-num">0</div></a><a href="/categories/"><div class="headline">Categories</div><div class="length-num">0</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="error404" id="body-wrap"><header class="not-top-img fixed" id="page-header"><nav id="nav"><span id="blog-info"><a href="/" title="QuickReference"><span class="site-name">QuickReference</span></a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav></header><div id="error-wrap"><div class="error-content"><div class="error-img"><img src="https://i.loli.net/2020/05/19/aKOcLiyPl2JQdFD.png" alt="Page not found"></div><div class="error-info"><h1 class="error_title">404</h1><div class="error_subtitle">Page Not Found</div></div></div></div></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="Toggle Between Light And Dark Mode"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="Toggle between Single-column and Double-column"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="Setting"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="Back To Top"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div></body></html>
|
||||
168
public/about/index.html
Normal file
@@ -0,0 +1,168 @@
|
||||
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>About me | QuickReference</title><meta name="author" content="shenjianZ"><meta name="copyright" content="shenjianZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="落花飞舞,翩若惊鸿。">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="About me">
|
||||
<meta property="og:url" content="https://rq.shenjianl.cn/about/index.html">
|
||||
<meta property="og:site_name" content="QuickReference">
|
||||
<meta property="og:description" content="落花飞舞,翩若惊鸿。">
|
||||
<meta property="og:locale" content="zh_CN">
|
||||
<meta property="og:image" content="https://rq.shenjianl.cn/img/avatar.jpg">
|
||||
<meta property="article:published_time" content="2024-08-10T02:35:41.000Z">
|
||||
<meta property="article:modified_time" content="2024-08-10T02:38:14.626Z">
|
||||
<meta property="article:author" content="shenjianZ">
|
||||
<meta property="article:tag" content="doucment">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:image" content="https://rq.shenjianl.cn/img/avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://rq.shenjianl.cn/about/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
|
||||
root: '/',
|
||||
algolia: undefined,
|
||||
localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
|
||||
translate: undefined,
|
||||
noticeOutdate: undefined,
|
||||
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
|
||||
copy: {
|
||||
success: '复制成功',
|
||||
error: '复制错误',
|
||||
noSupport: '浏览器不支持'
|
||||
},
|
||||
relativeDate: {
|
||||
homepage: false,
|
||||
post: false
|
||||
},
|
||||
runtime: '天',
|
||||
dateSuffix: {
|
||||
just: '刚刚',
|
||||
min: '分钟前',
|
||||
hour: '小时前',
|
||||
day: '天前',
|
||||
month: '个月前'
|
||||
},
|
||||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
Snackbar: undefined,
|
||||
infinitegrid: {
|
||||
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
|
||||
buttonText: '加载更多'
|
||||
},
|
||||
isPhotoFigcaption: false,
|
||||
islazyload: false,
|
||||
isAnchor: false,
|
||||
percent: {
|
||||
toc: true,
|
||||
rightside: false,
|
||||
},
|
||||
autoDarkmode: false
|
||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||
title: 'About me',
|
||||
isPost: false,
|
||||
isHome: false,
|
||||
isHighlightShrink: undefined,
|
||||
isToc: false,
|
||||
postUpdate: '2024-08-10 10:38:14'
|
||||
}</script><script>(win=>{
|
||||
win.saveToLocal = {
|
||||
set: (key, value, ttl) => {
|
||||
if (ttl === 0) return
|
||||
const now = Date.now()
|
||||
const expiry = now + ttl * 86400000
|
||||
const item = {
|
||||
value,
|
||||
expiry
|
||||
}
|
||||
localStorage.setItem(key, JSON.stringify(item))
|
||||
},
|
||||
|
||||
get: key => {
|
||||
const itemStr = localStorage.getItem(key)
|
||||
|
||||
if (!itemStr) {
|
||||
return undefined
|
||||
}
|
||||
const item = JSON.parse(itemStr)
|
||||
const now = Date.now()
|
||||
|
||||
if (now > item.expiry) {
|
||||
localStorage.removeItem(key)
|
||||
return undefined
|
||||
}
|
||||
return item.value
|
||||
}
|
||||
}
|
||||
|
||||
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script')
|
||||
script.src = url
|
||||
script.async = true
|
||||
script.onerror = reject
|
||||
script.onload = script.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
script.onload = script.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
|
||||
Object.keys(attr).forEach(key => {
|
||||
script.setAttribute(key, attr[key])
|
||||
})
|
||||
|
||||
document.head.appendChild(script)
|
||||
})
|
||||
|
||||
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
|
||||
const link = document.createElement('link')
|
||||
link.rel = 'stylesheet'
|
||||
link.href = url
|
||||
if (id) link.id = id
|
||||
link.onerror = reject
|
||||
link.onload = link.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
link.onload = link.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
document.head.appendChild(link)
|
||||
})
|
||||
|
||||
win.activateDarkMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
||||
}
|
||||
}
|
||||
win.activateLightMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
||||
}
|
||||
}
|
||||
const t = saveToLocal.get('theme')
|
||||
|
||||
if (t === 'dark') activateDarkMode()
|
||||
else if (t === 'light') activateLightMode()
|
||||
|
||||
const asideStatus = saveToLocal.get('aside-status')
|
||||
if (asideStatus !== undefined) {
|
||||
if (asideStatus === 'hide') {
|
||||
document.documentElement.classList.add('hide-aside')
|
||||
} else {
|
||||
document.documentElement.classList.remove('hide-aside')
|
||||
}
|
||||
}
|
||||
|
||||
const detectApple = () => {
|
||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||
document.documentElement.classList.add('apple')
|
||||
}
|
||||
}
|
||||
detectApple()
|
||||
})(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="not-home-page fixed" id="page-header" style="background-image: url('/img/site01.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="QuickReference"><span class="site-name">QuickReference</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="page-site-info"><h1 id="site-title">About me</h1></div></header><main class="layout" id="content-inner"><div id="page"><div id="article-container"><p>落花飞舞,翩若惊鸿。</p>
|
||||
</div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">shenjianZ</div><div class="author-info__description">一份快捷简便的文档,便于查阅编程的细节</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/shenjianz"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/shenjianZ" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:15202078626@163.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">一个简单快捷的文档知识点查阅网站</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/8816.html" title="集成学习"><img src="/img/machinelearning/ensemble-learning.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="集成学习"/></a><div class="content"><a class="title" href="/posts/8816.html" title="集成学习">集成学习</a><time datetime="2025-01-25T07:12:08.000Z" title="发表于 2025-01-25 15:12:08">2025-01-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/95.html" title="决策树算法"><img src="/img/machinelearning/decision-tree.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="决策树算法"/></a><div class="content"><a class="title" href="/posts/95.html" title="决策树算法">决策树算法</a><time datetime="2025-01-24T04:39:59.000Z" title="发表于 2025-01-24 12:39:59">2025-01-24</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/60504.html" title="逻辑回归">逻辑回归</a><time datetime="2025-01-20T07:30:08.000Z" title="发表于 2025-01-20 15:30:08">2025-01-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/52662.html" title="线性回归">线性回归</a><time datetime="2025-01-19T08:46:51.000Z" title="发表于 2025-01-19 16:46:51">2025-01-19</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/12462.html" title="C lang">C lang</a><time datetime="2025-01-15T12:41:26.000Z" title="发表于 2025-01-15 20:41:26">2025-01-15</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
|
||||
<i class="fas fa-folder-open"></i>
|
||||
<span>分类</span>
|
||||
|
||||
</div>
|
||||
<ul class="card-category-list" id="aside-cat-list">
|
||||
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/machinelearning/"><span class="card-category-list-name">machinelearning</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/"><span class="card-category-list-name">古文观止</span><span class="card-category-list-count">1</span></a></li>
|
||||
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/linear-regression/" style="font-size: 1.1em; color: #999">linear-regression</a> <a href="/tags/KNN/" style="font-size: 1.1em; color: #999">KNN</a> <a href="/tags/logistic-regression/" style="font-size: 1.1em; color: #999">logistic-regression</a> <a href="/tags/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/" style="font-size: 1.1em; color: #999">古文观止</a> <a href="/tags/decisiontree/" style="font-size: 1.1em; color: #999">decisiontree</a> <a href="/tags/uniapp/" style="font-size: 1.5em; color: #99a9bf">uniapp</a> <a href="/tags/%E7%BD%91%E7%BB%9C%E4%BB%A3%E7%90%86/" style="font-size: 1.1em; color: #999">网络代理</a> <a href="/tags/C-C/" style="font-size: 1.1em; color: #999">C C++</a> <a href="/tags/ensemble-learning/" style="font-size: 1.1em; color: #999">ensemble-learning</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2025/01/"><span class="card-archive-list-date">一月 2025</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/09/"><span class="card-archive-list-date">九月 2024</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/08/"><span class="card-archive-list-date">八月 2024</span><span class="card-archive-list-count">8</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">18</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2024-07-30T16:00:00.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2025-10-16T03:29:44.082Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer" style="background: transparent"><div id="footer-wrap"><div class="copyright">©2024 - 2025 By shenjianZ</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/#/Integrated/recordQuery"><img class="icp-icon" src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png"><span>备案号:豫ICP备2023019300号</span></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
|
||||
POWERMODE.shake = true;
|
||||
POWERMODE.mobile = false;
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js?v=4.13.0"></script></div></div></body></html>
|
||||
158
public/archives/2024/08/index.html
Normal file
158
public/archives/2024/09/index.html
Normal file
158
public/archives/2024/page/2/index.html
Normal file
158
public/archives/2025/01/index.html
Normal file
158
public/archives/2025/index.html
Normal file
158
public/archives/page/2/index.html
Normal file
160
public/categories/index.html
Normal file
158
public/categories/machinelearning/index.html
Normal file
158
public/categories/古文观止/index.html
Normal file
@@ -194,7 +194,6 @@ template {
|
||||
white-space: nowrap;
|
||||
}
|
||||
.limit-more-line,
|
||||
.error404 #error-wrap .error-content .error-info .error_subtitle,
|
||||
.article-sort-item-title,
|
||||
#recent-posts > .recent-post-item >.recent-post-info > .article-title,
|
||||
#recent-posts > .recent-post-item >.recent-post-info > .content,
|
||||
@@ -211,6 +210,13 @@ template {
|
||||
}
|
||||
.fontawesomeIcon,
|
||||
.custom-hr:before,
|
||||
#article-container.post-content h1:before,
|
||||
#article-container.post-content h2:before,
|
||||
#article-container.post-content h3:before,
|
||||
#article-container.post-content h4:before,
|
||||
#article-container.post-content h5:before,
|
||||
#article-container.post-content h6:before,
|
||||
#article-container.post-content hr:before,
|
||||
#post .post-copyright:before,
|
||||
#post .post-outdate-notice:before,
|
||||
.note:not(.no-icon)::before,
|
||||
@@ -222,7 +228,6 @@ template {
|
||||
-webkit-font-smoothing: antialiased;
|
||||
}
|
||||
.cardHover,
|
||||
.error404 #error-wrap .error-content,
|
||||
.layout > div:first-child:not(.recent-posts),
|
||||
#recent-posts > .recent-post-item,
|
||||
#aside-content .card-widget,
|
||||
@@ -238,7 +243,6 @@ template {
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.cardHover:hover,
|
||||
.error404 #error-wrap .error-content:hover,
|
||||
.layout > div:first-child:not(.recent-posts):hover,
|
||||
#recent-posts > .recent-post-item:hover,
|
||||
#aside-content .card-widget:hover,
|
||||
@@ -247,7 +251,6 @@ template {
|
||||
box-shadow: var(--card-hover-box-shadow);
|
||||
}
|
||||
.imgHover,
|
||||
.error404 #error-wrap .error-content .error-img img,
|
||||
.article-sort-item-img :first-child,
|
||||
#recent-posts > .recent-post-item .post_cover .post-bg,
|
||||
#aside-content .aside-list > .aside-list-item .thumbnail :first-child {
|
||||
@@ -261,7 +264,6 @@ template {
|
||||
object-fit: cover;
|
||||
}
|
||||
.imgHover:hover,
|
||||
.error404 #error-wrap .error-content .error-img img:hover,
|
||||
.article-sort-item-img :first-child:hover,
|
||||
#recent-posts > .recent-post-item .post_cover .post-bg:hover,
|
||||
#aside-content .aside-list > .aside-list-item .thumbnail :first-child:hover {
|
||||
@@ -333,6 +335,7 @@ template {
|
||||
transition: all 0.3s ease-out;
|
||||
}
|
||||
.custom-hr,
|
||||
#article-container.post-content hr,
|
||||
.search-dialog hr {
|
||||
position: relative;
|
||||
margin: 40px auto;
|
||||
@@ -340,10 +343,12 @@ template {
|
||||
width: calc(100% - 4px);
|
||||
}
|
||||
.custom-hr:hover:before,
|
||||
#article-container.post-content hr:hover:before,
|
||||
.search-dialog hr:hover:before {
|
||||
left: calc(95% - 20px);
|
||||
}
|
||||
.custom-hr:before,
|
||||
#article-container.post-content hr:before,
|
||||
.search-dialog hr:before {
|
||||
position: absolute;
|
||||
top: -10px;
|
||||
@@ -1504,6 +1509,17 @@ body {
|
||||
input::placeholder {
|
||||
color: var(--font-color);
|
||||
}
|
||||
#web_bg {
|
||||
position: fixed;
|
||||
z-index: -999;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: url(https://file.shenjianl.cn/assets/site.jpg);
|
||||
background-attachment: local;
|
||||
background-position: center;
|
||||
background-size: cover;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
h1,
|
||||
h2,
|
||||
h3,
|
||||
@@ -2007,97 +2023,6 @@ figure.highlight pre .javascript .function {
|
||||
filter: alpha(opacity=60);
|
||||
}
|
||||
}
|
||||
.error404 #error-wrap {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
right: 0;
|
||||
left: 0;
|
||||
margin: 0 auto;
|
||||
padding: 60px 20px 0;
|
||||
max-width: 1000px;
|
||||
-webkit-transform: translate(0, -50%);
|
||||
-moz-transform: translate(0, -50%);
|
||||
-o-transform: translate(0, -50%);
|
||||
-ms-transform: translate(0, -50%);
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
.error404 #error-wrap .error-content {
|
||||
overflow: hidden;
|
||||
margin: 0 20px;
|
||||
height: 360px;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.error404 #error-wrap .error-content {
|
||||
margin: 0;
|
||||
height: 500px;
|
||||
}
|
||||
}
|
||||
.error404 #error-wrap .error-content .error-img {
|
||||
display: inline-block;
|
||||
overflow: hidden;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.error404 #error-wrap .error-content .error-img {
|
||||
width: 100%;
|
||||
height: 45%;
|
||||
}
|
||||
}
|
||||
.error404 #error-wrap .error-content .error-img img {
|
||||
background-color: #1e90ff;
|
||||
}
|
||||
.error404 #error-wrap .error-content .error-info {
|
||||
display: -webkit-inline-box;
|
||||
display: -moz-inline-box;
|
||||
display: -webkit-inline-flex;
|
||||
display: -ms-inline-flexbox;
|
||||
display: inline-box;
|
||||
display: inline-flex;
|
||||
-webkit-box-orient: vertical;
|
||||
-moz-box-orient: vertical;
|
||||
-o-box-orient: vertical;
|
||||
-webkit-flex-direction: column;
|
||||
-ms-flex-direction: column;
|
||||
flex-direction: column;
|
||||
-webkit-box-pack: center;
|
||||
-moz-box-pack: center;
|
||||
-o-box-pack: center;
|
||||
-ms-flex-pack: center;
|
||||
-webkit-justify-content: center;
|
||||
justify-content: center;
|
||||
-ms-flex-line-pack: center;
|
||||
-webkit-align-content: center;
|
||||
align-content: center;
|
||||
width: 50%;
|
||||
height: 100%;
|
||||
vertical-align: top;
|
||||
text-align: center;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.error404 #error-wrap .error-content .error-info {
|
||||
width: 100%;
|
||||
height: 55%;
|
||||
}
|
||||
}
|
||||
.error404 #error-wrap .error-content .error-info .error_title {
|
||||
margin-top: -0.6em;
|
||||
font-size: 9em;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
.error404 #error-wrap .error-content .error-info .error_title {
|
||||
font-size: 8em;
|
||||
}
|
||||
}
|
||||
.error404 #error-wrap .error-content .error-info .error_subtitle {
|
||||
margin-top: -3em;
|
||||
word-break: break-word;
|
||||
font-size: 1.6em;
|
||||
-webkit-line-clamp: 2;
|
||||
}
|
||||
.error404 + #rightside {
|
||||
display: none;
|
||||
}
|
||||
.article-sort {
|
||||
margin-left: 10px;
|
||||
padding-left: 20px;
|
||||
@@ -3438,6 +3363,13 @@ h1.page-title + .tag-cloud-list {
|
||||
background-position: bottom;
|
||||
background-size: cover;
|
||||
}
|
||||
#footer:before {
|
||||
position: absolute;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: var(--mark-bg);
|
||||
content: '';
|
||||
}
|
||||
#footer-wrap {
|
||||
position: relative;
|
||||
padding: 40px 20px;
|
||||
@@ -3544,7 +3476,7 @@ h1.page-title + .tag-cloud-list {
|
||||
font-size: 20px;
|
||||
}
|
||||
#page-header.not-home-page {
|
||||
height: 400px;
|
||||
height: 750px !important;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
#page-header.not-home-page {
|
||||
@@ -3563,7 +3495,7 @@ h1.page-title + .tag-cloud-list {
|
||||
}
|
||||
}
|
||||
#page-header.post-bg {
|
||||
height: 400px;
|
||||
height: 750px;
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
#page-header.post-bg {
|
||||
@@ -4068,6 +4000,113 @@ h1.page-title + .tag-cloud-list {
|
||||
#article-container hr {
|
||||
margin: 20px 0;
|
||||
}
|
||||
#article-container.post-content h1,
|
||||
#article-container.post-content h2,
|
||||
#article-container.post-content h3,
|
||||
#article-container.post-content h4,
|
||||
#article-container.post-content h5,
|
||||
#article-container.post-content h6 {
|
||||
-webkit-transition: all 0.2s ease-out;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-o-transition: all 0.2s ease-out;
|
||||
-ms-transition: all 0.2s ease-out;
|
||||
transition: all 0.2s ease-out;
|
||||
}
|
||||
#article-container.post-content h1:before,
|
||||
#article-container.post-content h2:before,
|
||||
#article-container.post-content h3:before,
|
||||
#article-container.post-content h4:before,
|
||||
#article-container.post-content h5:before,
|
||||
#article-container.post-content h6:before {
|
||||
position: absolute;
|
||||
top: calc(50% - 7px);
|
||||
color: #f47466;
|
||||
content: '\f0c1';
|
||||
left: 0;
|
||||
line-height: 1;
|
||||
-webkit-transition: all 0.2s ease-out;
|
||||
-moz-transition: all 0.2s ease-out;
|
||||
-o-transition: all 0.2s ease-out;
|
||||
-ms-transition: all 0.2s ease-out;
|
||||
transition: all 0.2s ease-out;
|
||||
}
|
||||
#article-container.post-content h1:hover:before,
|
||||
#article-container.post-content h2:hover:before,
|
||||
#article-container.post-content h3:hover:before,
|
||||
#article-container.post-content h4:hover:before,
|
||||
#article-container.post-content h5:hover:before,
|
||||
#article-container.post-content h6:hover:before {
|
||||
color: #1e90ff;
|
||||
}
|
||||
#article-container.post-content h1 {
|
||||
padding-left: 28px;
|
||||
}
|
||||
#article-container.post-content h1:before {
|
||||
font-size: 18px;
|
||||
}
|
||||
#article-container.post-content h1:hover {
|
||||
padding-left: 32px;
|
||||
}
|
||||
#article-container.post-content h2 {
|
||||
padding-left: 26px;
|
||||
}
|
||||
#article-container.post-content h2:before {
|
||||
font-size: 16px;
|
||||
}
|
||||
#article-container.post-content h2:hover {
|
||||
padding-left: 30px;
|
||||
}
|
||||
#article-container.post-content h3 {
|
||||
padding-left: 24px;
|
||||
}
|
||||
#article-container.post-content h3:before {
|
||||
font-size: 14px;
|
||||
}
|
||||
#article-container.post-content h3:hover {
|
||||
padding-left: 28px;
|
||||
}
|
||||
#article-container.post-content h4 {
|
||||
padding-left: 22px;
|
||||
}
|
||||
#article-container.post-content h4:before {
|
||||
font-size: 12px;
|
||||
}
|
||||
#article-container.post-content h4:hover {
|
||||
padding-left: 26px;
|
||||
}
|
||||
#article-container.post-content h5 {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#article-container.post-content h5:before {
|
||||
font-size: 10px;
|
||||
}
|
||||
#article-container.post-content h5:hover {
|
||||
padding-left: 24px;
|
||||
}
|
||||
#article-container.post-content h6 {
|
||||
padding-left: 20px;
|
||||
}
|
||||
#article-container.post-content h6:before {
|
||||
font-size: 10px;
|
||||
}
|
||||
#article-container.post-content h6:hover {
|
||||
padding-left: 24px;
|
||||
}
|
||||
#article-container.post-content ol p,
|
||||
#article-container.post-content ul p {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
#article-container.post-content li::marker {
|
||||
color: #1e90ff;
|
||||
font-weight: 600;
|
||||
font-size: 1.05em;
|
||||
}
|
||||
#article-container.post-content li:hover::marker {
|
||||
color: var(--pseudo-hover);
|
||||
}
|
||||
#article-container.post-content ul > li {
|
||||
list-style-type: circle;
|
||||
}
|
||||
#post .tag_share:after {
|
||||
display: block;
|
||||
clear: both;
|
||||
@@ -4568,6 +4607,20 @@ mjx-assistive-mml {
|
||||
#article-container .aplayer {
|
||||
margin: 0 0 20px;
|
||||
}
|
||||
#article-container .aplayer ol,
|
||||
#article-container .aplayer ul {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
#article-container .aplayer ol li,
|
||||
#article-container .aplayer ul li {
|
||||
margin: 0;
|
||||
padding: 0 15px;
|
||||
}
|
||||
#article-container .aplayer ol li:before,
|
||||
#article-container .aplayer ul li:before {
|
||||
content: none;
|
||||
}
|
||||
.snackbar-css {
|
||||
border-radius: 5px !important;
|
||||
}
|
||||
@@ -6282,3 +6335,75 @@ blockquote.pullquote.right {
|
||||
display: none;
|
||||
background: rgba(0,0,0,0.6);
|
||||
}
|
||||
#local-search .search-dialog .local-search-box {
|
||||
margin: 0 auto;
|
||||
max-width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
#local-search .search-dialog .local-search-box input {
|
||||
padding: 5px 14px;
|
||||
width: 100%;
|
||||
outline: none;
|
||||
border: 2px solid #1e90ff;
|
||||
border-radius: 40px;
|
||||
background: var(--search-bg);
|
||||
color: var(--search-input-color);
|
||||
-webkit-appearance: none;
|
||||
}
|
||||
#local-search .search-dialog .search-wrap {
|
||||
display: none;
|
||||
}
|
||||
#local-search .search-dialog .local-search-hit-item {
|
||||
position: relative;
|
||||
padding-left: 24px;
|
||||
line-height: 1.7;
|
||||
}
|
||||
#local-search .search-dialog .local-search-hit-item:hover:before {
|
||||
border-color: var(--pseudo-hover);
|
||||
}
|
||||
#local-search .search-dialog .local-search-hit-item:before {
|
||||
position: absolute;
|
||||
top: 0.45em;
|
||||
left: 0;
|
||||
width: 0.5em;
|
||||
height: 0.5em;
|
||||
border: 3px solid #1e90ff;
|
||||
border-radius: 0.5em;
|
||||
background: transparent;
|
||||
content: '';
|
||||
line-height: 0.5em;
|
||||
-webkit-transition: all 0.2s ease-in-out;
|
||||
-moz-transition: all 0.2s ease-in-out;
|
||||
-o-transition: all 0.2s ease-in-out;
|
||||
-ms-transition: all 0.2s ease-in-out;
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
#local-search .search-dialog .local-search-hit-item a {
|
||||
display: block;
|
||||
color: var(--search-a-color);
|
||||
}
|
||||
#local-search .search-dialog .local-search-hit-item a:hover {
|
||||
color: #1e90ff;
|
||||
}
|
||||
#local-search .search-dialog .local-search-hit-item .search-result-title {
|
||||
font-weight: 600;
|
||||
}
|
||||
#local-search .search-dialog .local-search-hit-item .search-result {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
#local-search .search-dialog .search-result-list {
|
||||
overflow-y: overlay;
|
||||
margin: 0 -20px;
|
||||
padding: 0 22px;
|
||||
max-height: calc(80vh - 200px);
|
||||
}
|
||||
@media screen and (max-width: 768px) {
|
||||
#local-search .search-dialog .search-result-list {
|
||||
max-height: calc(var(--search-height) - 220px) !important;
|
||||
}
|
||||
}
|
||||
.search-keyword {
|
||||
background: transparent;
|
||||
color: #f47466;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
BIN
public/img/000001.png
Normal file
|
After Width: | Height: | Size: 152 KiB |
BIN
public/img/dingyue.png
Normal file
|
After Width: | Height: | Size: 609 KiB |
BIN
public/img/language/c-env-conf.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
BIN
public/img/machinelearning/cros-valid.png
Normal file
|
After Width: | Height: | Size: 183 KiB |
BIN
public/img/machinelearning/decision-tree.png
Normal file
|
After Width: | Height: | Size: 537 KiB |
BIN
public/img/machinelearning/ensemble-learning.png
Normal file
|
After Width: | Height: | Size: 613 KiB |
BIN
public/img/machinelearning/fitting.png
Normal file
|
After Width: | Height: | Size: 100 KiB |
BIN
public/img/machinelearning/kfold-skfold.png
Normal file
|
After Width: | Height: | Size: 27 KiB |
BIN
public/img/machinelearning/knn-01.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
public/img/machinelearning/linear.png
Normal file
|
After Width: | Height: | Size: 123 KiB |
BIN
public/img/machinelearning/ott.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
public/img/machinelearning/over_random_sampling.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
public/img/machinelearning/over_smote_sampling.png
Normal file
|
After Width: | Height: | Size: 39 KiB |
BIN
public/img/machinelearning/random-forest.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
public/img/machinelearning/under_sampling.png
Normal file
|
After Width: | Height: | Size: 36 KiB |
BIN
public/img/peiqian.png
Normal file
|
After Width: | Height: | Size: 770 KiB |
BIN
public/img/site01.jpg
Normal file
|
After Width: | Height: | Size: 1.1 MiB |
BIN
public/img/yiyuan.png
Normal file
|
After Width: | Height: | Size: 203 KiB |
203
public/link/index.html
Normal file
@@ -0,0 +1,203 @@
|
||||
<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0,viewport-fit=cover"><title>link | QuickReference</title><meta name="author" content="shenjianZ"><meta name="copyright" content="shenjianZ"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta name="description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||
<meta property="og:type" content="website">
|
||||
<meta property="og:title" content="link">
|
||||
<meta property="og:url" content="https://rq.shenjianl.cn/link/index.html">
|
||||
<meta property="og:site_name" content="QuickReference">
|
||||
<meta property="og:description" content="一份快捷简便的文档,便于查阅编程的细节">
|
||||
<meta property="og:locale" content="zh_CN">
|
||||
<meta property="og:image" content="https://rq.shenjianl.cn/img/avatar.jpg">
|
||||
<meta property="article:published_time" content="2024-08-10T02:42:35.000Z">
|
||||
<meta property="article:modified_time" content="2024-08-10T02:42:48.927Z">
|
||||
<meta property="article:author" content="shenjianZ">
|
||||
<meta property="article:tag" content="doucment">
|
||||
<meta name="twitter:card" content="summary">
|
||||
<meta name="twitter:image" content="https://rq.shenjianl.cn/img/avatar.jpg"><link rel="shortcut icon" href="/img/favicon.png"><link rel="canonical" href="https://rq.shenjianl.cn/link/index.html"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/css/index.css?v=4.13.0"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.1/css/all.min.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = {
|
||||
root: '/',
|
||||
algolia: undefined,
|
||||
localSearch: {"path":"/search.xml","preload":false,"top_n_per_article":1,"unescape":true,"languages":{"hits_empty":"找不到您查询的内容:${query}","hits_stats":"共找到 ${hits} 篇文章"}},
|
||||
translate: undefined,
|
||||
noticeOutdate: undefined,
|
||||
highlight: {"plugin":"highlight.js","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
|
||||
copy: {
|
||||
success: '复制成功',
|
||||
error: '复制错误',
|
||||
noSupport: '浏览器不支持'
|
||||
},
|
||||
relativeDate: {
|
||||
homepage: false,
|
||||
post: false
|
||||
},
|
||||
runtime: '天',
|
||||
dateSuffix: {
|
||||
just: '刚刚',
|
||||
min: '分钟前',
|
||||
hour: '小时前',
|
||||
day: '天前',
|
||||
month: '个月前'
|
||||
},
|
||||
copyright: undefined,
|
||||
lightbox: 'fancybox',
|
||||
Snackbar: undefined,
|
||||
infinitegrid: {
|
||||
js: 'https://cdn.jsdelivr.net/npm/@egjs/infinitegrid@4.11.1/dist/infinitegrid.min.js',
|
||||
buttonText: '加载更多'
|
||||
},
|
||||
isPhotoFigcaption: false,
|
||||
islazyload: false,
|
||||
isAnchor: false,
|
||||
percent: {
|
||||
toc: true,
|
||||
rightside: false,
|
||||
},
|
||||
autoDarkmode: false
|
||||
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
|
||||
title: 'link',
|
||||
isPost: false,
|
||||
isHome: false,
|
||||
isHighlightShrink: undefined,
|
||||
isToc: false,
|
||||
postUpdate: '2024-08-10 10:42:48'
|
||||
}</script><script>(win=>{
|
||||
win.saveToLocal = {
|
||||
set: (key, value, ttl) => {
|
||||
if (ttl === 0) return
|
||||
const now = Date.now()
|
||||
const expiry = now + ttl * 86400000
|
||||
const item = {
|
||||
value,
|
||||
expiry
|
||||
}
|
||||
localStorage.setItem(key, JSON.stringify(item))
|
||||
},
|
||||
|
||||
get: key => {
|
||||
const itemStr = localStorage.getItem(key)
|
||||
|
||||
if (!itemStr) {
|
||||
return undefined
|
||||
}
|
||||
const item = JSON.parse(itemStr)
|
||||
const now = Date.now()
|
||||
|
||||
if (now > item.expiry) {
|
||||
localStorage.removeItem(key)
|
||||
return undefined
|
||||
}
|
||||
return item.value
|
||||
}
|
||||
}
|
||||
|
||||
win.getScript = (url, attr = {}) => new Promise((resolve, reject) => {
|
||||
const script = document.createElement('script')
|
||||
script.src = url
|
||||
script.async = true
|
||||
script.onerror = reject
|
||||
script.onload = script.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
script.onload = script.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
|
||||
Object.keys(attr).forEach(key => {
|
||||
script.setAttribute(key, attr[key])
|
||||
})
|
||||
|
||||
document.head.appendChild(script)
|
||||
})
|
||||
|
||||
win.getCSS = (url, id = false) => new Promise((resolve, reject) => {
|
||||
const link = document.createElement('link')
|
||||
link.rel = 'stylesheet'
|
||||
link.href = url
|
||||
if (id) link.id = id
|
||||
link.onerror = reject
|
||||
link.onload = link.onreadystatechange = function() {
|
||||
const loadState = this.readyState
|
||||
if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
|
||||
link.onload = link.onreadystatechange = null
|
||||
resolve()
|
||||
}
|
||||
document.head.appendChild(link)
|
||||
})
|
||||
|
||||
win.activateDarkMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'dark')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
|
||||
}
|
||||
}
|
||||
win.activateLightMode = () => {
|
||||
document.documentElement.setAttribute('data-theme', 'light')
|
||||
if (document.querySelector('meta[name="theme-color"]') !== null) {
|
||||
document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
|
||||
}
|
||||
}
|
||||
const t = saveToLocal.get('theme')
|
||||
|
||||
if (t === 'dark') activateDarkMode()
|
||||
else if (t === 'light') activateLightMode()
|
||||
|
||||
const asideStatus = saveToLocal.get('aside-status')
|
||||
if (asideStatus !== undefined) {
|
||||
if (asideStatus === 'hide') {
|
||||
document.documentElement.classList.add('hide-aside')
|
||||
} else {
|
||||
document.documentElement.classList.remove('hide-aside')
|
||||
}
|
||||
}
|
||||
|
||||
const detectApple = () => {
|
||||
if(/iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
|
||||
document.documentElement.classList.add('apple')
|
||||
}
|
||||
}
|
||||
detectApple()
|
||||
})(window)</script><meta name="generator" content="Hexo 7.3.0"></head><body><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src="/img/avatar.jpg" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="sidebar-site-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><hr class="custom-hr"/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div></div></div><div class="page" id="body-wrap"><header class="not-home-page fixed" id="page-header" style="background-image: url('/img/site01.jpg')"><nav id="nav"><span id="blog-info"><a href="/" title="QuickReference"><span class="site-name">QuickReference</span></a></span><div id="menus"><div id="search-button"><a class="site-page social-icon search" href="javascript:void(0);"><i class="fas fa-search fa-fw"></i><span> 搜索</span></a></div><div class="menus_items"><div class="menus_item"><a class="site-page" href="/"><i class="fa-fw fas fa-home"></i><span> Home</span></a></div><div class="menus_item"><a class="site-page" href="/archives/"><i class="fa-fw fas fa-archive"></i><span> Archives</span></a></div><div class="menus_item"><a class="site-page" href="/tags/"><i class="fa-fw fas fa-tags"></i><span> Tags</span></a></div><div class="menus_item"><a class="site-page" href="/categories/"><i class="fa-fw fas fa-folder-open"></i><span> Categories</span></a></div><div class="menus_item"><a class="site-page group" href="javascript:void(0);"><i class="fa-fw fas fa-list"></i><span> List</span><i class="fas fa-chevron-down"></i></a><ul class="menus_item_child"><li><a class="site-page child" href="/music/"><i class="fa-fw fas fa-music"></i><span> Music</span></a></li><li><a class="site-page child" href="/movies/"><i class="fa-fw fas fa-video"></i><span> Movie</span></a></li></ul></div><div class="menus_item"><a class="site-page" href="/link/"><i class="fa-fw fas fa-link"></i><span> Link</span></a></div><div class="menus_item"><a class="site-page" href="/about/"><i class="fa-fw fas fa-heart"></i><span> About</span></a></div></div><div id="toggle-menu"><a class="site-page" href="javascript:void(0);"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="page-site-info"><h1 id="site-title">link</h1></div></header><main class="layout" id="content-inner"><div id="page"><div id="article-container"><div class="flink"><h2 id="友情链接"><a href="#友情链接" class="headerlink" title="友情链接"></a>友情链接</h2><div class="flink-desc">那些人,那些事</div> <div class="flink-list">
|
||||
<div class="flink-list-item">
|
||||
<a href="https://hexo.io/zh-cn/" title="Hexo" target="_blank">
|
||||
<div class="flink-item-icon">
|
||||
<img class="no-lightbox" src="https://d33wubrfki0l68.cloudfront.net/6657ba50e702d84afb32fe846bed54fba1a77add/827ae/logo.svg" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Hexo" />
|
||||
</div>
|
||||
<div class="flink-item-name">Hexo</div>
|
||||
<div class="flink-item-desc" title="快速、简单且強大的文档框架">快速、简单且強大的文档框架</div>
|
||||
</a>
|
||||
</div></div><h2 id="网站"><a href="#网站" class="headerlink" title="网站"></a>网站</h2><div class="flink-desc">值得推荐的网站</div> <div class="flink-list">
|
||||
<div class="flink-list-item">
|
||||
<a href="https://www.youtube.com/" title="Youtube" target="_blank">
|
||||
<div class="flink-item-icon">
|
||||
<img class="no-lightbox" src="https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Youtube" />
|
||||
</div>
|
||||
<div class="flink-item-name">Youtube</div>
|
||||
<div class="flink-item-desc" title="视频网站">视频网站</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flink-list-item">
|
||||
<a href="https://www.weibo.com/" title="Weibo" target="_blank">
|
||||
<div class="flink-item-icon">
|
||||
<img class="no-lightbox" src="https://i.loli.net/2020/05/14/TLJBum386vcnI1P.png" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Weibo" />
|
||||
</div>
|
||||
<div class="flink-item-name">Weibo</div>
|
||||
<div class="flink-item-desc" title="中国最大社交分享平台">中国最大社交分享平台</div>
|
||||
</a>
|
||||
</div>
|
||||
<div class="flink-list-item">
|
||||
<a href="https://twitter.com/" title="Twitter" target="_blank">
|
||||
<div class="flink-item-icon">
|
||||
<img class="no-lightbox" src="https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png" onerror='this.onerror=null;this.src="/img/friend_404.gif"' alt="Twitter" />
|
||||
</div>
|
||||
<div class="flink-item-name">Twitter</div>
|
||||
<div class="flink-item-desc" title="社交分享平台">社交分享平台</div>
|
||||
</a>
|
||||
</div></div></div></div></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src="/img/avatar.jpg" onerror="this.onerror=null;this.src='/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">shenjianZ</div><div class="author-info__description">一份快捷简便的文档,便于查阅编程的细节</div></div><div class="card-info-data site-data is-center"><a href="/archives/"><div class="headline">文章</div><div class="length-num">18</div></a><a href="/tags/"><div class="headline">标签</div><div class="length-num">9</div></a><a href="/categories/"><div class="headline">分类</div><div class="length-num">2</div></a></div><a id="card-info-btn" target="_blank" rel="noopener" href="https://github.com/shenjianz"><i class="fab fa-github"></i><span>Follow Me</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="https://github.com/shenjianZ" target="_blank" title="Github"><i class="fab fa-github" style="color: #24292e;"></i></a><a class="social-icon" href="mailto:15202078626@163.com" target="_blank" title="Email"><i class="fas fa-envelope" style="color: #4a7dbe;"></i></a></div></div><div class="card-widget card-announcement"><div class="item-headline"><i class="fas fa-bullhorn fa-shake"></i><span>公告</span></div><div class="announcement_content">一个简单快捷的文档知识点查阅网站</div></div><div class="sticky_layout"><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/posts/8816.html" title="集成学习"><img src="/img/machinelearning/ensemble-learning.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="集成学习"/></a><div class="content"><a class="title" href="/posts/8816.html" title="集成学习">集成学习</a><time datetime="2025-01-25T07:12:08.000Z" title="发表于 2025-01-25 15:12:08">2025-01-25</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/posts/95.html" title="决策树算法"><img src="/img/machinelearning/decision-tree.png" onerror="this.onerror=null;this.src='/img/404.jpg'" alt="决策树算法"/></a><div class="content"><a class="title" href="/posts/95.html" title="决策树算法">决策树算法</a><time datetime="2025-01-24T04:39:59.000Z" title="发表于 2025-01-24 12:39:59">2025-01-24</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/60504.html" title="逻辑回归">逻辑回归</a><time datetime="2025-01-20T07:30:08.000Z" title="发表于 2025-01-20 15:30:08">2025-01-20</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/52662.html" title="线性回归">线性回归</a><time datetime="2025-01-19T08:46:51.000Z" title="发表于 2025-01-19 16:46:51">2025-01-19</time></div></div><div class="aside-list-item no-cover"><div class="content"><a class="title" href="/posts/12462.html" title="C lang">C lang</a><time datetime="2025-01-15T12:41:26.000Z" title="发表于 2025-01-15 20:41:26">2025-01-15</time></div></div></div></div><div class="card-widget card-categories"><div class="item-headline">
|
||||
<i class="fas fa-folder-open"></i>
|
||||
<span>分类</span>
|
||||
|
||||
</div>
|
||||
<ul class="card-category-list" id="aside-cat-list">
|
||||
<li class="card-category-list-item "><a class="card-category-list-link" href="/categories/machinelearning/"><span class="card-category-list-name">machinelearning</span><span class="card-category-list-count">5</span></a></li><li class="card-category-list-item "><a class="card-category-list-link" href="/categories/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/"><span class="card-category-list-name">古文观止</span><span class="card-category-list-count">1</span></a></li>
|
||||
</ul></div><div class="card-widget card-tags"><div class="item-headline"><i class="fas fa-tags"></i><span>标签</span></div><div class="card-tag-cloud"><a href="/tags/linear-regression/" style="font-size: 1.1em; color: #999">linear-regression</a> <a href="/tags/KNN/" style="font-size: 1.1em; color: #999">KNN</a> <a href="/tags/logistic-regression/" style="font-size: 1.1em; color: #999">logistic-regression</a> <a href="/tags/%E5%8F%A4%E6%96%87%E8%A7%82%E6%AD%A2/" style="font-size: 1.1em; color: #999">古文观止</a> <a href="/tags/decisiontree/" style="font-size: 1.1em; color: #999">decisiontree</a> <a href="/tags/uniapp/" style="font-size: 1.5em; color: #99a9bf">uniapp</a> <a href="/tags/%E7%BD%91%E7%BB%9C%E4%BB%A3%E7%90%86/" style="font-size: 1.1em; color: #999">网络代理</a> <a href="/tags/C-C/" style="font-size: 1.1em; color: #999">C C++</a> <a href="/tags/ensemble-learning/" style="font-size: 1.1em; color: #999">ensemble-learning</a></div></div><div class="card-widget card-archives"><div class="item-headline"><i class="fas fa-archive"></i><span>归档</span></div><ul class="card-archive-list"><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2025/01/"><span class="card-archive-list-date">一月 2025</span><span class="card-archive-list-count">6</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/09/"><span class="card-archive-list-date">九月 2024</span><span class="card-archive-list-count">4</span></a></li><li class="card-archive-list-item"><a class="card-archive-list-link" href="/archives/2024/08/"><span class="card-archive-list-date">八月 2024</span><span class="card-archive-list-count">8</span></a></li></ul></div><div class="card-widget card-webinfo"><div class="item-headline"><i class="fas fa-chart-line"></i><span>网站资讯</span></div><div class="webinfo"><div class="webinfo-item"><div class="item-name">文章数目 :</div><div class="item-count">18</div></div><div class="webinfo-item"><div class="item-name">已运行时间 :</div><div class="item-count" id="runtimeshow" data-publishDate="2024-07-30T16:00:00.000Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站访客数 :</div><div class="item-count" id="busuanzi_value_site_uv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">本站总访问量 :</div><div class="item-count" id="busuanzi_value_site_pv"><i class="fa-solid fa-spinner fa-spin"></i></div></div><div class="webinfo-item"><div class="item-name">最后更新时间 :</div><div class="item-count" id="last-push-date" data-lastPushDate="2025-10-16T03:29:44.082Z"><i class="fa-solid fa-spinner fa-spin"></i></div></div></div></div></div></div></main><footer id="footer" style="background: transparent"><div id="footer-wrap"><div class="copyright">©2024 - 2025 By shenjianZ</div><div class="framework-info"><span>框架 </span><a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a><span class="footer-separator">|</span><span>主题 </span><a target="_blank" rel="noopener" href="https://github.com/jerryc127/hexo-theme-butterfly">Butterfly</a></div><div class="footer_custom_text"><a target="_blank" rel="noopener" href="https://beian.miit.gov.cn/#/Integrated/recordQuery"><img class="icp-icon" src="https://beian.mps.gov.cn/img/logo01.dd7ff50e.png"><span>备案号:豫ICP备2023019300号</span></a></div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside-config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button id="go-up" type="button" title="回到顶部"><span class="scroll-percent"></span><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/js/utils.js?v=4.13.0"></script><script src="/js/main.js?v=4.13.0"></script><script src="https://cdn.jsdelivr.net/npm/@fancyapps/ui@5.0.33/dist/fancybox/fancybox.umd.min.js"></script><div class="js-pjax"></div><script src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1.1.3/dist/activate-power-mode.min.js"></script><script>POWERMODE.colorful = true;
|
||||
POWERMODE.shake = true;
|
||||
POWERMODE.mobile = false;
|
||||
document.body.addEventListener('input', POWERMODE);
|
||||
</script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script><div id="local-search"><div class="search-dialog"><nav class="search-nav"><span class="search-dialog-title">搜索</span><span id="loading-status"></span><button class="search-close-button"><i class="fas fa-times"></i></button></nav><div class="is-center" id="loading-database"><i class="fas fa-spinner fa-pulse"></i><span> 数据库加载中</span></div><div class="search-wrap"><div id="local-search-input"><div class="local-search-box"><input class="local-search-box--input" placeholder="搜索文章" type="text"/></div></div><hr/><div id="local-search-results"></div><div id="local-search-stats-wrap"></div></div></div><div id="search-mask"></div><script src="/js/search/local-search.js?v=4.13.0"></script></div></div></body></html>
|
||||
167
public/movies/index.html
Normal file
167
public/music/index.html
Normal file
255
public/page/2/index.html
Normal file
172
public/posts/12462.html
Normal file
209
public/posts/14011.html
Normal file
164
public/posts/1441.html
Normal file
173
public/posts/16107.html
Normal file
249
public/posts/29139.html
Normal file
171
public/posts/33957.html
Normal file
164
public/posts/34849.html
Normal file
160
public/posts/41168.html
Normal file
199
public/posts/47807.html
Normal file
222
public/posts/52662.html
Normal file
162
public/posts/58638.html
Normal file
163
public/posts/58817.html
Normal file
228
public/posts/60504.html
Normal file
195
public/posts/61251.html
Normal file
202
public/posts/61252.html
Normal file
215
public/posts/61253.html
Normal file
167
public/posts/8816.html
Normal file
193
public/posts/95.html
Normal file
564
public/search.xml
Normal file
158
public/tags/C-C/index.html
Normal file
158
public/tags/KNN/index.html
Normal file
158
public/tags/decisiontree/index.html
Normal file
158
public/tags/ensemble-learning/index.html
Normal file
167
public/tags/index.html
Normal file
158
public/tags/linear-regression/index.html
Normal file
158
public/tags/logistic-regression/index.html
Normal file
158
public/tags/uniapp/index.html
Normal file
158
public/tags/古文观止/index.html
Normal file
158
public/tags/网络代理/index.html
Normal file
23
source/_data/link.yml
Normal file
@@ -0,0 +1,23 @@
|
||||
- class_name: 友情链接
|
||||
class_desc: 那些人,那些事
|
||||
link_list:
|
||||
- name: Hexo
|
||||
link: https://hexo.io/zh-cn/
|
||||
avatar: https://d33wubrfki0l68.cloudfront.net/6657ba50e702d84afb32fe846bed54fba1a77add/827ae/logo.svg
|
||||
descr: 快速、简单且強大的文档框架
|
||||
|
||||
- class_name: 网站
|
||||
class_desc: 值得推荐的网站
|
||||
link_list:
|
||||
- name: Youtube
|
||||
link: https://www.youtube.com/
|
||||
avatar: https://i.loli.net/2020/05/14/9ZkGg8v3azHJfM1.png
|
||||
descr: 视频网站
|
||||
- name: Weibo
|
||||
link: https://www.weibo.com/
|
||||
avatar: https://i.loli.net/2020/05/14/TLJBum386vcnI1P.png
|
||||
descr: 中国最大社交分享平台
|
||||
- name: Twitter
|
||||
link: https://twitter.com/
|
||||
avatar: https://i.loli.net/2020/05/14/5VyHPQqR6LWF39a.png
|
||||
descr: 社交分享平台
|
||||
@@ -1,8 +0,0 @@
|
||||
---
|
||||
title: About me
|
||||
date: 2024-07-30 17:25:52
|
||||
tags:
|
||||
categories:
|
||||
---
|
||||
|
||||
## about
|
||||
11
source/_posts/ancient/guwenguanzhi/1.md
Normal file
@@ -0,0 +1,11 @@
|
||||
---
|
||||
title: 郑伯克段于鄢
|
||||
tags: 古文观止
|
||||
categories:
|
||||
- 古文观止
|
||||
abbrlink: 58638
|
||||
date: 2024-08-09 20:00:13
|
||||
---
|
||||
原文如下:
|
||||
|
||||
初,郑武公娶于申【申国】,曰武姜【武为武公谥号,姜为其宗族之性】。生庄公及共叔段【共表示其曾出逃到共,叔为老三,段为名】。庄公寤生【出生时头先出,难产】,惊姜氏,故名曰“寤生”, 遂恶之,爱【喜爱】共叔段,欲立【立为储君】之,亟(qì)【多次】请于武公,及庄公即位,为之【共叔段】请制【一个叫制的封地,虎牢关所在】。公曰:“制,岩邑【险要的城邑】也,虢叔死焉,佗【通“他”,其他】邑唯命(是听)。”请京,使居之,谓之“京城大叔”。
|
||||
264
source/_posts/bigdata/hadoop/env.md
Normal file
@@ -0,0 +1,264 @@
|
||||
---
|
||||
title: Hadoop集群搭建基础环境
|
||||
top_img: /img/site01.jpg
|
||||
top_img_height: 800px
|
||||
abbrlink: 61253
|
||||
date: 2024-09-011 22:45:40
|
||||
---
|
||||
|
||||
### 防火墙关闭
|
||||
```bash
|
||||
# 在 6 台主机执行
|
||||
systemctl stop firewalld
|
||||
systemctl disable firewalld
|
||||
```
|
||||
### 配置yum源
|
||||
- 下载 repo 文件:
|
||||
[Centos-7.repo](http://mirrors.aliyun.com/repo/Centos-7.repo)
|
||||
并上传到`/tmp`,进入到`/tmp`
|
||||
- 备份并且替换系统的repo文件
|
||||
``` bash
|
||||
cp Centos-7.repo /etc/yum.repos.d/
|
||||
cd /etc/yum.repos.d/
|
||||
mv CentOS-Base.repo CentOS-Base.repo.bak
|
||||
mv Centos-7.repo CentOS-Base.repo
|
||||
```
|
||||
- 将`nn1`上的`CentOS-Base.repo`拷贝到其他主机
|
||||
```bash
|
||||
scp /etc/yum.repos.d/CentOS-Base.repo root@nn2:/etc/yum.repos.d
|
||||
scp /etc/yum.repos.d/CentOS-Base.repo root@nn3:/etc/yum.repos.d
|
||||
scp /etc/yum.repos.d/CentOS-Base.repo root@s1:/etc/yum.repos.d
|
||||
scp /etc/yum.repos.d/CentOS-Base.repo root@s2:/etc/yum.repos.d
|
||||
scp /etc/yum.repos.d/CentOS-Base.repo root@s3:/etc/yum.repos.d
|
||||
```
|
||||
- 执行yum源更新命令
|
||||
```bash
|
||||
yum clean all
|
||||
yum makecache
|
||||
yum update -y
|
||||
```
|
||||
- 安装常用软件
|
||||
```bash
|
||||
yum install -y openssh-server vim gcc gcc-c++ glibc-headers bzip2-devel lzo-devel curl wget openssh-clients zlib-devel autoconf automake cmake libtool openssl-devel fuse-devel snappy-devel telnet unzip zip net-tools.x86_64 firewalld systemd ntp unrar bzip2
|
||||
```
|
||||
### JDK安装
|
||||
>注意需要在六台机器依次执行
|
||||
- 上传到`/tmp`目录下,安装
|
||||
```bash
|
||||
cd /tmp
|
||||
rpm -ivh jdk-8u144-linux-x64.rpm
|
||||
```
|
||||
- 配置环境变量
|
||||
```bash
|
||||
ln -s /usr/java/jdk1.8.0_144/ /usr/java/jdk1.8
|
||||
echo 'export JAVA_HOME=/usr/java/jdk1.8' >> /etc/profile.d/myEnv.sh
|
||||
echo 'export PATH=$PATH:$JAVA_HOME/bin' >> /etc/profile.d/myEnv.sh
|
||||
source /etc/profile
|
||||
java -version
|
||||
```
|
||||
### 修改主机名和主机名映射
|
||||
|
||||
```bash
|
||||
vim /etc/hostname
|
||||
```
|
||||
6台机器分别为nn1、nn2、nn3、s1、s2、s3
|
||||
|
||||
```bash
|
||||
vim /etc/hosts
|
||||
```
|
||||
|
||||
修改为
|
||||
```text
|
||||
192.168.1.30 nn1
|
||||
192.168.1.31 nn2
|
||||
192.168.1.32 nn3
|
||||
192.168.1.33 s1
|
||||
192.168.1.34 s2
|
||||
192.168.1.35 s3
|
||||
```
|
||||
### 创建hadoop用户
|
||||
```bash
|
||||
#创建hadoop用户
|
||||
useradd hadoop
|
||||
#给hadoop用户设置密码: 12345678
|
||||
passwd hadoop
|
||||
```
|
||||
### 禁止非 wheel 组用户切换到root,配置免密切换root
|
||||
- 修改/etc/pam.d/su配置
|
||||
```bash
|
||||
sed -i 's/#auth\t\trequired\tpam_wheel.so/auth\t\trequired\tpam_wheel.so/g' '/etc/pam.d/su'
|
||||
sed -i 's/#auth\t\tsufficient\tpam_wheel.so/auth\t\tsufficient\tpam_wheel.so/g' '/etc/pam.d/su'
|
||||
```
|
||||
- 修改/etc/login.defs文件
|
||||
```bash
|
||||
echo "SU_WHEEL_ONLY yes" >> /etc/login.defs
|
||||
```
|
||||
- 添加用户到管理员,禁止普通用户su 到 root
|
||||
```bash
|
||||
#把hadoop用户加到wheel组里
|
||||
gpasswd -a hadoop wheel
|
||||
#查看wheel组里是否有hadoop用户
|
||||
cat /etc/group | grep wheel
|
||||
```
|
||||
### 给hadoop用户,配置SSH密钥
|
||||
#### 配置hadoop用户ssh免密码登录到hadoop
|
||||
- 仅在`nn1`执行这段脚本命令即可
|
||||
但是 `su - hadoop ` ,` mkdir ~/.ssh` 需要在其他主机执行一下
|
||||
```bash
|
||||
#切换到hadoop用户
|
||||
su - hadoop
|
||||
#生成ssh公私钥
|
||||
ssh-keygen -t rsa -f ~/.ssh/id_rsa -P ''
|
||||
ssh-copy-id nn1
|
||||
ssh-copy-id nn2
|
||||
ssh-copy-id nn3
|
||||
ssh-copy-id s1
|
||||
ssh-copy-id s2
|
||||
ssh-copy-id s3
|
||||
scp /home/hadoop/.ssh/id_rsa hadoop@nn2:/home/hadoop/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa hadoop@nn3:/home/hadoop/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa hadoop@s1:/home/hadoop/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa hadoop@s2:/home/hadoop/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa hadoop@s3:/home/hadoop/.ssh
|
||||
```
|
||||
#### 配置hadoop用户ssh免密码登录到root
|
||||
- 同上
|
||||
```bash
|
||||
ssh-copy-id root@nn1
|
||||
ssh-copy-id root@ nn2
|
||||
ssh-copy-id root@nn3
|
||||
ssh-copy-id root@s1
|
||||
ssh-copy-id root@s2
|
||||
ssh-copy-id root@s3
|
||||
scp /home/hadoop/.ssh/id_rsa root@nn2:/root/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa root@nn3:/root/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa root@s1:/root/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa root@s2:/root/.ssh
|
||||
scp /home/hadoop/.ssh/id_rsa root@s3:/root/.ssh
|
||||
```
|
||||
### 脚本配置
|
||||
- **ips**
|
||||
```bash
|
||||
vim /home/hadoop/bin/ips
|
||||
```
|
||||
|
||||
```bash
|
||||
nn1
|
||||
nn2
|
||||
nn3
|
||||
s1
|
||||
s2
|
||||
s3
|
||||
```
|
||||
- **ssh_all.sh**
|
||||
```bash
|
||||
vim /home/hadoop/bin/ssh_all.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
#! /bin/bash
|
||||
# 进入到当前脚本所在目录
|
||||
cd `dirname $0`
|
||||
# 获取当前脚本所在目录
|
||||
dir_path=`pwd`
|
||||
#echo $dir_path
|
||||
# 读ips文件得到数组(里面是一堆主机名)
|
||||
ip_arr=(`cat $dir_path/ips`)
|
||||
# 遍历数组里的主机名
|
||||
for ip in ${ip_arr[*]}
|
||||
do
|
||||
# 拼接ssh命令: ssh hadoop@nn1.hadoop ls
|
||||
cmd_="ssh hadoop@${ip} \"$*\" "
|
||||
echo $cmd_
|
||||
# 通过eval命令 执行 拼接的ssh 命令
|
||||
if eval ${cmd_} ; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
done
|
||||
```
|
||||
- **ssh_root.sh**
|
||||
```bash
|
||||
#! /bin/bash
|
||||
# 进入到当前脚本所在目录
|
||||
cd `dirname $0`
|
||||
# 获取当前脚本所在目录
|
||||
dir_path=`pwd`
|
||||
#echo $dir_path
|
||||
# 读ips文件得到数组(里面是一堆主机名)
|
||||
ip_arr=(`cat $dir_path/ips`)
|
||||
# 遍历数组里的主机名
|
||||
for ip in ${ip_arr[*]}
|
||||
do
|
||||
# 拼接ssh命令: ssh hadoop@nn1.hadoop ls
|
||||
cmd_="ssh hadoop@${ip} ~/bin/exe.sh \"$*\""
|
||||
echo $cmd_
|
||||
# 通过eval命令 执行 拼接的ssh 命令
|
||||
if eval ${cmd_} ; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
done
|
||||
```
|
||||
- **scp_all.sh**
|
||||
```bash
|
||||
#! /bin/bash
|
||||
# 进入到当前脚本所在目录
|
||||
cd `dirname $0`
|
||||
# 获取当前脚本所在目录
|
||||
dir_path=`pwd`
|
||||
#echo $dir_path
|
||||
# 读ips文件得到数组(里面是一堆主机名)
|
||||
ip_arr=(`cat $dir_path/ips`)
|
||||
# 源
|
||||
source_=$1
|
||||
# 目标
|
||||
target=$2
|
||||
# 遍历数组里的主机名
|
||||
for ip in ${ip_arr[*]}
|
||||
do
|
||||
# 拼接scp命令: scp 源 hadoop@nn1.hadoop:目标
|
||||
cmd_="scp -r ${source_} hadoop@${ip}:${target}"
|
||||
echo $cmd_
|
||||
# 通过eval命令 执行 拼接的scp 命令
|
||||
if eval ${cmd_} ; then
|
||||
echo "OK"
|
||||
else
|
||||
echo "FAIL"
|
||||
fi
|
||||
done
|
||||
```
|
||||
- **exe.sh**
|
||||
```bash
|
||||
#切换到root用户执行cmd命令
|
||||
cmd=$*
|
||||
su - << EOF
|
||||
$cmd
|
||||
EOF
|
||||
```
|
||||
- 赋予执行权限
|
||||
```bash
|
||||
chmod +x ssh_all.sh
|
||||
chmod +x scp_all.sh
|
||||
chmod +x ssh_root.sh
|
||||
chmod +x exe.sh
|
||||
```
|
||||
- 分发到其他主机
|
||||
```bash
|
||||
./ssh_all.sh mkdir /home/hadoop/bin
|
||||
./scp_all.sh /home/hadoop/bin/ips /home/hadoop/bin/
|
||||
./scp_all.sh /home/hadoop/bin/exe.sh /home/hadoop/bin/
|
||||
./scp_all.sh /home/hadoop/bin/ssh_all.sh /home/hadoop/bin/
|
||||
./scp_all.sh /home/hadoop/bin/scp_all.sh /home/hadoop/bin/
|
||||
./scp_all.sh /home/hadoop/bin/ssh_root.sh /home/hadoop/bin/
|
||||
```
|
||||
|
||||
- 将 `/home/hadoop/bin`添加到hadoop用户的环境变量,需要切换到`hadoop`用户
|
||||
|
||||
```bash
|
||||
echo 'export PATH=$PATH:/home/hadoop/bin' >> ~/.bashrc && source ~/.bashrc
|
||||
scp_all.sh /home/hadoop/.bashrc /home/hadoop/
|
||||
ssh_all.sh source ~/.bashrc
|
||||
```
|
||||
294
source/_posts/bigdata/hadoop/hdfs.md
Normal file
@@ -0,0 +1,294 @@
|
||||
---
|
||||
title: Hadoop集群HDFS配置
|
||||
top_img: /img/site01.jpg
|
||||
top_img_height: 800px
|
||||
abbrlink: 61252
|
||||
date: 2024-09-011 22:45:40
|
||||
---
|
||||
|
||||
### 上传`hadoop-3.1.4.tar.gz`到`/tmp`,解压
|
||||
>注意在六台机器均上传到`/tmp`
|
||||
```bash
|
||||
# 在6台机器执行
|
||||
sudo tar -zxvf /tmp/hadoop-3.1.4.tar.gz -C /usr/local/
|
||||
# 分发到其他主机
|
||||
ssh_root.sh chown -R hadoop:hadoop /usr/local/hadoop-3.1.4
|
||||
ssh_root.sh ln -s /usr/local/hadoop-3.1.4/ /usr/local/hadoop
|
||||
```
|
||||
### 配置环境变量
|
||||
```bash
|
||||
echo 'export HADOOP_HOME=/usr/local/hadoop' >> /etc/profile.d/myEnv.sh
|
||||
echo 'export PATH=$PATH:$HADOOP_HOME/bin' >> /etc/profile.d/myEnv.sh
|
||||
echo 'export PATH=$PATH:$HADOOP_HOME/sbin' >> /etc/profile.d/myEnv.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
# 分发到nn2、nn3、s1、s2、s3
|
||||
scp_all.sh /etc/profile.d/myEnv.sh /etc/profile.d/
|
||||
# source 环境变量
|
||||
ssh_root.sh source /etc/profile
|
||||
```
|
||||
>还需要创建 `/data`这个目录,由于nn1、nn2、nn3已经创建`/data`,其他三台需要创建一下
|
||||
```bash
|
||||
### 在s1、s2、s3执行
|
||||
sudo mkdir /data
|
||||
sudo chown -R hadoop:hadoop /data
|
||||
```
|
||||
|
||||
### 修改core-site.xml
|
||||
```bash
|
||||
vim /usr/local/hadoop/etc/hadoop/core-site.xml
|
||||
```
|
||||
|
||||
```xml
|
||||
<configuration>
|
||||
<property>
|
||||
<name>fs.defaultFS</name>
|
||||
<value>hdfs://ns1</value>
|
||||
<description>默认文件服务的协议和NS逻辑名称,和hdfs-site.xml里的对应此配置替代了1.0里的fs.default.name</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>hadoop.tmp.dir</name>
|
||||
<value>/data/tmp</value>
|
||||
<description>数据存储目录</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>hadoop.proxyuser.root.groups</name>
|
||||
<value>hadoop</value>
|
||||
<description>
|
||||
hdfs dfsadmin –refreshSuperUserGroupsConfiguration,
|
||||
yarn rmadmin –refreshSuperUserGroupsConfiguration
|
||||
使用这两个命令不用重启就能刷新
|
||||
</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>hadoop.proxyuser.root.hosts</name>
|
||||
<value>localhost</value>
|
||||
<description>本地代理</description>
|
||||
</property>
|
||||
|
||||
<!-- zkfc的配置 -->
|
||||
<property>
|
||||
<name>ha.zookeeper.quorum</name>
|
||||
<value>nn1:2181,nn2:2181,nn3:2181</value>
|
||||
<description>HA使用的zookeeper地址</description>
|
||||
</property>
|
||||
</configuration>
|
||||
```
|
||||
### 修改`hdfs-site.xml`
|
||||
```bash
|
||||
vim /usr/local/hadoop/etc/hadoop/hdfs-site.xml
|
||||
```
|
||||
|
||||
```xml
|
||||
<configuration>
|
||||
<property>
|
||||
<name>dfs.namenode.name.dir</name>
|
||||
<value>/data/namenode</value>
|
||||
<description>namenode本地文件存放地址</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.nameservices</name>
|
||||
<value>ns1</value>
|
||||
<description>提供服务的NS逻辑名称,与core-site.xml里的对应</description>
|
||||
</property>
|
||||
|
||||
<!-- namenode的配置 -->
|
||||
<!-- 主要的 -->
|
||||
<property>
|
||||
<name>dfs.ha.namenodes.ns1</name>
|
||||
<value>nn1,nn2,nn3</value>
|
||||
<description>列出该逻辑名称下的NameNode逻辑名称</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.namenode.rpc-address.ns1.nn1</name>
|
||||
<value>nn1:9000</value>
|
||||
<description>指定NameNode的RPC位置</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.namenode.http-address.ns1.nn1</name>
|
||||
<value>nn1:50070</value>
|
||||
<description>指定NameNode的Web Server位置</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.namenode.rpc-address.ns1.nn2</name>
|
||||
<value>nn2:9000</value>
|
||||
<description>指定NameNode的RPC位置</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.namenode.http-address.ns1.nn2</name>
|
||||
<value>nn2:50070</value>
|
||||
<description>指定NameNode的Web Server位置</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.namenode.rpc-address.ns1.nn3</name>
|
||||
<value>nn3:9000</value>
|
||||
<description>指定NameNode的RPC位置</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.namenode.http-address.ns1.nn3</name>
|
||||
<value>nn3:50070</value>
|
||||
<description>指定NameNode的Web Server位置</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.namenode.handler.count</name>
|
||||
<value>77</value>
|
||||
<description>namenode的工作线程数</description>
|
||||
</property>
|
||||
|
||||
<!-- journaldata配置,使得其他两个namenode同步第一个namenode数据 -->
|
||||
<property>
|
||||
<name>dfs.namenode.shared.edits.dir</name>
|
||||
<value>qjournal://nn1:8485;nn2:8485;nn3:8485/ns1</value>
|
||||
<description>指定用于HA存放edits的共享存储,通常是namenode的所在机器</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.journalnode.edits.dir</name>
|
||||
<value>/data/journaldata/</value>
|
||||
<description>journaldata服务存放文件的地址</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>ipc.client.connect.max.retries</name>
|
||||
<value>10</value>
|
||||
<description>namenode和journalnode的链接重试次数10次</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>ipc.client.connect.retry.interval</name>
|
||||
<value>10000</value>
|
||||
<description>重试的间隔时间10s</description>
|
||||
</property>
|
||||
|
||||
<!-- zkfc的配置 -->
|
||||
<property>
|
||||
<name>dfs.ha.fencing.methods</name>
|
||||
<value>sshfence</value>
|
||||
<description>指定HA做隔离的方法,缺省是ssh,可设为shell,稍后详述</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.ha.fencing.ssh.private-key-files</name>
|
||||
<value>/home/hadoop/.ssh/id_rsa</value>
|
||||
<description>杀死命令脚本的免密配置秘钥</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.client.failover.proxy.provider.ns1</name>
|
||||
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
|
||||
<description>指定客户端用于HA切换的代理类,不同的NS可以用不同的代理类以上示例为Hadoop 2.0自带的缺省代理类</description>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.client.failover.proxy.provider.auto-ha</name>
|
||||
<value>org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider</value>
|
||||
</property>
|
||||
|
||||
<property>
|
||||
<name>dfs.ha.automatic-failover.enabled</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
<!-- datanode配置 -->
|
||||
<property>
|
||||
<name>dfs.datanode.data.dir</name>
|
||||
<value>/data/datanode</value>
|
||||
<description>datanode本地文件存放地址</description>
|
||||
</property>
|
||||
<property>
|
||||
<name>dfs.replication</name>
|
||||
<value>3</value>
|
||||
<description>文件复本数</description>
|
||||
</property>
|
||||
<property>
|
||||
<name>dfs.namenode.datanode.registration.ip-hostname-check</name>
|
||||
<value>false</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>dfs.client.use.datanode.hostname</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property>
|
||||
<name>dfs.datanode.use.datanode.hostname</name>
|
||||
<value>true</value>
|
||||
</property>
|
||||
</configuration>
|
||||
```
|
||||
### 修改`hadoop-env.sh`
|
||||
```bash
|
||||
vim /usr/local/hadoop/etc/hadoop/hadoop-env.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
# 添加这两行
|
||||
source /etc/profile
|
||||
export HADOOP_HEAPSIZE_MAX=512
|
||||
```
|
||||
### 分发这些配置文件
|
||||
```bash
|
||||
scp_all.sh /usr/local/hadoop/etc/hadoop/core-site.xml /usr/local/hadoop/etc/hadoop/
|
||||
scp_all.sh /usr/local/hadoop/etc/hadoop/hdfs-site.xml /usr/local/hadoop/etc/hadoop/
|
||||
scp_all.sh /usr/local/hadoop/etc/hadoop/hadoop-env.sh /usr/local/hadoop/etc/hadoop/
|
||||
```
|
||||
### 集群初始化
|
||||
- 需要先启动zookeeper集群
|
||||
```bash
|
||||
ssh_all_zookeeper.sh /usr/local/zookeeper/bin/zkServer.sh start
|
||||
```
|
||||
|
||||
```bash
|
||||
# 第一次启动先启动journalnode,便于3个namenode的元数据同步
|
||||
ssh_all_zookeeper.sh hadoop-daemon.sh start journalnode
|
||||
```
|
||||
- `zkfc`搭建
|
||||
```bash
|
||||
#在nn1节点执行
|
||||
hdfs zkfc -formatZK
|
||||
#nn1 nn2 nn3启动zkfc
|
||||
hadoop-daemon.sh start zkfc
|
||||
```
|
||||
- 初始化nn1的namenode,在nn1执行
|
||||
```bash
|
||||
hdfs namenode -format
|
||||
hadoop-daemon.sh start namenode
|
||||
```
|
||||
- 格式化第二台和第三台namenode,并且启动namenode,在nn2、nn3执行
|
||||
```bash
|
||||
hdfs namenode -bootstrapStandby
|
||||
hadoop-daemon.sh start namenode
|
||||
```
|
||||
- 修改**workers**
|
||||
```bash
|
||||
vim /usr/local/hadoop/etc/hadoop/workers
|
||||
```
|
||||
修改为
|
||||
```text
|
||||
s1
|
||||
s2
|
||||
s3
|
||||
```
|
||||
分发给其他机器
|
||||
```bash
|
||||
scp_all.sh /usr/local/hadoop/etc/hadoop/workers /usr/local/hadoop/etc/hadoop
|
||||
```
|
||||
- 启动datanode节点,在s1、s2、s3执行
|
||||
|
||||
```bash
|
||||
#启动各个节点的datanode
|
||||
hadoop-daemons.sh start datanode
|
||||
```
|
||||
### 集群启动
|
||||
```bash
|
||||
start-dfs.sh
|
||||
```
|
||||
114
source/_posts/bigdata/hadoop/zookeper.md
Normal file
@@ -0,0 +1,114 @@
|
||||
---
|
||||
title: Hadoop集群Zookeeper配置
|
||||
top_img: /img/site01.jpg
|
||||
top_img_height: 800px
|
||||
abbrlink: 61251
|
||||
date: 2024-09-011 22:45:40
|
||||
---
|
||||
|
||||
### Zookeeper脚本配置
|
||||
- 拷贝ips
|
||||
```bash
|
||||
cp ips ips_zookeeper
|
||||
```
|
||||
修改为
|
||||
```bash
|
||||
nn1
|
||||
nn2
|
||||
nn3
|
||||
```
|
||||
- 拷贝三个脚本
|
||||
```bash
|
||||
cp scp_all.sh scp_all_zookeeper.sh
|
||||
cp ssh_all.sh ssh_all_zookeeper.sh
|
||||
cp ssh_root.sh ssh_root_zookeeper.sh
|
||||
```
|
||||
- 修改脚本
|
||||
```shell
|
||||
vim scp_all_zookeeper.sh
|
||||
vim ssh_all_zookeeper.sh
|
||||
vim ssh_root_zookeeper.sh
|
||||
```
|
||||
|
||||
将三个脚本中的ips改为ips_zookeeper
|
||||
### Zookeeper安装
|
||||
- 上传到`/tmp`目录下,解压
|
||||
```bash
|
||||
sudo tar -zxvf /tmp/zookeeper-3.4.8.tar.gz -C /usr/local/
|
||||
scp -r /usr/local/zookeeper-3.4.8/ root@nn2:/usr/local/
|
||||
scp -r /usr/local/zookeeper-3.4.8/ root@nn3:/usr/local/
|
||||
ssh_root_zookeeper.sh chown -R hadoop:hadoop /usr/local/zookeeper-3.4.8
|
||||
ssh_root_zookeeper.s ln -s /usr/local/zookeeper-3.4.8/ /usr/local/zookeeper
|
||||
```
|
||||
### Zookeeper配置
|
||||
- zoo.cfg配置
|
||||
```bash
|
||||
cd /usr/local/zookeeper/conf/
|
||||
cp zoo_sample.cfg zoo.cfg
|
||||
```
|
||||
然后`vim zoo.cfg`,修改如下:
|
||||
```properties
|
||||
# 修改dataDir
|
||||
dataDir=/data/zookeeper
|
||||
# 添加一下内容
|
||||
server.1=nn1:2888:3888
|
||||
server.2=nn2:2888:3888
|
||||
server.3=nn3:2888:3888
|
||||
```
|
||||
分发给nn2、nn3
|
||||
`scp_all_zookeeper.sh /usr/local/zookeeper/conf/zoo.cfg /usr/local/zookeeper/conf/`
|
||||
|
||||
- `zkEnv.sh`配置
|
||||
`vim /usr/local/zookeeper/bin/zkEnv.sh`
|
||||

|
||||
分发到nn2、nn3
|
||||
```bash
|
||||
scp_all_zookeeper.sh /usr/local/zookeeper/bin/zkEnv.sh /usr/local/zookeeper/bin/
|
||||
```
|
||||
- 创建zookeeper数据目录
|
||||
```bash
|
||||
ssh_root_zookeeper.sh mkdir -p /data/zookeeper
|
||||
ssh_root_zookeeper.sh chown -R hadoop:hadoop /data
|
||||
```
|
||||
- 创建myid文件
|
||||
```bash
|
||||
ssh nn1 'echo "1" > /data/zookeeper/myid'
|
||||
ssh nn2 'echo "2" > /data/zookeeper/myid'
|
||||
ssh nn3 'echo "3" > /data/zookeeper/myid'
|
||||
```
|
||||
- 配置Zookeeper环境变量
|
||||
```bash
|
||||
# 在其他所有主机也执行
|
||||
sudo chown -R hadoop:hadoop /etc/profile.d/myEnv.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
echo 'export ZOOKEEPER_HOME=/usr/local/zookeeper' >> /etc/profile.d/myEnv.sh
|
||||
echo 'export PATH=$PATH:$ZOOKEEPER_HOME/bin' >> /etc/profile.d/myEnv.sh
|
||||
```
|
||||
|
||||
```bash
|
||||
# 分发到nn2、nn3
|
||||
scp_all_zookeeper.sh /etc/profile.d/myEnv.sh /etc/profile.d/
|
||||
# source 环境变量
|
||||
ssh_all_zookeeper.sh source /etc/profile
|
||||
```
|
||||
### Zookeeper的命令
|
||||
```bash
|
||||
#启动zk服务
|
||||
ssh_all_zookeeper.sh /usr/local/zookeeper/bin/zkServer.sh start
|
||||
#查看每个机器ZK运行的状态
|
||||
ssh_all_zookeeper.sh /usr/local/zookeeper/bin/zkServer.sh status
|
||||
#整体停止服务
|
||||
ssh_all_zookeeper.sh /usr/local/zookeeper/bin/zkServer.sh stop
|
||||
#重启zk服务
|
||||
ssh_all_zookeeper.sh /usr/local/zookeeper/bin/zkServer.sh restart
|
||||
```
|
||||
|
||||
```shell
|
||||
#启动zookeeper客户端,并连接zookeeper集群
|
||||
/usr/local/zookeeper/bin/zkCli.sh -server nn1:2181
|
||||
# 可以简化为:
|
||||
zkCli.sh
|
||||
```
|
||||
|
||||
62
source/_posts/frontend/deploy/deploy.md
Normal file
@@ -0,0 +1,62 @@
|
||||
---
|
||||
title: Docker被墙,如何继续使用?
|
||||
top_img: /img/site01.jpg
|
||||
top_img_height: 800px
|
||||
abbrlink: 47807
|
||||
date: 2024-08-01 09:10:40
|
||||
tags:
|
||||
---
|
||||
|
||||
## Docker Download
|
||||
> 自从docker官方仓库在中国大陆被墙后,docker的部署方式也发生了改变。
|
||||
> 解决docker安装问题:https://github.com/shenjianZ/docker_installer
|
||||
|
||||
1. 安装docker
|
||||
```shell
|
||||
sudo curl -fsSL https://gitee.com/tech-shrimp/docker_installer/releases/download/latest/linux.sh| bash -s docker --mirror Aliyun
|
||||
```
|
||||
|
||||
2. 启动docker
|
||||
```shell
|
||||
sudo systemctl start docker
|
||||
```
|
||||
|
||||
3. 设置开机自启
|
||||
```shell
|
||||
sudo systemctl enable docker
|
||||
```
|
||||
|
||||
4. Docker pull images
|
||||
> 将image下载到阿里云镜像仓库中
|
||||
> 解决docker pull 镜像问题:https://github.com/shenjianZ/docker_image_pusher
|
||||
|
||||
1. **登录阿里云镜像服务** https://cr.console.aliyun.com/,
|
||||
|
||||
启用个人实例,创建一个命名空间(`ALIYUN_NAME_SPACE`)
|
||||
|
||||
2. 在**访问凭证** 可以看到账号 用户名(`ALIYUN_REGISTRY_USER`)
|
||||
|
||||
密码(`ALIYUN_REGISTRY_PASSWORD`)
|
||||
|
||||
仓库地址(`ALIYUN_REGISTRY`)
|
||||
|
||||
3. **启动Action**
|
||||
进入您自己的项目,点击`Action`,启用`Github Action`功能
|
||||
|
||||
4. **配置环境变量**
|
||||
进入Settings->Secret and variables->Actions->New Repository secret
|
||||
将上一步的四个值
|
||||
`ALIYUN_NAME_SPACE`,
|
||||
|
||||
` ALIYUN_REGISTRY_USER`,
|
||||
|
||||
`ALIYUN_REGISTRY_PASSWORD`,
|
||||
|
||||
`ALIYUN_REGISTRY`
|
||||
配置成环境变量
|
||||
|
||||
5. **添加镜像**
|
||||
打开`images.txt`文件,添加你想要的镜像 可以加tag
|
||||
|
||||
6. 使用镜像
|
||||
回到阿里云,镜像仓库,点击任意镜像,可查看镜像状态。(可以改成公开,拉取镜像免登录)
|
||||
9
source/_posts/frontend/frontend.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: page
|
||||
abbrlink: 1441
|
||||
date: 2024-08-01 09:00:10
|
||||
tags:
|
||||
---
|
||||
|
||||
- [deploy](./deploy)
|
||||
-
|
||||
57
source/_posts/frontend/uniapp/component1.md
Normal file
@@ -0,0 +1,57 @@
|
||||
---
|
||||
title: 组件使用
|
||||
tags: uniapp
|
||||
abbrlink: 33957
|
||||
date: 2024-08-05 14:07:01
|
||||
---
|
||||
|
||||
### 组件自动导入
|
||||
```json
|
||||
"easycom":{
|
||||
"autoscan": true,
|
||||
"custom": {
|
||||
"^tui-(.*)": "@/components/thorui/tui-$1/tui-$1.vue" // 匹配components目录内的vue文件
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### `tui-sticky 吸顶容器`
|
||||
|
||||
> 包含 以下 `tui` 组件 :
|
||||
> - tui-sticky
|
||||
> - tui-list-view
|
||||
> - tui-list-cell
|
||||
>
|
||||
|
||||
```html
|
||||
<tui-sticky :scrollTop="scrollTop" stickyHeight="104rpx" container>
|
||||
<!-- header start -->
|
||||
<template v-slot:header>
|
||||
<view class="sticky-item">
|
||||
<view class="setting">设置</view>
|
||||
</view>
|
||||
</template>
|
||||
<!-- header end -->
|
||||
<!--内容 start-->
|
||||
<template v-slot:content>
|
||||
<tui-list-view class="content">
|
||||
<tui-list-cell :arrow="false">
|
||||
<switch class='switch' checked color="#FFCC33" />
|
||||
</tui-list-cell>
|
||||
</tui-list-view>
|
||||
</template>
|
||||
<!--内容 end-->
|
||||
</tui-sticky>
|
||||
|
||||
<script setup>
|
||||
import { ref } from 'vue'
|
||||
import { onPageScroll } from '@dcloudio/uni-app'
|
||||
|
||||
// 定义 scrollTop 响应式变量
|
||||
const scrollTop = ref(0)
|
||||
// 监听页面滚动事件
|
||||
onPageScroll((e) => {
|
||||
scrollTop.value = e.scrollTop
|
||||
})
|
||||
</script>
|
||||
```
|
||||
7
source/_posts/frontend/uniapp/uniapp.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: uniapp 开发
|
||||
tags: uniapp
|
||||
abbrlink: 58817
|
||||
date: 2024-08-05 14:07:01
|
||||
---
|
||||
- [uniapp component](../component1)
|
||||
@@ -1,5 +1,6 @@
|
||||
---
|
||||
title: Hello World
|
||||
abbrlink: 16107
|
||||
---
|
||||
Welcome to [Hexo](https://hexo.io/)! This is your very first post. Check [documentation](https://hexo.io/docs/) for more info. If you get any problems when using Hexo, you can find the answer in [troubleshooting](https://hexo.io/docs/troubleshooting.html) or you can ask me on [GitHub](https://github.com/hexojs/hexo/issues).
|
||||
|
||||
|
||||
81
source/_posts/language/C.md
Normal file
@@ -0,0 +1,81 @@
|
||||
---
|
||||
title: C lang
|
||||
tags: C C++
|
||||
abbrlink: 12462
|
||||
date: 2025-01-15 20:41:26
|
||||
---
|
||||
|
||||
### c lang在windows下的开发(VS code)
|
||||
[WinLibs - GCC+MinGW-w64 compiler for Windows](https://winlibs.com/#download-release)下载你需要的版本
|
||||
解压到`D:\ProgramModule`,并将 `bin\`加入环境变量`PATH`
|
||||
打开新的`Terminal`输入`gcc -v`,查看`gcc`是否安装成功
|
||||
在`VS code` 的插件管理下载`Code Runner`、`C\C++`这两个插件
|
||||
在`*.c`源文件的内容区,右键点击`Run Code` ,即可运行成功
|
||||

|
||||
|
||||
### 数据类型
|
||||
- 整数类型
|
||||
```c
|
||||
short a = 12;
|
||||
int b = 100;
|
||||
long c = 1000L;
|
||||
long long d = 1000000LL;
|
||||
unsigned int e = 10;
|
||||
printf("a: %hd\n",a);
|
||||
printf("b: %d\n",b);
|
||||
printf("c: %ld\n",c);
|
||||
printf("d: %lld\n",d);
|
||||
printf("e: %u\n",e);
|
||||
printf("f: %.3f\n",f);
|
||||
```
|
||||
- 小数类型
|
||||
```c
|
||||
float f = 3.14F;
|
||||
printf("f: %.3f\n",f);
|
||||
double g = 5.65;
|
||||
printf("g: %.2lf\n",g);
|
||||
```
|
||||
- 字符类型
|
||||
```c
|
||||
char h = 'x';
|
||||
printf("x: %c\n",x);
|
||||
```
|
||||
### 类型转换
|
||||
- 隐式转换
|
||||
- 强制转换
|
||||
```c
|
||||
int b = 23;
|
||||
short c = (short) b;
|
||||
```
|
||||
### 数组
|
||||
```c
|
||||
#include <stdio.h>
|
||||
|
||||
int main(){
|
||||
int arr [10] = {2,3,4,5,6,7,8,9,10,11};
|
||||
arr[0] = 1525;
|
||||
*(arr+1) = 25;
|
||||
int len = sizeof(arr)/sizeof(arr[0]);
|
||||
void printArr(int arr[], int len){
|
||||
for (int i = 0; i < len;i++){
|
||||
printf("%d\t",arr[i]);
|
||||
}
|
||||
}
|
||||
printArr(arr,len);
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
### 指针
|
||||
```c
|
||||
// swap the value of a and b
|
||||
void swap(int* x, int* y){
|
||||
int temp = *x;
|
||||
*x = *y;
|
||||
*y = temp;
|
||||
|
||||
}
|
||||
int a = 5;
|
||||
int b = 10;
|
||||
swap(&a, &b);
|
||||
printf("a = %d b = %d\n", a, b);
|
||||
```
|
||||
60
source/_posts/linux/script.md
Normal file
@@ -0,0 +1,60 @@
|
||||
---
|
||||
title: script
|
||||
abbrlink: 34849
|
||||
date: 2024-08-17 11:09:24
|
||||
tags:
|
||||
---
|
||||
|
||||
### 查看CPU、内存使用率
|
||||
```bash
|
||||
#!/bin/bash
|
||||
|
||||
# 定义颜色
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
YELLOW='\033[0;33m'
|
||||
BLUE='\033[0;34m'
|
||||
NC='\033[0m' # 无颜色
|
||||
|
||||
while true; do
|
||||
# 获取所有进程的CPU使用率和内存使用率
|
||||
cpu_usage=$(ps aux | awk '{sum_cpu += $3} END {print sum_cpu}')
|
||||
mem_usage=$(ps aux | awk '{sum_mem += $4} END {print sum_mem}')
|
||||
|
||||
# 打印结果,带有时间戳、分隔线和颜色高亮
|
||||
echo -e "${BLUE}==============================${NC}"
|
||||
echo -e "${YELLOW}Timestamp: $(date)${NC}"
|
||||
echo -e "${BLUE}==============================${NC}"
|
||||
echo -e "${GREEN}Total CPU usage: ${RED}$cpu_usage%${NC}"
|
||||
echo -e "${GREEN}Total Memory usage: ${RED}$mem_usage%${NC}"
|
||||
echo -e "${BLUE}==============================${NC}"
|
||||
|
||||
# 等待5秒后再次执行
|
||||
sleep 5
|
||||
done
|
||||
|
||||
```
|
||||
**保存脚本到/usr/local/bin目录下**
|
||||
```bash
|
||||
mv usage.sh /usr/local/bin/usage
|
||||
```
|
||||
|
||||
### Shell脚本编写的基本信息
|
||||
|
||||
```bash
|
||||
#! /bin/bash
|
||||
# -------------------------------------------------
|
||||
# Filename: test.sh
|
||||
# Version: 1.0
|
||||
# Date: 2024/05/02
|
||||
# Author: shenjianZ
|
||||
# Email: shenjianZLT@gmail.com
|
||||
# Website: https://blog.shenjianl.cn
|
||||
# Description: this is a test shell
|
||||
# CopyRight: 2024 All rights reserved shenjianZ
|
||||
# License GPL
|
||||
# ------------------------------------------------
|
||||
|
||||
|
||||
# Your script logic goes here
|
||||
```
|
||||
214
source/_posts/machinelearning/decisiontree.md
Normal file
@@ -0,0 +1,214 @@
|
||||
---
|
||||
title: 决策树算法
|
||||
tags: decisiontree
|
||||
categories: machinelearning
|
||||
abbrlink: 95
|
||||
date: 2025-01-24 12:39:59
|
||||
cover: /img/machinelearning/decision-tree.png
|
||||
top_img: /img/site01.jpg
|
||||
---
|
||||
|
||||
### C4.5
|
||||
C4.5 是一种用于生成决策树的算法,不再使用信息增益,而是使用信息增益比,来避免偏向于选择取值较多的特征。信息增益比是信息增益与特征的熵的比值。
|
||||
### ID3
|
||||
D3 是一种基于信息增益(Information Gain)的决策树算法
|
||||
### Cart
|
||||
CART(分类与回归树)一种决策树算法,,CART 使用 **二叉树结构**,即每个节点只能有两个子节点。
|
||||
### cart剪枝
|
||||
CART 决策树的剪枝方法分为 **预剪枝**(Pre-pruning)和 **后剪枝**(Post-pruning)两种:
|
||||
#### **预剪枝**:
|
||||
预剪枝是在构建决策树时就决定是否停止进一步划分某个节点。主要通过以下标准来控制:
|
||||
- 当某个节点的样本数小于某个阈值时,不再继续划分。
|
||||
- 当某个节点的 Gini 不纯度小于某个阈值时,不再继续划分。
|
||||
预剪枝的优点是能够减少计算量,但缺点是可能会导致模型不够复杂,从而产生欠拟合。
|
||||
#### **后剪枝**:
|
||||
后剪枝是在决策树完全构建出来之后,对树进行修剪。具体过程如下:
|
||||
- 构建完整的决策树。
|
||||
- 从叶子节点开始,逐渐向上遍历树的每个节点。
|
||||
- 对每个节点进行判断,是否合适剪去该节点及其子树。如果剪去该子树后,模型的性能没有显著下降,就可以剪枝。
|
||||
后剪枝通过避免过度拟合来提高模型的泛化能力,但其计算开销较大。
|
||||
### 特征工程(特征提取)
|
||||
- **字典特征提取**
|
||||
主要用于处理包含键值对(key-value pairs)的数据结构
|
||||
```python
|
||||
from sklearn.feature_extraction import DictVectorizer
|
||||
# 字典特征提取
|
||||
data = [
|
||||
{'city': 'beijing', 'temperature': 100},
|
||||
{'city': 'shanghai', 'temperature': 95},
|
||||
{'city': 'guangzhou', 'temperature': 98}
|
||||
]
|
||||
transfer = DictVectorizer(sparse=False)
|
||||
new_data = transfer.fit_transform(data)
|
||||
print(transfer.feature_names_)
|
||||
print(new_data)
|
||||
```
|
||||
- **文本特征提取**
|
||||
主要用于将文本数据(如句子、段落、文章等)转换成数值型特征。这对于文本分类、信息检索等任务非常重要。
|
||||
```python
|
||||
from sklearn.feature_extraction.text import CountVectorizer
|
||||
# 示例文本数据
|
||||
data = [
|
||||
"I love programming",
|
||||
"Python is great",
|
||||
"I love machine learning"
|
||||
]
|
||||
# 创建 CountVectorizer 对象
|
||||
transfer = CountVectorizer()
|
||||
# 将文本数据转换为特征向量
|
||||
new_data = transfer.fit_transform(data)
|
||||
# 输出特征名称
|
||||
print("Feature Names:", transfer.get_feature_names_out())
|
||||
# 输出转换后的特征矩阵
|
||||
print("Transformed Data:", new_data.toarray())
|
||||
```
|
||||
- 文本特征提取(中文文本)
|
||||
```python
|
||||
from sklearn.feature_extraction.text import CountVectorizer
|
||||
import jieba
|
||||
# 中文文本数据(大于20个字)
|
||||
data = [
|
||||
"我热爱编程,学习编程语言是一件非常有趣的事情,它能够提升我们解决问题的能力,编程让我变得更加有创意。",
|
||||
"Python语言是一门非常强大的编程语言,具有简洁的语法和丰富的库,可以帮助开发者更高效地完成任务。",
|
||||
"机器学习是一项非常有前途的技术,它能够让计算机从数据中自动学习,逐步提高模型的精确度,解决实际问题。"
|
||||
|
||||
]
|
||||
# 使用jieba分词
|
||||
text_list = []
|
||||
for line in data:
|
||||
text_list.append(" ".join(list(jieba.cut(line))))
|
||||
# 创建 CountVectorizer 对象
|
||||
transfer = CountVectorizer()
|
||||
# 将文本数据转换为特征向量
|
||||
new_data = transfer.fit_transform(text_list)
|
||||
# 输出特征名称
|
||||
print("Feature Names:", transfer.get_feature_names_out())
|
||||
# 输出转换后的特征矩阵
|
||||
print("Transformed Data:", new_data.toarray())
|
||||
```
|
||||
### tf-idf
|
||||
> 词频 * 逆文档频率
|
||||
```python
|
||||
# tfi-df
|
||||
from sklearn.feature_extraction.text import TfidfVectorizer
|
||||
import jieba
|
||||
data=["一种还是一种今天很残酷,明天更残酷,后天很美好,但绝对大部分是死在明天晚上,所以每个人不要放弃今天。",
|
||||
"我们看到的从很远星系来的光是在几百万年之前发出的,这样当我们看到宇宙时,我们是在看它的过去",
|
||||
"如果只用一种方式了解某样事物,你就不会真正了解它。了解事物真正含义的秘密取决于如何将其与我们所了解的事物相联系"]
|
||||
list = []
|
||||
for item in data:
|
||||
list.append(" ".join(jieba.cut(item)))
|
||||
transfer = TfidfVectorizer()
|
||||
new_data = transfer.fit_transform(list)
|
||||
print(f"特征名字:\n{transfer.get_feature_names_out()}")
|
||||
|
||||
print(f"转换后的特征矩阵:\n{ new_data.toarray()}")
|
||||
print(f"转换后的数据:\n{new_data}")
|
||||
```
|
||||
|
||||
|
||||
### 回归决策树
|
||||
#### 决策树算法的应用 (泰坦尼克号沉船幸存者预测)
|
||||
```python
|
||||
import seaborn as sns
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.feature_extraction import DictVectorizer
|
||||
from sklearn.tree import DecisionTreeClassifier,export_graphviz
|
||||
# 1.获取数据集 - 加载 Titanic 数据集
|
||||
titanic = sns.load_dataset('titanic')
|
||||
missing_age_count = titanic['age'].isna().sum()
|
||||
# print(f"缺失的 age 数量: {missing_age_count}")
|
||||
# 2. 数据基本处理
|
||||
# 2.1 确认特征值、目标值
|
||||
X = titanic[['pclass','age','sex']]
|
||||
y = titanic['survived']
|
||||
# 2.2 缺失值处理
|
||||
X.loc[:, 'age'] = X['age'].fillna(value=X['age'].mean()) # 使用 .loc 进行修改
|
||||
# 2.3 划分数据集
|
||||
X_train,X_test,y_train,y_test = train_test_split(X,y,random_state=22)
|
||||
# 3. 特征工程(字典特征提取)
|
||||
X_train = X_train.to_dict(orient="records")
|
||||
X_test= X_test.to_dict(orient="records")
|
||||
transfer = DictVectorizer()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test)
|
||||
# 4. 机器学习 决策树算法
|
||||
estimator = DecisionTreeClassifier(criterion="gini")
|
||||
estimator.fit(X_train,y_train)
|
||||
y_pred = estimator.predict(X_test)
|
||||
print(f"模型的测试集的预测值:{y_pred}")
|
||||
ret = estimator.score(X_test,y_test)
|
||||
print(f"模型的评分:{ret}")
|
||||
print(X_test.toarray())
|
||||
```
|
||||
|
||||
生成对应的图
|
||||
```python
|
||||
from sklearn.tree import export_graphviz
|
||||
import graphviz # 用于渲染图像
|
||||
|
||||
# 导出决策树的 Graphviz 表示
|
||||
export_graphviz(estimator, out_file='./data/tree.dot',
|
||||
feature_names=transfer.get_feature_names_out()) # 特征名称
|
||||
# 使用 graphviz 渲染 .dot 文件
|
||||
with open('./data/tree.dot', 'r') as f:
|
||||
dot_graph = f.read()
|
||||
# 渲染决策树
|
||||
graph = graphviz.Source(dot_graph)
|
||||
|
||||
# 设置保存路径
|
||||
output_path = './data/decision_tree' # 自定义保存路径
|
||||
|
||||
# 保存图像到指定路径,格式可以是 .png, .pdf, .jpg 等
|
||||
# graph.render(output_path, format='png') # 保存为 .png 文件
|
||||
|
||||
# 显示图像
|
||||
graph.view(output_path) # 打开图像,path为保存路径,不需要加后缀
|
||||
|
||||
```
|
||||
|
||||
[Webgraphviz](http://webgraphviz.com/),这个网站可以将`tree.dot`文件的内容生成对应的可视化树
|
||||
|
||||
|
||||
#### 回归决策树与线性回归的对比
|
||||
```python
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from sklearn.linear_model import LinearRegression
|
||||
from sklearn.tree import DecisionTreeRegressor
|
||||
from matplotlib import rcParams
|
||||
|
||||
# 设置matplotlib使用的字体为SimHei(黑体)
|
||||
rcParams['font.sans-serif'] = ['SimHei'] # 也可以使用 'Microsoft YaHei'
|
||||
rcParams['axes.unicode_minus'] = False # 正常显示负号
|
||||
x = np.array(list(range(1,11))).reshape(-1,1)
|
||||
y = ([5.56,5.70,5.91,6.40,6.80,7.05,8.90,8.70,9.00,9.05])
|
||||
|
||||
m1 = DecisionTreeRegressor(max_depth=1)
|
||||
m2 = DecisionTreeRegressor(max_depth=3)
|
||||
m3 = DecisionTreeRegressor()
|
||||
|
||||
# 模型训练
|
||||
m1.fit(x,y)
|
||||
m2.fit(x,y)
|
||||
m3.fit(x,y)
|
||||
|
||||
# 模型预测
|
||||
x_test = np.arange(0,10,0.01).reshape(-1,1)
|
||||
y_1 = m1.predict(x_test)
|
||||
y_2 = m2.predict(x_test)
|
||||
y_3 = m3.predict(x_test)
|
||||
|
||||
# 结果展示
|
||||
plt.figure(figsize=(10,6),dpi=100)
|
||||
plt.scatter(x,y ,label = "data")
|
||||
plt.plot(x_test,y_1,label = "max_depth=1")
|
||||
plt.plot(x_test,y_2,label = "max_depth=3")
|
||||
plt.plot(x_test,y_3,label = "linearregression")
|
||||
plt.xlabel("数据")
|
||||
plt.ylabel("预测值")
|
||||
plt.legend()
|
||||
plt.show()
|
||||
```
|
||||
129
source/_posts/machinelearning/ensemblelearning.md
Normal file
@@ -0,0 +1,129 @@
|
||||
---
|
||||
title: 集成学习
|
||||
tags: ensemble-learning
|
||||
categories: machinelearning
|
||||
abbrlink: 8816
|
||||
date: 2025-01-25 15:12:08
|
||||
cover: /img/machinelearning/ensemble-learning.png
|
||||
top_img: /img/site01.jpg
|
||||
---
|
||||
|
||||
### Bagging
|
||||
|
||||
### 随机森林
|
||||
> `Random-Forest` 就是`Bagging + Decisiontree`
|
||||
```python
|
||||
import seaborn as sns
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from sklearn.model_selection import train_test_split,GridSearchCV
|
||||
from sklearn.feature_extraction import DictVectorizer
|
||||
from sklearn.ensemble import RandomForestClassifier
|
||||
# 1.获取数据集 - 加载 Titanic 数据集
|
||||
titanic = sns.load_dataset('titanic')
|
||||
missing_age_count = titanic['age'].isna().sum()
|
||||
# print(f"缺失的 age 数量: {missing_age_count}")
|
||||
# 2. 数据基本处理
|
||||
# 2.1 确认特征值、目标值
|
||||
X = titanic[['pclass','age','sex']]
|
||||
y = titanic['survived']
|
||||
# 2.2 缺失值处理
|
||||
X.loc[:, 'age'] = X['age'].fillna(value=X['age'].mean()) # 使用 .loc 进行修改
|
||||
# 2.3 划分数据集
|
||||
X_train,X_test,y_train,y_test = train_test_split(X,y,random_state=22)
|
||||
# 3. 特征工程(字典特征提取)
|
||||
X_train = X_train.to_dict(orient="records")
|
||||
X_test= X_test.to_dict(orient="records")
|
||||
transfer = DictVectorizer()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test)
|
||||
# 4. 机器学习 随机森林
|
||||
rf = RandomForestClassifier()
|
||||
gc = GridSearchCV(estimator=rf ,param_grid={"n_estimators":[100,120,300],"max_depth":[3,7,11]},cv=3)
|
||||
gc.fit(X_train,y_train)
|
||||
y_pred = gc.predict(X_test)
|
||||
print(f"模型的测试集的预测值:{y_pred}")
|
||||
ret = gc.score(X_test,y_test)
|
||||
print(f"最佳模型在测试集上的评分:{ret}")
|
||||
print(f"最佳模型的参数:{gc.best_estimator_}")
|
||||
print(f"最佳模型在训练集上的评分:{gc.best_score_}")
|
||||
print(X_test.toarray())
|
||||
```
|
||||

|
||||
|
||||
### ott案例
|
||||
```python
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
import matplotlib.pyplot as plt
|
||||
from imblearn.under_sampling import RandomUnderSampler
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import LabelEncoder
|
||||
from sklearn.ensemble import RandomForestClassifier
|
||||
from sklearn.metrics import log_loss
|
||||
from sklearn.preprocessing import OneHotEncoder
|
||||
# 1. 获取数据集
|
||||
data = pd.read_csv('./data/train.csv')
|
||||
# 查看目标值分类
|
||||
import seaborn as sns
|
||||
sns.countplot(data=data, x='target', hue='target', palette="Set2", legend=False) # 使用 hue='target' 替代 palette
|
||||
plt.show()
|
||||
|
||||
# 2. 数据集的基本处理
|
||||
# 2.1 确定特征值、目标值
|
||||
x = data.drop(["id", "target"], axis=1)
|
||||
y = data['target']
|
||||
|
||||
# 2.2 使用随机欠采样进行平衡
|
||||
undersampler = RandomUnderSampler(sampling_strategy='auto', random_state=0)
|
||||
x_resampled, y_resampled = undersampler.fit_resample(x, y)
|
||||
|
||||
# 查看欠采样后的类别分布
|
||||
# print(f"欠采样后训练集中的类别分布:\n{y_train_resampled.value_counts()}")
|
||||
|
||||
# 2.3. 将标签转换为数字
|
||||
le = LabelEncoder()
|
||||
y_resampled = le.fit_transform(y_resampled)
|
||||
|
||||
# 2.4. 划分训练集和测试集
|
||||
x_train, x_test, y_train, y_test = train_test_split(x_resampled, y_resampled, test_size=0.2)
|
||||
|
||||
# 3. 机器学习
|
||||
rf = RandomForestClassifier(oob_score = True)
|
||||
rf.fit(x_train,y_train)
|
||||
y_pred = rf.predict(x_test)
|
||||
print(f"预测值:{y_pred}")
|
||||
print(f"评分:{rf.score(x_test,y_test)}")
|
||||
|
||||
# # 4. 模型评估 (解决二分类预测问题)
|
||||
# import numpy as np
|
||||
# from sklearn.metrics import log_loss
|
||||
# # 假设 y_pred_prob 是通过 predict_proba 得到的预测概率
|
||||
# # 对预测概率进行裁剪,将其限制在 [eps, 1-eps] 范围内
|
||||
# eps = 1e-15 # 设置一个小的eps值,避免极端值
|
||||
# y_pred_prob = rf.predict_proba(x_test)
|
||||
# y_pred_prob = np.clip(y_pred_prob, eps, 1 - eps)
|
||||
|
||||
# # 计算 log_loss
|
||||
# loss = log_loss(y_test, y_pred_prob, normalize=True)
|
||||
# print(f"Log Loss: {loss}")
|
||||
|
||||
# 4. 模型评估 (解决多分类预测问题)
|
||||
|
||||
# 获取预测的概率
|
||||
y_pred_prob = rf.predict_proba(x_test)
|
||||
|
||||
# 使用 OneHotEncoder 对 y_test 进行 One-Hot 编码
|
||||
encoder = OneHotEncoder(sparse_output=False) # 确保返回的是密集矩阵
|
||||
y_test_one_hot = encoder.fit_transform(y_test.reshape(-1, 1))
|
||||
|
||||
# 对预测概率进行裁剪,将其限制在 [eps, 1-eps] 范围内
|
||||
eps = 1e-15
|
||||
y_pred_prob = np.clip(y_pred_prob, eps, 1 - eps)
|
||||
|
||||
# 计算 log_loss
|
||||
loss = log_loss(y_test_one_hot, y_pred_prob, normalize=True)
|
||||
print(f"Log Loss: {loss}")
|
||||
|
||||
```
|
||||

|
||||
191
source/_posts/machinelearning/knn.md
Normal file
@@ -0,0 +1,191 @@
|
||||
---
|
||||
title: k近邻算法(K-Nearest Neighbors)KNN
|
||||
tags: KNN
|
||||
categories: machinelearning
|
||||
abbrlink: 29139
|
||||
mathjax: true
|
||||
date: 2025-01-13 17:20:59
|
||||
---
|
||||
## **k近邻算法(K-Nearest Neighbors)KNN**
|
||||
将当前样本的类别归类于距离最近的**k**个样本的类别
|
||||
|
||||
#### **距离公式(2维)**
|
||||
|
||||
- 欧式距离
|
||||
$$
|
||||
d = \sqrt{(x_1-y_1)^2 + (x_2 - y_2)^2}
|
||||
$$
|
||||
- 曼哈顿距离
|
||||
$$
|
||||
d = |x_1 - x_2| + |y_1 - y_2|
|
||||
$$
|
||||
- 切比雪夫距离
|
||||
$$
|
||||
d = \max\left(|x_1 - x_2|, |y_1 - y_2|\right)
|
||||
$$
|
||||
#### k值选择问题
|
||||
|
||||
| k值 | 影响 |
|
||||
| --- | ------------------ |
|
||||
| 越大 | 模型过拟合,准确率波动较大 |
|
||||
| 越小 | 模型欠拟合,准确率趋于稳定但可能较低 |
|
||||
### 特征预处理
|
||||
> 通过一些转换函数将特征数据转换成更加适合算法模型的特征数据过程
|
||||
- 归一化
|
||||
将数据变换到指定区间(默认是\[0,1\])
|
||||
$$ x' = \frac{x- x_{\text {min}}}{x_{\text{max}} - x_{\text{min}}} $$
|
||||
若需要缩放到任意区间 \(\[a, b\]\),公式为: $$ x' = a + \frac{(x - x_{\text{min}}) \cdot (b - a)}{x_{\text{max}} - x_{\text{min}}} $$
|
||||
其中:\( \[a, b\] \):目标区间的范围
|
||||
归一化受到数据集的异常值的影响,需要进行标准化处理(更加合理)
|
||||
``` python
|
||||
from sklearn.preprocessing import MinMaxScaler # 归一化
|
||||
```
|
||||
- 标准化
|
||||
将数据调整为均值为 0,标准差为 1 的标准正态分布
|
||||
$$ z = \frac{x - \mu}{\sigma} $$
|
||||
\( z \):标准化后的值 \( x \):原始数据值 \( $\mu$ \):数据的均值 \( $\sigma$\):数据的标准差
|
||||
|
||||
``` python
|
||||
from sklearn.preprocessing import StandardScaler # 标准化
|
||||
```
|
||||
|
||||
### KNN代码实现
|
||||
```python
|
||||
import seaborn as sns
|
||||
import matplotlib.pyplot as plt
|
||||
import pandas as pd
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.datasets import load_iris
|
||||
from sklearn.preprocessing import MinMaxScaler,StandardScaler
|
||||
from sklearn.neighbors import KNeighborsClassifier
|
||||
from sklearn.metrics import accuracy_score
|
||||
|
||||
# 1 数据集获取
|
||||
iris = load_iris()
|
||||
# print(iris.feature_names)
|
||||
iris_data = pd.DataFrame(iris.data,columns=['Sepal_Length', 'Sepal_Width', 'Petal_Length', 'Petal_Width'])
|
||||
iris_data['target'] = iris.target
|
||||
|
||||
def iris_plot(data,col1,col2):
|
||||
sns.lmplot(x=col1,y=col2,data=data,hue="target",fit_reg=False)
|
||||
plt.show()
|
||||
# 2 数据集可视化
|
||||
# iris_plot(iris_data, 'Sepal_Width', 'Petal_Length')
|
||||
|
||||
# 3 数据集的划分
|
||||
X_train,X_test,y_train,y_test = train_test_split(iris.data,iris.target,test_size=0.2,random_state=44)
|
||||
# print("训练集的特征值:\n",X_train)
|
||||
# print("训练集的目标值:\n",y_train)
|
||||
# print("测试集的特征值:\n",X_test)
|
||||
# print("测试集的特征值:\n",y_test)
|
||||
|
||||
# 4 归一化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test)
|
||||
# print("归一化的,X_train:\n",X_train)
|
||||
# print("归一化的X_test:\n",X_test)
|
||||
|
||||
# 5 机器学习 KNN
|
||||
# 5.1 实例化估计器
|
||||
estimator = KNeighborsClassifier(n_neighbors=9)
|
||||
# 5.2 进行训练
|
||||
estimator.fit(X_train,y_train)
|
||||
|
||||
# 6 模型评估
|
||||
y_pred = estimator.predict(X_test)
|
||||
print("预测值:\n",y_pre)
|
||||
print("预测值与真实值是否相等:\n",y_pred==y_test)
|
||||
accuracy = accuracy_score(y_test, y_pred)
|
||||
print(f"\nKNN 模型的准确率: {accuracy:.4f}")
|
||||
```
|
||||
|
||||

|
||||
### 交叉验证与网格搜索
|
||||
```python
|
||||
import seaborn as sns
|
||||
import matplotlib.pyplot as plt
|
||||
import pandas as pd
|
||||
from sklearn.model_selection import train_test_split,GridSearchCV
|
||||
from sklearn.datasets import load_iris
|
||||
from sklearn.preprocessing import MinMaxScaler,StandardScaler
|
||||
from sklearn.neighbors import KNeighborsClassifier
|
||||
from sklearn.metrics import accuracy_score
|
||||
|
||||
# 1 数据集获取
|
||||
iris = load_iris()
|
||||
iris_data = pd.DataFrame(iris.data,columns=['Sepal_Length', 'Sepal_Width', 'Petal_Length', 'Petal_Width'])
|
||||
iris_data['target'] = iris.target
|
||||
|
||||
# 3 数据集的划分
|
||||
X_train,X_test,y_train,y_test = train_test_split(iris.data,iris.target,test_size=0.2)
|
||||
|
||||
# 4 归一化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test)
|
||||
|
||||
# 5 机器学习 KNN
|
||||
# 5.1 实例化估计器
|
||||
#
|
||||
#不指定 <code> n_neighbors </code> ,使用网格搜索进行循环训练
|
||||
estimator = KNeighborsClassifier()
|
||||
# 5.2 模型调优 -- 交叉验证,网格搜素
|
||||
estimator = GridSearchCV(estimator,param_grid={"n_neighbors":[1,3,5,7]},cv=5) # 5 折
|
||||
# 5.2 进行训练
|
||||
estimator.fit(X_train,y_train)
|
||||
|
||||
# 6 模型评估
|
||||
y_pred = estimator.predict(X_test)
|
||||
print("预测值:\n",y_pred)
|
||||
print("预测值与真实值是否相等:\n",y_pred==y_test)
|
||||
accuracy = accuracy_score(y_test, y_pred)
|
||||
print(f"\nKNN 模型的准确率: {accuracy:.4f}")
|
||||
|
||||
# 交叉验证的相关参数
|
||||
print(f"最好结果:{estimator.best_score_}")
|
||||
print(f"最好模型:{estimator.best_estimator_}")
|
||||
print(f"最好模型结果:{estimator.cv_results_}")
|
||||
```
|
||||

|
||||
|
||||
### 机器学习的基本步骤
|
||||
- 获取数据集
|
||||
- 数据集基本处理
|
||||
- 去重去空、填充等操作
|
||||
- 确定特征值和目标值
|
||||
- 分割数据集
|
||||
- 特征工程(特征预处理 标准化等)
|
||||
- 机器学习
|
||||
- 模型评估
|
||||
|
||||
### 数据分割的方法
|
||||
- 留出法
|
||||
训练/测试集的划分要尽可能保持数据分布的一致性,避免因数据划分过程引入额外的偏差而对最终结果产生影响。
|
||||
单次使用留出法得到的估计结果往往不够稳定可靠,在使用留出法时,一般要采用若干次随机划分、重复进行实验评估后取平均值作为留出法的评估结果。
|
||||
``` python
|
||||
from sklearn.model_selection import KFold,StratifiedKFold
|
||||
import pandas as pd
|
||||
X = np.array([
|
||||
[1,2,3,4],
|
||||
[11,12,13,14],
|
||||
[21,22,23,24],
|
||||
[31,32,33,34],
|
||||
[41,42,43,44],
|
||||
[51,52,53,54],
|
||||
[61,62,63,64],
|
||||
[71,72,73,74]
|
||||
])
|
||||
y=np.array([1,1,0,0,1,1,0,0])
|
||||
folder = KFold(n_splits=4)
|
||||
sfloder = StratifiedKFold(n_splits=4)
|
||||
print("KFOLD:")
|
||||
for train,test in folder.split(X,y):
|
||||
print(f"train:{train},test:{test}")
|
||||
print("SKFOLD:")
|
||||
for train,test in sfloder.split(X,y):
|
||||
print(f"train:{train},test:{test}")
|
||||
```
|
||||

|
||||
- 自助法
|
||||
- 交叉验证法
|
||||
200
source/_posts/machinelearning/linearreression.md
Normal file
@@ -0,0 +1,200 @@
|
||||
---
|
||||
title: 线性回归
|
||||
tags: linear-regression
|
||||
categories: machinelearning
|
||||
mathjax: true
|
||||
abbrlink: 52662
|
||||
date: 2025-01-19 16:46:51
|
||||
---
|
||||
|
||||
### 线性回归简介
|
||||
>用于预测一个连续的目标变量(因变量),与一个或多个特征(自变量)之间存在线性关系。
|
||||
|
||||
假设函数:
|
||||
$$y = w_1x_1 + w_2x_2 + \cdot\cdot\cdot+w_nx_n$$
|
||||
- $y$ 是目标变量(因变量),即我们希望预测的值。
|
||||
- $x1,x2,…,xn$ 是特征变量(自变量),即输入的值。
|
||||
### 损失函数
|
||||
|
||||
为了找到最佳的线性模型,我们需要通过最小化损失函数来优化模型参数。在线性回归中,常用的损失函数是 **均方误差(MSE)**:
|
||||
$$J(\theta) = \frac{1}{2N} \sum_{i=1}^{N} (y_i - f_\theta(x_i))^2$$
|
||||
- N 是样本的数量。
|
||||
- $y_i$ 是第 i 个样本的真实值。
|
||||
- $f_\theta(x_i)$ 是模型预测的第 i 个样本的值。
|
||||
|
||||
### 线性回归优化
|
||||
|
||||
- 梯度下降法
|
||||
```python
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
from sklearn.linear_model import SGDRegressor
|
||||
from sklearn.metrics import mean_squared_error
|
||||
|
||||
# 1. 获取数据集
|
||||
housing = fetch_california_housing()
|
||||
|
||||
# 2. 数据集处理
|
||||
# 2.1 分割数据集
|
||||
X_train, X_test, y_train, y_test = train_test_split(housing.data, housing.target, test_size=0.25)
|
||||
|
||||
# 3. 特征工程
|
||||
# 3.1 标准化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test) # 使用 transform() 而不是 fit_transform()
|
||||
|
||||
# 4.机器学习- 梯度下降法
|
||||
estimater = SGDRegressor(max_iter=1000, eta0=0.01)
|
||||
estimater.fit(X_train, y_train)
|
||||
print(f"SGD模型的偏置是:{estimater.intercept_}")
|
||||
print(f"SGD模型的系数是:{estimater.coef_}")
|
||||
|
||||
# 5. 模型评估
|
||||
y_pred = estimater.predict(X_test)
|
||||
print(f"SGD模型预测值:{y_pred}")
|
||||
mse = mean_squared_error(y_test, y_pred)
|
||||
print(f"SGD模型均方误差:{mse}")
|
||||
```
|
||||
|
||||
- 正规方程
|
||||
```python
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
from sklearn.linear_model import LinearRegression
|
||||
from sklearn.metrics import mean_squared_error
|
||||
|
||||
# 1. 获取数据集
|
||||
housing = fetch_california_housing()
|
||||
|
||||
# 2. 数据集处理
|
||||
# 2.1 分割数据集
|
||||
X_train, X_test, y_train, y_test = train_test_split(housing.data, housing.target, test_size=0.25)
|
||||
|
||||
# 3. 特征工程
|
||||
# 3.1 标准化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.fit_transform(X_test)
|
||||
|
||||
# 4.机器学习- 线性回归
|
||||
estimater = LinearRegression()
|
||||
estimater.fit(X_train, y_train)
|
||||
print(f"模型的偏置是:{estimater.intercept_}")
|
||||
print(f"模型的系数是:{estimater.coef_}")
|
||||
|
||||
# 5. 模型评估
|
||||
y_pred = estimater.predict(X_test)
|
||||
print(f"模型预测值:{y_pred}")
|
||||
mse = mean_squared_error(y_test, y_pred)
|
||||
print(f"模型均方误差:{mse}")
|
||||
```
|
||||
|
||||
- 岭回归
|
||||
```python
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
from sklearn.linear_model import Ridge, RidgeCV
|
||||
from sklearn.metrics import mean_squared_error
|
||||
|
||||
# 1. 获取数据集
|
||||
housing = fetch_california_housing()
|
||||
|
||||
# 2. 数据集处理
|
||||
# 2.1 分割数据集
|
||||
X_train, X_test, y_train, y_test = train_test_split(housing.data, housing.target, test_size=0.25)
|
||||
|
||||
# 3. 特征工程
|
||||
# 3.1 标准化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test) # 使用 transform() 而不是 fit_transform()
|
||||
|
||||
# 4.机器学习- 岭回归 使用了Ridge的alpha的搜索
|
||||
# estimater = Ridge(alpha=1.0)
|
||||
estimater = RidgeCV(alphas=[0.001, 0.01, 0.1, 1, 10, 100])
|
||||
estimater.fit(X_train, y_train)
|
||||
print(f"Ridge模型的偏置是:{estimater.intercept_}")
|
||||
print(f"Ridge模型的系数是:{estimater.coef_}")
|
||||
|
||||
# 查看最佳 alpha
|
||||
print(f"最佳 alpha 值是:{estimater.alpha_}")
|
||||
|
||||
# 5. 模型评估
|
||||
y_pred = estimater.predict(X_test)
|
||||
print(f"Ridge模型预测值:{y_pred}")
|
||||
mse = mean_squared_error(y_test, y_pred)
|
||||
print(f"Ridge模型均方误差:{mse}")
|
||||
```
|
||||
|
||||
这样每个代码块的缩进保持一致,便于阅读和理解。如果有其他优化需求,随时告诉我!
|
||||
|
||||
|
||||

|
||||
|
||||

|
||||
### 模型保存和加载
|
||||
```python
|
||||
from sklearn.datasets import fetch_california_housing
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
from sklearn.linear_model import Ridge, RidgeCV
|
||||
from sklearn.metrics import mean_squared_error
|
||||
import joblib
|
||||
|
||||
def save_model():
|
||||
# 1. 获取数据集
|
||||
housing = fetch_california_housing()
|
||||
# 2. 数据集处理
|
||||
# 2.1 分割数据集
|
||||
X_train, X_test, y_train, y_test = train_test_split(housing.data, housing.target, test_size=0.25)
|
||||
# 3. 特征工程
|
||||
# 3.1 标准化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test) # 使用 transform() 而不是 fit_transform()
|
||||
# 4. 机器学习 - 岭回归 使用了Ridge的alpha的搜索
|
||||
estimater = RidgeCV(alphas=[0.001, 0.01, 0.1, 1, 10, 100])
|
||||
estimater.fit(X_train, y_train)
|
||||
print(f"Ridge模型的偏置是:{estimater.intercept_}")
|
||||
print(f"Ridge模型的系数是:{estimater.coef_}")
|
||||
# 保存模型
|
||||
joblib.dump(estimater, 'ridge_model.pkl')
|
||||
# 查看最佳 alpha
|
||||
print(f"最佳 alpha 值是:{estimater.alpha_}")
|
||||
# 5. 模型评估
|
||||
y_pred = estimater.predict(X_test)
|
||||
mse = mean_squared_error(y_test, y_pred)
|
||||
print(f"Ridge模型均方误差:{mse}")
|
||||
|
||||
def load_model():
|
||||
# 1. 获取数据集
|
||||
housing = fetch_california_housing()
|
||||
# 2. 数据集处理
|
||||
# 2.1 分割数据集
|
||||
X_train, X_test, y_train, y_test = train_test_split(housing.data, housing.target, test_size=0.25)
|
||||
# 3. 特征工程
|
||||
# 3.1 标准化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test) # 使用 transform() 而不是 fit_transform()
|
||||
# 加载模型
|
||||
estimater = joblib.load('ridge_model.pkl')
|
||||
print(f"Ridge模型的偏置是:{estimater.intercept_}")
|
||||
print(f"Ridge模型的系数是:{estimater.coef_}")
|
||||
# 查看最佳 alpha
|
||||
print(f"最佳 alpha 值是:{estimater.alpha_}")
|
||||
# 5. 模型评估
|
||||
y_pred = estimater.predict(X_test)
|
||||
mse = mean_squared_error(y_test, y_pred)
|
||||
print(f"Ridge模型预测值:{y_pred}")
|
||||
print(f"Ridge模型均方误差:{mse}")
|
||||
|
||||
print("训练并保存模型:")
|
||||
save_model()
|
||||
print("加载模型")
|
||||
load_model()
|
||||
```
|
||||
173
source/_posts/machinelearning/logisticregression.md
Normal file
@@ -0,0 +1,173 @@
|
||||
---
|
||||
title: 逻辑回归
|
||||
tags: logistic-regression
|
||||
categories: machinelearning
|
||||
mathjax: true
|
||||
abbrlink: 60504
|
||||
date: 2025-01-20 15:30:08
|
||||
---
|
||||
|
||||
### logistic regression code
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from sklearn.datasets import load_breast_cancer
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
from sklearn.linear_model import LogisticRegression
|
||||
# 1. 加载乳腺癌数据集
|
||||
data = load_breast_cancer()
|
||||
# 2.1 数据集基本处理
|
||||
df = pd.DataFrame(data.data, columns=data.feature_names)
|
||||
df['target'] = data.target
|
||||
for i in df.columns:
|
||||
# 检查列是否有缺失值
|
||||
if np.any(pd.isnull(df[i])):
|
||||
print(f"Filling missing values in column: {i}")
|
||||
#2.2 确认特征值、目标值
|
||||
X = df.iloc[:,0:df.shape[1] - 1]
|
||||
y = df.loc[:,"target"]
|
||||
# 2.3 分割数据
|
||||
X_train,X_test,y_train,y_test = train_test_split(X,y,test_size=0.3)
|
||||
# 显示前几行数据
|
||||
df.head(1)
|
||||
|
||||
# 3. 特征工程 标准化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test)
|
||||
|
||||
# 4 机器学习 逻辑回归
|
||||
estimator = LogisticRegression()
|
||||
estimator.fit(X_train,y_train)
|
||||
|
||||
# 5. 模型评估
|
||||
print(f"模型准确率:{estimator.score(X_test,y_test)}")
|
||||
print(f"模型预测值为:\n{estimator.predict(X_test)}")
|
||||
```
|
||||
|
||||
### 分类评估的参数
|
||||
- 准确率
|
||||
准确率是所有预测正确的样本占总样本的比例
|
||||
$$Accuracy = \frac{TP+TN}{TP+FN+FP+TN}$$
|
||||
|
||||
- 精准率
|
||||
精准率(又称查准率)是指所有被预测为正类的样本中,真正为正类的比例
|
||||
$$Precision = \frac{TP}{TP+FP}$$
|
||||
|
||||
- 召回率
|
||||
召回率(又称查全率)是指所有实际为正类的样本中,被正确预测为正类的比例
|
||||
$$Recall = \frac{TP}{TP+FN}$$
|
||||
|
||||
- F1-score
|
||||
F1 值(F1 Score)是精准率和召回率的调和平均数,综合考虑了精准率和召回率的影响。
|
||||
$$ F1 = 2 \times \frac{\text{Precision} \times \text{Recall}}{\text{Precision} + \text{Recall}} $$
|
||||
|
||||
- roc曲线
|
||||
tpr、fpr来衡量不平衡的二分类问题
|
||||
|
||||
```python
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from sklearn.datasets import load_breast_cancer
|
||||
from sklearn.model_selection import train_test_split
|
||||
from sklearn.preprocessing import StandardScaler
|
||||
from sklearn.linear_model import LogisticRegression
|
||||
from sklearn.metrics import classification_report, roc_auc_score
|
||||
# 1. 加载乳腺癌数据集
|
||||
data = load_breast_cancer()
|
||||
# 2.1 数据集基本处理
|
||||
df = pd.DataFrame(data.data, columns=data.feature_names)
|
||||
df['target'] = data.target
|
||||
for i in df.columns:
|
||||
# 检查列是否有缺失值
|
||||
if np.any(pd.isnull(df[i])):
|
||||
print(f"Filling missing values in column: {i}")
|
||||
# 2.2 确认特征值、目标值
|
||||
X = df.iloc[:, 0:df.shape[1] - 1]
|
||||
y = df.loc[:, "target"]
|
||||
# 2.3 分割数据
|
||||
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3)
|
||||
# 显示前几行数据
|
||||
df.head(1)
|
||||
|
||||
# 3. 特征工程 标准化
|
||||
transfer = StandardScaler()
|
||||
X_train = transfer.fit_transform(X_train)
|
||||
X_test = transfer.transform(X_test)
|
||||
|
||||
# 4 机器学习 逻辑回归
|
||||
estimator = LogisticRegression()
|
||||
estimator.fit(X_train, y_train)
|
||||
|
||||
# 5. 模型评估
|
||||
print(f"模型准确率:{estimator.score(X_test, y_test)}")
|
||||
y_pred = estimator.predict(X_test)
|
||||
print(f"模型预测值为:\n{y_pred}")
|
||||
# 5.1 精确率、召回率
|
||||
ret = classification_report(y_test, y_pred, labels=[1, 0], target_names=["良性", "恶性"])
|
||||
roc_score = roc_auc_score(y_test, y_pred)
|
||||
print(f"准确率、召回率:{ret}")
|
||||
print(f"roc_score:{roc_score}")
|
||||
```
|
||||
|
||||
### 类别不平衡的处理
|
||||
先准备类别不平衡的数据
|
||||
|
||||
```python
|
||||
from imblearn.over_sampling import RandomOverSampler,SMOTE
|
||||
from imblearn.under_sampling import RandomUnderSampler
|
||||
from sklearn.datasets import make_classification
|
||||
import matplotlib.pyplot as plt
|
||||
from collections import Counter
|
||||
|
||||
# 1.准备类别不平衡的数据
|
||||
X, y = make_classification(
|
||||
n_samples=5000,
|
||||
n_features=2,
|
||||
n_informative=2,
|
||||
n_redundant=0,
|
||||
n_repeated=0,
|
||||
n_classes=3,
|
||||
n_clusters_per_class=1,
|
||||
weights=[0.01, 0.05, 0.94],
|
||||
random_state=0,
|
||||
)
|
||||
counter = Counter(y)
|
||||
plt.scatter(X[:,0],X[:,1],c=y)
|
||||
plt.show()
|
||||
```
|
||||
|
||||
- 过采样
|
||||
增加训练集的少数的类别的样本,使得正反例样本数据接近
|
||||
- 随机过采样(RandomOverSampler)
|
||||
```python
|
||||
ros = RandomOverSampler()
|
||||
X_resampled,y_resampled = ros.fit_resample(X,y)
|
||||
print(Counter(y_resampled))
|
||||
plt.scatter(X_resampled[:,0],X_resampled[:,1],c=y_resampled)
|
||||
plt.show()
|
||||
```
|
||||

|
||||
- `SMOTE`过采样(SMOTE)
|
||||
```python
|
||||
smote = SMOTE()
|
||||
X_resampled,y_resampled = smote.fit_resample(X,y)
|
||||
print(Counter(y_resampled))
|
||||
plt.scatter(X_resampled[:,0],X_resampled[:,1],c=y_resampled)
|
||||
plt.show()
|
||||
```
|
||||

|
||||
- 欠采样
|
||||
减少训练集的多数的类别的样本,使得正反例样本数据接近
|
||||
- 随机欠采样(RandomUnderSampler)
|
||||
```python
|
||||
rus = RandomUnderSampler(random_state=0)
|
||||
X_resampled,y_resampled = rus.fit_resample(X,y)
|
||||
print(Counter(y_resampled))
|
||||
plt.scatter(X_resampled[:,0],X_resampled[:,1],c=y_resampled)
|
||||
plt.show()
|
||||
```
|
||||

|
||||
|
||||
7
source/_posts/net/index.md
Normal file
@@ -0,0 +1,7 @@
|
||||
---
|
||||
title: 网络相关
|
||||
abbrlink: 41168
|
||||
date: 2024-08-07 10:06:08
|
||||
tags:
|
||||
---
|
||||
|
||||
67
source/_posts/net/jichang/jichang.md
Normal file
@@ -0,0 +1,67 @@
|
||||
---
|
||||
title: 无法访问外网?需要订阅代理服务?
|
||||
tags: 网络代理
|
||||
abbrlink: 14011
|
||||
date: 2024-08-07 10:06:08
|
||||
---
|
||||
|
||||
{% note info %}
|
||||
**由于中国大陆的GFW(防火墙)限制,无法访问外网网络,因此需要访问像GitHub、YouTube这样的
|
||||
的网站将被屏蔽拦截,接下来我将给出一种使用`VPN`服务的可行的方案来保证服务的可靠性。**
|
||||
{% endnote %}
|
||||
|
||||
### 介绍
|
||||
> 根据测试,许多提供服务的提供商所在的网站需要使用`外部网络`才能打开,仅有少部分的网站(**比较贵**)可以直接使用
|
||||
> 国内网络环境打开直接购买订阅服务。
|
||||
>
|
||||
|
||||
那么你现在可以有两个选择:
|
||||
1. **方案一**:使用无需`外部网络`便能开通订阅服务的VPN,费用高,如果你选择此方案,那么你可自行搜索解决,此处仅仅讨论方案二。
|
||||
2. **方案二**:如果使用此方案,详见下方。
|
||||
|
||||
|
||||
### 解决方案
|
||||
> 采用**方案二**方式
|
||||
>
|
||||
> 这是一些订阅服务推广的链接: https://9.234456.xyz/abc.html?t=638586217737356738 (此链接打开无需使用VPN,但进入对应的机场页面却仍无法打开)
|
||||
>
|
||||
> 此教程中我们使用的机场是
|
||||
> 1. `一元机场`: https://xn--4gq62f52gdss.com/
|
||||
> 2. `赔钱机场`:https://xn--mes358aby2apfg.com/
|
||||
|
||||
### 机场选择的建议:
|
||||
|
||||
- `一元机场`
|
||||

|
||||
可以看到
|
||||
- `12元/年`,每月50GB的可用额度,下个月重置流量额度
|
||||
- `15元/季`,即为`60元/年`,每月有4000GB的可用额度,下个月重置流量额度
|
||||
- `7元/月`,即为`84元/年`,每个月8000GB的可用额度,下个月重置流量额度
|
||||
根据我个人的使用情况,大多数情况下我每月的流量使用未超过50GB,如果没有频繁的流量使用,
|
||||
建议选择`12元/年`,否则可以选择`15元/季`,这意味着每月将有4000GB的可用额度
|
||||
|
||||
- `赔钱机场`
|
||||
|
||||

|
||||
可以看到
|
||||
- `18元/年`,每月100GB的可用额度,允许最多10个设备同时在线,下个月重置流量额度
|
||||
- `34.99元/年`,每月有500GB的可用额度,允许最多15个设备同时在线,下个月重置流量额度
|
||||
- `68.99元/年`,每个月1000GB的可用额度,允许最多20个设备同时在线,下个月重置流量额度
|
||||
- 其余可以自行查看
|
||||
|
||||
`赔钱机场`的订阅共有5种方案(按周期付费),这里我仅显示自己正在使用的,个人认为十分优惠:
|
||||
- `34.99元/年`,每月500GB的可用额度,根据我观察和使用,这个订阅方案比`一元机场`的性价比更高,且流量使用额度也不用担心
|
||||
|
||||
### 如何订阅?
|
||||
{% note success %}
|
||||
由于需要外部网络才能完成订阅服务的购买,你可以向我的邮箱`15202078626@163.com`发送你的订阅计划方案,
|
||||
扫描付款二维码,我将为你开通订阅(您只需要付款对应的订阅金额即可)
|
||||
{% endnote %}
|
||||
<img src="/img/dingyue.png" width='150px'>
|
||||
|
||||
### 完成订阅后如何使用?
|
||||
> 你可以在 `Windows`、`Mac`、`Android`等平台使用此服务
|
||||
> 使用订阅的对应链接: https://flowus.cn/shenjian/22f76d4f-e7b3-4b8a-8a89-561566f6eb60
|
||||
|
||||
|
||||
|
||||
6
source/about/index.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
title: About me
|
||||
date: 2024-08-10 10:35:41
|
||||
---
|
||||
|
||||
落花飞舞,翩若惊鸿。
|
||||
9
source/categories/index.md
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
title: categories
|
||||
date: 2024-07-31 08:33:49
|
||||
aside: false
|
||||
top_img: false
|
||||
type: "categories"
|
||||
---
|
||||
|
||||
### category
|
||||
BIN
source/img/000001.png
Normal file
|
After Width: | Height: | Size: 152 KiB |