ESP32CAM物联网教学11

ESP32CAM物联网教学11

霍霍webserver

在第八课的时候,小智把乐鑫公司提供的官方示例程序CameraWebServer改成了明码,这样说明这个官方程序也是可以更改的嘛。这个官方程序有四个文件,一共3500行代码,看着都头晕,小智决定对这个官方程序下手,砍一砍,看看能看到多少行代码!

  • 整合、删减

首先把四个文件整合成一个文件。

Camera_pins.h这个是定义摄像头引脚接口的,我们仅仅保留AI_THINKER这种摄像头的接口;camera_index.h是服务网页的源代码,我们只保留改编后的明码;接来着是更改最多的app_httpd.cpp,这个是定义了网页服务的后台程序。

这个官方程序在设计的时候,主要是面向更多款式的ESP32Cam开发板,为用户提供更多的使用操作,提供了非常丰富、非常完整的服务,是一个主打“通用型程序”。但是,我们在这里的目的是删减,只要保留着针对手中的这块ESP32Cam,程序只要能跑就好,不需要更多的花里胡哨,删减程序主打“专用型程序”。

因此,如图所示,我们在这个程序中,仅仅保留了两个网页服务:一个是主页index.html,一个是视频服务Stream。然后把其他的相关内容全部删除,经过删减,代码打印剩下300行了。

330行代码:

#include "esp_camera.h"
#include <WiFi.h>
#include "esp_http_server.h"const char* ssid = "ChinaNet-xxVP";
const char* password = "123456789";void startCameraServer();//  这个是index.html网页的源代码
static const char mainPage[] = u8R"(
<!doctype html>
<html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>ESP32 OV2460</title></head><body><section class="main"><div id="content"><div id="sidebar"><nav id="menu"><section id="buttons"><button id="toggle-stream">Start Stream</button><button id="stggle-stream">Stop Stream</button></section></nav></div><figure><div id="stream-container" class="image-container hidden"><img id="stream" src="" crossorigin></div></figure></div></section><script>
document.addEventListener('DOMContentLoaded', function (event) {var baseHost = document.location.originvar streamUrl = baseHost + ':81'function setWindow(start_x, start_y, end_x, end_y, offset_x, offset_y, total_x, total_y, output_x, output_y, scaling, binning, cb){fetchUrl(`${baseHost}/resolution?sx=${start_x}&sy=${start_y}&ex=${end_x}&ey=${end_y}&offx=${offset_x}&offy=${offset_y}&tx=${total_x}&ty=${total_y}&ox=${output_x}&oy=${output_y}&scale=${scaling}&binning=${binning}`, cb);}document.querySelectorAll('.close').forEach(el => {el.onclick = () => {hide(el.parentNode)}})const view = document.getElementById('stream')const streamButton = document.getElementById('toggle-stream')const streamButton2 = document.getElementById('stggle-stream')streamButton.onclick = () => {view.src = `${streamUrl}/stream`show(viewContainer)}streamButton2.onclick = () => {window.stop();}})</script></body>
</html>
)";///
// 摄像头引脚 AI_Thinker
#define PWDN_GPIO_NUM     32
#define RESET_GPIO_NUM    -1
#define XCLK_GPIO_NUM      0
#define SIOD_GPIO_NUM     26
#define SIOC_GPIO_NUM     27
#define Y9_GPIO_NUM       35
#define Y8_GPIO_NUM       34
#define Y7_GPIO_NUM       39
#define Y6_GPIO_NUM       36
#define Y5_GPIO_NUM       21
#define Y4_GPIO_NUM       19
#define Y3_GPIO_NUM       18
#define Y2_GPIO_NUM        5
#define VSYNC_GPIO_NUM    25
#define HREF_GPIO_NUM     23
#define PCLK_GPIO_NUM     22
//#define LED_GPIO_NUM       4///
// 开启调试信息
#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
#include "esp32-hal-log.h"
#endif
// 开启模块的存储 PSRAM
#ifdef BOARD_HAS_PSRAM
#define CONFIG_ESP_FACE_DETECT_ENABLED 1
#define CONFIG_ESP_FACE_RECOGNITION_ENABLED 0
#endif#define PART_BOUNDARY "123456789000000000000987654321"
static const char *_STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY;
static const char *_STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";
static const char *_STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\nX-Timestamp: %d.%06d\r\n\r\n";httpd_handle_t stream_httpd = NULL;
httpd_handle_t camera_httpd = NULL;static esp_err_t stream_handler(httpd_req_t *req)
{camera_fb_t *fb = NULL;struct timeval _timestamp;esp_err_t res = ESP_OK;size_t _jpg_buf_len = 0;uint8_t *_jpg_buf = NULL;char *part_buf[128];res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);if (res != ESP_OK){return res;}httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");httpd_resp_set_hdr(req, "X-Framerate", "60");while (true){fb = esp_camera_fb_get();if (!fb){log_e("Camera capture failed");res = ESP_FAIL;}else{  // 从摄像头获取图片的数据_jpg_buf_len = fb->len;_jpg_buf = fb->buf;}if (res == ESP_OK){res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));}if (res == ESP_OK){size_t hlen = snprintf((char *)part_buf, 128, _STREAM_PART, _jpg_buf_len, _timestamp.tv_sec, _timestamp.tv_usec);res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);}if (res == ESP_OK){res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);}// 清除相关的内存if (fb){esp_camera_fb_return(fb);fb = NULL;_jpg_buf = NULL;}else if (_jpg_buf){free(_jpg_buf);_jpg_buf = NULL;}if (res != ESP_OK){log_e("Send frame failed");break;}}return res;
}static esp_err_t index_handler(httpd_req_t *req)
{httpd_resp_set_type(req, "text/html");//httpd_resp_set_hdr(req, "Content-Encoding", "gzip");httpd_resp_set_hdr(req, "Content-Encoding", "html");sensor_t *s = esp_camera_sensor_get();if (s != NULL) {//return httpd_resp_send(req, (const char *)index_ov2640_html_gz, index_ov2640_html_gz_len);const char* charHtml = mainPage;return  httpd_resp_send(req, (const char *)charHtml, strlen(charHtml));} else {log_e("Camera sensor not found");return httpd_resp_send_500(req);}
}void startCameraServer()
{httpd_config_t config = HTTPD_DEFAULT_CONFIG();config.max_uri_handlers = 16;httpd_uri_t index_uri = {.uri = "/",.method = HTTP_GET,.handler = index_handler,.user_ctx = NULL};httpd_uri_t stream_uri = {.uri = "/stream",.method = HTTP_GET,.handler = stream_handler,.user_ctx = NULL};log_i("Starting web server on port: '%d'", config.server_port);if (httpd_start(&camera_httpd, &config) == ESP_OK){httpd_register_uri_handler(camera_httpd, &index_uri);//httpd_register_uri_handler(camera_httpd, &cmd_uri);//httpd_register_uri_handler(camera_httpd, &status_uri);//httpd_register_uri_handler(camera_httpd, &capture_uri);//httpd_register_uri_handler(camera_httpd, &bmp_uri);//httpd_register_uri_handler(camera_httpd, &xclk_uri);//httpd_register_uri_handler(camera_httpd, &reg_uri);//httpd_register_uri_handler(camera_httpd, &greg_uri);//httpd_register_uri_handler(camera_httpd, &pll_uri);//httpd_register_uri_handler(camera_httpd, &win_uri);}config.server_port += 1;config.ctrl_port += 1;log_i("Starting stream server on port: '%d'", config.server_port);if (httpd_start(&stream_httpd, &config) == ESP_OK){httpd_register_uri_handler(stream_httpd, &stream_uri);}
}///void setup() {Serial.begin(115200);Serial.setDebugOutput(true);Serial.println();camera_config_t config;config.ledc_channel = LEDC_CHANNEL_0;config.ledc_timer = LEDC_TIMER_0;config.pin_d0 = Y2_GPIO_NUM;config.pin_d1 = Y3_GPIO_NUM;config.pin_d2 = Y4_GPIO_NUM;config.pin_d3 = Y5_GPIO_NUM;config.pin_d4 = Y6_GPIO_NUM;config.pin_d5 = Y7_GPIO_NUM;config.pin_d6 = Y8_GPIO_NUM;config.pin_d7 = Y9_GPIO_NUM;config.pin_xclk = XCLK_GPIO_NUM;config.pin_pclk = PCLK_GPIO_NUM;config.pin_vsync = VSYNC_GPIO_NUM;config.pin_href = HREF_GPIO_NUM;config.pin_sccb_sda = SIOD_GPIO_NUM;config.pin_sccb_scl = SIOC_GPIO_NUM;config.pin_pwdn = PWDN_GPIO_NUM;config.pin_reset = RESET_GPIO_NUM;config.xclk_freq_hz = 20000000;config.frame_size = FRAMESIZE_UXGA;config.pixel_format = PIXFORMAT_JPEG; // for streaming//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognitionconfig.grab_mode = CAMERA_GRAB_WHEN_EMPTY;config.fb_location = CAMERA_FB_IN_PSRAM;config.jpeg_quality = 12;config.fb_count = 1;// if PSRAM IC present, init with UXGA resolution and higher JPEG quality//                      for larger pre-allocated frame buffer.if(config.pixel_format == PIXFORMAT_JPEG){if(psramFound()){config.jpeg_quality = 10;config.fb_count = 2;config.grab_mode = CAMERA_GRAB_LATEST;} else {// Limit the frame size when PSRAM is not availableconfig.frame_size = FRAMESIZE_SVGA;config.fb_location = CAMERA_FB_IN_DRAM;}}// camera initesp_err_t err = esp_camera_init(&config);if (err != ESP_OK) {Serial.printf("Camera init failed with error 0x%x", err);return;}sensor_t * s = esp_camera_sensor_get();// drop down frame size for higher initial frame rateif(config.pixel_format == PIXFORMAT_JPEG){s->set_framesize(s, FRAMESIZE_QVGA);}WiFi.begin(ssid, password);WiFi.setSleep(false);while (WiFi.status() != WL_CONNECTED) {delay(500);Serial.print(".");}Serial.println("");Serial.println("WiFi connected");startCameraServer();Serial.print("Camera Ready! Use 'http://");Serial.print(WiFi.localIP());Serial.println("' to connect");
}void loop() {// Do nothing. Everything is done in another task by the web serverdelay(10000);
}

  • 再次删减

我们通过查阅index.html的源码,发现这个视频显示的代码,其实是指向另外的一个网页,结合后台的处理程序,我们知道了这个视频的网址是http://192.168.1.184:81/stream,我们只要在浏览器中直接访问这个网址,也能查看到摄像头的视频。也就是说,我们可以绕开主页index.html,然后直接去访问这个显示视频的网页。

view.src = `${streamUrl}/stream`

show(viewContainer)

这样就给了我们再次删减程序的方法了,我们之间李代桃僵,用这个视频显示的网页,直接代替主页index.html。这样,我们在开发板的后台程序中,可以删减掉原来的index.html的源代码以及页面服务了。

程序经过再次删减,仅剩下200行了。这样,我们新建一个Arduino IDE程序,要把这200行的代码,写入ESP32Cam开发板,就能用浏览器看到这个摄像头的视频了。

为什么删减程序呢?我们在研究这个官方程序的时候,如果是5000行代码,谁看都晕,现在变成200行,一眼就能看得明明白白清清楚楚了。

200行代码:

#include "esp_camera.h"
#include <WiFi.h>
#include "esp_http_server.h"const char* ssid = "ChinaNet-xxVP";
const char* password = "123456789";void startCameraServer();///
// 开启调试信息
#if defined(ARDUINO_ARCH_ESP32) && defined(CONFIG_ARDUHAL_ESP_LOG)
#include "esp32-hal-log.h"
#endif
// 开启模块的存储 PSRAM
#ifdef BOARD_HAS_PSRAM
#define CONFIG_ESP_FACE_DETECT_ENABLED 1
#define CONFIG_ESP_FACE_RECOGNITION_ENABLED 0
#endif#define PART_BOUNDARY "123456789000000000000987654321"
static const char *_STREAM_CONTENT_TYPE = "multipart/x-mixed-replace;boundary=" PART_BOUNDARY;
static const char *_STREAM_BOUNDARY = "\r\n--" PART_BOUNDARY "\r\n";
static const char *_STREAM_PART = "Content-Type: image/jpeg\r\nContent-Length: %u\r\nX-Timestamp: %d.%06d\r\n\r\n";httpd_handle_t camera_httpd = NULL;static esp_err_t index_handler(httpd_req_t *req)
{camera_fb_t *fb = NULL;struct timeval _timestamp;esp_err_t res = ESP_OK;size_t _jpg_buf_len = 0;uint8_t *_jpg_buf = NULL;char *part_buf[128];res = httpd_resp_set_type(req, _STREAM_CONTENT_TYPE);if (res != ESP_OK){return res;}httpd_resp_set_hdr(req, "Access-Control-Allow-Origin", "*");httpd_resp_set_hdr(req, "X-Framerate", "60");while (true){fb = esp_camera_fb_get();if (!fb){log_e("Camera capture failed");res = ESP_FAIL;}else{  // 从摄像头获取图片的数据_jpg_buf_len = fb->len;_jpg_buf = fb->buf;}if (res == ESP_OK){res = httpd_resp_send_chunk(req, _STREAM_BOUNDARY, strlen(_STREAM_BOUNDARY));}if (res == ESP_OK){size_t hlen = snprintf((char *)part_buf, 128, _STREAM_PART, _jpg_buf_len, _timestamp.tv_sec, _timestamp.tv_usec);res = httpd_resp_send_chunk(req, (const char *)part_buf, hlen);}if (res == ESP_OK){res = httpd_resp_send_chunk(req, (const char *)_jpg_buf, _jpg_buf_len);}// 清除相关的内存if (fb){esp_camera_fb_return(fb);fb = NULL;_jpg_buf = NULL;}else if (_jpg_buf){free(_jpg_buf);_jpg_buf = NULL;}if (res != ESP_OK){log_e("Send frame failed");break;}}return res;
}void startCameraServer()
{httpd_config_t config = HTTPD_DEFAULT_CONFIG();config.max_uri_handlers = 16;httpd_uri_t index_uri = {.uri = "/",.method = HTTP_GET,.handler = index_handler,.user_ctx = NULL};log_i("Starting web server on port: '%d'", config.server_port);if (httpd_start(&camera_httpd, &config) == ESP_OK){httpd_register_uri_handler(camera_httpd, &index_uri);}
}///void setup() {Serial.begin(115200);Serial.setDebugOutput(true);Serial.println();camera_config_t config;config.ledc_channel = LEDC_CHANNEL_0;config.ledc_timer = LEDC_TIMER_0;config.pin_d0 = 5;config.pin_d1 = 18;config.pin_d2 = 19;config.pin_d3 = 21;config.pin_d4 = 36;config.pin_d5 = 39;config.pin_d6 = 34;config.pin_d7 = 35;config.pin_xclk = 0;config.pin_pclk = 22;config.pin_vsync = 25;config.pin_href = 23;config.pin_sccb_sda = 26;config.pin_sccb_scl = 27;config.pin_pwdn = 32;config.pin_reset = -1;config.xclk_freq_hz = 20000000;config.frame_size = FRAMESIZE_UXGA;config.pixel_format = PIXFORMAT_JPEG; // for streaming//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognitionconfig.grab_mode = CAMERA_GRAB_WHEN_EMPTY;config.fb_location = CAMERA_FB_IN_PSRAM;config.jpeg_quality = 12;config.fb_count = 1;// if PSRAM IC present, init with UXGA resolution and higher JPEG quality//                      for larger pre-allocated frame buffer.if(config.pixel_format == PIXFORMAT_JPEG){if(psramFound()){config.jpeg_quality = 10;config.fb_count = 2;config.grab_mode = CAMERA_GRAB_LATEST;} else {// Limit the frame size when PSRAM is not availableconfig.frame_size = FRAMESIZE_SVGA;config.fb_location = CAMERA_FB_IN_DRAM;}}// camera initesp_err_t err = esp_camera_init(&config);if (err != ESP_OK) {Serial.printf("Camera init failed with error 0x%x", err);return;}sensor_t * s = esp_camera_sensor_get();// drop down frame size for higher initial frame rateif(config.pixel_format == PIXFORMAT_JPEG){s->set_framesize(s, FRAMESIZE_QVGA);}WiFi.begin(ssid, password);WiFi.setSleep(false);while (WiFi.status() != WL_CONNECTED) {delay(500);Serial.print(".");}Serial.println("");Serial.println("WiFi connected");startCameraServer();Serial.print("Camera Ready! Use 'http://");Serial.print(WiFi.localIP());Serial.println("' to connect");
}void loop() {// Do nothing. Everything is done in another task by the web serverdelay(10000);
}

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

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

相关文章

S7-200smart与C#通信

https://www.cnblogs.com/heizao/p/15797382.html C#与PLC通信开发之西门子s7-200 smart_c# s7-200smart通讯库-CSDN博客https://blog.csdn.net/weixin_44455060/article/details/109713121 C#上位机读写西门子S7-200SMART PLC变量 教程_哔哩哔哩_bilibilihttps://www.bilibili…

清朝嘉庆二十五年(1820年)地图数据

我们在《中国历史行政区划连续变化数据》一文中&#xff0c;为你分享了中国历史行政区划连续变化地图数据。 现在再为你分享清朝嘉庆二十五年&#xff08;1820年&#xff09;的地图数据&#xff0c;该数据对于研究历史的朋友应该比较有用&#xff0c;请在文末查看领取方式。 …

HTTP背后的故事:理解现代网络如何工作的关键(一)

一.HTTP是什么 概念 &#xff1a; 1.HTTP ( 全称为 " 超文本传输协议 ") 是一种应用非常广泛的 应用层协议。 2.HTTP 诞生与1991年. 目前已经发展为最主流使用的一种应用层协议. 3.HTTP 往往是基于传输层的 TCP 协议实现的 . (HTTP1.0, HTTP1.1, HTTP2.0 均为 T…

2024世界人工智能大会(WAIC)学习总结

1 前言 在2024年的世界人工智能大会&#xff08;WAIC&#xff09;上&#xff0c;我们见证了从农业社会到工业社会再到数字化社会的深刻转变。这一进程不仅体现在技术的单点爆发&#xff0c;更引发了整个产业链的全面突破&#xff0c;未来将是技术以指数级速度发展的崭新时代。…

【从0到1进阶Redis】主从复制 — 主从机宕机测试

上一篇&#xff1a;【从0到1进阶Redis】主从复制 测试&#xff1a;主机断开连接&#xff0c;从机依旧连接到主机的&#xff0c;但是没有写操作&#xff0c;这个时候&#xff0c;主机如果回来了&#xff0c;从机依旧可以直接获取到主机写的信息。 如果是使用命令行&#xff0c;来…

PyTorch深度学习实战(46)——深度Q学习

PyTorch深度学习实战&#xff08;46&#xff09;——深度Q学习 0. 前言1. 深度 Q 学习2. 网络架构3. 实现深度 Q 学习模型进行 CartPole 游戏小结系列链接 0. 前言 我们已经学习了如何构建一个 Q 表&#xff0c;通过在多个 episode 中重复进行游戏获取与给定状态-动作组合相对…

【学习笔记】无人机(UAV)在3GPP系统中的增强支持(十四)-无人机操控关键绩效指标(KPI)框架

引言 本文是3GPP TR 22.829 V17.1.0技术报告&#xff0c;专注于无人机&#xff08;UAV&#xff09;在3GPP系统中的增强支持。文章提出了多个无人机应用场景&#xff0c;分析了相应的能力要求&#xff0c;并建议了新的服务级别要求和关键性能指标&#xff08;KPIs&#xff09;。…

第二证券:转融通是什么意思?什么是转融通?

转融通&#xff0c;包含转融资和转融券&#xff0c;实质是借钱和借券。转融通是指证券金融公司借入证券、筹得资金后&#xff0c;再转借给证券公司&#xff0c;是一假贷联络&#xff0c;具体是指证券公司从符合要求的基金处理公司、保险公司、社保基金等组织出资者融券&#xf…

Python应用开发——30天学习Streamlit Python包进行APP的构建(15):优化性能并为应用程序添加状态

Caching and state 优化性能并为应用程序添加状态! Caching 缓存 Streamlit 为数据和全局资源提供了强大的缓存原语。即使从网络加载数据、处理大型数据集或执行昂贵的计算,它们也能让您的应用程序保持高性能。 本页仅包含有关 st.cache_data API 的信息。如需深入了解缓…

技术成神之路:设计模式(六)策略模式

1.介绍 策略模式&#xff08;Strategy Pattern&#xff09;是一种行为型设计模式&#xff0c;它定义了一系列算法&#xff0c;封装每一个算法&#xff0c;并使它们可以相互替换。策略模式使得算法的变化独立于使用算法的客户端。 2.主要作用 策略模式的主要作用是将算法或行为…

什么叫图像的双边滤波,并附利用OpenCV和MATLB实现双边滤波的代码

双边滤波&#xff08;Bilateral Filtering&#xff09;是一种在图像处理中常用的非线性滤波技术&#xff0c;主要用于去噪和保边。它在空间域和像素值域上同时进行加权&#xff0c;既考虑了像素之间的空间距离&#xff0c;也考虑了像素值之间的相似度&#xff0c;从而能够有效地…

手机怎么看WiFi的IP地址

在如今数字化快速发展的时代&#xff0c;无线网络已成为我们日常生活中不可或缺的一部分。无论是工作、学习还是娱乐&#xff0c;我们可能都离不开WiFi的陪伴。然而&#xff0c;在使用WiFi的过程中&#xff0c;有时我们可能需要查看其IP地址&#xff0c;以便更好地管理我们的网…

【动态规划】背包问题 {01背包问题;完全背包问题;二维费用背包问题}

一、背包问题概述 背包问题(Knapsackproblem)是⼀种组合优化的NP完全问题。 问题可以描述为&#xff1a;给定一组物品&#xff0c;每种物品都有自己的重量和价格&#xff0c;在限定的总重量内&#xff0c;我们如何选择&#xff0c;才能使得物品的总价格最⾼。 根据物品的个数…

链接追踪系列-07.logstash安装json_lines插件

进入docker中的logstash 容器内&#xff1a; jelexbogon ~ % docker exec -it 7ee8960c99a31e607f346b2802419b8b819cc860863bc283cb7483bc03ba1420 /bin/sh $ pwd /usr/share/logstash $ ls bin CONTRIBUTORS Gemfile jdk logstash-core modules tools x-pack …

语音识别概述

语音识别概述 一.什么是语音&#xff1f; 语音是语言的声学表现形式&#xff0c;是人类自然的交流工具。 图片来源&#xff1a;https://www.shenlanxueyuan.com/course/381 二.语音识别的定义 语音识别&#xff08;Automatic Speech Recognition, ASR 或 Speech to Text, ST…

基于RAG大模型的变电站智慧运维-第十届Nvidia Sky Hackathon参赛作品

第十届Nvidia Sky Hackathon参赛作品 1. 项目说明 变电站是用于变电的设施&#xff0c;主要的作用是将电压转化&#xff0c;使电能在输电线路中能够长距离传输。在电力系统中&#xff0c;变电站起到了极为重要的作用&#xff0c;它可以完成电能的负荷分配、电压的稳定、容错保…

电影购票小程序论文(设计)开题报告

一、课题的背景和意义 随着互联网技术的不断发展&#xff0c;人们对于购票的需求也越来越高。传统的购票方式存在着排队时间长、购票流程繁琐等问题&#xff0c;而网上购票则能够有效地解决这些问题。电影购票小程序是网上购票的一种新型应用&#xff0c;它能够让用户随时随地…

06.截断文本 选择任何链接 :root 和 html 有什么区别

截断文本 对超过一行的文本进行截断,在末尾添加省略号(…)。 使用 overflow: hidden 防止文本超出其尺寸。使用 white-space: nowrap 防止文本超过一行高度。使用 text-overflow: ellipsis 使得如果文本超出其尺寸,将以省略号结尾。为元素指定固定的 width,以确定何时显示省略号…

笔记 4 :linux 0.11 中继续分析 0 号进程创建一号进程的 fork () 函数

&#xff08;27&#xff09;本条目开始&#xff0c; 开始分析 copy_process () 函数&#xff0c;其又会调用别的函数&#xff0c;故先分析别的函数。 get_free_page &#xff08;&#xff09; &#xff1b; 先 介绍汇编指令 scasb &#xff1a; 以及 指令 sstosd &#xff1a;…

什么是架构设计师?定义、职责和任务,全方位解析需要具备的专业素质

目录 1. 架构设计师的定义 2. 架构设计师的职责和任务 2.1 系统架构设计 2.1.1 模块划分 2.1.2 接口设计 2.1.3 通信方式 2.2 技术选型与决策 2.2.1 技术评估 2.2.2 技术选型 2.2.3 技术决策 2.3 性能优化与调优 2.3.1 性能分析 2.3.2 性能优化 2.3.3 性能调优 …