分类 未分类 下的文章
jekyll根据Url的Get参数动态变更内容
jekyll本身是预处理成静态页面,所以是不支持的。如果还是只用静态页面服务器的话,要支持只能从js上想办法。
JS获得GET参数
location.search可以获取get参数, 如?b=qq&c=dd,然后将其转化为json对象,我用的是字符串替换+JSON.parse
let urlParams = JSON.parse('{"'+location.search.substring(1).replace(/=/g,'":"').replace(/&/g,'","')+'"}')对单个DOM元素在JS中修改
给DOM元素加id,再通过js修改即可。
  document.getElementById('name').innerText = someNewName按GET参数不同显示不同的post
可以先在css中设置class,属性是display:none将元素隐藏,然后将所有的post按打上不同的class标记,再在js中遍历post的元素,将需要显示的class标记删除。
css:
.qq,.tr{
display:none;
}预处理前的liquid代码
<li class="{{post.b}}"> ....</li>js代码
    var all = document.getElementsByClassName(urlParams.b);
    console.log(all.length)
    //这儿删除了 i++, 因为 每次使用classList.remove, 都会让当前的all[i]从all的数组中删除, 数组会不断变短直至为0
    for (var i = 0; i < all.length;) { 
      all[i].classList.remove(urlParams.b)
    }批量修改class颜色
可以通过css变量
参考:https://stackoverflow.com/questions/9436123/javascript-changing-a-class-style/65471649
:root {
    --some-color: red;
}
.someClass {
    color: var(--some-color);
}Then you can change the variable's value in Javascript with
document.documentElement.style.setProperty('--some-color', '(random color)');矿机改做AI训练?
2018年的文章: 【年薪千万超级矿工】共享矿机训练神经网络,收益是挖矿4倍
Magic Eye
ESP8266腾讯Qcloud AT命令集
中国纹饰及其含义
其他参考文献
传统窗格图案几何纹饰及其艺术特征
V1分布图
根据企查查2021-8-18
| Floor | 01 | 02 | 03 | 04 | 05 | 06 | 07 | 08 | 09 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 总计 | 计数 | 
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4-7 | 1 | 1 | 1 | |||||||||||||||
| 8 | 1 | 2 | 2 | 1 | 1 | 1 | 1 | 1 | 10 | 8 | ||||||||
| 10 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 2 | 2 | 7 | 2 | 20 | 11 | |||||
| 12 | 1 | 1 | 1 | 1 | 1 | 1 | 4 | 2 | 12 | 8 | ||||||||
| 14 | 2 | 1 | 2 | 1 | 1 | 7 | 5 | |||||||||||
| 16 | 2 | 1 | 1 | 2 | 2 | 1 | 1 | 10 | 7 | |||||||||
| 18 | 1 | 2 | 2 | 7 | 1 | 1 | 1 | 15 | 7 | |||||||||
| 20 | 1 | 2 | 2 | 5 | 3 | |||||||||||||
| 22 | 2 | 2 | 1 | 1 | 2 | 3 | 11 | 6 | ||||||||||
| 26 | 2 | 1 | 3 | 1 | 1 | 8 | 5 | |||||||||||
| 28 | 1 | 8 | 1 | 3 | 3 | 1 | 1 | 18 | 7 | |||||||||
| 30 | 1 | 2 | 3 | 2 | ||||||||||||||
| 总计 | 3 | 5 | 16 | 1 | 3 | 2 | 1 | 3 | 4 | 12 | 14 | 12 | 6 | 10 | 17 | 11 | 120 | |
| 计数 | 3 | 4 | 6 | 1 | 2 | 2 | 1 | 2 | 2 | 8 | 7 | 7 | 5 | 6 | 7 | 7 | 
AI人工智能的认证
知乎上的回答
tensorflow官方认证地址
考取google Tensorflow认证的流程
另一个老外的TensorFlow考试经历
Tensorflow考试准备
学习教程
AI技术文章
容量、过拟合和欠拟合
深度学习中过拟合、欠拟合问题及解决方案
熵,交叉熵,二分类交叉熵/Entropy, crossentropy, binary crossentropy
正则化
正则化消除过拟合
AI前沿思考
笔记本电脑上训练
PS: 可以通过Nvidia的显卡加速, 不过在i7-8550U+MX150上测试, MX150似乎比CPU还慢.
使用MX150:
2021-08-23 11:01:05.658828: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cufft64_10.dll
2021-08-23 11:01:05.661719: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library curand64_10.dll
2021-08-23 11:01:05.667080: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cusolver64_11.dll
2021-08-23 11:01:05.672298: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cusparse64_11.dll
2021-08-23 11:01:05.681747: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudnn64_8.dll
2021-08-23 11:01:05.681986: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0
2021-08-23 11:01:05.682349: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-08-23 11:01:05.683329: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties: 
pciBusID: 0000:01:00.0 name: NVIDIA GeForce MX150 computeCapability: 6.1
coreClock: 1.341GHz coreCount: 3 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 37.33GiB/s
2021-08-23 11:01:05.683674: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1871] Adding visible gpu devices: 0
2021-08-23 11:01:06.781669: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-08-23 11:01:06.781862: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264]      0 
2021-08-23 11:01:06.781974: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1277] 0:   N 
2021-08-23 11:01:06.784405: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1418] Created TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 1332 MB memory) -> physical GPU (device: 0, name: NVIDIA GeForce MX150, pci bus id: 0000:01:00.0, compute capability: 6.1)
2021-08-23 11:01:07.432975: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:176] None of the MLIR Optimization Passes are enabled (registered 2)
Epoch 1/5
2021-08-23 11:01:07.782500: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublas64_11.dll
2021-08-23 11:01:08.920483: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublasLt64_11.dll
1875/1875 [==============================] - 6s 2ms/step - loss: 0.2974 - accuracy: 0.9155
Epoch 2/5
1875/1875 [==============================] - 5s 2ms/step - loss: 0.1430 - accuracy: 0.9569
Epoch 3/5
1875/1875 [==============================] - 5s 2ms/step - loss: 0.1057 - accuracy: 0.9685
Epoch 4/5
1875/1875 [==============================] - 5s 2ms/step - loss: 0.0867 - accuracy: 0.9742
Epoch 5/5
1875/1875 [==============================] - 5s 3ms/step - loss: 0.0741 - accuracy: 0.9764
313/313 - 1s - loss: 0.0704 - accuracy: 0.9784
Process finished with exit code 0
上面MX150的Epoch每一项在5~6秒, 而使用CPU只需要1~2秒:
D:\r\pyproj\TFproj1\venv\Scripts\python.exe D:/r/pyproj/TFproj1/main.py
2021-08-23 11:04:35.810645: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudart64_110.dll
2.5.0
2021-08-23 11:04:39.140247: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library nvcuda.dll
2021-08-23 11:04:39.791839: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1733] Found device 0 with properties: 
pciBusID: 0000:01:00.0 name: NVIDIA GeForce MX150 computeCapability: 6.1
coreClock: 1.341GHz coreCount: 3 deviceMemorySize: 2.00GiB deviceMemoryBandwidth: 37.33GiB/s
2021-08-23 11:04:39.792157: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cudart64_110.dll
2021-08-23 11:04:39.808505: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublas64_11.dll
2021-08-23 11:04:39.808676: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cublasLt64_11.dll
2021-08-23 11:04:39.813804: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cufft64_10.dll
2021-08-23 11:04:39.816603: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library curand64_10.dll
2021-08-23 11:04:39.822109: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cusolver64_11.dll
2021-08-23 11:04:39.827115: I tensorflow/stream_executor/platform/default/dso_loader.cc:53] Successfully opened dynamic library cusparse64_11.dll
2021-08-23 11:04:39.832314: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'cudnn64_8.dll'; dlerror: cudnn64_8.dll not found
2021-08-23 11:04:39.832637: W tensorflow/core/common_runtime/gpu/gpu_device.cc:1766] Cannot dlopen some GPU libraries. Please make sure the missing libraries mentioned above are installed properly if you would like to use GPU. Follow the guide at https://www.tensorflow.org/install/gpu for how to download and setup the required libraries for your platform.
Skipping registering GPU devices...
2021-08-23 11:04:39.833777: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations:  AVX AVX2
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.
2021-08-23 11:04:39.834660: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1258] Device interconnect StreamExecutor with strength 1 edge matrix:
2021-08-23 11:04:39.834922: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1264]      
2021-08-23 11:04:40.297728: I tensorflow/compiler/mlir/mlir_graph_optimization_pass.cc:176] None of the MLIR Optimization Passes are enabled (registered 2)
Epoch 1/5
1875/1875 [==============================] - 2s 840us/step - loss: 0.2934 - accuracy: 0.9141
Epoch 2/5
1875/1875 [==============================] - 1s 764us/step - loss: 0.1421 - accuracy: 0.9578
Epoch 3/5
1875/1875 [==============================] - 2s 853us/step - loss: 0.1091 - accuracy: 0.9674
Epoch 4/5
1875/1875 [==============================] - 2s 1ms/step - loss: 0.0881 - accuracy: 0.9730
Epoch 5/5
1875/1875 [==============================] - 2s 1ms/step - loss: 0.0763 - accuracy: 0.9759
313/313 - 0s - loss: 0.0729 - accuracy: 0.9780
Process finished with exit code 0创业三条
以前认为至少两条:
1、预测准;
2、对人好;
现在得加第三条:
3、执行力强;
要强成信仰一样。
[转载]在win10家庭版中使用gpedit.msc组策略管理器
原文连接
启用方式是以管理员运行下面的bat文件:
@echo off
pushd "%~dp0"
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~3*.mum >List.txt
dir /b C:\Windows\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~3*.mum >>List.txt
for /f %%i in ('findstr /i . List.txt 2^>nul') do dism /online /norestart /add-package:"C:\Windows\servicing\Packages\%%i"
pause[转载]在 Windows 10 中使用系统文件检查器
系统文件检查器是 Windows 10 中的一个实用工具,用于检查计算机中文件的问题。若要运行它,请按照下列步骤进行操作:
确保已安装 Windows 10 的最新更新,然后重启计算机。若要了解详细信息,请阅读更新 Windows 10。
在任务栏上的搜索框中,键入“命令提示符”,然后长按或右键单击结果列表内的“命令提示符”(桌面应用)。选择“以管理员身份运行”,然后选择“是”。
键入 DISM.exe /Online /Cleanup-image /Restorehealth(注意每个 "/" 前的空格),然后按“Enter”键。(注意:此步骤可能需要几分钟才会启动,最多可能需要 30 分钟才能完成。)
在看到显示“操作已成功完成”的消息后,键入sfc /scannow(注意“sfc”和“/”之间的空格),然后按下“Enter”。
在看到一条显示“验证 100% 完成”的消息后,键入“退出”。
电脑竟然中病毒了
这么洁身自好竟然中病毒了? 上周五下午去小米换电池, 难道是小米维修?
症状:
- CPU占用率极高, 一晚上没有关机电脑很烫.
- 不能打开任务管理器, 提示被管理员禁用.
- 不能打开组策略管理器 GPEDIT.msc.
腾讯电脑管家居然不报.
C盘 AutoRun.inf
我只能转为图片上传, 因为有的杀毒软件会检测这些病毒内容,并且自动断开与网站的链接.

D 盘 AutoRun.inf

jbqgma.exe
100 KB (103,140 字节)
ulvx.pif
在 https://r.virscan.org/ 上扫描, 结果如下:
文件名称 :ulvx.pif (本站不提供任何文件的下载服务)
文件大小 :103140 byte
文件类型 :PE32 executable (GUI) Intel 80386
MD5:b7ff0959b1568d9530a4c69661dbebc7
SHA1:1b3b4f74fd93e1786c2c195125c28aaae5d8f57b
SHA256:9e9d4b2eaf3c20b3c4397c205989970d2064a7d1a8ced715e62c955d3f8922e5
SSDEEP:1536:5ww2cwmgypHD4U4EYtBnp9LFT8RkTWvaYGTQ2fACZWoWafNRyX2QCSQeAxkR5DlY:5zDJD4CYzxLCig2aoWPmQCSQlkR5m
| 软件名称 | 引擎版本 | 病毒库版本 | 病毒库时间 | 扫描结果 | 扫描耗时 | 
|---|---|---|---|---|---|
| AVAST! | 18.4.3895.0 | 18.4.3895.0 | 44391 | Win32:Sality | 11 | 
| AVG | 10.0.1405 | 10.0.1405 | 44391 | Win32:Sality | 7 | 
| Alyac | 17.7.13.1 | 17.7.13.1 | 44391 | Worm.Sality.3.Gen | 5 | 
| Arcabit | 1 | 1 | 44391 | W32.Sality.BH.Dropper2 | 8 | 
| Authentium | 4.6.5 | 5.3.14 | 44391 | 没有发现病毒 | 1 | 
| Avira | 1.9.2.0 | 1.9.159.0 | 44391 | W32/Sality.AT | 9 | 
| Baidu Antivirus | 2.0.1.0 | 4.1.3.52192 | 44391 | Virus.Win32.Sality.$Emu | 1 | 
| Bitdefender | 7.141118 | 7.141118 | 44391 | 没有发现病毒 | 21 | 
| ClamAV | 26230 | 0.100.2 | 44390 | Win.Virus.Sality-1067 | 1 | 
| Comodo | 6.5.0.819 | 6.5.0.819 | 44329 | Virus.Win32.Sality.gen@1egj5j | 2 | 
| Cyren | 6.0.0.4 | 6.0.0 | 44391 | W32/Sality.AN.gen!Eldorado | 2 | 
| Defenx | 11.193.37706 | 15.2.0.53 | 44390 | Trojan ( 001e7bc71 ) | 1 | 
| Dr.Web | 11.0.10.1810231600 | 11.0.10.1810231600 | 44391 | Win32.Sector.31 | 12 | 
| F-PROT | 4.6.2.117 | 6.5.1.5418 | 42405 | 没有发现病毒 | 1 | 
| F-Secure | 2015-08-01-02 | 9.13 | 44391 | Malware.W32/Sality.AT | 6 | 
| Fortinet | 1.000, 71.889, 71.844, 71.868 | 5.4.247 | 43773 | W32/LPECrypt.A!tr | 1 | 
| GData | 25.29645 | 25.29645 | 44331 | Win32.Sality.3 | 12 | 
| GridinSoft | 1.0.27.118 | 1.0.27.118 | 44232 | 没有发现病毒 | 4 | 
| Hunter | 1.0.1.300 | 1.0.1.300 | 44391 | 没有发现病毒 | 1 | 
| IKARUS | 5.06.02 | V5.05.01 | 44390 | Virus.Win32.Sality | 5 | 
| K7 | 11.193.37706 | 15.2.0.53 | 44390 | Trojan ( 001e7bc71 ) | 1 | 
| NOD32 | 9846 | 4.5.15 | 44391 | 没有发现病毒 | 1 | 
| Nano | 1.0.134.90567 | 1.0.134.90567 | 44391 | Virus.Win32.Sality.beygb | 4 | 
| QQ手机 | 2.0.0.0 | 2.0.0.0 | 44391 | 没有发现病毒 | 1 | 
| Quickheal | 14 | 14 | 44391 | W32.Sality.U | 3 | 
| SOPHOS | 5.32 | 3.65.2 | 44391 | 没有发现病毒 | 1 | 
| Sunbelt | 3.9.2671.2 | 3.9.2671.2 | 44391 | Virus.Win32.Sality.at | 18 | 
| Systweak | 1 | 1 | 44391 | 没有发现病毒 | 1 | 
| TheHacker | 6.8.0.5 | 6.8.0.5 | 44391 | W32/Sality.gen | 3 | 
| Vba32 | 5.0.0 | 5.0.0 | 44390 | Virus.Win32.Sality.bakb | 5 | 
| ViRobot | 2.73 | 2.73 | 42034 | 没有发现病毒 | 1 | 
| VirusBuster | 15.0.985.0 | 5.5.2.13 | 44391 | 没有发现病毒 | 5 | 
| Xvirus | 2.0.0 | 2.0.0 | 44391 | 没有发现病毒 | 1 | 
| emsisoft | 9.0.0.4799 | 9.0.0.4799 | 44391 | 没有发现病毒 | 0 | 
| nProtect | 9.9.9 | 9.9.9 | 44391 | Trojan.SalityStub.A | 35 | 
| 卡巴斯基(kavfs) | 8.0.4.312 | 8.0.4.312 | 43490 | Virus.Win32.Sality.gen | 2 | 
| 卡巴斯基(klms) | 5.5.33 | 5.5.33 | 44391 | Virus.Win32.Sality.gen | 2 | 
| 奇虎360 | 1.0.1 | 1.0.1 | 44391 | Trojan.Win32.SalityStub.A | 4 | 
| 安博士V3 | 9.9.9 | 9.9.9 | 44391 | Win32/Kashu.E | 8 | 
| 安天 | AVL SDK 3.0 | AVL SDK 3.0 | 44391 | Virus/Win32.Sality.gen | 1 | 
| 新华三 | 1.0.114 | 1.0.114 | 44385 | 没有发现病毒 | 11 | 
| 江民杀毒 | 16.0.100 | 1.0.0.0 | 44391 | Win32/HLLP.Kuku.poly2 | 42 | 
| 深信服 | 2.20200403 | 2.20200403 | 44391 | Malware | 3 | 
| 熊猫卫士 | 9.05.01 | 9.05.01 | 44391 | W32/Sality.AK.drp | 19 | 
| 瑞星 | 5380 | 5380 | 44391 | Malware.Heuristic | 1 | 
| 百度杀毒 | 1 | 1 | 44391 | 没有发现病毒 | 1 | 
| 费尔 | 17.47.17308 | 1.0.2.2108 | 44332 | Suspicious:Trojan.Quk.a.eobw.mg | 2 | 
| 赛门铁克 | 20151230.005 | 1.3.0.24 | 42368 | 没有发现病毒 | 1 | 
| 趋势科技 | 13.302.06 | 9.500-1005 | 44391 | PE_SALITY.RL-O | 1 | 
| 迈克菲 | 8254 | 5400.1158 | 44358 | W32/Sality.gen.z | 5 | 
| 金山毒霸 | 2.1 | 2.1 | 43497 | Win32.Heur.KVMH004.a | 8 | 
■Heuristic/Suspicious ■Exact
注意: 就算报告发现病毒,也可能是杀软误报,请根据查毒结果自行判断 
分析
应该是在最近中的病毒. 一着急没去看病毒文件的创建日期就给删掉了. 看起来似乎是U盘病毒. 除了在小米换电池, 还有就是上周去出差电脑拿出来做演示, 是不是有病毒文件通过别人的U盘传入? 就不知道了.
杀毒
使用Avast全盘杀毒, 查出来3660个病毒, 大多是Win32: SaliCode[Inf]病毒,还有一些是Wrm病毒, 感染的主要是Exe文件. 我使用everything搜索所有Exe文件并对修改时间排序, 除了Avast正在查杀修改的Exe以外, 竟然找不到其他大批量修改Exe的时间段?!
对步进电机28BYJ-48的介绍
太极创客对28BYJ-48单极性步进电机的介绍很详细, 型号源于名称: 外径28毫米四相八拍式永磁减速型步进电机.B是步进,Y是永磁, J是减速,哈哈很明显是我国的电机标准.
太极创客对这个步进电机的原理的介绍讲转子有6齿而定子有8齿, 最后算下来每一步是11.25度, 很有道理但很可惜, 是错的. 按转子6齿, BCDA每次循环完毕, 转子只会转45/3×4=60度, 每一步只有45/3=15度. 但11.25度这个结论却是对的. 是因为其实转子和定子都是8齿!
这个老外的博客对28BYJ-48这个国产型号电机进行了详细的拆解分析, 反而是正确的.
定子是4个8齿的齿板组成, 分上下两组. 每组两个齿板两两相对. 每个齿板上, 齿角是360/8=45度. 从上到下四个齿板角度依次为0度, (45/4)×2度, (45/4)×1度, (45/4)×3度. 转子是8个方向的永磁铁组成. 每一步可以走45/4=11.25度. 走完一圈是360/11.25=32步. 减速比1/64, 故最外层走完一圈是32×64=2048步. 然而上下两组齿板同时通磁,可以形成半步, 这样可以做到2048×2=4096个不同角度.

舵机与步进电机对比
直观上, 舵机的噪音好大.
我买的这款步进电机28BYJ-48, 在转动的时候似乎在不停的震颤. 难道是步进的缘故?











