豆包ai 生成动态tree 增、删、改以及上移下移 html+jquery
@[豆包ai 生成动态tree 增、删、改以及上移下移 html+jquery)
人工Ai 编程
推荐一Kimi https://kimi.moonshot.cn/
推荐二 豆包https://www.doubao.com/
实现效果图

html 代码
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale = 1.0"><title>Chapter Tree</title><style>/* 整体树容器样式 */#chapter-tree-container {padding-left: 20px;}/* 章节li样式 */li {position: relative;padding-left: 20px;margin: 5px 0;line-height: 24px;}/* 利用伪元素创建线条 */li::before {content: '';position: absolute;left: 0;top: 12px;width: 10px;border-top: 1px solid #ccc;}/* 顶级li去除顶部线条 */#chapter-tree-container ul li:first-child::before {border-top: none;}/* 有子章节的li添加垂直线条 */li:has(ul)::before {height: 100%;border-left: 1px solid #ccc;}/* 子章节ul样式 */ul {list-style-type: none;padding-left: 10px;}/* 美化 input */input.edit-input {width: 150px;padding: 8px;border: 1px solid #ccc;border-radius: 4px;font-size: 14px;color: #555;outline: none;}input.edit-input::placeholder {color: #999;}/* 美化操作按钮 */button {padding: 6px 12px;background-color: #007BFF;color: white;border: none;border-radius: 4px;font-size: 14px;cursor: pointer;transition: background-color 0.3s ease;}button:hover {background-color: #0056b3;}button.add-button {background-color: #28a745;}button.add-button:hover {background-color: #218838;}button.modify-button {background-color: #ffc107;}button.modify-button:hover {background-color: #e0a800;}button.delete-button {background-color: #dc3545;}button.delete-button:hover {background-color: #c82333;}/* 折叠按钮样式 */button[text="+"],button[text="-"] {width: 24px;height: 24px;border-radius: 50%;padding: 0;font-size: 14px;line-height: 24px;text-align: center;}</style>
</head><body><div id="chapter-tree-container"></div><script src="https://code.jquery.com/jquery-3.6.0.min.js"></script><script>// 初始数据结构,为每个章节添加唯一 idvar initialData = [{id: 1,name: "第一单元 成长的节拍",children: [{id: 2,name: "第一课 中学时代",children: [{ id: 3, name: "中学序曲" },{ id: 4, name: "珍惜青春" },{ id: 5, name: "步入中学生活" }]},{id: 6,name: "少年有梦",children: [{ id: 7, name: "梦想的含义" },{ id: 8, name: "努力的意义" },{ id: 9, name: "实现理想的途径" },{ id: 10, name: "正确对待理想与现实" }]}]}];// 渲染树形章节结构function renderTree(data) {// 清空旧的渲染内容$('#chapter-tree-container').empty();var ul = $("<ul>");function renderChildren(children, parentUl) {if (!children) return;children.forEach(function (child) {let li;li = $("<li>").data('chapter-id', child.id);var expandButton = $("<button>").text("+");expandButton.click(function () {try {var subUl = li.find("ul");if (subUl.length) {subUl.toggle();expandButton.text(subUl.is(":visible")? "-" : "+");} else {var newSubUl = $("<ul>").hide();renderChildren(child.children, newSubUl);li.append(newSubUl);newSubUl.show();expandButton.text("-");}} catch (error) {console.error('Error in expand button click:', error);}});var chapterNameSpan = $("<span>").text(child.name).addClass('chapter-name-span');// 添加增删改按钮var addButton = $("<button>").text("添加").addClass('add-button');var modifyButton = $("<button>").text("修改").addClass('modify-button');var deleteButton = $("<button>").text("删除").addClass('delete-button');var moveUpButton = $("<button>").text("上移");var moveDownButton = $("<button>").text("下移");var addSubChapterButton = $("<button>").text("添加子章节");addButton.click(function () {try {addChapter(li);} catch (error) {console.error('Error in add button click:', error);}});modifyButton.click(function () {try {var currentLi = $(this).closest('li');var chapterId = currentLi.data('chapter-id');var chapter = findChapterById(chapterId, initialData);if (!chapter) {console.error('Chapter not found for modification.');return;}var chapterNameSpan = currentLi.find('.chapter-name-span:eq(0)');var input = $("<input>").val(chapter.name).addClass('edit-input').focus();chapterNameSpan.replaceWith(input);input.on('blur', function () {try {var newName = $(this).val();var currentLi = $(this).closest('li');var chapter = getChapterFromLi(currentLi);if (chapter) {chapter.name = newName;var newChapterNameSpan = $("<span>").text(newName).addClass('chapter-name-span');$(this).replaceWith(newChapterNameSpan);if (chapter.children && chapter.children.length > 0) {var subUl = currentLi.find('ul');if (!subUl.length) {subUl = $("<ul>");renderChildren(chapter.children, subUl);currentLi.append(subUl);}}}} catch (error) {console.error('Error in blur event of edit input:', error);}});} catch (error) {console.error('Error in modify button click:', error);}});deleteButton.click(function () {try {var chapterId = li.data('chapter-id');var chapter = findChapterById(chapterId, initialData);if (chapter) {deleteChapter(chapter);}} catch (error) {console.error('Error in delete button click:', error);}});moveUpButton.click(function () {try {moveChapterUp(li);} catch (error) {console.error('Error in move up button click:', error);}});moveDownButton.click(function () {try {moveChapterDown(li);} catch (error) {console.error('Error in move down button click:', error);}});addSubChapterButton.click(function () {try {var chapterId = li.data('chapter-id');var chapter = findChapterById(chapterId, initialData);if (chapter) {addSubChapter(chapter);}} catch (error) {console.error('Error in add sub-chapter button click:', error);}});li.append(expandButton, chapterNameSpan, addButton, modifyButton, deleteButton, moveUpButton, moveDownButton, addSubChapterButton);if (child.children && child.children.length > 0) {var subUl = $("<ul>");renderChildren(child.children, subUl);li.append(subUl);}parentUl.append(li);});}renderChildren(data, ul);$("#chapter-tree-container").append(ul);}// 添加章节function addChapter(clickedLi) {try {var newChapter = { id: Date.now(), name: "默认章节", children: [] };var parentUl = clickedLi.parent('ul');var parentChapter;if (parentUl.length) {var parentLi = parentUl.parent('li');if (parentLi.length) {parentChapter = getChapterFromLi(parentLi);} else {// 顶级 ul 的情况parentChapter = { children: initialData };}} else {// 顶级 li 的情况parentChapter = { children: initialData };}if (!parentChapter.children) {parentChapter.children = [];}parentChapter.children.push(newChapter);renderTree(initialData);} catch (error) {console.error('Error in addChapter function:', error);}}// 添加子章节function addSubChapter(parentNode) {try {var newChapter = { id: Date.now(), name: "默认子章节", children: [] };if (!parentNode.children) {parentNode.children = [];}parentNode.children.push(newChapter);renderTree(initialData);} catch (error) {console.error('Error in addSubChapter function:', error);}}// 删除章节function deleteChapter(node) {try {if (node.parent) {var index = node.parent.children.indexOf(node);if (index >-1) {node.parent.children.splice(index, 1);}} else {var index = initialData.indexOf(node);if (index >-1) {initialData.splice(index, 1);}}renderTree(initialData);} catch (error) {console.error('Error in deleteChapter function:', error);}}// 章节上移function moveChapterUp(li) {try {var prevLi = li.prev("li");if (prevLi.length) {var prevIndex = li.parent().children().index(prevLi);var currentIndex = li.parent().children().index(li);var parent = getParentOfLi(li);if (parent && Array.isArray(parent.children)) {var chapter = getChapterFromLi(li);if (chapter) {parent.children.splice(currentIndex, 1);parent.children.splice(prevIndex, 0, chapter);}} else if (!parent && Array.isArray(initialData)) {var chapter = getChapterFromLi(li);if (chapter) {initialData.splice(currentIndex, 1);initialData.splice(prevIndex, 0, chapter);}}li.insertBefore(prevLi);}} catch (error) {console.error('Error in moveChapterUp function:', error);}}// 章节下移function moveChapterDown(li) {try {var nextLi = li.next("li");if (nextLi.length) {var nextIndex = li.parent().children().index(nextLi);var currentIndex = li.parent().children().index(li);var parent = getParentOfLi(li);if (parent && Array.isArray(parent.children)) {var chapter = getChapterFromLi(li);if (chapter) {parent.children.splice(currentIndex, 1);parent.children.splice(nextIndex + 1, 0, chapter);}} else if (!parent && Array.isArray(initialData)) {var chapter = getChapterFromLi(li);if (chapter) {initialData.splice(currentIndex, 1);initialData.splice(nextIndex + 1, 0, chapter);}}li.insertAfter(nextLi);}} catch (error) {console.error('Error in moveChapterDown function:', error);}}function getParentOfLi(li) {try {var parentLi = li.parent('li');if (parentLi.length) {var parentChapterId = parentLi.data('chapter-id');return findChapterById(parentChapterId, initialData);}return null;} catch (error) {console.error('Error in getParentOfLi function:', error);}}function getChapterFromLi(li) {try {var chapterId = li.data('chapter-id');return findChapterById(chapterId, initialData);} catch (error) {console.error('Error in getChapterFromLi function:', error);}}function findChapterById(id, data) {try {for (var i = 0; i < data.length; i++) {if (data[i].id === id) {return data[i];}if (data[i].children && data[i].children.length > 0) {var found = findChapterById(id, data[i].children);if (found) {return found;}}}return null;} catch (error) {console.error('Error in findChapterById function:', error);}}// 初始化渲染$(document).ready(function () {renderTree(initialData);});</script>
</body></html>
上一版本有问题,下面是最新版本的。
<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale = 1.0"><title>Chapter Tree</title><style>/* 整体树容器样式 */#chapter-tree-container {padding-left: 20px;}/* 章节li样式 */li {position: relative;padding-left: 20px;margin: 5px 0;line-height: 24px;}/* 利用伪元素创建线条 */li::before {content: '';position: absolute;left: 0;top: 12px;width: 10px;border-top: 1px solid #ccc;}/* 顶级li去除顶部线条 */#chapter-tree-container ul li:first-child::before {border-top: none;}/* 有子章节的li添加垂直线条 */li:has(ul)::before {height: 100%;border-left: 1px solid #ccc;}/* 子章节ul样式 */ul {list-style-type: none;padding-left: 10px;}/* 美化 input */input.edit-input {width: 150px;padding: 8px;border: 1px solid #ccc;border-radius: 4px;font-size: 14px;color: #555;outline: none;}input.edit-input::placeholder {color: #999;}/* 美化操作按钮 */button {padding: 6px 12px;background-color: #007BFF;color: white;border: none;border-radius: 4px;font-size: 14px;cursor: pointer;transition: background-color 0.3s ease;}button:hover {background-color: #0056b3;}button.add-button {background-color: #28a745;}button.add-button:hover {background-color: #218838;}button.modify-button {background-color: #ffc107;}button.modify-button:hover {background-color: #e0a800;}button.delete-button {background-color: #dc3545;}button.delete-button:hover {background-color: #c82333;}/* 折叠按钮样式 */button[text="+"],button[text="-"] {width: 24px;height: 24px;border-radius: 50%;padding: 0;font-size: 14px;line-height: 24px;text-align: center;}</style>
</head><body><div id="chapter-tree-container"></div><script src="https://code.jquery.com/jquery-3.6.0.min.js"></script><script>// 初始数据结构,为每个章节添加唯一 idvar initialData = [{id: 1,name: "第一单元 成长的节拍",children: [{id: 2,name: "第一课 中学时代",children: [{ id: 3, name: "中学序曲" },{ id: 4, name: "珍惜青春" },{ id: 5, name: "步入中学生活" }]},{id: 6,name: "少年有梦",children: [{ id: 7, name: "梦想的含义" },{ id: 8, name: "努力的意义" },{ id: 9, name: "实现理想的途径" },{ id: 10, name: "正确对待理想与现实" }]}]}];// 记录展开状态的对象var expandedStates = {};// 渲染树形章节结构function renderTree(data) {// 清空旧的渲染内容$('#chapter-tree-container').empty();var ul = $("<ul>");function renderChildren(children, parentUl) {if (!children) return;children.forEach(function (child) {let li;li = $("<li>").data('chapter-id', child.id);var expandButton = $("<button>").text(expandedStates[child.id]? "-" : "+");expandButton.click(function () {try {var subUl = li.find("ul");if (subUl.length) {subUl.toggle();expandButton.text(subUl.is(":visible")? "-" : "+");expandedStates[child.id] = subUl.is(":visible");} else {var newSubUl = $("<ul>").hide();renderChildren(child.children, newSubUl);li.append(newSubUl);newSubUl.show();expandButton.text("-");expandedStates[child.id] = true;}} catch (error) {console.error('Error in expand button click:', error);}});var chapterNameSpan = $("<span>").text(child.name).addClass('chapter-name-span');// 添加增删改按钮var addButton = $("<button>").text("添加").addClass('add-button');var modifyButton = $("<button>").text("修改").addClass('modify-button');var deleteButton = $("<button>").text("删除").addClass('delete-button');var moveUpButton = $("<button>").text("上移");var moveDownButton = $("<button>").text("下移");var addSubChapterButton = $("<button>").text("添加子章节");addButton.click(function () {try {addChapter(li);} catch (error) {console.error('Error in add button click:', error);}});modifyButton.click(function () {try {var currentLi = $(this).closest('li');var chapterId = currentLi.data('chapter-id');var chapter = findChapterById(chapterId, initialData);if (!chapter) {console.error('Chapter not found for modification.');return;}var chapterNameSpan = currentLi.find('.chapter-name-span:eq(0)');var input = $("<input>").val(chapter.name).addClass('edit-input').focus();chapterNameSpan.replaceWith(input);input.on('blur', function () {try {var newName = $(this).val();var currentLi = $(this).closest('li');var chapter = getChapterFromLi(currentLi);if (chapter) {chapter.name = newName;var newChapterNameSpan = $("<span>").text(newName).addClass('chapter-name-span');$(this).replaceWith(newChapterNameSpan);if (chapter.children && chapter.children.length > 0) {var subUl = currentLi.find('ul');if (!subUl.length) {subUl = $("<ul>");renderChildren(chapter.children, subUl);currentLi.append(subUl);}}}} catch (error) {console.error('Error in blur event of edit input:', error);}});} catch (error) {console.error('Error in modify button click:', error);}});deleteButton.click(function () {try {var chapterId = li.data('chapter-id');var chapter = findChapterById(chapterId, initialData);if (chapter && (!chapter.children || (chapter.children && chapter.children.length === 0))) {deleteChapter(chapter);}} catch (error) {console.error('Error in delete button click:', error);}});moveUpButton.click(function () {try {moveChapterUp(li);} catch (error) {console.error('Error in move up button click:', error);}});moveDownButton.click(function () {try {moveChapterDown(li);} catch (error) {console.error('Error in move down button click:', error);}});addSubChapterButton.click(function () {try {var chapterId = li.data('chapter-id');var chapter = findChapterById(chapterId, initialData);if (chapter) {addSubChapter(chapter);}} catch (error) {console.error('Error in add sub - chapter button click:', error);}});li.append(expandButton, chapterNameSpan, addButton, modifyButton, deleteButton, moveUpButton, moveDownButton, addSubChapterButton);if (child.children && child.children.length > 0) {var subUl = $("<ul>");renderChildren(child.children, subUl);li.append(subUl);if (expandedStates[child.id]) {subUl.show();expandButton.text("-");} else {subUl.hide();expandButton.text("+");}}parentUl.append(li);});}renderChildren(data, ul);$("#chapter-tree-container").append(ul);}// 添加章节function addChapter(clickedLi) {try {var newChapter = { id: Date.now(), name: "默认章节", children: [] };var parentUl = clickedLi.parent('ul');var parentChapter;if (parentUl.length) {var parentLi = parentUl.parent('li');if (parentLi.length) {parentChapter = getChapterFromLi(parentLi);} else {// 顶级 ul 的情况parentChapter = { children: initialData };}} else {// 顶级 li 的情况parentChapter = { children: initialData };}if (!parentChapter.children) {parentChapter.children = [];}parentChapter.children.push(newChapter);renderTree(initialData);} catch (error) {console.error('Error in addChapter function:', error);}}// 添加子章节function addSubChapter(parentNode) {try {var newChapter = { id: Date.now(), name: "默认子章节", children: [] };if (!parentNode.children) {parentNode.children = [];}parentNode.children.push(newChapter);renderTree(initialData);} catch (error) {console.error('Error in addSubChapter function:', error);}}// 删除章节function deleteChapter(node) {try {let parent;let parentArray;if (node.id === initialData[0].id) {initialData = [];} else {const findParent = (data) => {for (let i = 0; i < data.length; i++) {if (data[i].children) {for (let j = 0; j < data[i].children.length; j++) {if (data[i].children[j].id === node.id) {return { parent: data[i], index: j };}}const result = findParent(data[i].children);if (result) {return result;}}}return null;};const parentInfo = findParent(initialData);if (parentInfo) {parent = parentInfo.parent;parentArray = parent.children;parentArray.splice(parentInfo.index, 1);}}renderTree(initialData);} catch (error) {console.error('Error in deleteChapter function:', error);}}// 章节上移function moveChapterUp(li) {try {var chapter = getChapterFromLi(li);if (!chapter) {return;}var parentArray = findContainingArray(chapter, initialData);if (!parentArray) {return;}var currentIndex = parentArray.indexOf(chapter);if (currentIndex > 0) {var temp = parentArray[currentIndex - 1];parentArray[currentIndex - 1] = chapter;parentArray[currentIndex] = temp;renderTree(initialData);}} catch (error) {console.error('Error in moveChapterUp function:', error);}}// 章节下移function moveChapterDown(li) {try {var chapter = getChapterFromLi(li);if (!chapter) {return;}var parentArray = findContainingArray(chapter, initialData);if (!parentArray) {return;}var currentIndex = parentArray.indexOf(chapter);if (currentIndex < parentArray.length - 1) {var temp = parentArray[currentIndex + 1];parentArray[currentIndex + 1] = chapter;parentArray[currentIndex] = temp;renderTree(initialData);}} catch (error) {console.error('Error in moveChapterDown function:', error);}}function findContainingArray(target, data) {for (let i = 0; i < data.length; i++) {if (data[i].id === target.id) {return data;}if (data[i].children) {const subArray = findContainingArray(target, data[i].children);if (subArray) {return subArray;}}}return null;}function getChapterFromLi(li) {const chapterId = li.data('chapter-id');return findChapterById(chapterId, initialData);}function findChapterById(id, data) {for (let i = 0; i < data.length; i++) {if (data[i].id === id) {return data[i];}if (data[i].children) {const found = findChapterById(id, data[i].children);if (found) {return found;}}}return null;}// 初始化渲染$(document).ready(function () {renderTree(initialData);});</script>
</body></html>
再次实现,两个tree 左右对比,左边的章节,选中关联的在右边tree2 默认出来

增加搜索按钮,动态折叠展示搜索的内容

学习Ai 大模型 第一步学会使用这些工具助手
相关文章:
豆包ai 生成动态tree 增、删、改以及上移下移 html+jquery
[豆包ai 生成动态tree 增、删、改以及上移下移 htmljquery) 人工Ai 编程 推荐一Kimi https://kimi.moonshot.cn/ 推荐二 豆包https://www.doubao.com/ 实现效果图 html 代码 <!DOCTYPE html> <html lang"en"><head><meta charset"UTF…...
【网络协议】IPv4 地址分配 - 第二部分
前言 在第 1 部分中,我们学习了 IPv4 地址的分配方式,了解了各种类型的 IPv4 地址,并进行了基础的子网划分(Subnetting)。在第 2 部分中,我们将继续学习子网划分,并引入一些新的概念。 【网络…...
攻防世界 bug
发现有Register界面,先去注册 登录以后发现以下界面,点击Manage显示you are not admin,并且在注册界面用admin为注册名时显示用户名已存在。初步推测是设法改变admin的密码取得权限。 在主界面一通操作并没有什么发现,去findpw…...
Flink如何设置合理的并行度
一个Flink程序由多个Operator组成(source、transformation和 sink)。 一个Operator由多个并行的Task(线程)来执行, 一个Operator的并行Task(线程)数目就被称为该Operator(任务)的并行度(Parallel)。即并行度就是相对于Operator来说的。 合理设置并行度可以有效提高Flink作业…...
小兔鲜儿:生鲜区域,最新专题
生鲜区域: 生鲜区域标题部分: 生鲜区域内容部分: 分左右两个部分 右边区域是8个 li 标签区域,li中嵌套 a ,上部分是图片,下部分是内容;与 a 并列的是cover,定位在 li 之外,设置是溢出隐藏&…...
TypeScript语言的网络编程
基于 TypeScript 的网络编程探索 随着互联网技术的发展,网络编程已成为软件开发中不可或缺的一部分。尤其是在构建现代 Web 应用程序时,网络编程的各个方面,包括 HTTP 请求、WebSocket、API 交互等,都扮演着至关重要的角色。Type…...
复合机器人助力手机壳cnc加工向自动化升级
在当今竞争激烈的制造业领域,如何提高生产效率、降低成本、提升产品质量,成为众多企业面临的关键挑战。尤其是在手机壳 CNC 加工这一细分行业,随着市场需求的持续增长,对生产效能的要求愈发严苛。而复合机器人的出现,正…...
在 C# 中显示动画 GIF 并在运行时更改它们
您可以通过将按钮、图片框、标签或其他控件的Image属性设置为 GIF 文件 来显示动画 GIF 。(如果您在窗体的BackgroundImage属性中显示一个,则不会获得动画。) 有几种方法可以在运行时更改 GIF。 首先,您可以将 GIF 添加为资源。…...
个人博客搭建(二)—Typora+PicGo+OSS
个人博客站—运维鹿: http://www.kervin24.top CSDN博客—做个超努力的小奚: 做个超努力的小奚-CSDN博客 一、前言 博客搭建完一直没有更新,因为WordPress自带的文档编辑器不方便,以前用CSDN写作的时候,习惯了Typora。最近对比了…...
Cloudflare IP 优选工具:轻松找到最快的 CDN 节点
Cloudflare IP 优选工具:轻松找到最快的 CDN 节点 在线体验地址:https://cf-ip.cdtools.click 功能介绍 Cloudflare IP 优选工具是一个专门用于测试和筛选 Cloudflare CDN 节点的在线服务。它能够帮助用户找到最适合自己的 Cloudflare IP 地址ÿ…...
HTB:Ransom[WriteUP]
目录 连接至HTB服务器并启动靶机 信息收集 使用rustscan对靶机TCP端口进行开放扫描 使用nmap对靶机TCP开放端口进行脚本、服务扫描 使用nmap对靶机TCP开放端口进行漏洞、系统扫描 使用nmap对靶机常用UDP端口进行开放扫描 使用ffuf对靶机80端口进行路径FUZZ 访问/regist…...
Eclipse配置Tomcat服务器(最全图文详解)
前言: 本章使用图文讲解如何在Eclipse开发工具中配置Tomcat服务器、如何创建和启动JavaWeb工程,欢迎童鞋们互相交流。觉得不错可以三连订阅喔。 目标: 一、配置Tomcat服务器 1. 切换Eclipse视图 2. 打开菜单 3. 找到服务选项 4. 选择…...
STM32烧写失败之Contents mismatch at: 0800005CH (Flash=FFH Required=29H) !
一)问题:用ULINK2给STM32F103C8T6下载程序,下载方式设置如下: 出现下面两个问题: 1)下载问题界面如下: 这个错误的信息大概可以理解为,在0x08000063地址上读取到flash存储为FF&am…...
用户界面的UML建模10
非正常的可视反馈可伴随着同步事件发生,而同步事件可由系统动作产生。但是,可以分别对它们进行建模。 在下节中将对这些特殊的事件依次进行论述。 6.1 异常处理建模 异常,由Meyer 定义[16],其作为运行时事件(run-time events&a…...
电影动画shader解析与实现
着色器代码解析 大家好!我是 [数擎AI],一位热爱探索新技术的前端开发者,在这里分享前端和Web3D、AI技术的干货与实战经验。如果你对技术有热情,欢迎关注我的文章,我们一起成长、进步! 开发领域:…...
蓝桥杯 第十五届 研究生组 B题 召唤数学精灵
问题描述: 数学家们发现了两种用于召唤强大的数学精灵的仪式,这两种仪式分别被称为累加法仪式 A(n) 和累乘法仪式 B(n)。累加法仪式 A(n) 是将从 1 到 n 的所有数字进行累加求和,即:A(n)12⋯n累乘法仪式 B(n) 则是将从 1 到 n 的所…...
在 Go 应用中 如何像 FastAPI 一样优雅地构建控制器
文章精选推荐 1 JetBrains Ai assistant 编程工具让你的工作效率翻倍 2 Extra Icons:JetBrains IDE的图标增强神器 3 IDEA插件推荐-SequenceDiagram,自动生成时序图 4 BashSupport Pro 这个ides插件主要是用来干嘛的 ? 5 IDEA必装的插件&…...
用户界面的UML建模11
然而,在用户界面方面,重要的是要了解《boundary》类是如何与这个异常分层结构进行关联的。 《exception》类的对象可以作为《control》类的对象。因此,《exception》类能够聚合《boundary》类。 参见图12,《exception》Database…...
历代iPhone运行内存大小和电池容量信息
系列设备名称充电端口标配充电线PD快充无线充电 (W)标配充电器电池容量 (mAh)发布时间RAM运存iPhone 16iPhone 16 Pro MaxUSB Type-CUSB-C to USB-C支持25无47472024/9/108GB LPDDR5XiPhone 16 ProUSB Type-CUSB-C to USB-C支持25无35772024/9/108GB LPDDR5XiPhone 16 PlusUSB …...
计算机网络之---物理层设备
什么是物理层设备 物理层设备是指负责数据在物理媒介上传输的硬件设备,它们主要处理数据的转换、信号的传输与接收,而不涉及数据的内容或意义。常见的物理层设备包括网卡、集线器、光纤收发器、调制解调器等。 物理层设备有哪些 1、网卡(N…...
微信小程序之bind和catch
这两个呢,都是绑定事件用的,具体使用有些小区别。 官方文档: 事件冒泡处理不同 bind:绑定的事件会向上冒泡,即触发当前组件的事件后,还会继续触发父组件的相同事件。例如,有一个子视图绑定了b…...
【第二十一章 SDIO接口(SDIO)】
第二十一章 SDIO接口 目录 第二十一章 SDIO接口(SDIO) 1 SDIO 主要功能 2 SDIO 总线拓扑 3 SDIO 功能描述 3.1 SDIO 适配器 3.2 SDIOAHB 接口 4 卡功能描述 4.1 卡识别模式 4.2 卡复位 4.3 操作电压范围确认 4.4 卡识别过程 4.5 写数据块 4.6 读数据块 4.7 数据流…...
JVM垃圾回收机制全解析
Java虚拟机(JVM)中的垃圾收集器(Garbage Collector,简称GC)是用于自动管理内存的机制。它负责识别和清除不再被程序使用的对象,从而释放内存空间,避免内存泄漏和内存溢出等问题。垃圾收集器在Ja…...
渲染学进阶内容——模型
最近在写模组的时候发现渲染器里面离不开模型的定义,在渲染的第二篇文章中简单的讲解了一下关于模型部分的内容,其实不管是方块还是方块实体,都离不开模型的内容 🧱 一、CubeListBuilder 功能解析 CubeListBuilder 是 Minecraft Java 版模型系统的核心构建器,用于动态创…...
pikachu靶场通关笔记22-1 SQL注入05-1-insert注入(报错法)
目录 一、SQL注入 二、insert注入 三、报错型注入 四、updatexml函数 五、源码审计 六、insert渗透实战 1、渗透准备 2、获取数据库名database 3、获取表名table 4、获取列名column 5、获取字段 本系列为通过《pikachu靶场通关笔记》的SQL注入关卡(共10关࿰…...
【Nginx】使用 Nginx+Lua 实现基于 IP 的访问频率限制
使用 NginxLua 实现基于 IP 的访问频率限制 在高并发场景下,限制某个 IP 的访问频率是非常重要的,可以有效防止恶意攻击或错误配置导致的服务宕机。以下是一个详细的实现方案,使用 Nginx 和 Lua 脚本结合 Redis 来实现基于 IP 的访问频率限制…...
归并排序:分治思想的高效排序
目录 基本原理 流程图解 实现方法 递归实现 非递归实现 演示过程 时间复杂度 基本原理 归并排序(Merge Sort)是一种基于分治思想的排序算法,由约翰冯诺伊曼在1945年提出。其核心思想包括: 分割(Divide):将待排序数组递归地分成两个子…...
跨平台商品数据接口的标准化与规范化发展路径:淘宝京东拼多多的最新实践
在电商行业蓬勃发展的当下,多平台运营已成为众多商家的必然选择。然而,不同电商平台在商品数据接口方面存在差异,导致商家在跨平台运营时面临诸多挑战,如数据对接困难、运营效率低下、用户体验不一致等。跨平台商品数据接口的标准…...
DAY 45 超大力王爱学Python
来自超大力王的友情提示:在用tensordoard的时候一定一定要用绝对位置,例如:tensorboard --logdir"D:\代码\archive (1)\runs\cifar10_mlp_experiment_2" 不然读取不了数据 知识点回顾: tensorboard的发展历史和原理tens…...
数据分析六部曲?
引言 上一章我们说到了数据分析六部曲,何谓六部曲呢? 其实啊,数据分析没那么难,只要掌握了下面这六个步骤,也就是数据分析六部曲,就算你是个啥都不懂的小白,也能慢慢上手做数据分析啦。 第一…...
