新冠肺炎实时软件源码
main 函数
#include "widget.h"
#include<QFile>
#include <QApplication>int main(int argc, char *argv[])
{QApplication a(argc, argv);QFile qss(":/style/main.qss");qss.open(QFile::ReadOnly);a.setStyleSheet(qss.readAll());qss.close();Widget w;w.show();return a.exec();
}
//widget.h
#ifndef WIDGET_H
#define WIDGET_H
#include<QtCharts>
#include <QWidget>
#include<QNetworkAccessManager>
#include<QNetworkReply>
#include<QTimer>
#include<QCoreApplication>
using namespace QtCharts;
QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACEclass Widget : public QWidget
{Q_OBJECTpublic:Widget(QWidget *parent = nullptr);~Widget();void loadStyleSheet(const QString &sheetName);//加载样式文件void createChart();//创建图表void setChartValue(QJsonArray &obj);//给图表设值void httprequest();void showData();void showDetail(QJsonArray &array);void chinaToday(QJsonObject &obj);void chinaTotal(QJsonObject &obj);
public slots:void startRequest();void replyFinished(QNetworkReply*);
private:Ui::Widget *ui;QNetworkAccessManager *manager;QNetworkReply *pReply;QTimer *startTimer;QNetworkRequest request;QString path=QCoreApplication::applicationDirPath();
};
#endif // WIDGET_H//widget.cpp
#include "widget.h"
#include "ui_widget.h"
#include<QFile>
#include<QNetworkAccessManager>
#include<QNetworkCookie>
#include<QNetworkReply>
#include<QSslConfiguration>
#include<QJsonDocument>
#include<iostream>
#include<string>
#include<QDebug>using namespace std;
Widget::Widget(QWidget *parent): QWidget(parent), ui(new Ui::Widget)
{ui->setupUi(this);setWindowTitle("新冠肺炎实时数据");createChart();//创建图表manager = new QNetworkAccessManager(this);//新建网络管理类startTimer=new QTimer(this);connect(startTimer,SIGNAL(timeout()),this,SLOT(startRequest()));connect(manager,SIGNAL(finished(QNetworkReply*)),this,SLOT(replyFinished(QNetworkReply*)));//关联信号和槽QSslConfiguration conf = request.sslConfiguration();conf.setPeerVerifyMode(QSslSocket::VerifyNone);conf.setProtocol(QSsl::TlsV1SslV3);request.setSslConfiguration(conf);QString url="https://c.m.163.com/ug/api/wuhan/app/data/list-total?t=1581743590402";request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json"));request.setUrl(QUrl(url));startTimer->start(10000);showData();
}
void Widget::createChart()
{QChart *chart = new QChart();QFont f;f.setPointSize(12);f.setBold(1);chart->setTitleFont(f);chart->setTitleBrush(QBrush(QColor(89,168,227)));chart->setAnimationOptions(QChart::SeriesAnimations);chart->legend()->setVisible(false);ui->chartView->setRenderHint(QPainter::Antialiasing);QBrush brush;brush.setColor(QColor(1,33,56));chart->setBackgroundBrush(brush);brush.setColor(Qt::white);chart->setAnimationOptions(QChart::NoAnimation);QFont font;font.setBold(true);font.setFamily("方正粗黑宋简体");font.setPointSize(8);QBrush brushs;brushs.setColor(Qt::white);QBarCategoryAxis *axisX=new QBarCategoryAxis();QValueAxis *axisY=new QValueAxis();axisY->setTitleText("人数");axisX->setLabelsFont(font);axisX->setLabelsColor(Qt::white);axisX->setGridLineColor(QColor(13,50,77));axisX->setTitleText("日期");axisX->setTitleBrush(brushs);font.setPointSize(12);axisX->setTitleFont(font);axisX->setGridLineVisible(false);font.setPointSize(8);axisY->setLabelsFont(font);axisY->setLabelsColor(Qt::white);axisY->setGridLineVisible(false);axisY->setTitleText("数目");font.setPointSize(12);axisY->setTitleFont(font);axisY->setTitleBrush(brushs);chart->addAxis(axisX,Qt::AlignBottom);chart->addAxis(axisY,Qt::AlignLeft);ui->chartView->setChart(chart);
}
void Widget::setChartValue(QJsonArray &obj)
{//解析数据QStringList axisxList=QStringList();QList<QPointF> confirmList,deadList,healList,suspectList;\QList<int> yu;int i=0;for(auto var:obj){QJsonObject subObj=var.toObject();QString axisX=subObj["date"].toString().mid(5,5);axisxList.append(axisX);int confirm= subObj["today"].toObject()["confirm"].toInt();int dead= subObj["today"].toObject()["dead"].toInt();int heal= subObj["today"].toObject()["heal"].toInt();int suspect= subObj["today"].toObject()["suspect"].toInt();yu.append(confirm);QPoint point;point.setX(i);point.setY(confirm);confirmList.append(point);point.setY(dead);deadList.append(point);point.setY(heal);healList.append(point);point.setY(suspect);suspectList.append(point);i++;}QList<QAbstractAxis *> axes=ui->chartView->chart()->axes();QBarCategoryAxis*axisX= qobject_cast<QBarCategoryAxis*>(axes.at(0));axisX->append(axisxList);QValueAxis*axisY= qobject_cast<QValueAxis*>(axes.at(1));axisY->setRange(0,15000);ui->chartView->chart()->removeAllSeries();QLineSeries *seriesconfirm=new QLineSeries();seriesconfirm->setName("确诊");ui->chartView->chart()->addSeries(seriesconfirm);seriesconfirm->append(confirmList);seriesconfirm->attachAxis(axisX);seriesconfirm->attachAxis(axisY);QLineSeries *seriesdead=new QLineSeries();seriesdead->setName("死亡");ui->chartView->chart()->addSeries(seriesdead);seriesdead->append(deadList);seriesdead->attachAxis(axisX);seriesdead->attachAxis(axisY);QLineSeries *seriesheal=new QLineSeries();seriesheal->setName("治愈");ui->chartView->chart()->addSeries(seriesheal);seriesheal->append(healList);seriesheal->attachAxis(axisX);seriesheal->attachAxis(axisY);QLineSeries *seriessuspect=new QLineSeries();seriessuspect->setName("疑似");ui->chartView->chart()->addSeries(seriessuspect);seriessuspect->append(suspectList);seriessuspect->attachAxis(axisX);seriessuspect->attachAxis(axisY);ui->chartView->chart()->legend()->setVisible(true);}
void Widget::startRequest()
{/*发送get网络请求*/manager->get(request);
}
void Widget::replyFinished(QNetworkReply *reply)
{if(reply->error()== QNetworkReply::NoError){qDebug("No Error");QByteArray array= reply->readAll();QString string =QString::fromUtf8(array);QJsonObject l_ret;QJsonParseError l_err;QJsonDocument l_doc = QJsonDocument::fromJson(string.toUtf8(), &l_err);QString filePath=path+"/Data.json";QFile file(filePath);file.open(QIODevice::WriteOnly);file.write(l_doc.toJson());file.close();}showData();
}Widget::~Widget()
{delete ui;
}
void Widget::loadStyleSheet(const QString &sheetName)
{QFile file(sheetName);file.open(QFile::ReadOnly);if (file.isOpen()){QString styleSheet = this->styleSheet();styleSheet += QLatin1String(file.readAll());this->setStyleSheet(styleSheet);}
}
void Widget::showDetail(QJsonArray &array)
{QJsonArray chinaObj;for( auto var:array){if(var.toObject()["id"].toInt()==0){chinaObj=var.toObject()["children"].toArray();break;}}QList<QTreeWidgetItem*> itemlist;for(auto var:chinaObj){QString name=var.toObject()["name"].toString();int addNew=var.toObject()["today"].toObject()["confirm"].toInt();int totalConfirm=var.toObject()["total"].toObject()["confirm"].toInt();int death=var.toObject()["total"].toObject()["dead"].toInt();int heal=var.toObject()["total"].toObject()["heal"].toInt();QTreeWidgetItem *item=new QTreeWidgetItem;item->setText(0,name);item->setText(1,QString::number(addNew));item->setText(2,QString::number(totalConfirm));item->setText(3,QString::number(death));item->setText(4,QString::number(heal));QJsonArray subChildren=var.toObject()["children"].toArray();QList<QTreeWidgetItem*> list1;for(auto var:subChildren){QString name1=var.toObject()["name"].toString();int addNew1=var.toObject()["today"].toObject()["confirm"].toInt();int totalConfirm1=var.toObject()["total"].toObject()["confirm"].toInt();int death1=var.toObject()["total"].toObject()["dead"].toInt();int heal1=var.toObject()["total"].toObject()["heal"].toInt();QTreeWidgetItem *items=new QTreeWidgetItem;items->setText(0,name1);items->setText(1,QString::number(addNew1));items->setText(2,QString::number(totalConfirm1));items->setText(3,QString::number(death1));items->setText(4,QString::number(heal1));list1.append(items);}item->addChildren(list1);itemlist.append(item);}ui->treeWidget->clear();ui->treeWidget->addTopLevelItems(itemlist);
}
void Widget::showData()
{QString filePath=path+"/Data.json";QFile file(filePath);if(!file.open(QFile::ReadOnly)){qDebug("打开文件失败");return;}QByteArray allData = file.readAll();file.close();QJsonParseError json_error;QJsonDocument jsonDoc(QJsonDocument::fromJson(allData, &json_error));if(json_error.error != QJsonParseError::NoError){qDebug() << "json error!";return;}QJsonObject rootObj = jsonDoc.object();//今日数据QJsonObject todayObj=rootObj["data"].toObject()["chinaTotal"].toObject()["today"].toObject();chinaToday(todayObj);//累计数据QJsonObject totalObj=rootObj["data"].toObject()["chinaTotal"].toObject()["total"].toObject();chinaTotal(totalObj);//数据截至时间QString timeStr=rootObj["data"].toObject()["lastUpdateTime"].toString();ui->timeLabel->clear();ui->timeLabel->setText("<html><head/><body><p><span style=\" font-size:12pt; font-weight:600; color:#a1a1a1;\">统计截止于:</span><span style=\" font-family:'Consolas','Courier New','monospace'; font-size:12pt; font-weight:600; color:#989898;\">"+timeStr+"</span></p></body></html>");//给图表设置QJsonArray chinaDayListObj=rootObj["data"].toObject()["chinaDayList"].toArray();setChartValue(chinaDayListObj);//各省份列表QJsonArray areaTree=rootObj["data"].toObject()["areaTree"].toArray();showDetail(areaTree);}
void Widget::chinaTotal(QJsonObject &obj)
{int confirm=obj["confirm"].toInt();int dead=obj["dead"].toInt();int heal=obj["heal"].toInt();int suspect=obj["suspect"].toInt();ui->tconfirmLabel->clear();ui->tdeadLabel->clear();ui->thealLabel->clear();ui->tsuspectLabel->clear();ui->tdeadLabel->setText("<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; \">"+QString::number(dead)+"</span></p></body></html>");ui->tconfirmLabel->setText("<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; color:#e32e09;\">"+QString::number(confirm)+"</span></p></body></html>");ui->thealLabel->setText("<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; color:#2faa77;\">"+QString::number(heal)+"</span></p></body></html>");ui->tsuspectLabel->setText("<html><head/><body><p align=\"center\"><span style=\" font-size:12pt; font-weight:600; color:#ffaa00;\">"+QString::number(suspect)+"</span></p></body></html>");
}
void Widget::chinaToday(QJsonObject &obj)
{int confirm=obj["confirm"].toInt();int dead=obj["dead"].toInt();int heal=obj["heal"].toInt();int suspect=obj["suspect"].toInt();ui->confirmLabel->clear();ui->deadLabel->clear();ui->healLabel->clear();ui->suspectLabel->clear();ui->confirmLabel->setText("<html><head/><body><p align=\"center\">较昨日<span style=\" font-size:12pt; font-weight:600; color:#ff0000;\">+"+QString::number(confirm)+"</span></p></body></html>");ui->deadLabel->setText("<html><head/><body><p align=\"center\">较昨日<span style=\" font-size:12pt; font-weight:600; \">+"+QString::number(dead)+"</span></p></body></html>");ui->healLabel->setText("<html><head/><body><p align=\"center\">较昨日<span style=\" font-size:12pt; font-weight:600; color:#0036a2;\">+"+QString::number(heal)+"</span></p></body></html>");ui->suspectLabel->setText("<html><head/><body><p align=\"center\">较昨日<span style=\" font-size:12pt; font-weight:600; color:#ffce6b;\">+"+QString::number(suspect)+"</span></p></body></html>");
}
//widget.ui
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"><class>Widget</class><widget class="QWidget" name="Widget"><property name="geometry"><rect><x>0</x><y>0</y><width>886</width><height>640</height></rect></property><property name="windowTitle"><string>Widget</string></property><layout class="QGridLayout" name="gridLayout_2"><item row="3" column="0"><layout class="QVBoxLayout" name="verticalLayout_5"><item><widget class="QLabel" name="label_15"><property name="minimumSize"><size><width>30</width><height>30</height></size></property><property name="text"><string>全国新增趋势图</string></property></widget></item><item><widget class="QChartView" name="chartView" native="true"/></item></layout></item><item row="0" column="0"><widget class="QLabel" name="labelPic"><property name="minimumSize"><size><width>0</width><height>100</height></size></property><property name="maximumSize"><size><width>16777215</width><height>100</height></size></property><property name="styleSheet"><string notr="true"/></property><property name="frameShape"><enum>QFrame::Box</enum></property><property name="text"><string/></property></widget></item><item row="1" column="0"><widget class="QLabel" name="timeLabel"><property name="maximumSize"><size><width>16777215</width><height>50</height></size></property><property name="font"><font><family>Calibri</family></font></property><property name="text"><string><html><head/><body><p><span style=" font-size:12pt; font-weight:600; color:#a1a1a1;">统计截止于:</span><span style=" font-family:'Consolas','Courier New','monospace'; font-size:12pt; font-weight:600; color:#989898;">2020-02-15 15:45:35</span></p></body></html></string></property></widget></item><item row="0" column="1" rowspan="4"><widget class="QTreeWidget" name="treeWidget"><property name="minimumSize"><size><width>450</width><height>0</height></size></property><property name="maximumSize"><size><width>450</width><height>16777215</height></size></property><column><property name="text"><string>地区</string></property></column><column><property name="text"><string>新增确诊</string></property></column><column><property name="text"><string>确诊</string></property></column><column><property name="text"><string>死亡</string></property></column><column><property name="text"><string>治愈</string></property></column></widget></item><item row="2" column="0"><widget class="QWidget" name="widget" native="true"><layout class="QGridLayout" name="gridLayout"><item row="0" column="0"><layout class="QVBoxLayout" name="verticalLayout"><item><widget class="QLabel" name="confirmLabel"><property name="text"><string><html><head/><body><p align="center">较昨日<span style=" font-size:12pt; font-weight:600; color:#ff0000;">+123</span></p></body></html></string></property></widget></item><item><widget class="QLabel" name="tconfirmLabel"><property name="minimumSize"><size><width>0</width><height>50</height></size></property><property name="styleSheet"><string notr="true">background-color: rgb(170, 255, 0);</string></property><property name="text"><string><html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600; color:#e32e09;">7990</span></p></body></html></string></property></widget></item><item><widget class="QLabel" name="label_3"><property name="text"><string><html><head/><body><p align="center"><span style=" font-size:10pt; font-weight:600;">确诊</span></p></body></html></string></property></widget></item></layout></item><item row="0" column="1"><layout class="QVBoxLayout" name="verticalLayout_2"><item><widget class="QLabel" name="suspectLabel"><property name="text"><string><html><head/><body><p align="center">较昨日<span style=" font-size:12pt; font-weight:600; color:#ffce6b;">+123</span></p></body></html></string></property></widget></item><item><widget class="QLabel" name="tsuspectLabel"><property name="minimumSize"><size><width>0</width><height>50</height></size></property><property name="styleSheet"><string notr="true">background-color: rgb(170, 255, 0);</string></property><property name="text"><string><html><head/><body><p align="center"><span style=" font-size:12pt; font-weight:600; color:#ffaa00;">68799</span></p></body></html></string></property></widget></item><item><widget class="QLabel" name="label_4"><property name="text"><string><html><head/><body><p align="center"><span style=" font-size:10pt; font-weight:600;">疑似</span></p></body></html></string></property></widget></item></layout></item><item row="0" column="2"><layout class="QVBoxLayout" name="verticalLayout_3"><item><widget class="QLabel" name="deadLabel"><property name="text"><string><html><head/><body><p align="center">较昨日<span style=" font-size:12pt; font-weight:600;">+123</span></p></body></html></string></property></widget></item><item><widget class="QLabel" name="tdeadLabel"><property name="minimumSize"><size><width>0</width><height>50</height></size></property><property name="styleSheet"><string notr="true">background-color: rgb(170, 255, 0);</string></property><property name="text"><string/></property></widget></item><item><widget class="QLabel" name="tdeadLabels"><property name="text"><string><html><head/><body><p align="center"><span style=" font-size:10pt; font-weight:600;">死亡</span></p></body></html></string></property></widget></item></layout></item><item row="0" column="3"><layout class="QVBoxLayout" name="verticalLayout_4"><item><widget class="QLabel" name="healLabel"><property name="text"><string><html><head/><body><p align="center">较昨日<span style=" font-size:12pt; font-weight:600; color:#0036a2;">+123</span></p></body></html></string></property></widget></item><item><widget class="QLabel" name="thealLabel"><property name="minimumSize"><size><width>0</width><height>50</height></size></property><property name="styleSheet"><string notr="true">background-color: rgb(170, 255, 0);</string></property><property name="text"><string/></property></widget></item><item><widget class="QLabel" name="thealLabelq"><property name="text"><string><html><head/><body><p align="center"><span style=" font-size:10pt; font-weight:600;">治愈</span></p></body></html></string></property></widget></item></layout></item></layout></widget></item></layout></widget><customwidgets><customwidget><class>QChartView</class><extends>QWidget</extends><header>qchartview.h</header><container>1</container></customwidget></customwidgets><resources/><connections/>
</ui>
样式表
*{background-color:rgba(200,200,100,100);border-color:rgba(5,39,175,100);
}
QLabel#labelPic
{
background-color: rgb(255, 255, 0);
}](https://img-blog.csdnimg.cn/20200216100309835.jpg?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L3dlaXhpbl80MjIwMjY3NA==,size_16,color_FFFFFF,t_70)
如若内容造成侵权/违法违规/事实不符,请联系编程学习网邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
相关文章
- promise(特点,项目中如何应用)
promise(特点,项目中如何应用) promisepromise 是用于异步编程的,他解决了编程的中的回调地狱,比传统的解决方案(回调函数和事件)更合理更强大。 属性: 使用 Promise 对象中有三个参数, pending:初始化状态 fulfilled:操作成功 rejected: 操作失败 promise 优点: ①统…...
2024/4/28 18:05:47 - 如何享受人生,享受工作-读书笔记-得你所想、享你所得
这本书有很多很好的观点,对于我们日常的工作、生活都有很多的帮助,其中,人生的目标:得你所想和享你所得,让我印象颇为深刻。此外对于自己的定位要清晰,人生从来都不是一帆风顺,如果遭遇同事、朋友乃至亲人的不理解时,不要一味的沮丧,其中“没人会去踢一条死狗”说明,…...
2024/4/28 17:56:18 - String 常用方法
使用场景: 底层是基于char[], 一旦创建长度就固定不变了,适用于字符串不经常增删改的操作的场景,节省空间。 常用方法: 1. char charAt(int index) 返回 char指定索引处的字符。 不能超过下标范围 2. String concat(String str) 将指定的字符串连接到该字符串的末尾。 3. …...
2024/4/28 20:29:08 - 2020面经-JS部分(二)类型,this,promise,apply,深拷贝
1、列举三种强制类型转换和两种隐式类型转换 JavaScript是一门弱类型语言,在JavaScript中声明变量不需指定类型, 对变量赋值也没有类型检查,同时JavaScript允许隐式类型转换。 强制类型转换 通过String(),toString(),Number(),parseInt(),parseFloat(),Boolean()等函数…...
2024/4/28 18:21:00 - Linux之准备工作[jdk卸载与安装]
Linux之准备工作[jdk卸载与安装] 准备资料 1.已经在VMware安装好了的虚拟机,使用的是Linux系统是CentOS7 2.jdk:jdk-8u11-linux-x64.tar.gz 3.xshell 远程操作虚拟机工具[需要linux连接网络] 操作流程在xshell远程连接工具登录root输入指令:“rpm -qa | grep java” 该指令作…...
2024/4/28 22:13:25 - Python远程获取回收站内容
本文的文字及图片来源于网络,仅供学习、交流使用,不具有任何商业用途,版权归原作者所有,如有问题请及时联系我们以作处理。以下文章来源于娜璋AI安全之家,作者 Eastmount获取回收站内容为什么我们要去获取回收站文件呢?因为很多情况下调查取证需要获取远程目标的历史痕迹,回…...
2024/4/27 22:02:50 - 推荐系统架构治理
导读:在数字化革命和AI赋能的大背景下,推荐场景逻辑越来越复杂,推荐细分场景越来越丰富,对业务迭代和效果优化的效率有了更高的要求。推荐系统业务和技术在传统架构支撑下自然堆砌,变得越来越臃肿,开发维护困难,推荐系统在应用架构上正面临新的挑战。本文就第四范式在智…...
2024/4/6 13:24:37 - 【LeetCode】438. 找到字符串中所有字母异位词
一、题目 给定一个字符串 s 和一个非空字符串 p,找到 s 中所有是 p 的字母异位词的子串,返回这些子串的起始索引。 字符串只包含小写英文字母,并且字符串 s 和 p 的长度都不超过 20100。 说明:字母异位词指字母相同,但排列不同的字符串。 不考虑答案输出的顺序。示例 1: 输…...
2024/4/28 21:10:07 - 初学者如何准备开始学习Python-1 (中/英原版)
0.1 Python 2 or Python 3 (Python 2 与 Python 3 的区别) (序一)The print statement has become the print function. What this means is that this line in Python 2: print "hello world"is as follows in Python 3: print("hello world”)The raw_inpu…...
2024/4/28 5:36:48 - Linux企业实战-----docker仓库的搭建与管理(官方仓库、私有仓库、用户认证、远程连接)
目录1.docker hub(官方镜像仓库)1.1 登录docker hub1.2 对推送的镜像打标签1.3 推送镜像1.4 拉取镜像1.5 删除 dockerhub 上的仓库2.搭建私有仓库2.1 配置阿里云镜像加速器2.2 下载 registry 镜像2.3 上传本地镜像到 registry2.4 配置 registry 加密(tls)2.5 测试3.docker …...
2024/4/26 8:26:55 - Python爬虫爬取B站排行榜数据
目录写在前文获取网页数据提取数据整合并保存数据运行结果写在前文很多人学习python,不知道从何学起。 很多人学习python,掌握了基本语法过后,不知道在哪里寻找案例上手。 很多已经做案例的人,却不知道如何去学习更加高深的知识。 那么针对这三类人,我给大家提供一个好的学…...
2024/4/28 10:15:28 - TVM: End-to-End Optimization Stack for Deep Learning
背景 要让AI芯片支持深度学习架构,要将深度学习架构等部署到芯片上就需要将深度学习架构中的这些代码编译成芯片支持的指令集,所以要从头到尾设计一套软件栈,做一套全栈的优化。所以现在的许多深度学习的架构只能在某一些厂商的GPU设备上获得加速,这种支持依赖于特定的GPU库…...
2024/4/27 22:19:00 - iPerf3 局域网性能测试路由器
iPerf3 搭建局域网内部测速环境 这篇文章主要来简单写写局域网里怎么测速,比如日常换了个新路由,想要测试一下无线性能和覆盖之类的情况。 外网测速这一块,市面上的各类软件已经是数不清了,最有名的应该就是 Ookla 出的 Speedtest 了,各种平台都有对应客户端,使用起来极其…...
2024/4/4 14:48:53 - LSTM理解
背景 本文按照RNN和LSTM(1997年提出)进行对比、LSTM的标准流程、LSTM的常见变种、为什么LSTM不会出现梯度爆炸或梯度消失?、双向LSTM、深度双向LSTM的脉络进行记述。由于常见的RNN随着序列的增长产生梯度爆炸或梯度消失问题,导致在实际应用过程中并不能学习到间隔太远的输入…...
2024/4/28 11:05:20 - centos下zookeeper开机启动
以下解决方案借鉴了:https://www.pocketdigi.com/20180131/1593.html环境:centos7,集成zookeeper的kafka,kafka_2.12-2.6.0,jdk1.8思路:用rc.local来解决? 答案不行,用两三个小时,无法解决,而且rc.local文件中也有明确注释“It is highly advisable to create own sy…...
2024/4/28 4:55:40 - SpringBoot AOP拦截、修改请求参数
前言 最近有这么个功能,由于使用了thymeleaf,多个页面遇到要使用同一个数据的问题,但是如果在每个Controller下都要向Model放数据,那么就有很多重复代码,不太优雅,所以想到了AOP,在进入方法前取到Model实例,向他增加数据即可。 引入依赖<dependency><groupId&…...
2024/4/27 23:55:33 - 学习通景观地学基础作业
网络选修课学习通景观地学基础党安荣老师主讲 章节测验答案景观地学基础作业答案 景观地学基础 绪论(一) 1 【单选题】景观地学基础的范围不包括(C)。 A、地貌 B、地质 C、人工建筑结构 D、土壤 2 【单选题】“黄山四绝”不包括(C)。 A、奇松 B、怪石 C、孔庙 D、云海 3 …...
2024/4/27 22:50:37 - 使用synchronized产生的死锁问题及其解决
synchronized 死锁 synchronized作为解决并发编程中原子性、可见性和有序性问题的万能钥匙。其带来的是性能上的问题。使用synchronized关键是看充当锁的角色,锁的作用是保护资源,我们要确定其锁定的范围囊括了需要保护的资源。我们知道synchronized(类名.class){}的用法,类…...
2024/4/4 14:26:11 - ISP(图像信号处理)算法概述、工作原理、架构、处理流程
转自:https://zhuanlan.zhihu.com/p/115321553ISP的主要内部构成:ISP内部包含 CPU、SUP IP(各种功能模块的通称)、IF 等设备ISP的控制结构:1、ISP逻辑 2、运行在其上的firmwareISP上的Firmware包含三部分:AP对ISP的操控方式:外置:I2C/SPI。 内置:MEM MAP、MEM SHAREIS…...
2024/4/12 13:15:50 - 办理个人pos机危害
Pos机在人们的印象里,是一些商家作为收款的工具,这几年随着个体的需求量增加,很多人在办理pos机的时候,都会有一些顾虑,首先是安全,其次是在办理之后对于其它方面会不会带来什么影响,接下来三陆合pos就来分析一下。 资金安全,只要是正规机构旗下的产品,安全都是有保障…...
2024/4/4 14:18:32
最新文章
- node.js + @elastic/elasticsearch 操作elasticsearch数据库
我这边node.js 使用的是 koa2,elasticsearch是8.11.1版本 官网:https://www.elastic.co/guide/en/elasticsearch/client/javascript-api/current/getting-started-js.html 一、elastic/elasticsearch 连接 elasticsearch数据库 如果elasticsearch没有设…...
2024/4/28 22:39:40 - 梯度消失和梯度爆炸的一些处理方法
在这里是记录一下梯度消失或梯度爆炸的一些处理技巧。全当学习总结了如有错误还请留言,在此感激不尽。 权重和梯度的更新公式如下: w w − η ⋅ ∇ w w w - \eta \cdot \nabla w ww−η⋅∇w 个人通俗的理解梯度消失就是网络模型在反向求导的时候出…...
2024/3/20 10:50:27 - 从头开发一个RISC-V的操作系统(二)RISC-V 指令集架构介绍
文章目录 前提ISA的基本介绍ISA是什么CISC vs RISCISA的宽度 RISC-V指令集RISC-V ISA的命名规范模块化的ISA通用寄存器Hart特权级别内存管理与保护异常和中断 目标:通过这一个系列课程的学习,开发出一个简易的在RISC-V指令集架构上运行的操作系统。 前提…...
2024/4/24 5:34:22 - Go语言map、slice、channel底层实现(go面试)
slice 切片是一个引用类型,其底层实现是一个结构体,包含以下字段: ptr:一个指向底层数组的指针,指针指向数组的第一个元素。 len:切片当前包含的元素数量。 cap:切片的容量,即底层…...
2024/4/24 19:38:16 - 416. 分割等和子集问题(动态规划)
题目 题解 class Solution:def canPartition(self, nums: List[int]) -> bool:# badcaseif not nums:return True# 不能被2整除if sum(nums) % 2 ! 0:return False# 状态定义:dp[i][j]表示当背包容量为j,用前i个物品是否正好可以将背包填满ÿ…...
2024/4/28 4:04:40 - 【Java】ExcelWriter自适应宽度工具类(支持中文)
工具类 import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet;/*** Excel工具类** author xiaoming* date 2023/11/17 10:40*/ public class ExcelUti…...
2024/4/28 12:01:04 - Spring cloud负载均衡@LoadBalanced LoadBalancerClient
LoadBalance vs Ribbon 由于Spring cloud2020之后移除了Ribbon,直接使用Spring Cloud LoadBalancer作为客户端负载均衡组件,我们讨论Spring负载均衡以Spring Cloud2020之后版本为主,学习Spring Cloud LoadBalance,暂不讨论Ribbon…...
2024/4/28 16:34:55 - TSINGSEE青犀AI智能分析+视频监控工业园区周界安全防范方案
一、背景需求分析 在工业产业园、化工园或生产制造园区中,周界防范意义重大,对园区的安全起到重要的作用。常规的安防方式是采用人员巡查,人力投入成本大而且效率低。周界一旦被破坏或入侵,会影响园区人员和资产安全,…...
2024/4/28 18:31:47 - VB.net WebBrowser网页元素抓取分析方法
在用WebBrowser编程实现网页操作自动化时,常要分析网页Html,例如网页在加载数据时,常会显示“系统处理中,请稍候..”,我们需要在数据加载完成后才能继续下一步操作,如何抓取这个信息的网页html元素变化&…...
2024/4/28 12:01:03 - 【Objective-C】Objective-C汇总
方法定义 参考:https://www.yiibai.com/objective_c/objective_c_functions.html Objective-C编程语言中方法定义的一般形式如下 - (return_type) method_name:( argumentType1 )argumentName1 joiningArgument2:( argumentType2 )argumentName2 ... joiningArgu…...
2024/4/28 12:01:03 - 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】
👨💻博客主页:花无缺 欢迎 点赞👍 收藏⭐ 留言📝 加关注✅! 本文由 花无缺 原创 收录于专栏 【洛谷算法题】 文章目录 【洛谷算法题】P5713-洛谷团队系统【入门2分支结构】🌏题目描述🌏输入格…...
2024/4/28 12:01:03 - 【ES6.0】- 扩展运算符(...)
【ES6.0】- 扩展运算符... 文章目录 【ES6.0】- 扩展运算符...一、概述二、拷贝数组对象三、合并操作四、参数传递五、数组去重六、字符串转字符数组七、NodeList转数组八、解构变量九、打印日志十、总结 一、概述 **扩展运算符(...)**允许一个表达式在期望多个参数࿰…...
2024/4/28 16:07:14 - 摩根看好的前智能硬件头部品牌双11交易数据极度异常!——是模式创新还是饮鸩止渴?
文 | 螳螂观察 作者 | 李燃 双11狂欢已落下帷幕,各大品牌纷纷晒出优异的成绩单,摩根士丹利投资的智能硬件头部品牌凯迪仕也不例外。然而有爆料称,在自媒体平台发布霸榜各大榜单喜讯的凯迪仕智能锁,多个平台数据都表现出极度异常…...
2024/4/27 21:08:20 - Go语言常用命令详解(二)
文章目录 前言常用命令go bug示例参数说明 go doc示例参数说明 go env示例 go fix示例 go fmt示例 go generate示例 总结写在最后 前言 接着上一篇继续介绍Go语言的常用命令 常用命令 以下是一些常用的Go命令,这些命令可以帮助您在Go开发中进行编译、测试、运行和…...
2024/4/28 9:00:42 - 用欧拉路径判断图同构推出reverse合法性:1116T4
http://cplusoj.com/d/senior/p/SS231116D 假设我们要把 a a a 变成 b b b,我们在 a i a_i ai 和 a i 1 a_{i1} ai1 之间连边, b b b 同理,则 a a a 能变成 b b b 的充要条件是两图 A , B A,B A,B 同构。 必要性显然࿰…...
2024/4/27 18:40:35 - 【NGINX--1】基础知识
1、在 Debian/Ubuntu 上安装 NGINX 在 Debian 或 Ubuntu 机器上安装 NGINX 开源版。 更新已配置源的软件包信息,并安装一些有助于配置官方 NGINX 软件包仓库的软件包: apt-get update apt install -y curl gnupg2 ca-certificates lsb-release debian-…...
2024/4/28 4:14:21 - Hive默认分割符、存储格式与数据压缩
目录 1、Hive默认分割符2、Hive存储格式3、Hive数据压缩 1、Hive默认分割符 Hive创建表时指定的行受限(ROW FORMAT)配置标准HQL为: ... ROW FORMAT DELIMITED FIELDS TERMINATED BY \u0001 COLLECTION ITEMS TERMINATED BY , MAP KEYS TERMI…...
2024/4/27 13:52:15 - 【论文阅读】MAG:一种用于航天器遥测数据中有效异常检测的新方法
文章目录 摘要1 引言2 问题描述3 拟议框架4 所提出方法的细节A.数据预处理B.变量相关分析C.MAG模型D.异常分数 5 实验A.数据集和性能指标B.实验设置与平台C.结果和比较 6 结论 摘要 异常检测是保证航天器稳定性的关键。在航天器运行过程中,传感器和控制器产生大量周…...
2024/4/27 13:38:13 - --max-old-space-size=8192报错
vue项目运行时,如果经常运行慢,崩溃停止服务,报如下错误 FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory 因为在 Node 中,通过JavaScript使用内存时只能使用部分内存(64位系统&…...
2024/4/28 12:00:58 - 基于深度学习的恶意软件检测
恶意软件是指恶意软件犯罪者用来感染个人计算机或整个组织的网络的软件。 它利用目标系统漏洞,例如可以被劫持的合法软件(例如浏览器或 Web 应用程序插件)中的错误。 恶意软件渗透可能会造成灾难性的后果,包括数据被盗、勒索或网…...
2024/4/28 12:00:58 - JS原型对象prototype
让我简单的为大家介绍一下原型对象prototype吧! 使用原型实现方法共享 1.构造函数通过原型分配的函数是所有对象所 共享的。 2.JavaScript 规定,每一个构造函数都有一个 prototype 属性,指向另一个对象,所以我们也称为原型对象…...
2024/4/27 22:51:49 - C++中只能有一个实例的单例类
C中只能有一个实例的单例类 前面讨论的 President 类很不错,但存在一个缺陷:无法禁止通过实例化多个对象来创建多名总统: President One, Two, Three; 由于复制构造函数是私有的,其中每个对象都是不可复制的,但您的目…...
2024/4/28 7:31:46 - python django 小程序图书借阅源码
开发工具: PyCharm,mysql5.7,微信开发者工具 技术说明: python django html 小程序 功能介绍: 用户端: 登录注册(含授权登录) 首页显示搜索图书,轮播图࿰…...
2024/4/28 8:32:05 - 电子学会C/C++编程等级考试2022年03月(一级)真题解析
C/C++等级考试(1~8级)全部真题・点这里 第1题:双精度浮点数的输入输出 输入一个双精度浮点数,保留8位小数,输出这个浮点数。 时间限制:1000 内存限制:65536输入 只有一行,一个双精度浮点数。输出 一行,保留8位小数的浮点数。样例输入 3.1415926535798932样例输出 3.1…...
2024/4/27 20:28:35 - 配置失败还原请勿关闭计算机,电脑开机屏幕上面显示,配置失败还原更改 请勿关闭计算机 开不了机 这个问题怎么办...
解析如下:1、长按电脑电源键直至关机,然后再按一次电源健重启电脑,按F8健进入安全模式2、安全模式下进入Windows系统桌面后,按住“winR”打开运行窗口,输入“services.msc”打开服务设置3、在服务界面,选中…...
2022/11/19 21:17:18 - 错误使用 reshape要执行 RESHAPE,请勿更改元素数目。
%读入6幅图像(每一幅图像的大小是564*564) f1 imread(WashingtonDC_Band1_564.tif); subplot(3,2,1),imshow(f1); f2 imread(WashingtonDC_Band2_564.tif); subplot(3,2,2),imshow(f2); f3 imread(WashingtonDC_Band3_564.tif); subplot(3,2,3),imsho…...
2022/11/19 21:17:16 - 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机...
win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”问题的解决方法在win7系统关机时如果有升级系统的或者其他需要会直接进入一个 等待界面,在等待界面中我们需要等待操作结束才能关机,虽然这比较麻烦,但是对系统进行配置和升级…...
2022/11/19 21:17:15 - 台式电脑显示配置100%请勿关闭计算机,“准备配置windows 请勿关闭计算机”的解决方法...
有不少用户在重装Win7系统或更新系统后会遇到“准备配置windows,请勿关闭计算机”的提示,要过很久才能进入系统,有的用户甚至几个小时也无法进入,下面就教大家这个问题的解决方法。第一种方法:我们首先在左下角的“开始…...
2022/11/19 21:17:14 - win7 正在配置 请勿关闭计算机,怎么办Win7开机显示正在配置Windows Update请勿关机...
置信有很多用户都跟小编一样遇到过这样的问题,电脑时发现开机屏幕显现“正在配置Windows Update,请勿关机”(如下图所示),而且还需求等大约5分钟才干进入系统。这是怎样回事呢?一切都是正常操作的,为什么开时机呈现“正…...
2022/11/19 21:17:13 - 准备配置windows 请勿关闭计算机 蓝屏,Win7开机总是出现提示“配置Windows请勿关机”...
Win7系统开机启动时总是出现“配置Windows请勿关机”的提示,没过几秒后电脑自动重启,每次开机都这样无法进入系统,此时碰到这种现象的用户就可以使用以下5种方法解决问题。方法一:开机按下F8,在出现的Windows高级启动选…...
2022/11/19 21:17:12 - 准备windows请勿关闭计算机要多久,windows10系统提示正在准备windows请勿关闭计算机怎么办...
有不少windows10系统用户反映说碰到这样一个情况,就是电脑提示正在准备windows请勿关闭计算机,碰到这样的问题该怎么解决呢,现在小编就给大家分享一下windows10系统提示正在准备windows请勿关闭计算机的具体第一种方法:1、2、依次…...
2022/11/19 21:17:11 - 配置 已完成 请勿关闭计算机,win7系统关机提示“配置Windows Update已完成30%请勿关闭计算机”的解决方法...
今天和大家分享一下win7系统重装了Win7旗舰版系统后,每次关机的时候桌面上都会显示一个“配置Windows Update的界面,提示请勿关闭计算机”,每次停留好几分钟才能正常关机,导致什么情况引起的呢?出现配置Windows Update…...
2022/11/19 21:17:10 - 电脑桌面一直是清理请关闭计算机,windows7一直卡在清理 请勿关闭计算机-win7清理请勿关机,win7配置更新35%不动...
只能是等着,别无他法。说是卡着如果你看硬盘灯应该在读写。如果从 Win 10 无法正常回滚,只能是考虑备份数据后重装系统了。解决来方案一:管理员运行cmd:net stop WuAuServcd %windir%ren SoftwareDistribution SDoldnet start WuA…...
2022/11/19 21:17:09 - 计算机配置更新不起,电脑提示“配置Windows Update请勿关闭计算机”怎么办?
原标题:电脑提示“配置Windows Update请勿关闭计算机”怎么办?win7系统中在开机与关闭的时候总是显示“配置windows update请勿关闭计算机”相信有不少朋友都曾遇到过一次两次还能忍但经常遇到就叫人感到心烦了遇到这种问题怎么办呢?一般的方…...
2022/11/19 21:17:08 - 计算机正在配置无法关机,关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机...
关机提示 windows7 正在配置windows 请勿关闭计算机 ,然后等了一晚上也没有关掉。现在电脑无法正常关机以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!关机提示 windows7 正在配…...
2022/11/19 21:17:05 - 钉钉提示请勿通过开发者调试模式_钉钉请勿通过开发者调试模式是真的吗好不好用...
钉钉请勿通过开发者调试模式是真的吗好不好用 更新时间:2020-04-20 22:24:19 浏览次数:729次 区域: 南阳 > 卧龙 列举网提醒您:为保障您的权益,请不要提前支付任何费用! 虚拟位置外设器!!轨迹模拟&虚拟位置外设神器 专业用于:钉钉,外勤365,红圈通,企业微信和…...
2022/11/19 21:17:05 - 配置失败还原请勿关闭计算机怎么办,win7系统出现“配置windows update失败 还原更改 请勿关闭计算机”,长时间没反应,无法进入系统的解决方案...
前几天班里有位学生电脑(windows 7系统)出问题了,具体表现是开机时一直停留在“配置windows update失败 还原更改 请勿关闭计算机”这个界面,长时间没反应,无法进入系统。这个问题原来帮其他同学也解决过,网上搜了不少资料&#x…...
2022/11/19 21:17:04 - 一个电脑无法关闭计算机你应该怎么办,电脑显示“清理请勿关闭计算机”怎么办?...
本文为你提供了3个有效解决电脑显示“清理请勿关闭计算机”问题的方法,并在最后教给你1种保护系统安全的好方法,一起来看看!电脑出现“清理请勿关闭计算机”在Windows 7(SP1)和Windows Server 2008 R2 SP1中,添加了1个新功能在“磁…...
2022/11/19 21:17:03 - 请勿关闭计算机还原更改要多久,电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机怎么办...
许多用户在长期不使用电脑的时候,开启电脑发现电脑显示:配置windows更新失败,正在还原更改,请勿关闭计算机。。.这要怎么办呢?下面小编就带着大家一起看看吧!如果能够正常进入系统,建议您暂时移…...
2022/11/19 21:17:02 - 还原更改请勿关闭计算机 要多久,配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以...
配置windows update失败 还原更改 请勿关闭计算机,电脑开机后一直显示以以下文字资料是由(历史新知网www.lishixinzhi.com)小编为大家搜集整理后发布的内容,让我们赶快一起来看一下吧!配置windows update失败 还原更改 请勿关闭计算机&#x…...
2022/11/19 21:17:01 - 电脑配置中请勿关闭计算机怎么办,准备配置windows请勿关闭计算机一直显示怎么办【图解】...
不知道大家有没有遇到过这样的一个问题,就是我们的win7系统在关机的时候,总是喜欢显示“准备配置windows,请勿关机”这样的一个页面,没有什么大碍,但是如果一直等着的话就要两个小时甚至更久都关不了机,非常…...
2022/11/19 21:17:00 - 正在准备配置请勿关闭计算机,正在准备配置windows请勿关闭计算机时间长了解决教程...
当电脑出现正在准备配置windows请勿关闭计算机时,一般是您正对windows进行升级,但是这个要是长时间没有反应,我们不能再傻等下去了。可能是电脑出了别的问题了,来看看教程的说法。正在准备配置windows请勿关闭计算机时间长了方法一…...
2022/11/19 21:16:59 - 配置失败还原请勿关闭计算机,配置Windows Update失败,还原更改请勿关闭计算机...
我们使用电脑的过程中有时会遇到这种情况,当我们打开电脑之后,发现一直停留在一个界面:“配置Windows Update失败,还原更改请勿关闭计算机”,等了许久还是无法进入系统。如果我们遇到此类问题应该如何解决呢࿰…...
2022/11/19 21:16:58 - 如何在iPhone上关闭“请勿打扰”
Apple’s “Do Not Disturb While Driving” is a potentially lifesaving iPhone feature, but it doesn’t always turn on automatically at the appropriate time. For example, you might be a passenger in a moving car, but your iPhone may think you’re the one dri…...
2022/11/19 21:16:57