【QT】day6

news2025/1/20 10:52:14

在这里插入图片描述

#include "home.h"
#include "ui_home.h"

Home::Home(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Home)
{
    ui->setupUi(this);

    // 从配置文件读取用户名
    QSettings settings("kim", "ad");
    username = settings.value("username").toString();
    usertype = settings.value("usertype").toString();
    ui->usertypelabel->setText(usertype);
    if(usertype=="学生")
    {
        ui->listframe->hide();
        ui->setframe->hide();
        ui->mainframe->hide();
        QFrame *stuframe = new QFrame();
        stuframe->setParent(this);
        stuframe->setStyleSheet("width:100px;height:100px;background-color: rgb(250, 250, 250);");
        stuframe->move(100,0);

        teachEdit = new QLineEdit(this);
        teachEdit->move(200,50);
        teachEdit->setStyleSheet("background-color:#ffffff;color:#000000;width:200px;height:30px;border-radius:7px;color:#000000;padding-left:10px;");
        teachEdit->setPlaceholderText("请输入教师账号");

        adkeyEdit = new QLineEdit(this);
        adkeyEdit->move(200,90);
        adkeyEdit->setStyleSheet("background-color:#ffffff;color:#000000;width:200px;height:30px;border-radius:7px;color:#000000;padding-left:10px;");
        adkeyEdit->setPlaceholderText("请输入签到验证码");

        adkeybtn = new QPushButton(this);
        adkeybtn->move(200,170);
        adkeybtn->setText("签到");
        adkeybtn->setStyleSheet("background-color:#000000;color:#ffffff;width:200px;height:40px;border-radius:7px;");
        connect(adkeybtn, &QPushButton::clicked, this, &Home::onAdKeyBtnClicked);

        stuHintLable = new QLabel(this);
        stuHintLable->move(210,140);
        stuHintLable->setFixedWidth(200);
        stuHintLable->setStyleSheet("color:rgb(222, 60, 51);height:40px;");
    }
    ui->usernamelabel->setText(username);
    ui->usertypelabel->setAlignment(Qt::AlignCenter);
    closeAllpage();
    openAdPage();
}

Home::~Home()
{
    delete ui;
}

void Home::onAdKeyBtnClicked() {
    if(teachEdit->text()=="")
    {
        stuHintLable->setText("教师账号不能为空");
        stuHintLable->setStyleSheet("color:rgb(222, 60, 51);height:40px;");
    }else if(adkeyEdit->text()=="")
    {
        stuHintLable->setText("签到激活码不能为空");
        stuHintLable->setStyleSheet("color:rgb(222, 60, 51);height:40px;");
    }else{
        socket = new QTcpSocket(this);
        socket->connectToHost(ip,port);
        connect(socket,&QTcpSocket::connected,this,&Home::stuad_connected_slot);
        connect(socket,&QTcpSocket::readyRead,this,&Home::stuad_readyRead_slot);
    }

}


void Home::startad_connected_slot()
{
    struct data user;
    user.type=STARTAD;
    user.username=username;
    user.value=generateRandomString(6);
    ui->hintlable_3->setText("签到码:"+user.value);
    ui->startattendancebtn->setStyleSheet("background-color:#ffffff;border-radius:7px;border:1px solid #000000;color:#000000;");
    socket->write(user.toByteArray());
}

void Home::startad_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    outputlog(receivedInfo.data);
    socket->disconnectFromHost();
}

void Home::endad_connected_slot()
{
    struct data user;
    user.type=ENDAD;
    user.username=username;
    user.value="123";
    ui->hintlable_3->setText("");
    ui->startattendancebtn->setStyleSheet("background-color:#000000;border-radius:7px;color:#ffffff;");
    socket->write(user.toByteArray());
}

void Home::endad_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    outputlog(receivedInfo.data);
    socket->disconnectFromHost();
}

void Home::addname_connected_slot()
{
    struct data user;
    user.type=NAMEADD;
    user.username=username;
    user.value=ui->funcinput->text();
    socket->write(user.toByteArray());
}

void Home::addname_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    outputlog("【"+ui->funcinput->text()+"】"+receivedInfo.data);
    ui->funcinput->clear();
    socket->disconnectFromHost();
}

void Home::getAllName_connected_slot()
{
    struct data user;
    user.type=NAMEGETALL;
    user.username=username;
    user.value="123";
    socket->write(user.toByteArray());
}

void Home::getAllName_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    QString receivedData(receivedInfo.data);
    QStringList records = receivedData.split("|", Qt::SkipEmptyParts);

    // 遍历每个记录

    ui->settable->setRowCount(records.size());
    for (int row = 0; row < records.size(); ++row) {
        // 以 '\n' 分割记录中的行
        QStringList lines = records[row].split("\n", Qt::SkipEmptyParts);

        // 遍历每行并添加到QTableWidget中
        for (int col = 0; col < lines.size(); ++col) {
            // 以 ':' 分割键和值
            QStringList keyValue = lines[col].split("&", Qt::SkipEmptyParts);

            QString key = keyValue[0].trimmed();
            QString value = keyValue[1].trimmed();
            QTableWidgetItem *item = new QTableWidgetItem(value);
            ui->settable->setItem(row, col, item);
            item->setTextAlignment(Qt::AlignCenter);
        }
    }
    ui->settable->setColumnWidth(0, 50);
    ui->settable->setColumnWidth(1, 100);
    ui->settable->setColumnWidth(2, 180);
    socket->disconnectFromHost();
}

void Home::deletename_connected_slot()
{


    QList<QTableWidgetItem *> selectedItems = ui->settable->selectedItems();
    if (!selectedItems.isEmpty()) {
        int selectedRow = selectedItems.first()->row();
        QTableWidgetItem *item1 = ui->settable->item(selectedRow, 0);
        QString content1 = item1->text();
        struct data user;
        user.type=NAMEDELETE;
        user.username=username;
        user.value=content1;
        socket->write(user.toByteArray());
    } else {
        qDebug() << "No row selected.";
    }
}

void Home::deletename_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    outputlog(receivedInfo.data);
    socket->disconnectFromHost();
}

void Home::searchname_connected_slot()
{
    struct data user;
    user.type=NAMESEARCH;
    user.username=username;
    user.value=ui->funcinput->text();
    socket->write(user.toByteArray());
}

void Home::searchname_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    QString receivedData(receivedInfo.data);
    QStringList records = receivedData.split("|", Qt::SkipEmptyParts);

    // 遍历每个记录

    ui->settable->setRowCount(records.size());
    for (int row = 0; row < records.size(); ++row) {
        // 以 '\n' 分割记录中的行
        QStringList lines = records[row].split("\n", Qt::SkipEmptyParts);

        // 遍历每行并添加到QTableWidget中
        for (int col = 0; col < lines.size(); ++col) {
            // 以 ':' 分割键和值
            QStringList keyValue = lines[col].split("&", Qt::SkipEmptyParts);

            QString key = keyValue[0].trimmed();
            QString value = keyValue[1].trimmed();
            QTableWidgetItem *item = new QTableWidgetItem(value);
            ui->settable->setItem(row, col, item);
            item->setTextAlignment(Qt::AlignCenter);
        }
    }
    ui->settable->setColumnWidth(0, 50);
    ui->settable->setColumnWidth(1, 100);
    ui->settable->setColumnWidth(2, 180);
    socket->disconnectFromHost();
}

void Home::getadList_connected_slot()
{
    struct data user;
    user.type=NAMEHISTORY;
    user.username=username;
    user.value="123";
    socket->write(user.toByteArray());
}

void Home::getadList_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    QString receivedData(receivedInfo.data);
    QStringList records = receivedData.split("|", Qt::SkipEmptyParts);

    // 遍历每个记录

    ui->settable->setRowCount(records.size());
    for (int row = 0; row < records.size(); ++row) {
        // 以 '\n' 分割记录中的行
        QStringList lines = records[row].split("\n", Qt::SkipEmptyParts);

        // 遍历每行并添加到QTableWidget中
        for (int col = 0; col < lines.size(); ++col) {
            // 以 ':' 分割键和值
            QStringList keyValue = lines[col].split("&", Qt::SkipEmptyParts);

            QString key = keyValue[0].trimmed();
            QString value = keyValue[1].trimmed();
            QTableWidgetItem *item = new QTableWidgetItem(value);
            ui->settable->setItem(row, col, item);
            item->setTextAlignment(Qt::AlignCenter);
        }
    }
    ui->settable->setColumnWidth(0, 50);
    ui->settable->setColumnWidth(1, 80);
    ui->settable->setColumnWidth(2, 80);
    ui->settable->setColumnWidth(3, 160);
    socket->disconnectFromHost();
}

void Home::stuad_connected_slot()
{
    struct data user;
    user.type=STUAD;
    user.username=username;
    user.value=teachEdit->text();
    user.value1=adkeyEdit->text();
    socket->write(user.toByteArray());
}

void Home::callname_connected_slot()
{
    struct data user;
    user.type=NAMECALL;
    user.username=username;
    user.value="123";
    user.value1="123";
    socket->write(user.toByteArray());
}

void Home::callname_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    outputlog(receivedInfo.data);
    socket->disconnectFromHost();
}

void Home::stuad_readyRead_slot()
{
    QByteArray rawData = socket->readAll();
    const char* rawCharArray = rawData.constData();
    socketinfo receivedInfo;
    memcpy(&receivedInfo, rawCharArray, sizeof(socketinfo));
    stuHintLable->setText(receivedInfo.data);
    stuHintLable->setStyleSheet("color:rgb(26, 136, 35);height:40px;");
    socket->disconnectFromHost();
}

void Home::on_startattendancebtn_clicked()
{
    if(ui->startattendancebtn->text()=="发起签到")
    {
        socket = new QTcpSocket(this);
        socket->connectToHost(ip,port);
        connect(socket,&QTcpSocket::connected,this,&Home::startad_connected_slot);
        connect(socket,&QTcpSocket::readyRead,this,&Home::startad_readyRead_slot);
        ui->startattendancebtn->setText("关闭签到");
    }else{
        socket = new QTcpSocket(this);
        socket->connectToHost(ip,port);
        connect(socket,&QTcpSocket::connected,this,&Home::endad_connected_slot);
        connect(socket,&QTcpSocket::readyRead,this,&Home::endad_readyRead_slot);
        ui->startattendancebtn->setText("发起签到");
        ui->startattendancebtn->setStyleSheet("background-color:#000000;border-radius:7px;color:#ffffff;");
    }

}

void Home::outputlog(QString msg)
{
    ui->adEdit->setText("【"+getCurretTime()+"】"+msg+"\n"+ui->adEdit->toPlainText());
}

QString Home::getCurretTime()
{
    QTime systime = QTime::currentTime();
    QString s = systime.toString("hh:mm:ss");
    return s;
}

QString Home::generateRandomString(int length) {
    const QString charset = "123456789abcdefghijklmnpqrstuvwxyz";
    QString randomString;

    for (int i = 0; i < length; ++i) {
        int randomIndex = QRandomGenerator::global()->bounded(charset.length());
        randomString.append(charset.at(randomIndex));
    }

    return randomString;
}

void Home::closeAllpage()
{
    ui->hintframe->hide();
    ui->hintframe_2->hide();
    ui->startattendancebtn->hide();
    ui->setmainframe->hide();
    ui->callnamebtn->hide();
}

void Home::openAdPage()
{
    ui->hintframe->show();
    ui->hintframe_2->show();
    ui->startattendancebtn->show();
    ui->callnamebtn->show();
    this->setWindowTitle("签到管理系统v1.0-签到");
}

void Home::openListPage()
{
    this->setWindowTitle("签到管理系统v1.0-记录");
    ui->setmainframe->show();
    ui->funcinput->hide();
    ui->addbtn->hide();
    ui->searchbtn->hide();
    ui->deletebtn->hide();
    ui->backbtn->hide();
    QStringList headerLabels;
    headerLabels << "ID" << "姓名" << "签到码" << "签到时间";
    ui->settable->setHorizontalHeaderLabels(headerLabels);
    ui->settable->verticalHeader()->setVisible(false);
    ui->settable->setColumnCount(4);
    ui->settable->setStyleSheet("QScrollBar:vertical {"
                                "    background: #ffffff;"
                                "    width: 10px;"
                                "    margin: 16px 0px 16px 0px;"
                                "}"
                                "QScrollBar::handle:vertical {"
                                "    background: rgb(78, 79, 79);"
                                "    min-height: 10px;"
                                "}"
                                "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {"
                                "    border: none;"
                                "    background: none;"
                                "}"
                                "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {"
                                "    background: none;"
                                "}"
                                "#settable{background-color:#ffffff;color:#000000;}"
                                "QTableWidget::item:selected {"
                                "    background-color: #eeeeee;"
                                "color:#000000;"
                                "}");
    socket = new QTcpSocket(this);
    socket->connectToHost(ip,port);
    connect(socket,&QTcpSocket::connected,this,&Home::getadList_connected_slot);
    connect(socket,&QTcpSocket::readyRead,this,&Home::getadList_readyRead_slot);

    for (int row = 0; row < ui->settable->rowCount(); ++row) {
        for (int col = 0; col < ui->settable->columnCount(); ++col) {
            QTableWidgetItem *item = new QTableWidgetItem(QString("Row %1, Col %2").arg(row + 1).arg(col + 1));

            // 设置文本居中
            item->setTextAlignment(Qt::AlignCenter);
        }
    }
}

void Home::openSetPage()
{
    this->setWindowTitle("签到管理系统v1.0-设置");
    ui->setmainframe->show();
    ui->funcinput->show();
    ui->addbtn->show();
    ui->searchbtn->show();
    ui->deletebtn->show();
    ui->backbtn->show();
    QStringList headerLabels;
    headerLabels << "ID" << "姓名" << "添加时间";
    ui->settable->setHorizontalHeaderLabels(headerLabels);
    ui->settable->verticalHeader()->setVisible(false);
    ui->settable->setColumnCount(3);
    ui->settable->setColumnWidth(2, 500);
    ui->settable->setStyleSheet("QScrollBar:vertical {"
                              "    background: #ffffff;"
                              "    width: 10px;"
                              "    margin: 16px 0px 16px 0px;"
                              "}"
                              "QScrollBar::handle:vertical {"
                              "    background: rgb(78, 79, 79);"
                              "    min-height: 10px;"
                              "}"
                              "QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical {"
                              "    border: none;"
                              "    background: none;"
                              "}"
                              "QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical {"
                              "    background: none;"
                              "}"
                                "#settable{background-color:#ffffff;color:#000000;}"
                               "QTableWidget::item:selected {"
                                "    background-color: #eeeeee;"
                                "color:#000000;"
                                "}");
    socket = new QTcpSocket(this);
    socket->connectToHost(ip,port);
    connect(socket,&QTcpSocket::connected,this,&Home::getAllName_connected_slot);
    connect(socket,&QTcpSocket::readyRead,this,&Home::getAllName_readyRead_slot);

    for (int row = 0; row < ui->settable->rowCount(); ++row) {
        for (int col = 0; col < ui->settable->columnCount(); ++col) {
            QTableWidgetItem *item = new QTableWidgetItem(QString("Row %1, Col %2").arg(row + 1).arg(col + 1));

            // 设置文本居中
            item->setTextAlignment(Qt::AlignCenter);
        }
    }

}



void Home::on_callbtn_2_clicked()
{
    closeAllpage();
    openListPage();
}


void Home::on_callbtn_clicked()
{
    closeAllpage();
    openAdPage();
}


void Home::on_callbtn_3_clicked()
{
    closeAllpage();
    openSetPage();
}


void Home::on_callnamebtn_clicked()
{
    socket = new QTcpSocket(this);
    socket->connectToHost(ip,port);
    connect(socket,&QTcpSocket::connected,this,&Home::callname_connected_slot);
    connect(socket,&QTcpSocket::readyRead,this,&Home::callname_readyRead_slot);
}


void Home::on_addbtn_clicked()
{
    socket = new QTcpSocket(this);
    socket->connectToHost(ip,port);
    connect(socket,&QTcpSocket::connected,this,&Home::addname_connected_slot);
    connect(socket,&QTcpSocket::readyRead,this,&Home::addname_readyRead_slot);
}


void Home::on_deletebtn_clicked()
{
    socket = new QTcpSocket(this);
    socket->connectToHost(ip,port);
    connect(socket,&QTcpSocket::connected,this,&Home::deletename_connected_slot);
    connect(socket,&QTcpSocket::readyRead,this,&Home::deletename_readyRead_slot);


}


void Home::on_backbtn_clicked()
{
    // 创建 Widget 窗口
    Widget *w = new Widget();
    // 显示 Widget 窗口
    w->show();
    // 关闭当前 Home 窗口
    this->close();
}


void Home::on_searchbtn_clicked()
{
    socket = new QTcpSocket(this);
    socket->connectToHost(ip,port);
    connect(socket,&QTcpSocket::connected,this,&Home::searchname_connected_slot);
    connect(socket,&QTcpSocket::readyRead,this,&Home::searchname_readyRead_slot);
}


本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/1441623.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Python 数据可视化:配色方案

1、引言 在这篇文章中&#xff0c;我们将研究Python的一些配色方案&#xff0c;主要是Seaborn库。这将采用 Python Notebook 格式&#xff0c;其中包括绘图的代码。 2、实验数据 首先导入必要的库&#xff1a; import pandas as pd import seaborn as sns import matplotlib…

腾讯云游戏服务器购买入口,详细配置精准报价

2024年更新腾讯云游戏联机服务器配置价格表&#xff0c;可用于搭建幻兽帕鲁、雾锁王国等游戏服务器&#xff0c;游戏服务器配置可选4核16G12M、8核32G22M、4核32G10M、16核64G35M、4核16G14M等配置&#xff0c;可以选择轻量应用服务器和云服务器CVM内存型MA3或标准型SA2实例&am…

Backtrader 文档学习- Plotting

Backtrader 文档学习- Plotting 虽然回测是一个基于数学计算的自动化过程&#xff0c;还是希望实际通过可视化验证。无论是使用现有算法回测&#xff0c;还是观察数据驱动的指标&#xff08;内置或自定义&#xff09;。 凡事都要有人完成&#xff0c;绘制数据加载、指标、操作…

Vuex介绍和使用

1. 什么是Vuex Vuex 是一个专为 Vue.js 应用程序开发的状态管理模式和库。它解决了在大型 Vue.js 应用程序中共享和管理状态的问题&#xff0c;使得状态管理变得更加简单、可预测和可维护。 在 Vue.js 应用中&#xff0c;组件之间的通信可以通过 props 和事件进行&#xff0c…

微信小程序(三十四)搜索框-带历史记录

注释很详细&#xff0c;直接上代码 上一篇 新增内容&#xff1a; 1.搜索框基本模板 2.历史记录基本模板 3.细节处理 源码&#xff1a; index.wxml <!-- 1.点击搜索按钮a.非空判断b.历史记录&#xff08;去重&#xff09;c.清空搜索框d.去除前后多余空格2.删除搜索 3.无搜索…

【制作100个unity游戏之24】unity制作一个3D动物AI生态系统游戏3(附项目源码)

最终效果 文章目录 最终效果系列目录前言随着地面法线旋转在地形上随机生成动物不同部位颜色不同最终效果源码完结系列目录 前言 欢迎来到【制作100个Unity游戏】系列!本系列将引导您一步步学习如何使用Unity开发各种类型的游戏。在这第24篇中,我们将探索如何用unity制作一…

肯尼斯·里科《C和指针》第13章 高级指针话题(3)命令行参数

处理命令行参数是指向指针的指针的另一个用武之地。有些操作系统&#xff0c;包括UNIX和MS-DOS&#xff0c;让用户在命令行中编写参数来启动一个程序的执行。这些参数被传递给程序&#xff0c;程序按照它认为合适的任何方式对它们进行处理。 13.4.1 传递命令行参数 这些参数如何…

BestEdrOfTheMarket:一个针对AVEDR绕过的训练学习环境

关于BestEdrOfTheMarket BestEdrOfTheMarket是一个针对AV/EDR绕过的训练学习环境&#xff0c;广大研究人员和信息安全爱好者可以使用该项目研究和学习跟AV和EDR绕过相关的技术知识。 支持绕过的防御技术 1、多层API钩子&#xff1b; 2、SSH钩子&#xff1b; 3、IAT钩子&#x…

比较6*6范围内7个点182个结构的顺序

( A, B )---6*30*2---( 1, 0 )( 0, 1 ) 让网络的输入有6个节点&#xff0c;训练集AB各由6张二值化的图片组成&#xff0c;让A中有7个点&#xff0c;让B全是0&#xff0c;收敛误差7e-4&#xff0c;收敛199次&#xff0c;统计迭代次数平均值并排序。 得到顺序为 用6个点的结构标…

【开源】JAVA+Vue.js实现在线课程教学系统

目录 一、摘要1.1 系统介绍1.2 项目录屏 二、研究内容2.1 课程类型管理模块2.2 课程管理模块2.3 课时管理模块2.4 课程交互模块2.5 系统基础模块 三、系统设计3.1 用例设计3.2 数据库设计 四、系统展示4.1 管理后台4.2 用户网页 五、样例代码5.1 新增课程类型5.2 网站登录5.3 课…

初识NodeJS

本文主要基于极客时间《Nodejs开发实战》课程。 本篇&#xff08;一&#xff09;为课程的第二篇——技术预研篇。 什么是Nodejs? 来源官网&#xff1a; Node.js 是一个基于 Chrome V8 引擎的 JavaScript 运行环境。Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型&#x…

备战蓝桥杯---动态规划(基础1)

先看几道比较简单的题&#xff1a; 直接f[i][j]f[i-1][j]f[i][j-1]即可&#xff08;注意有马的地方赋值为0&#xff09; 下面是递推循环方式实现的AC代码&#xff1a; #include<bits/stdc.h> using namespace std; #define int long long int a[30][30]; int n,m,x,y; …

HTTP2:netty http2 StreamChannel多流实现与Http2StreamFrame解码器的源码分析

netty http2 server侧的核心逻辑个人认为&#xff0c;主要在编解码处理器和Stream Transform Channel这块&#xff0c;分别处理Http2 消息帧的编解码&#xff0c;以及连接的多流处理机制。对应用的处理类分别&#xff1a; ChannelHandlerDescio.netty.handler.codec.http2.Htt…

vue 引入 百度地图API 和 路书

公司项目中&#xff0c;偶尔都会涉及到地图的使用&#xff0c;这里以百度地图为例&#xff0c;我们梳理一下引用流程及注意点 账号和获取密钥 百度地图示例 百度地图 类参考 1、账号和获取密钥 // api.map.baidu.com/api?typewebgl&v3.0&ak您的密钥<script type…

宋小黑原创高清壁纸分享之蓝白云海

大家好&#xff0c;我是小黑&#xff0c;最近迷上了制作壁纸&#xff0c;哈哈&#xff0c;给大家分享一波&#xff0c;小黑做的美图~ 本期给大家分享的是&#xff0c;小黑原创的蓝白云海主题系统壁纸~ 厌倦了一成不变的壁纸吗&#xff1f; 感到学习负担过重吗&#xff1f; …

肯尼斯·里科《C和指针》第13章 高级指针话题(1)进一步探讨指向指针的指针变量的高级声明

13.1 进一步探讨指向指针的指针 上一章使用了指向指针的指针&#xff0c;用于简化向单链表插入新值的函数。另外还存在许多领域&#xff0c;指向指针的指针可以在其中发挥重要的作用。这里有一个通用的例子&#xff1a; 这些声明在内存中创建了下列变量。如果它们是自动变量&am…

6.0 Zookeeper session 基本原理详解教程

客户端与服务端之间的连接是基于 TCP 长连接&#xff0c;client 端连接 server 端默认的 2181 端口&#xff0c;也就 是 session 会话。 从第一次连接建立开始&#xff0c;客户端开始会话的生命周期&#xff0c;客户端向服务端的ping包请求&#xff0c;每个会话都可以设置一个…

python列表推导式(List Comprehension)

目录 1. 介绍&#xff1a;2. 示例3. 过滤功能4. 多重循环小结&#xff1a; 1. 介绍&#xff1a; 列表推导式是 Python 中一种简洁的语法形式&#xff0c;用于从一个可迭代对象中生成新的列表。它的语法形式为 [expression for item in iterable]&#xff0c;其中expression是一…

【Larry】英语学习笔记语法篇——从句=连词+简单句

目录 三、从句连词简单句 1、必须有连词 主从结构 疑问词的词性 2、名词性从句 同位语从句 形式主语 形式宾语 that的省略 3、形容词性从句&#xff08;上&#xff09; 关系代词 关系词的作用 介词前置问题 4、形容词性从句&#xff08;中&#xff09; 定语关系…

(十四)springboot实战——spring securtity安全框架原理之启动流程

前言 本节内容主要介绍spring securtity的初始化启动流程&#xff0c;spring security是通过EnableWebSecurity注解来启用的&#xff0c;在EnableWebSecurity注解中主要引入了WebSecurityConfiguration、SpringWebMvcImportSelector、OAuth2ImportSelector、HttpSecurityConfi…