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

Stm32_标准库_16_串口蓝牙模块_手机与蓝牙模块通信_手机传入信息能对芯片时间日期进行更改

实现了手机发送信息给蓝牙模块,程序对数据进行分析拆解,并更新自身数据

main.c:

#include "stm32f10x.h"    // Device header
#include "Delay.h"
#include "OLED.h"
#include "Serial.h"
#include "Time.h"
#include "Function.h"
#include <stdio.h>
#include <stdlib.h>char *News = NULL;//存数据
unsigned int time[] = {22, 59, 30};
unsigned int date[] = {2023, 12, 31};
char month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
unsigned int updateTime[] = {0, 0, 0};
unsigned int updateDate[] = {0, 0, 0};void TIM2_IRQHandler(void){//定时器2//主要运用时间更新if(TIM_GetITStatus(TIM2, TIM_IT_Update) == SET){TIM_ClearITPendingBit(TIM2, TIM_IT_Update);//清除标志位Time_Control(time, month, date);}}int main(void){OLED_Init();//初始化OLEDTime_Init();//开启计时器Serial_Init();//开启串口while(1){uint16_t flag = 0;if(Serial_GetRxFlag() == 1){Delay_ms(1000);//等待数据传输完News = Serial_returnNews();OLED_ShowString(3, 1, News);if((flag = Function_DateCheck(Serial_GetRFlagTime(), Serial_GetFlagDate())) == 0){//至少得有标志符号OLED_ShowString(4, 1, "error");}else{if(flag == 1){if(Function_TimeUpdate(updateTime, time, News) == 1) OLED_ShowString(4, 1, ":RIGHT");//写入else  OLED_ShowString(4, 1, "ERROR"); 									}else{OLED_ShowString(4, 1, "/RIGHT");}Function_ArrayReset(updateTime, updateDate);				}flag = 0;Serial_RESETI();//I至0Serial_GetRxFlag();//制零否者if循环将会被执行两次free(News);//释放空间必须释放否者发生地址紊乱,直接卡机}Time_Show(time);//Time_Show_Date(date);}}

Function.c:

#include "stm32f10x.h"
#include "Serial.h"
#include "OLED.h"
#include "Delay.h"
//一些函数的实现void Function_ArrayClear(char *News){//恢复数组初始化uint16_t i = 0;for(i = 0; i < 100; i ++) News[i] = '\0';
}uint8_t Function_ArrayLength(char * a){//计算数组长度函数uint8_t length = 0;uint8_t i = 0;while(a[i] != '\0'){i ++;length ++;}return length;
}uint8_t Function_DateCheck(uint8_t flagTime, uint8_t flagDate){if(flagDate == flagTime) return 0;if(flagTime == 1) return 1;return 2;
}
uint8_t Function_Numlength(uint16_t num){uint8_t length = 0;if(num == 0) return (uint8_t) 1;while(num > 0){num = num / 10;length = length + 1;}return length;
}
uint8_t Function_TimeDateState(unsigned int *updateTime, char *News){uint8_t cnt = 0;uint8_t i = 0;uint8_t end = Serial_GetI();while(i < end){if(News[i] == ':') {cnt ++;i ++;if(cnt >= 3) return 0;continue;}updateTime[cnt] = updateTime[cnt] * 10 + (News[i] - '0');i ++;}//OLED_ShowNum(2,1,updateTime[2], 3);if(cnt != 2) return 0;//OLED_ShowString(2, 10, "here");//OLED_ShowNum(2,1,, 3);if(Function_Numlength(updateTime[0]) >= 3 || updateTime[0] > 23) return 0;//OLED_ShowString(2, 10, "here");if(Function_Numlength(updateTime[1]) >= 3 || updateTime[1] > 59) return 0;if(Function_Numlength(updateTime[2]) >= 3 || updateTime[2] > 59) return 0;//OLED_ShowString(2, 10, "here");return 1;
}uint8_t Function_TimeUpdate(unsigned int *updateTime, unsigned int *time, char *News){if(Function_TimeDateState(updateTime, News) == 1){uint8_t i = 0;OLED_ShowString(2, 12, "here");while(i < 3){time[i] = updateTime[i];i ++;}return 1;}return 0;
}void Function_ArrayReset(unsigned int *updateTime, unsigned int *updateDate){uint8_t i = 0;while(i < 3){updateDate[i] = 0;updateTime[i] = 0;i ++;}
}

Function.h:

#ifndef __FUNCTION_H
#define __FUNCTION_H
#include "stm32f10x.h"  
#include <stdio.h>void Function_ArrayClear(char *News);
uint8_t Function_ArrayLength(char * a);
uint8_t Function_DateCheck(uint8_t flagDate, uint8_t flagTime);
uint8_t Function_Numlength(uint16_t num);
uint8_t Function_TimeDateState(unsigned int *updateTime, char *News);
uint8_t Function_TimeUpdate(unsigned int *updateTime, unsigned int *time, char *News);
void Function_ArrayReset(unsigned int *updateTime, unsigned int *updateDate);#endif

Time.c:

#include "stm32f10x.h"
#include "OLED.h"TIM_TimeBaseInitTypeDef TIM_TimeBaseInitStructure;
NVIC_InitTypeDef NVIC_InitStructure;
/*初始化通用定时器TIM2*/
void Time_Init(void){RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);//APB1外设开启TIM_InternalClockConfig(TIM2);//选择内部时钟/*初始化时基单元*/TIM_TimeBaseInitStructure.TIM_ClockDivision = TIM_CKD_DIV1;TIM_TimeBaseInitStructure.TIM_CounterMode = TIM_CounterMode_Up;//向上计数TIM_TimeBaseInitStructure.TIM_Period = 10000 - 1;//ARR自动重装TIM_TimeBaseInitStructure.TIM_Prescaler = 7200 - 1;//psc预分频器TIM_TimeBaseInitStructure.TIM_RepetitionCounter = 0;//高级计时器内容直接给零//记录1s TIM_TimeBaseInit(TIM2, &TIM_TimeBaseInitStructure);//刚初始化完就会进中断TIM_ClearFlag(TIM2, TIM_FLAG_Update);//消除中断标志位//使能更新中断TIM_ITConfig(TIM2, TIM_IT_Update, ENABLE);/*配置中断*/NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//选择组2NVIC_InitStructure.NVIC_IRQChannel = TIM2_IRQn;//定时器2在NVIC内的通道NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 1;NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;NVIC_Init(&NVIC_InitStructure);TIM_Cmd(TIM2, ENABLE);//启动定时器
}void Time_Control(unsigned int *time, char *month, unsigned int *date){//更新时间time[2] = time[2] + 1;if(time[2] >= 60){time[2] = 0;time[1] = time[1] + 1;if(time[1] >= 60){time[1] = 0;time[0] = time[0] + 1;if(time[0] >= 24){time[0] = 0;date[2] = date[2] + 1;if(date[2] >= month[date[1]] + 1){date[2] = 1;date[1] = date[1] + 1;if(date[1] >= 13){date[1] = 1;date[0] = date[0] + 1;if(date[0] >= 9999){date[0] = 2023;}}}}}}}void Time_month2_Control(char *month,unsigned int *date){//判别闰平年 if((date[0] % 4 == 0 && date[0] % 100 != 0 )|| date[0] % 400 == 0) month[2] = 29;else month[2] = 28;
}void Time_Show(unsigned int *time){OLED_ShowNum(1,1,time[0], 2);OLED_ShowString(1, 3, ":");OLED_ShowNum(1,4,time[1], 2);OLED_ShowString(1, 6, ":");OLED_ShowNum(1,7,time[2], 2);
}
void Time_Show_Date(unsigned int *date){OLED_ShowNum(2,1,date[0], 4);OLED_ShowString(2, 5, "/");OLED_ShowNum(2,6,date[1], 2);OLED_ShowString(2, 8, "/");OLED_ShowNum(2,9,date[2], 2);
}

Time.h:

//显示时间&日期
#ifndef __TIME_H
#define __TIME_H
#include "stm32f10x.h"  
#include <stdio.h>void Time_Init(void);
void Time_Control(unsigned int *time, char *month, unsigned int *date);
void Time_month2_Control(char *month,unsigned int *date);
void Time_Show(unsigned int *time);
void Time_Show_Date(unsigned int *date);#endif

Serial.c:

#include "stm32f10x.h"                  // Device header
#include <stdio.h>
#include <stdarg.h>
#include "Delay.h"
#include <stdlib.h>
#include "OLED.h"uint8_t Serial_RxData;//存数据
uint8_t Serial_RxFlag;//标志位
GPIO_InitTypeDef GPIO_InitStructu;//GPIO
USART_InitTypeDef USART_InitStructure;//串口
NVIC_InitTypeDef NVIC_InitStructur;//中断
char news[100] = "";//存数据
uint8_t I = 0;
uint8_t flagDate = 0;//标志是否传入日期数据
uint8_t flagTime = 0;//标志是否传入时间数据void Serial_Init(void)
{RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1, ENABLE);RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);GPIO_InitStructu.GPIO_Mode = GPIO_Mode_AF_PP;GPIO_InitStructu.GPIO_Pin = GPIO_Pin_9;GPIO_InitStructu.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init(GPIOA, &GPIO_InitStructu);GPIO_InitStructu.GPIO_Mode = GPIO_Mode_IPU;GPIO_InitStructu.GPIO_Pin = GPIO_Pin_10;GPIO_InitStructu.GPIO_Speed = GPIO_Speed_50MHz;GPIO_Init(GPIOA, &GPIO_InitStructu);USART_InitStructure.USART_BaudRate = 9600;USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;USART_InitStructure.USART_Mode = USART_Mode_Tx | USART_Mode_Rx;USART_InitStructure.USART_Parity = USART_Parity_No;USART_InitStructure.USART_StopBits = USART_StopBits_1;USART_InitStructure.USART_WordLength = USART_WordLength_8b;USART_Init(USART1, &USART_InitStructure);USART_ITConfig(USART1, USART_IT_RXNE, ENABLE);NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);//通道NVIC_InitStructur.NVIC_IRQChannel = USART1_IRQn;//中断通道NVIC_InitStructur.NVIC_IRQChannelCmd = ENABLE;NVIC_InitStructur.NVIC_IRQChannelPreemptionPriority = 3;NVIC_InitStructur.NVIC_IRQChannelSubPriority = 1;NVIC_Init(&NVIC_InitStructur);USART_Cmd(USART1, ENABLE);
}uint8_t Serial_GetRxFlag(void)//读取标志位后自动青除
{if (Serial_RxFlag == 1){Serial_RxFlag = 0;return 1;}return 0;
}uint8_t Serial_GetFlagDate(void)//读取标志位后自动青除
{if (flagDate == 1){flagDate = 0;return 1;}return 0;
}uint8_t Serial_GetRFlagTime(void)//读取标志位后自动青除
{if (flagTime == 1){flagTime = 0;return 1;}return 0;
}void Serial_GetRxFlag_SET(void){Serial_RxFlag = 1;
}char * Serial_returnNews(void){//返还一个数组char * array;//int j = I;uint8_t i = 0;array = (char *) malloc(sizeof(char) * 100);while(i < I){if(news[i] == '/') flagDate = 1;if(news[i] == ':') flagTime = 1;array[i] = news[i];i ++;}return array;
}void Serial_RESETI(void){//初始化II = 0;
}uint8_t Serial_GetI(void){//返回Ireturn I;
}void USART1_IRQHandler(void)//中断函数
{if (USART_GetITStatus(USART1, USART_IT_RXNE) == SET){news[I] = USART_ReceiveData(USART1);//读数据Serial_RxFlag = 1;//至标志位为有数据I ++;USART_ClearITPendingBit(USART1, USART_IT_RXNE);}
}

Serial.h:

#ifndef __SERIAL_H
#define __SERIAL_H
#include "stm32f10x.h"  
#include <stdio.h>void Serial_Init(void);
uint8_t Serial_GetRxFlag(void);
uint8_t Serial_GetRxData(void);
void Serial_GetRxFlag_SET(void);
char * Serial_returnNews(void);
void Serial_RESETI(void);
uint8_t Serial_GetI(void);
uint8_t Serial_GetRFlagTime(void);
uint8_t Serial_GetFlagDate(void);#endif

效果:

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
时间 + 日期

main.c:

#include "stm32f10x.h"    // Device header
#include "Delay.h"
#include "OLED.h"
#include "Serial.h"
#include "Time.h"
#include "Function.h"
#include <stdio.h>
#include <stdlib.h>char *News = NULL;//存数据
unsigned int time[] = {22, 59, 30};
unsigned int date[] = {2023, 12, 31};
char month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
unsigned int updateTime[] = {0, 0, 0};
unsigned int updateDate[] = {0, 0, 0};void TIM2_IRQHandler(void){//定时器2//主要运用时间更新if(TIM_GetITStatus(TIM2, TIM_IT_Update) == SET){TIM_ClearITPendingBit(TIM2, TIM_IT_Update);//清除标志位Time_Control(time, month, date);}}int main(void){OLED_Init();//初始化OLEDTime_Init();//开启计时器Serial_Init();//开启串口while(1){uint16_t flag = 0;Time_month2_Control(month, date); if(Serial_GetRxFlag() == 1){Delay_ms(1000);//等待数据传输完News = Serial_returnNews();OLED_ShowString(3, 1, News);if((flag = Function_DateCheck(Serial_GetRFlagTime(), Serial_GetFlagDate())) == 0){//至少得有标志符号OLED_ShowString(4, 1, "error");}else{if(flag == 1){if(Function_TimeUpdate(updateTime, time, News) == 1) OLED_ShowString(4, 1, ":RIGHT");//写入else  OLED_ShowString(4, 1, "ERROR"); 									}else{if(Function_DateUpdate(updateDate,date,News) == 1)OLED_ShowString(4, 1, "/RIGHT");elseOLED_ShowString(4, 1, "ERROr");}Function_ArrayReset(updateTime, updateDate);				}Serial_RESETI();//I至0Serial_GetRxFlag();//制零否者if循环将会被执行两次free(News);//释放空间必须释放否者发生地址紊乱,直接卡机}Time_Show(time);Time_Show_Date(date);}}

Function.c:

#include "stm32f10x.h"
#include "Serial.h"
#include "OLED.h"
#include "Delay.h"
//一些函数的实现void Function_ArrayClear(char *News){//恢复数组初始化uint16_t i = 0;for(i = 0; i < 100; i ++) News[i] = '\0';
}uint8_t Function_ArrayLength(char * a){//计算数组长度函数uint8_t length = 0;uint8_t i = 0;while(a[i] != '\0'){i ++;length ++;}return length;
}uint8_t Function_DateCheck(uint8_t flagTime, uint8_t flagDate){if(flagDate == flagTime) return 0;if(flagTime == 1) return 1;return 2;
}
uint8_t Function_Numlength(uint16_t num){uint8_t length = 0;if(num == 0) return (uint8_t) 1;while(num > 0){num = num / 10;length = length + 1;}return length;
}
uint8_t Function_TimeDateState(unsigned int *updateTime, char *News){uint8_t cnt = 0;uint8_t i = 0;uint8_t end = Serial_GetI();while(i < end){if(News[i] == ':') {cnt ++;i ++;if(cnt >= 3) return 0;continue;}updateTime[cnt] = updateTime[cnt] * 10 + (News[i] - '0');i ++;}if(cnt != 2) return 0;if(Function_Numlength(updateTime[0]) >= 3 || updateTime[0] > 23) return 0;if(Function_Numlength(updateTime[1]) >= 3 || updateTime[1] > 59) return 0;if(Function_Numlength(updateTime[2]) >= 3 || updateTime[2] > 59) return 0;return 1;
}uint8_t Function_TimeUpdate(unsigned int *updateTime, unsigned int *time, char *News){if(Function_TimeDateState(updateTime, News) == 1){uint8_t i = 0;//OLED_ShowString(2, 12, "here");while(i < 3){time[i] = updateTime[i];i ++;}return 1;}return 0;
}void Function_ArrayReset(unsigned int *updateTime, unsigned int *updateDate){uint8_t i = 0;while(i < 3){updateDate[i] = 0;updateTime[i] = 0;i ++;}
}uint8_t Function_DateState(unsigned int *updateDate, char *News){uint8_t cnt = 0;uint8_t i = 0;uint8_t end = Serial_GetI();char month[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};while(i < end){if(News[i] == '/') {cnt ++;i ++;if(cnt >= 3) {return 0;}continue;}updateDate[cnt] = updateDate[cnt]* 10 + (News[i] - '0');i ++;}if(cnt != 2) return 0;if(Function_Numlength(updateDate[0]) >= 5 || updateDate[0] > 9999 || updateDate[0] == 0) return 0;if((updateDate[0] % 4 == 0 && updateDate[0] % 100 != 0 )|| updateDate[0] % 400 == 0) month[2] = 29;else month[2] = 28;if(Function_Numlength(updateDate[1]) >= 3 || updateDate[1] > 12 || updateDate[1] == 0) return 0;if(Function_Numlength(updateDate[2]) >= 3 || updateDate[2] > month[updateDate[1]]|| updateDate[2] == 0) return 0;return 1;}uint8_t Function_DateUpdate(unsigned int *updateDate, unsigned int *date, char *News){if(Function_DateState(updateDate, News) == 1){uint8_t i = 0;while(i < 3){date[i] = updateDate[i];i ++;}return 1;}return 0;
}

Function.h:

#ifndef __FUNCTION_H
#define __FUNCTION_H
#include "stm32f10x.h"  
#include <stdio.h>void Function_ArrayClear(char *News);
uint8_t Function_ArrayLength(char * a);
uint8_t Function_DateCheck(uint8_t flagDate, uint8_t flagTime);
uint8_t Function_Numlength(uint16_t num);
uint8_t Function_TimeDateState(unsigned int *updateTime, char *News);
uint8_t Function_TimeUpdate(unsigned int *updateTime, unsigned int *time, char *News);
void Function_ArrayReset(unsigned int *updateTime, unsigned int *updateDate);
uint8_t Function_DateState(unsigned int *updateDate, char *News);
uint8_t Function_DateUpdate(unsigned int *updateDate, unsigned int *date, char *News);#endif

效果:

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

相关文章:

Stm32_标准库_16_串口蓝牙模块_手机与蓝牙模块通信_手机传入信息能对芯片时间日期进行更改

实现了手机发送信息给蓝牙模块&#xff0c;程序对数据进行分析拆解&#xff0c;并更新自身数据 main.c: #include "stm32f10x.h" // Device header #include "Delay.h" #include "OLED.h" #include "Serial.h" #include "Ti…...

137.【SpringCloud-快速搭建】

微服务框架搭建 (一)、SpringCloud-Parent1.创建一个SpringBoot项目2.导入我们的依赖 (二)、SpringCloud-API (实体类)1.创建一个SpringBoot项目2.导入我们的依赖3.创建我们的实体类 (三)、SpringCloud-dept (业务A)1.创建一个SpringBoot项目2.导入我们的依赖3.配置我们的配置信…...

计算机网络第2章-CDN(4)

视频流和内容分发网 HTTP流和DASH 在HTTP流中&#xff0c;视频只是存储在HTTP服务器中作为一个普通的文件&#xff0c;每个文件有有一个特定的URL。当用户要看视频时&#xff0c;客户与服务器之间创建一个TCP连接并发送HTTP GET请求。 HTTP流具有严重缺陷&#xff0c;即所有…...

Linux常见的指令合集

Linux指令合集 认识linuxlinux基础指令1.pwd 命令2. ls 命令3.cd 命令4. man 命令5. grep 命令6. ps 命令7. kill 命令8. netstat 命令9. date 查看当前系统时间10. echo 打印选项 -e linux文件操作指令1. mkdir 命令2. rmdir 命令3. touch 命令4. rm 命令5. mv 命令6. cp 命令…...

字符串_哈希

参考文章&#xff1a; E. Compress Words(字符串hash)_z听歌的小孩z的博客-CSDN博客 字符串哈希 - OI Wiki (oi-wiki.org) 板子&#xff1a; #include<bits/stdc.h> using namespace std; const int N2e450; typedef long long ll; const int mod1e97; typedef unsig…...

python 之enumerate()函数

文章目录 enumerate() 是 Python 中的一个内置函数&#xff0c;它用于在遍历可迭代对象&#xff08;如列表、元组、字符串等&#xff09;时同时获取每个元素的索引和值。这个函数非常有用&#xff0c;因为它允许您在迭代过程中轻松地访问元素的索引&#xff0c;而不需要手动维护…...

【LeetCode刷题(数据结构与算法)】:用队列实现栈

请你仅使用两个队列实现一个后入先出&#xff08;LIFO&#xff09;的栈&#xff0c;并支持普通栈的全部四种操作&#xff08;push、top、pop 和 empty&#xff09; 实现 MyStack 类&#xff1a; void push(int x) 将元素 x 压入栈顶 int pop() 移除并返回栈顶元素 int top() 返…...

“客户端到服务器的数据传递”和“服务器上的数据传递”这两种数据传递的方式的区别

“客户端到服务器的数据传递”和“服务器上的数据传递”这两种数据传递方式的主要区别如下&#xff1a; 数据的流动方向&#xff1a; 在“客户端到服务器的数据传递”中&#xff0c;数据是从客户端&#xff08;如浏览器&#xff09;流向服务器。在“服务器上的数据传递”中&…...

LCR 181 字符串中的单词反转

​​题目来源&#xff1a; leetcode题目&#xff0c;网址&#xff1a;LCR 181. 字符串中的单词反转 - 力扣&#xff08;LeetCode&#xff09; 解题思路&#xff1a; 倒叙遍历&#xff0c;获得每个单词的起始位置与终止位置&#xff0c;然后将每次遇到的单词插入结果中。 解题…...

百度OCR识别图片文本字符串——物联网上位机软件

一、开发背景 根据项目需求&#xff0c;我们需要完成LED显示屏实时显示歌词的效果。最优的方法是调用歌曲播放器的API获取歌词&#xff0c;但是由于这个开发资格不是很好申请&#xff0c;因此我们采用其他方案&#xff0c;即通过OCR识别获取歌词&#xff0c;并投射到LED显示屏上…...

JAVA学习(6)-全网最详细~

&#x1f308;write in front&#x1f308; &#x1f9f8;大家好&#xff0c;我是Aileen&#x1f9f8;.希望你看完之后&#xff0c;能对你有所帮助&#xff0c;不足请指正&#xff01;共同学习交流. &#x1f194;本文由Aileen_0v0&#x1f9f8; 原创 CSDN首发&#x1f412; 如…...

睿趣科技:未来抖音开网店还有前景吗

随着科技的快速发展&#xff0c;电商平台已经成为了人们生活中不可或缺的一部分。在中国&#xff0c;抖音作为一个短视频平台&#xff0c;近年来迅速崛起&#xff0c;吸引了大量的用户和商家。那么&#xff0c;在未来&#xff0c;抖音是否还能为商家提供一个有效的电商平台呢?…...

第六章 应用层 | 计算机网络(谢希仁 第八版)

文章目录 第六章 应用层6.1 域名系统DNS6.1.1 域名系统概述6.1.2 互联网的域名结构6.1.3 域名服务器 6.2 文件传送协议6.2.1 FTP概述6.2.2 FTP的基本工作原理6.2.3 简单文件传送协议TFTP 6.3 远程终端协议TELNET6.4 万维网www6.4.1 万维网概述6.4.2 统一资源定位符URL6.4.3 超文…...

c++ lambda 表达式

1. 简介 lambda&#xff08;匿名函数&#xff09;是C11引入的一种函数对象&#xff0c;它允许我们在需要函数的地方创建一个临时的、匿名的函数。lambda表达式表示一个可以执行的代码单元&#xff0c;可以理解为一个未命名的内联函数。Lambda函数可以用于简化代码、提高可读性…...

Go语言入门心法(七): 并发与通道

Go语言入门心法(一): 基础语法 Go语言入门心法(二): 结构体 Go语言入门心法(三): 接口 Go语言入门心法(四): 异常体系 Go语言入门心法(五): 函数 一: go语言并发与通道...

前端组件封装:构建模块化、可维护和可重用的前端应用

前端组件封装&#xff1a;构建模块化、可维护和可重用的前端应用 前端开发领域的快速演进已经将前端应用的规模和复杂性提升到了一个新的水平。在这个背景下&#xff0c;前端组件封装成为了一项关键实践&#xff0c;旨在构建模块化、可维护和可重用的前端应用。在本文中&#…...

GPT绘制流程图咒语

【咒语】下面是我的一篇论文选取部分&#xff0c;为了让读者更好理解&#xff0c;我准备画一张图&#xff0c;请你阅读后为我设计一下这个图应该怎么画&#xff0c;更有说服力&#xff0c;更容易理解 论文片段&#xff1a; 多模态数据融合研究的基础在于有效的数据采集。首先&a…...

【扩散模型从原理到实战】Chapter1 扩散模型简介

文章目录 1.1 扩散模型的原理生成模型扩散过程DDPM的扩散过程前向过程反向过程优化目标 1.2 扩散模型的发展开始扩散&#xff1a;DDPM加速生成&#xff1a;采样器刷新记录&#xff1a;基于CLIP的多模态图像生成引爆网络&#xff1a;基于CLIP的多模态图像生成再次“出圈”&#…...

使用轮廓分数提升时间序列聚类的表现

我们将使用轮廓分数和一些距离指标来执行时间序列聚类实验&#xff0c;并且进行可视化 让我们看看下面的时间序列: 如果沿着y轴移动序列添加随机噪声&#xff0c;并随机化这些序列&#xff0c;那么它们几乎无法分辨&#xff0c;如下图所示-现在很难将时间序列列分组为簇: 上面…...

蔬菜水果生鲜配送团购商城小程序的作用是什么

蔬菜水果是人们生活所需品&#xff0c;从业者众多&#xff0c;无论小摊贩还是超市商场都有不少人每天光临&#xff0c;当然这些只是自然流量&#xff0c;在实际经营中&#xff0c;蔬菜水果商家还是面临着一些难题。 对蔬菜水果商家而言&#xff0c;线下门店是重要的&#xff0…...

3个技巧让LaTeX参考文献自动符合GB/T 7714国标:告别手动排版烦恼

3个技巧让LaTeX参考文献自动符合GB/T 7714国标&#xff1a;告别手动排版烦恼 【免费下载链接】gbt7714-bibtex-style BibTeX styles for Chinese National Standard GB/T 7714 项目地址: https://gitcode.com/gh_mirrors/gb/gbt7714-bibtex-style 还在为毕业论文、学术论…...

这3个降AI提示词千万别用!让你的知网AI率反涨10个点过不了AIGC检测

这3个降AI提示词千万别用&#xff01;让你的知网AI率反涨10个点过不了AIGC检测 室友的真实事故——降 AI 提示词用错知网 AI 率反涨 3 月 19 号晚上室友哭着发消息&#xff1a;「我上网搜了一个降 AI 万能提示词改完段落送知网测——AI 率从 67% 涨到 77% 了&#xff01;这怎…...

Python应用性能监控实战:New Relic探针架构与部署指南

1. 项目概述&#xff1a;一个现代应用性能管理的Python探针如果你正在用Python开发Web应用、微服务或者任何需要对外提供服务的后端系统&#xff0c;那么“性能”和“可观测性”这两个词一定不会陌生。当线上服务突然变慢、错误率飙升&#xff0c;或者用户反馈某个接口卡顿时&a…...

Go语言工厂模式:对象创建封装

Go语言工厂模式&#xff1a;对象创建封装 1. 简单工厂 type Product interface {Operation() string }type ConcreteProductA struct{}func (p *ConcreteProductA) Operation() string {return "Product A" }type ConcreteProductB struct{}func (p *ConcreteProduct…...

告别手动抢红包!用Kotlin写一个Android微信红包监听助手(附完整代码)

用Kotlin构建Android微信红包自动化工具&#xff1a;从原理到避坑指南 春节聚会时&#xff0c;你是否曾因低头抢红包错过亲友的精彩对话&#xff1f;工作群里的手气红包总在分神时一闪而过&#xff1f;作为一名Android开发者&#xff0c;其实可以用技术优雅解决这些烦恼。本文…...

在扁平化组织里,技术人如何建立“非职权影响力”?

一、为什么测试人更需要非职权影响力软件测试工程师的岗位设置本身就带有一种结构性矛盾&#xff1a;你对产品质量负责&#xff0c;却很少拥有对等的决策权。开发写代码&#xff0c;你找bug&#xff1b;产品定需求&#xff0c;你验证逻辑&#xff1b;项目经理排期&#xff0c;你…...

RAG已死?收藏这篇,小白程序员必看:上下文工程才是大模型未来!

本文探讨了围绕RAG技术的争议&#xff0c;分析了三种不同观点&#xff1a;RAG正进化为更智能的检索系统、RAG已成为核心工程学科、RAG正被长上下文和智能体取代。文章指出&#xff0c;简单的RAG已过时&#xff0c;但提供外部知识的需求依然存在&#xff0c;未来RAG将作为组件之…...

广东公考机构全景测评:粉笔凭极致性价比与本土教研实力领跑

随着2026年广东省考备考热潮的持续升温&#xff0c;选择一家靠谱的培训机构成为广大考生关注的焦点。在广东这片公考竞争激烈的热土上&#xff0c;除了粉笔、华图和中公三大巨头&#xff0c;以笨鸟教育、及第林教育为代表的本土精品机构也凭借极强的地域针对性异军突起。本次测…...

刚刚!西安推拉雨棚厂家测评出炉,陕西中顺雨篷质量优但价格略

本次测评聚焦西安推拉雨棚厂家&#xff0c;旨在为对西安推拉雨棚感兴趣的人群提供客观、真实的数据和信息&#xff0c;帮助大家了解不同厂家的特点。参与本次测评的厂家为陕西中顺雨篷商贸有限公司以及其他西安推拉雨棚厂家。本次测评均基于真实数据与体验&#xff0c;无商业倾…...

基于RK3568的边缘AIoT实战:多模态行为识别系统设计与优化

1. 项目概述&#xff1a;从赛题到全国一等奖的实战复盘去年&#xff0c;我们团队抱着“试试看”的心态参加了瑞芯微与飞凌嵌入式联合举办的全国大学生嵌入式设计大赛&#xff0c;最终捧回了全国一等奖的奖杯。现在比赛尘埃落定&#xff0c;我想把整个项目从破题、选型、开发到最…...