当前位置: 首页 > news >正文

将Sqlite3数据库挂在内存上处理

创作灵感:最近把小学生的口算题从2位数改到3位数,100以内四则运算练习(千纬数学)再次更新,选取难题-CSDN博客要不断刷题目,以前100以内的加减乘除也是这样刷出来的,代码如下:

import sqlite3
import random
from time import time
from pathlib import Path#导入必要的库resources_folder = Path(__file__).joinpath("../resources/").resolve()
db_filepath = resources_folder.joinpath("qwsx.db")
#db_filepath = '/storage/emulated/0/Pictures/qwsx.db'
#上面是数据库的存放位置,生成手机app请参考我以前的文章
#oppo版 需要用电脑调试应删除下面5行def gettid(s1,fh,s2,dan):conn = sqlite3.connect(db_filepath, timeout=10, check_same_thread=False)c = conn.cursor()#如果公式存在,提取tidcursor = c.execute("SELECT count(tid) from ys where s1 = ? and fh = ? and s2 = ?;", (s1,fh,s2,))row = cursor.fetchone()ctid = row[0]#如果公式不存在,插入公式到数据库if ctid == 0:c.execute("INSERT INTO ys(s1,fh,s2,dan,cs,cuo) VALUES (?,?,?,?,0,0);", (s1,fh,s2,dan,))conn.commit()cursor = c.execute("SELECT tid from ys where s1 = ? and fh = ? and s2 = ? order by tid desc;", (s1,fh,s2,))row = cursor.fetchone()tid = row[0] c.close()conn.close()return(tid)
#获取tid,题目的id
def settm(nd):    if nd ==1:jj = random.randint(0,1)elif nd ==2:jj = random.randint(0,3)if jj == 0:#为加法 s1 = random.randint(0,100)s2 = random.randint(0,(100 - s1))cvalue = str(s1) + "+" + str(s2) + "=" dan = s1 + s2hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□+" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3:cvalue = str(s1) + "+□=" + str(dan) + ",□为"dan = s2elif ii ==4 and s2 > 0:#a+0=a,a-0=a,可以是+-cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号elif jj ==1:s1 = random.randint(0,100)s2 = random.randint(0,s1)cvalue = str(s1) + "-" + str(s2) + "=" dan = s1 - s2hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□-" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3:cvalue = str(s1) + "-□=" + str(dan) + ",□为"dan = s2elif ii ==4 and s2 > 0:#a+0=a,a-0=a,可以是+-cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号elif jj ==2:#乘法s1 = random.randint(1,10)s2 = random.randint(0,int(100 / s1))cvalue = str(s1) + "×" + str(s2) + "="dan = s1 * s2hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□×" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3 and s2 > 0:#a*0=0,b*0=0cvalue = str(s1) + "×□=" + str(dan) + ",□为"dan = s2elif ii ==4 and s2 !=1 and s1 != 0:#a*=a,a/1=a;0*a=0,0/a=0cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号elif jj ==3:s1 = random.randint(1,10)s2 = random.randint(0,int(100 / s1))s3 = s1dan = s1 * s2s1 = dans2 = s3cvalue = str(s1) + "÷" + str(s2) + "=" dan = int(s1 / s2)hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□÷" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3 and s1 > 0:#0/a=0cvalue = str(s1) + "÷□=" + str(dan) + ",□为"dan = s2elif ii ==4 and s2 !=1 and s1 !=0:#a*=a,a/1=a;0*a=0,0/a=0cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号cid = 0return(jj,dan,hd,cid,tid,cvalue)i = 0
while i < 1000000:settm(2)i=i+1

上面代码就是刷题100万次,让电脑随机出题。实际能够存入数据库的题目只有1万条。所以当初刷题的时候没有考虑计算机的运行效率和对资源的消耗,从上面程序看,每运行一次就要从硬盘读取数据库文件一次。这次不知道要刷题多少次才能将3位数以内的算式。问下deepseek:

官网的罢工:

用下国家超算平台DeepSeek的:

最终答案:

两个1至3位数相加或相减,得数在0到999范围内的所有算式共有 998,001 条。

再加上200以内的乘法和除法:

经过上述计算,我们得出所有满足条件的算式共有 2000 个。

除法应该在2000个以内。

下面是随机生成的代码:

import sqlite3
import random
from time import time
from pathlib import Path
import datetime
#导入必要的库resources_folder = Path(__file__).joinpath("../resources/").resolve()
db_filepath = resources_folder.joinpath("qwsx.db")
#db_filepath = '/storage/emulated/0/Pictures/qwsx.db'
#上面是数据库的存放位置,生成手机app请参考我以前的文章
#oppo版 需要用电脑调试应删除下面5行
for j in range(0,10):# 连接到磁盘上的数据库disk_conn = sqlite3.connect(db_filepath)# 连接到内存数据库memory_conn = sqlite3.connect(':memory:')# 使用 backup API 将磁盘数据库复制到内存数据库disk_conn.backup(memory_conn)xt = 0def gettid(s1,fh,s2,dan):global xtconn = memory_connc = conn.cursor()#如果公式存在,提取tidcursor = c.execute("SELECT count(tid) from ys where s1 = ? and fh = ? and s2 = ?;", (s1,fh,s2,))row = cursor.fetchone()ctid = row[0]#如果公式不存在,插入公式到数据库if ctid == 0:c.execute("INSERT INTO ys(s1,fh,s2,dan,cs,cuo) VALUES (?,?,?,?,0,0);", (s1,fh,s2,dan,))conn.commit()# print(s1,fh,s2,dan)else:# print('与数据库存在相同')xt = xt + 1cursor = c.execute("SELECT tid from ys where s1 = ? and fh = ? and s2 = ? order by tid desc;", (s1,fh,s2,))row = cursor.fetchone()tid = row[0] c.close()return(tid)#获取tid,题目的iddef settm(nd):    if nd ==1:jj = random.randint(0,1)elif nd ==2:jj = random.randint(0,3)if jj == 0:#为加法 s1 = random.randint(0,999)s2 = random.randint(0,(999 - s1))cvalue = str(s1) + "+" + str(s2) + "=" dan = s1 + s2hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□+" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3:cvalue = str(s1) + "+□=" + str(dan) + ",□为"dan = s2elif ii == 4 and s2 > 0:#a+0=a,a-0=a,可以是+-cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号elif jj ==1:s1 = random.randint(0,999)s2 = random.randint(0,s1)cvalue = str(s1) + "-" + str(s2) + "=" dan = s1 - s2hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□-" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3:cvalue = str(s1) + "-□=" + str(dan) + ",□为"dan = s2elif ii ==4 and s2 > 0:#a+0=a,a-0=a,可以是+-cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号elif jj ==2:#乘法s1 = random.randint(1,200)s2 = random.randint(0,int(200 / s1))cvalue = str(s1) + "×" + str(s2) + "="dan = s1 * s2hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□×" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3 and s2 > 0:#a*0=0,b*0=0cvalue = str(s1) + "×□=" + str(dan) + ",□为"dan = s2elif ii ==4 and s2 !=1 and s1 != 0:#a*=a,a/1=a;0*a=0,0/a=0cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号elif jj ==3:s1 = random.randint(1,200)s2 = random.randint(0,int(200 / s1))s3 = s1dan = s1 * s2s1 = dans2 = s3cvalue = str(s1) + "÷" + str(s2) + "=" dan = int(s1 / s2)hd = 1tid = gettid(s1,jj,s2,dan)ii = random.randint(0,4) #0为提交答案if ii == 2:cvalue = "□÷" + str(s2) + "=" + str(dan) + ",□为"dan = s1elif ii == 3 and s1 > 0:#0/a=0cvalue = str(s1) + "÷□=" + str(dan) + ",□为"dan = s2elif ii ==4 and s2 !=1 and s1 !=0:#a*=a,a/1=a;0*a=0,0/a=0cvalue = str(s1) + "□" + str(s2) + "=" + str(dan) + ",□为"dan = jjhd = 4 #hd4为符号cid = 0return(jj,dan,hd,cid,tid,cvalue)print(datetime.datetime.now())i = 0while i < 50000:settm(1)i=i+1print(f'与原来数据库存在{xt}个相同。')print(datetime.datetime.now())# 将内存数据库的内容写回磁盘数据库memory_conn.backup(disk_conn)# 关闭连接disk_conn.close()memory_conn.close()

这样要形成一个随机的表,太慢了,运行了半天:

2025-02-12 23:19:25.515728
与原来数据库存在25585个相同。
2025-02-13 00:10:52.646772
2025-02-13 00:10:52.894585
与原来数据库存在26770个相同。
2025-02-13 01:04:37.832301
2025-02-13 01:04:38.108767
与原来数据库存在27902个相同。
2025-02-13 02:01:26.172076
2025-02-13 02:01:26.429696
与原来数据库存在28961个相同。
2025-02-13 03:01:18.825697
2025-02-13 03:01:19.081742
与原来数据库存在30000个相同。
2025-02-13 04:03:55.562965
2025-02-13 04:03:55.833989
与原来数据库存在30767个相同。
2025-02-13 05:09:20.222007
2025-02-13 05:09:20.711048
与原来数据库存在31616个相同。
2025-02-13 06:16:58.876971
2025-02-13 06:16:59.169436
与原来数据库存在32288个相同。
2025-02-13 07:27:02.256963
2025-02-13 07:27:02.546013
与原来数据库存在33187个相同。
2025-02-13 08:42:14.837606
2025-02-13 08:42:15.139579
与原来数据库存在33747个相同。
2025-02-13 09:57:30.281790

而且,接下来要生成数据库不存在的公式,将越来越少。所以不如按顺序全部生成,不用1分钟就完成:

import sqlite3
import random
from time import time
from pathlib import Path
import datetime
#导入必要的库resources_folder = Path(__file__).joinpath("../resources/").resolve()
db_filepath = resources_folder.joinpath("qwsx.db")
#db_filepath = '/storage/emulated/0/Pictures/qwsx.db'
#上面是数据库的存放位置,生成手机app请参考我以前的文章
#oppo版 需要用电脑调试应删除下面5行# 连接到磁盘上的数据库
disk_conn = sqlite3.connect(db_filepath)# 连接到内存数据库
memory_conn = sqlite3.connect(':memory:')# 使用 backup API 将磁盘数据库复制到内存数据库
disk_conn.backup(memory_conn)def gettid(s1,fh,s2,dan):conn = memory_connc = conn.cursor()#如果公式存在,提取tidc.execute("INSERT INTO ysall(s1,fh,s2,dan,cs,cuo) VALUES (?,?,?,?,0,0);", (s1,fh,s2,dan,))conn.commit()c.close()return(1)
#获取tid,题目的id
def settm(jj):if jj == 0:#为加法 for s1 in range(0,1000):for s2 in range(0,(1000 - s1)):dan = s1 + s2tid = gettid(s1,jj,s2,dan)cvalue = str(s1) + "+" + str(s2) + "=" + str(dan)print(cvalue)elif jj ==1:for s1 in range(0,1000):for s2 in range(0,s1 + 1):dan = s1 - s2tid = gettid(s1,jj,s2,dan)cvalue = str(s1) + "-" + str(s2) + "=" + str(dan)print(cvalue)elif jj ==2:#乘法for s1 in range(1,201):for s2 in range(0,int(200 / s1) + 1):dan = s1 * s2tid = gettid(s1,jj,s2,dan)cvalue = str(s1) + "×" + str(s2) + "=" + str(dan)print(cvalue)elif jj ==3:ii = 0for s1 in range(1,201):# print(s1)s3 = s1for s2 in range(0,int(200 / s1) + 1):ii = ii + 1# print(s3)dan = s1 * s2ss1 = danss2 = s3sdan = int(ss1 / ss2)tid = gettid(ss1,jj,ss2,sdan)cvalue = str(ss1) + "÷" + str(ss2) + "=" + str(sdan)print(cvalue)print(ii)return(jj,dan,tid,cvalue)
print(datetime.datetime.now())
settm(3)
print(datetime.datetime.now())
# 将内存数据库的内容写回磁盘数据库
memory_conn.backup(disk_conn)# 关闭连接
disk_conn.close()
memory_conn.close()

在对这些数据进行随机写入:

# -*- coding: utf-8 -*-
"""
Created on Thu Feb 13 10:47:16 2025@author: YBK
"""
import sqlite3
import random
from pathlib import Pathresources_folder = Path(__file__).joinpath("../resources/").resolve()
db_filepath = resources_folder.joinpath("qwsx.db")
# 连接到磁盘上的数据库
disk_conn = sqlite3.connect(db_filepath)
# 连接到内存数据库
memory_conn = sqlite3.connect(':memory:')
# 使用 backup API 将磁盘数据库复制到内存数据库
disk_conn.backup(memory_conn)conn = memory_conn
c = conn.cursor()
#如果公式存在,提取tid
cursor = c.execute("SELECT tid from ysall;")
rows = cursor.fetchall()
ysshun = [row[0] for row in rows]
print(len(ysshun))
random.shuffle(ysshun)
for tid in ysshun:cursor = c.execute("SELECT s1,fh,s2,dan from ysall where tid = ?;",(tid,))row = cursor.fetchone()c.execute("INSERT INTO ys(s1,fh,s2,dan,cs,cuo) VALUES (?,?,?,?,0,0);", (row[0],row[1],row[2],row[3],))conn.commit()
c.close# 将内存数据库的内容写回磁盘数据库
memory_conn.backup(disk_conn)# 关闭连接
disk_conn.close()
memory_conn.close()

不用1分钟就能完成。

######################################################

因为我原来数据库有2位数的加减乘除算式,所以这次只是将3位数的算式加上去,为保留原有数据的内容,只需要对原来数据中没有的数据加上去就可以,为了提高速度,在生成随机列表后,对原有公式一致的tid删除即可,删除1万来行。

# -*- coding: utf-8 -*-
"""
Created on Thu Feb 13 10:47:16 2025@author: YBK
"""
import sqlite3
import random
from pathlib import Pathresources_folder = Path(__file__).joinpath("../resources/").resolve()
db_filepath = resources_folder.joinpath("qwsx.db")
# 连接到磁盘上的数据库
disk_conn = sqlite3.connect(db_filepath)
# 连接到内存数据库
memory_conn = sqlite3.connect(':memory:')
# 使用 backup API 将磁盘数据库复制到内存数据库
disk_conn.backup(memory_conn)conn = memory_conn
c = conn.cursor()
#如果公式存在,提取tid
cursor = c.execute("SELECT tid from ysall;")
rows = cursor.fetchall()
ysshun = [row[0] for row in rows]
print(len(ysshun))
random.shuffle(ysshun)
#找出所有旧数据库有的tid,在列表中删除掉
cursor = c.execute("SELECT s1,fh,s2,dan from ys;")
rows = cursor.fetchall()
for row in rows:s1 = row[0]fh = row[1]s2 = row[2]cursor = c.execute("SELECT tid from ysall where s1 = ? and fh = ? and s2 = ?;", (s1,fh,s2,))row = cursor.fetchone()if row:ctid = row[0]        ysshun.remove(ctid)print(f'删除{ctid}')else:print(f'{s1},{fh},{s2}不存在') 
#插入删除已经有的公式后没有的数据
for tid in ysshun:cursor = c.execute("SELECT s1,fh,s2,dan from ysall where tid = ?;",(tid,))row = cursor.fetchone()s1 = row[0]fh = row[1]s2 = row[2]dan = row[3]c.execute("INSERT INTO ys(s1,fh,s2,dan,cs,cuo) VALUES (?,?,?,?,0,0);", (s1,fh,s2,dan,))conn.commit()
c.close# 将内存数据库的内容写回磁盘数据库
memory_conn.backup(disk_conn)# 关闭连接
disk_conn.close()
memory_conn.close()

相关文章:

将Sqlite3数据库挂在内存上处理

创作灵感&#xff1a;最近把小学生的口算题从2位数改到3位数&#xff0c;100以内四则运算练习&#xff08;千纬数学&#xff09;再次更新&#xff0c;选取难题-CSDN博客要不断刷题目&#xff0c;以前100以内的加减乘除也是这样刷出来的&#xff0c;代码如下&#xff1a; impor…...

前端大屏适配方案:从设计到实现的全流程指南

引言 随着数据可视化需求的增长&#xff0c;大屏展示项目在前端开发中越来越常见。然而&#xff0c;大屏开发面临独特的挑战&#xff1a; 屏幕分辨率多样&#xff1a;从1080P到4K甚至8K&#xff0c;如何保证清晰度&#xff1f;布局复杂&#xff1a;多图表、多组件如何合理排列…...

学习总结三十二

map #include<iostream> #include<map> using namespace std;int main() {//首先创建一个map对象map<int, char>oneMap;//插入数据oneMap.insert(pair<int, char>(1, A));oneMap.insert(make_pair(2,B));oneMap.insert(map<int,char>::value_ty…...

飞书专栏-TEE文档

CSDN学院课程连接&#xff1a;https://edu.csdn.net/course/detail/39573...

linux 查看设备中的摄像头迅速验证设备号

​ 通常&#xff0c;摄像头在系统中会被识别为/dev/video*设备文件&#xff0c;比如/dev/video0、/dev/video1等。用户可能有多个摄像头&#xff0c;比如内置摄像头和外接USB摄像头&#xff0c;这时候每个摄像头会被分配不同的设备号。 1. 列出所有摄像头设备 方法 1&#xf…...

2.8 企业级训练数据构造革命:从人工标注到GPT智能标注的工业级实践指南

企业级训练数据构造革命:从人工标注到GPT智能标注的工业级实践指南 引言:数据标注——AI模型的基石与瓶颈 据2024年AI行业报告显示,高质量标注数据的获取成本占模型开发总成本的62%,且标注错误导致的模型性能下降可达40%。本文将揭示如何结合大模型能力,构建支持千万级数…...

DeepSeek的蒸馏技术:让模型推理更快

DeepSeek系列模型&#xff0c;如DeepSeek-R1-Distill-Qwen-7B&#xff0c;采用了知识蒸馏&#xff08;Knowledge Distillation&#xff09;技术&#xff0c;这是一种强大的模型压缩和优化方法。通过蒸馏&#xff0c;DeepSeek模型在保持甚至提升性能的同时&#xff0c;实现了更快…...

19.4.6 读写数据库中的二进制数据

版权声明&#xff1a;本文为博主原创文章&#xff0c;转载请在显著位置标明本文出处以及作者网名&#xff0c;未经作者允许不得用于商业目的。 需要北风数据库的请留言自己的信箱。 北风数据库中&#xff0c;类别表的图片字段在【数据表视图】中显示为Bitmap Image&#xff1…...

如何在 Elasticsearch 中设置向量搜索 - 第二部分

作者&#xff1a;来自 Elastic Valentin Crettaz 了解如何在 Elasticsearch 中设置向量搜索并执行 k-NN 搜索。 本文是三篇系列文章中的第二篇&#xff0c;深入探讨了向量搜索&#xff08;也称为语义搜索&#xff09;的复杂性以及它在 Elasticsearch 中的实现方式。 第一部分重…...

【CXX-Qt】0 Rust与Qt集成实践指南(CXX-Qt)

CXX-Qt 是一个用于在 Rust 和 Qt 之间实现安全互操作的库。与通常的 Rust Qt 绑定不同&#xff0c;它提供了一种不同的方式来桥接 Qt 代码和 Rust 代码。CXX-Qt 认识到 Qt 和 Rust 代码具有不同的习惯&#xff0c;因此不能直接从一个语言包装到另一个语言。相反&#xff0c;它使…...

C++ 设计模式-适配器模式

适配器模式示例,包括多电压支持、类适配器实现、安全校验等功能: #include <iostream> #include <memory> #include <stdexcept>// 抽象目标接口:通用电源接口 class PowerOutlet {public:virtual ~PowerOutlet() = default;virtual int outputPower() c…...

【Elasticsearch】文本分析Text analysis概述

文本分析概述 文本分析使 Elasticsearch 能够执行全文搜索&#xff0c;搜索结果会返回所有相关的结果&#xff0c;而不仅仅是完全匹配的结果。 如果你搜索“Quick fox jumps”&#xff0c;你可能希望找到包含“A quick brown fox jumps over the lazy dog”的文档&#xff0c…...

【IDEA】2017版本的使用

目录 一、常识 二、安装 1. 下载IDEA2017.exe 2. 安装教程 三、基本配置 1. 自动更新关掉 2. 整合JDK环境 3. 隐藏.idea文件夹和.iml等文件 四、创建Java工程 1. 新建项目 2. 创建包结构&#xff0c;创建类&#xff0c;编写main主函数&#xff0c;在控制台输出内容。…...

ES6 Proxy 用法总结以及 Object.defineProperty用法区别

Proxy 是 ES6 引入的一种强大的拦截机制&#xff0c;用于定义对象的基本操作&#xff08;如读取、赋值、删除等&#xff09;的自定义行为。相较于 Object.defineProperty&#xff0c;Proxy 提供了更灵活、全面的拦截能力。 1. Proxy 语法 const proxy new Proxy(target, hand…...

数据结构——【二叉树模版】

#思路 1、二叉树不同于数的构建&#xff0c;在树节点类中&#xff0c;有数据&#xff0c;左子结点&#xff0c;右子节点三个属性&#xff0c;在树类的构造函数中&#xff0c;添加了变量maxNodes&#xff0c;用于后续列表索引的判断 2.GetTreeNode()函数是常用方法&#xff0c;…...

关闭浏览器安全dns解决访问速度慢的问题

谷歌浏览器加载速度突然变慢了&#xff1f;检查安全DNS功能(DoH)是否被默认开启。 谷歌浏览器在去年已经推出安全DNS功能(即DoH) , 启用此功能后可以通过加密的DNS增强网络连接安全性。例如查询请求被加密后网络运营商将无法嗅探用户访问的地址&#xff0c;因此对于增强用户的…...

【AIGC】语言模型的发展历程:从统计方法到大规模预训练模型的演化

博客主页&#xff1a; [小ᶻ☡꙳ᵃⁱᵍᶜ꙳] 本文专栏: AIGC | ChatGPT 文章目录 &#x1f4af;前言&#x1f4af;语言模型的发展历程&#xff1a;从统计方法到大规模预训练模型的演化1 统计语言模型&#xff08;Statistical Language Model, SLM&#xff09;&#xff1a;统…...

Spring Boot 中的事务管理:默认配置、失效场景及集中配置

Spring Boot 提供了强大的事务管理功能&#xff0c;基于 Spring 的 Transactional 注解。本文将详细介绍事务的默认配置、事务失效的常见场景、以及事务的几种集中配置方式&#xff0c;并给出相应的代码片段。 一、事务的默认配置 在 Spring Boot 中&#xff0c;默认情况下&am…...

DeepSeek 助力 Vue 开发:打造丝滑的进度条

前言&#xff1a;哈喽&#xff0c;大家好&#xff0c;今天给大家分享一篇文章&#xff01;并提供具体代码帮助大家深入理解&#xff0c;彻底掌握&#xff01;创作不易&#xff0c;如果能帮助到大家或者给大家一些灵感和启发&#xff0c;欢迎收藏关注哦 &#x1f495; 目录 Deep…...

deepseek的CoT优势、两阶段训练的有效性学习笔记

文章目录 1 DeepSeek的CoT思维链的优势1.2 open-r1的CoT训练数据1.3 ReAct任务与CoT任务适用场景 2 AI推理方向&#xff1a;deepseek与deepmind的两条路线的差异2.1 PRM与ORM的两大学派分支的差异2.2 DeepSeek-R1的两阶段训练概述 1 DeepSeek的CoT思维链的优势 DeepSeek跟之前…...

AI-调查研究-01-正念冥想有用吗?对健康的影响及科学指南

点一下关注吧&#xff01;&#xff01;&#xff01;非常感谢&#xff01;&#xff01;持续更新&#xff01;&#xff01;&#xff01; &#x1f680; AI篇持续更新中&#xff01;&#xff08;长期更新&#xff09; 目前2025年06月05日更新到&#xff1a; AI炼丹日志-28 - Aud…...

Leetcode 3576. Transform Array to All Equal Elements

Leetcode 3576. Transform Array to All Equal Elements 1. 解题思路2. 代码实现 题目链接&#xff1a;3576. Transform Array to All Equal Elements 1. 解题思路 这一题思路上就是分别考察一下是否能将其转化为全1或者全-1数组即可。 至于每一种情况是否可以达到&#xf…...

黑马Mybatis

Mybatis 表现层&#xff1a;页面展示 业务层&#xff1a;逻辑处理 持久层&#xff1a;持久数据化保存 在这里插入图片描述 Mybatis快速入门 ![在这里插入图片描述](https://i-blog.csdnimg.cn/direct/6501c2109c4442118ceb6014725e48e4.png //logback.xml <?xml ver…...

电脑插入多块移动硬盘后经常出现卡顿和蓝屏

当电脑在插入多块移动硬盘后频繁出现卡顿和蓝屏问题时&#xff0c;可能涉及硬件资源冲突、驱动兼容性、供电不足或系统设置等多方面原因。以下是逐步排查和解决方案&#xff1a; 1. 检查电源供电问题 问题原因&#xff1a;多块移动硬盘同时运行可能导致USB接口供电不足&#x…...

【算法训练营Day07】字符串part1

文章目录 反转字符串反转字符串II替换数字 反转字符串 题目链接&#xff1a;344. 反转字符串 双指针法&#xff0c;两个指针的元素直接调转即可 class Solution {public void reverseString(char[] s) {int head 0;int end s.length - 1;while(head < end) {char temp …...

ServerTrust 并非唯一

NSURLAuthenticationMethodServerTrust 只是 authenticationMethod 的冰山一角 要理解 NSURLAuthenticationMethodServerTrust, 首先要明白它只是 authenticationMethod 的选项之一, 并非唯一 1 先厘清概念 点说明authenticationMethodURLAuthenticationChallenge.protectionS…...

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别

OpenPrompt 和直接对提示词的嵌入向量进行训练有什么区别 直接训练提示词嵌入向量的核心区别 您提到的代码: prompt_embedding = initial_embedding.clone().requires_grad_(True) optimizer = torch.optim.Adam([prompt_embedding...

动态 Web 开发技术入门篇

一、HTTP 协议核心 1.1 HTTP 基础 协议全称 &#xff1a;HyperText Transfer Protocol&#xff08;超文本传输协议&#xff09; 默认端口 &#xff1a;HTTP 使用 80 端口&#xff0c;HTTPS 使用 443 端口。 请求方法 &#xff1a; GET &#xff1a;用于获取资源&#xff0c;…...

解决:Android studio 编译后报错\app\src\main\cpp\CMakeLists.txt‘ to exist

现象&#xff1a; android studio报错&#xff1a; [CXX1409] D:\GitLab\xxxxx\app.cxx\Debug\3f3w4y1i\arm64-v8a\android_gradle_build.json : expected buildFiles file ‘D:\GitLab\xxxxx\app\src\main\cpp\CMakeLists.txt’ to exist 解决&#xff1a; 不要动CMakeLists.…...

日常一水C

多态 言简意赅&#xff1a;就是一个对象面对同一事件时做出的不同反应 而之前的继承中说过&#xff0c;当子类和父类的函数名相同时&#xff0c;会隐藏父类的同名函数转而调用子类的同名函数&#xff0c;如果要调用父类的同名函数&#xff0c;那么就需要对父类进行引用&#…...