- 博客(35)
- 资源 (7)
- 收藏
- 关注

原创 Python实现定时发邮件
1. STMP简介smtp协议即简单邮件传输协议,而在Python的smtplib库对smtp协议进行了封装,对于用户很友好,关于smtplib库的详细介绍可以看官方的文档。2. QQ邮箱授权码的获取登陆网页版qq邮箱,在帐户那里可以开启qq邮箱的服务,然后点击授权码,在输入QQ安全中心(手机令牌)显示的动态密码,这样子就可以生成QQ邮箱的授权码了。3. SMTP 端口号端口25:s...
2020-05-01 21:33:27
200080
4
原创 输出无重复的3位数和计算无人机飞行坐标
从{1,2,3,4,5,6,7,8,9}中随机挑选不重复的5个数字作为输入数组‘selectedDigits’,能组成多少个互不相同且无重复数字的3位数?请编写程》序,从小到大顺序,以数组形式输出这些3位数。
2023-08-14 00:06:35
927
原创 python虚拟环境的安装以及移动目录虚拟环境失效的解决办法
python虚拟环境的安装以及移动目录虚拟环境失效的解决办法6.环境导入7.移动目录环境失效的解决办法步骤🎈:找到python的安装路径win+R,cmd,where python复制python.exe处在的文件目录,粘贴到test1环境下的配置文件pyvenv.cfg的home路径步骤🎈🎈:删掉script里面的pip.exe,重新安装
2022-09-08 10:13:19
1550
原创 小红拿到了一个仅由大小写字母组成的长度为n的字符串,她希望把前k个字母变成大写,后n- k个字母变成小写,你能帮帮她吗?
第二行输入一个长度为n的、仅由大小写字母组成的字符串。第一行输入两个正整数n和k,用空格隔开。
2022-08-28 13:53:31
2909
原创 git的基本用法
1. 配置用户名及邮箱git config --global user.name "xxx"git config --global user.email "xxx"2. 查看用户名及邮箱git config user.namegit config user.email3. 初始化 git init4. 添加项目的全部文件git add .5. 提交git commit -m 'message'6. 将本地代码库与远程代码库相关联git remote add origin
2022-07-25 20:40:24
129
原创 typescript中安装第三方库报错
typescript中安装第三方库报错:S7016: Could not find a declaration file for module ‘crypto-js’解决方式:安装它的类型定义的包官网npm i --save-dev @types/crypto-js其它ts的报错**S7016**也可以这样解决。
2022-07-25 20:35:57
1536
原创 fastspi报错:[WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试
ERROR: [WinError 10013] 以一种访问权限不允许的方式做了一个访问套接字的尝试。uvicorn main:app --reload默认8000端口所以修改它的的端口uvicorn main:app --reload --port 8500
2022-07-25 20:34:18
688
原创 vue3中数据修改了,视图未及时更新的解决办法
错误做法但是,使用****filter方法过滤数据重新赋值后,数据修改了,视图却没有更新,这和vue3的更新机制有关。例子说明:正确做法接下来,换个思路,换成splice方法,改变原数组。具体用法:Array.prototype.splice()此次的需求是删除其中一个元素,故基本语法如下:所以需要找到该对象元素在数组的索引方法1:indexOf()方法2:findIndex()结语问题完美地解决了~......
2022-07-01 21:10:04
18726
原创 前端实现背景模式的切换
单选框css变量操作dom修改样式3.css 变量var() 函数用于插入 CSS 变量的值。var() 函数的语法如下:值描述name必需,变量名(以两条破折号开头)value可选,回退值(在未找到变量时使用)变量名称必须以两个破折号(–)开头,且区分大小写!querySelectorAll方法的官网链接:querySelectorAll返回与指定的选择器组匹配的文档中的元素列表 (使用深度优先的先序遍历文档的节点)。返回的对象是NodeList。6.dom修改
2022-06-29 20:47:24
604
原创 This expression is not callable. Type ‘typeof import(“xxx“)‘ has no call signatures.ts(2349)
报错:import markedThis expression is not callable. Type 'typeof import("xxx")' has no call signatures.ts(2349)原因:import marked from 'marked'导入方式的错误修改:import {marked} from 'marked'
2022-05-08 14:11:27
5263
原创 vscode中进行typescript安装和使用的全套流程
npm install -g typescript管理员tsc -v查看版本报错:tsc : 无法加载文件 D:\codeSoftware\node\tsc.ps1,因为在此系统上禁止运行脚本。解决办法运行 set-ExecutionPolicy RemoteSigned 命令,在询问更改执行策略的时候选择敲Y或者A运行 get-ExecutionPolicy 命令,可看到脚本的执行策略已被更改为 RemoteSignedtsc --init生成配置文件删除之前写的ts和js文件,重
2022-05-08 14:00:28
1098
原创 react项目中设置环境变量(cross-env+react)
react项目中设置环境变量官网安装:npm install --save-dev cross-env
2022-03-10 09:36:57
3377
原创 react项目实现前端国际化(react+react-i18next)
1. 安装 react-i18nextnpm install react-i18next i18next --save2. 代码结构i18n的配置i18n.jsimport i18n from "i18next";import { initReactI18next } from "react-i18next";import en from "./locales/en.json";import zh from "./locales/zh.json";import LanguageDetec
2022-03-02 09:50:48
1989
1
原创 vite+react+typescript项目的创建
npm create vite@latest my-react-app – --template react-ts
2022-02-24 19:55:28
515
原创 解决react-router-dom V6路由嵌套时子路由无法显示的问题
<Route path="/" element={<NewsSandBox />} />NewsSandBox组件下的代码:import React from "react";import { HashRouter, Routes, Route } from "react-router-dom";import SideMenu from "../../components/sandbox/SideMenu";import TopHeader from "../../com
2022-01-16 14:54:40
5920
1
原创 Es-lint报错:Unnecessary else after return. no-else-return
报错:Unnecessary else after return. no-else-return错误:def foo(x): if x: return 1 else: return 2正确:def foo(x): if x: return 1 return 2
2022-01-14 13:29:32
5115
原创 浏览器地址栏的使用小技巧
1. 浏览器网页变成编辑器data:text/html,<html contenteditable>2. 浏览器网页输入htmldata:text/html,<h1>hello world</h1>
2022-01-14 13:23:53
197
原创 GitHub 镜像访问
GitHub 镜像访问这里提供两个最常用的镜像地址:https://github.com.cnpmjs.orghttps://hub.fastgit.org
2021-12-04 09:56:22
2349
原创 Github clone 报错:Failed to connect to github.com port 443 after 21103 ms: Timed out
2021-12-04 09:44:07
991
原创 typescript+react+antd实现表格内容的删除
代码如下:import React from "react"import { useState } from "react";import { Table, Space } from 'antd';import 'antd/dist/antd.css'function TableTest() { const initData = [ { id: '1', name: 'John Brown', ag
2021-11-26 19:32:09
764
原创 Type ‘string | null‘ is not assignable to type ‘string‘. Type ‘null‘ is not assignable to type ‘
报错如下:Type ‘string | null’ is not assignable to type ‘string’.Type ‘null’ is not assignable to type ‘string’.ts(2322)解决办法:token: localStorage.getItem("token") || ''
2021-11-18 19:13:51
7120
原创 ‘App‘ cannot be used as a JSX component. Its return type ‘Element[]‘ is not a valid JSX element.
记录最近在用ts写react遇到的一个问题:代码如下:function App() { const nameArray:string[] = ['Bob','Jack','Mary']; return( nameArray.map((name:string)=>{ return( <div>{name}</div> ) }) ) }然后报错:‘App’ cannot be used as a JSX compo
2021-10-29 20:55:16
8432
原创 日月光华深度学习课程资源详解
最近,对深度学习感兴趣,报了日月光华深度学习课程,所以给大家分享全部的代码、PPT、数据集资源:下载链接以下是fashion mnist数据集的识别分类代码:import tensorflow as tfimport matplotlib.pyplot as pltimport numpy as np(train_image,train_lable),(test_image,test_label)= tf.keras.datasets.fashion_mnist.load_data()print
2021-04-23 16:54:24
1784
1
原创 加载模型时报错:model_config = json.loads(model_config.decode(‘utf-8‘))
记录今天在加载深度学习所训练生成的模型model时,遇到的一个bug:model_config = json.loads(model_config.decode('utf-8')AttributeError: 'str' object has no attribute 'decode'解决方式,运行下面的命令即可解决,亲测有效!pip install tensorflow h5py==2.10.0...
2021-04-21 15:47:59
4781
12
原创 KNN算法实现鸢尾花的种类预测
K-近邻算法(KNN)实现鸢尾花的预测:from sklearn.datasets import load_irisfrom sklearn.model_selection import train_test_splitfrom sklearn.preprocessing import StandardScalerfrom sklearn.neighbors import KNeighborsClassifierdef knn_iris(): """ 用KNN算法来对鸢尾花进行分类
2021-04-09 20:25:06
694
4
原创 python实现QQ聊天自动化
下面的代码可以实现QQ自动发消息,分为文本和图片两种:import win32guiimport win32conimport win32clipboard as clipboardimport timefrom PIL import Imagefrom io import BytesIOdef send(name, msg): # 打开剪贴板 clipboard.OpenClipboard() # 清空剪贴板 clipboard.EmptyClipboard(
2021-04-06 09:52:22
2258
3
原创 如何安装python的第三方库?
对于很多刚刚开始接触python的人来讲,想要跑一下网上找来的代码,一般就放到python官方的解释器idle上运行,很大程度上会报错,比如需要用到lxml这个库的时候,会报错:ModuleNotFoundError: No module named 'lxml'接下来,我们手把手来安装它。1、首先,同时在键盘上按住win+R键2、进入下面的界面,输入pip install lxml,如下:3、等待一会儿,观察结果,报一大串的红色错误。报错原因:网络不好或者外网,外网连不通。4、解决办
2021-01-29 19:18:03
1575
4
原创 Sorry, we still could not detect a valid JDK, which we need to proceed.
我们在首次安装Android Studio的时候,可能会遇到以下的报错情况:Sorry, we still could not detect a valid JDK, which we need to proceed.If setting your JDK path manually, make sure you have browsed to a parent directory that contains a "bin'java.exe" whose version reports 1.7or hig
2020-12-30 16:04:00
1370
4
原创 新手入门Vim须知的基本操作
1. Vim简介Vim 共分为三种模式,分别是命令模式,输入模式和底线命令模式。模式作用命令模式打开文件之后, 默认进入命令模式输入模式需要输入一些命令, 切换到编辑模式底线命令模式在末行模式下可以输入一些命令2. 命令模式的操作2.21>. 光标的移动项目Value电脑$1600手机$12导管$1...
2020-05-07 19:11:29
342
5
原创 Matlab数字图像处理常用函数
1. imread()作用:从图形文件读取图像。语法:A = imread(filename)示例:im = imread('bear.jpg');imshow(im)显示结果:#### 2. imshow()作用:显示图像。语法:imshow(I) %在图窗中显示灰度图像 Iimshow(I,[low high]) %显示灰度图像 I,以二元素向量 [low...
2020-04-24 21:44:47
3081
3
基于STM32的指纹识别门禁系统设计
2021-01-14
嵌入式实习:基于STM32和UCOS操作系统的简易电子琴
2020-12-28
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人