Pycharm+Neo4j红楼梦人物关系图谱

news2024/11/20 6:23:44

欢迎来到我的主页~【蜡笔小新..】

本篇收录于专栏【Python】

如果对你有帮助,希望点赞收藏加关注啦~

目录

前言

neo4j基础知识

Pycharm及代码实现

 py2neo

 数据集获取

代码介绍


前言

Python实验课时,老师提到用知识图谱构建红楼梦的人物关系图,所以课后根据视频和博客的学习,初尝试用neo4j进行构建,也在学习如何用Python直接进行手撕关系图并可视化,但是目前效果不佳,后续构建好继续分享在专栏。

neo4j基础知识

neo4j.com进行数据库下载安装

使用命令行输入

neo4j.bat console

 找到localhost:7474,复制到浏览器进行登录,初始用户名和密码均为neo4j

其实在最顶端的窗口可以直接进行图谱的搭建,但由于本文是实现 Python进行构建,所以不在此进行赘述。

Pycharm及代码实现

 py2neo

neo4j提供python接口,可以使用py2neo库通过python操作neo4j数据库,py2neo安装较为简单,仅需要使用pip install方式进行安装。使用如下命令:

pip install py2neo

 安装完后进行测试:

from py2neo import Graph, Node, Relationship

def connect_database(username, password, dbname):
    graph_db = Graph("http://localhost:7474", name=dbname, auth=(username, password))
    return graph_db
    
if __name__ == '__main__':
    graph = connect_database("neo4j", "password", "neo4j")

 数据集获取

 将以下内容复制到txt文件中,再改为csv文件

 

"head","tail","relation","label"
"贾代善","贾源","son","子"
"娄氏","贾源","daughter_in_law_of_grandson","重孙媳妇"
"贾母","贾代善","wife","妻"
"老姨奶奶","贾代善","concubine","妾"
"贾敏","贾代善","daughter","女"
"嫣红","贾赦","concubine","妾"
"翠云","贾赦","concubine","妾"
"娇红","贾赦","concubine","妾"
"贾迎春","贾赦","daughter","女"
"赵姨娘","贾政","concubine","妾"
"周姨娘","贾政","concubine","妾"
"贾珠","贾政","son","子"
"尤二姐","贾琏","concubine","妾"
"秋桐","贾琏","concubine","妾"
"平儿","贾琏","concubine","妾"
"薛宝衩","贾宝玉","wife","妻"
"花袭人","贾宝玉","concubine","妾"
"贾桂","贾宝玉","son","子"
"贾菌","娄氏","son","子"
"周秀才","贾巧姐","brother_in_law","姐夫"
"周财主","周秀才","father","父亲"
"周妈妈","周秀才","mother","母亲"
"孙亲太太","孙绍祖","mother","母亲"
"刑大舅二姐","邢夫人","younger_sister","妹"
"邢德全","邢夫人","younger_brother","弟"
"张大老爷","邢夫人","old_relatives","老亲"
"邢忠","邢夫人","elder_brother","兄"
"张大老爷之女","张大老爷","daughter","女"
"刑秞烟","邢忠","daughter","女"
"李婶","李守中","sister_in_law","弟媳"
"李婶之弟","李婶","younger_brother","弟"
"李纹","李婶","daughter","女"
"甄宝玉","李绮","husband","夫"
"甄应嘉","甄宝玉祖母","son","子"
"甄夫人","甄应嘉","wife","妻"
"大姑娘","甄应嘉","daughter","女"
"二姑娘","甄应嘉","daughter","女"
"三姑娘","甄应嘉","daughter","女"
"袭人之母","袭人","mother","母亲"
"花自芳","袭人","elder_brother","兄"
"周琼之子","贾探春","husband","夫"
"林如海之父","林如海","father","父亲"
"林如海之祖","林如海","grandfather","祖父"
"林如海之子","林如海","son","子"
"李妈","贾巧姐","nurser","乳母"
"昭儿","贾琏","servant","奴仆"
"兴儿","贾琏","servant","奴仆"
"隆儿","贾琏","servant","奴仆"
"庆儿","贾琏","servant","奴仆"
"赵嬷嬷","贾琏","nurser","乳母"
"赵天梁","赵嬷嬷","son","子"
"赵天栋","赵嬷嬷","son","子"
"王信","贾琏","servant","奴仆"
"王信媳妇","贾琏","servant","奴仆"
"鲍二","贾琏","servant","奴仆"
"善姐","尤二姐","servant_girl","丫鬟"
"迎春乳母","贾迎春","nurser","乳母"
"王住儿媳妇","迎春乳母","daughter_in_law","子媳"
"绣桔","贾迎春","servant_girl","丫鬟"
"莲花儿","贾迎春","servant_girl","丫鬟"
"秦思祺","贾迎春","servant_girl","丫鬟"
"潘又安","秦思祺","boy_friend","男友"
"贾琮奶妈","贾琮","nurser","乳母"
"篆儿","刑秞烟","servant_girl","丫鬟"
"新进来的奶子","贾兰","nurser","奶妈"
"素云","李纨","servant_girl","丫鬟"
"碧月","李纨","servant_girl","丫鬟"
"抱琴","贾元春","servant_girl","丫鬟"
"李嬷嬷","贾宝玉","nurser","乳母"
"赵嬷嬷","贾宝玉","nurser","乳母"
"张嬷嬷","贾宝玉","nurser","乳母"
"宋嬷嬷","贾宝玉","servant","奴仆"
"叶茗烟","贾宝玉","servant","奴仆"
"锄药","贾宝玉","servant","奴仆"
"扫红","贾宝玉","servant","奴仆"
"墨雨","贾宝玉","servant","奴仆"
"引泉","贾宝玉","servant","奴仆"
"扫花","贾宝玉","servant","奴仆"
"挑云","贾宝玉","servant","奴仆"
"伴鹤","贾宝玉","servant","奴仆"
"双瑞","贾宝玉","servant","奴仆"
"双寿","贾宝玉","servant","奴仆"
"老叶妈","叶茗烟","mother","母亲"
"李贵","李嬷嬷","son","子"
"李嬷嬷孙子","贾宝玉","servant","奴仆"
"王荣","贾宝玉","servant","奴仆"
"张若锦","贾宝玉","servant","奴仆"
"赵亦华","贾宝玉","servant","奴仆"
"周瑞","王夫人","servant","奴仆"
"周瑞女儿","周瑞","daughter","女"
"冷子兴","周瑞","son_in_law","女婿"
"周嫂子的儿子","周瑞","son","子"
"何三","周瑞","adopted_son","干儿子"
"白金钏","王夫人","servant_girl","丫鬟"
"白玉钏","王夫人","servant_girl","丫鬟"
"彩云","王夫人","servant_girl","丫鬟"
"彩鸾","王夫人","servant_girl","丫鬟"
"绣鸾","王夫人","servant_girl","丫鬟"
"绣凤","王夫人","servant_girl","丫鬟"
"白老媳妇","白金钏","mother","母亲"
"白老媳妇","白玉钏","mother","母亲"
"彩霞之母","彩霞","mother","母亲"
"小霞","彩霞","younger_sister","妹"
"小鹊","赵姨娘","servant_girl","丫鬟"
"小吉祥","赵姨娘","servant_girl","丫鬟"
"赵国基","赵姨娘","elder_brother","兄"
"钱槐","赵姨娘","elder_male_cousin","表兄"
"钱槐","贾环","servant","奴仆"
"雪雁","林黛玉","servant_girl","丫鬟"
"王嬷嬷","林黛玉","nurser","乳母"
"紫鹊","林黛玉","servant_girl","丫鬟"
"春纤","林黛玉","servant_girl","丫鬟"
"藕官","林黛玉","servant_girl","丫鬟"
"赖嬷嬷","赖大","mother","母亲"
"赖尚荣","赖大","son","子"
"赖大的女儿","赖大","daughter","女"
"来旺儿","王熙凤","servant","奴仆"
"旺儿媳妇","王熙凤","servant_girl","丫鬟"
"来喜家的","王熙凤","servant","奴仆"
"丰儿","王熙凤","servant_girl","丫鬟"
"彩明","王熙凤","servant_girl","丫鬟"
"林红玉","王熙凤","servant_girl","丫鬟"
"林之孝","林红玉","father","父亲"
"王善保","邢夫人","servant","奴仆"
"费婆子","邢夫人","servant_girl","丫鬟"
"金鸳鸯","贾母","servant_girl","丫鬟"
"琥珀","贾母","servant_girl","丫鬟"
"鹦鹉","贾母","servant_girl","丫鬟"
"珍珠","贾母","servant_girl","丫鬟"
"翡翠","贾母","servant_girl","丫鬟"
"玻璃","贾母","servant_girl","丫鬟"
"文官","贾母","servant_girl","丫鬟"
"傻大姐的娘","傻大姐","mother","母亲"
"金彩","鸳鸯","father","父亲"
"金文翔","鸳鸯","elder_brother","兄"
"多官","晴雯","elder_male_cousin","表哥"
"多浑虫父亲","晴雯","mothers_brother","舅"
"多姑娘儿","多官","wife","妻"
"吴贵","晴雯","elder_male_cousin","表兄"
"花芳官","贾宝玉","servant_girl","丫鬟"
"媚人","贾宝玉","servant_girl","丫鬟"
"麝月","贾宝玉","servant_girl","丫鬟"
"茜雪","贾宝玉","servant_girl","丫鬟"
"秋纹","贾宝玉","servant_girl","丫鬟"
"绮霞","贾宝玉","servant_girl","丫鬟"
"碧痕","贾宝玉","servant_girl","丫鬟"
"檀云","贾宝玉","servant_girl","丫鬟"
"四儿","贾宝玉","servant_girl","丫鬟"
"佳蕙","贾宝玉","servant_girl","丫鬟"
"坠儿","贾宝玉","servant_girl","丫鬟"
"紫绡","贾宝玉","servant_girl","丫鬟"
"良儿","贾宝玉","servant_girl","丫鬟"
"何春燕","贾宝玉","servant_girl","丫鬟"
"厨房中的柳家媳妇","柳五儿","mother","母亲"
"柳二媳妇的妹子","柳五儿","younger_sister","妹"
"哥嫂侄儿","柳五儿","nephew","侄"
"侍书","贾探春","servant_girl","丫鬟"
"翠墨","贾探春","servant_girl","丫鬟"
"艾官","贾探春","servant_girl","丫鬟"
"小蝉","贾探春","servant_girl","丫鬟"
"何婆","何春燕","mother","母亲"
"何婆","芳官","adopted_mother","干娘"
"小鸠儿","何春燕","younger_sister","妹"
"夏婆子","何春燕","maternal_aunt","姨妈"
"夏婆子","藕官","adopted_mother","干娘"
"夏婆子","小蝉","grandmother","外祖母"
"蒋玉菡","贾宝玉","friend","朋友"
"通判傅试","贾政","pupil","门生"
"傅秋芳","傅试","younger_sister","妹"
"太祖皇帝","先皇","father","父亲"
"太上皇","先皇","son","子"
"皇太后","太上皇","wife","妻"
"太妃","太上皇","kings_concubine","嫔妃"
"皇帝","太上皇","son","子"
"贾元春","皇帝","imperial_concubine","妃"
"吴贵妃","皇帝","imperial_concubine","妃"
"周贵人","皇帝","imperial_concubine","妃"
"周贵人父亲","周贵人","father","父亲"
"吴天佑","吴贵妃","father","父亲"
"戴权","皇帝","minister","臣"
"夏守忠","皇帝","minister","臣"
"贾代化","贾演","son","子"
"焦大","贾演","servant","奴仆"
"贾敷","贾代化","son","子"
"贾敬","贾代化","son","子"
"贾惜春","贾敬","daughter","女"
"史湘云爷爷","史侯","son","子"
"史鼐","史湘云爷爷","son","子"
"史鼎","史湘云爷爷","son","子"
"湘云母","史湘云爷爷","daughter_in_law","儿媳"
"史鼎的夫人","史鼎","wife","妻"
"史湘云","湘云母","daughter","女"
"卫若兰","史湘云","husband","夫"
"翠缕","史湘云","servant_girl","丫鬟"
"葵官","史湘云","servant_girl","丫鬟"
"周奶妈","史湘云","nurser","乳母"
"凤姐之祖王夫人之父","王公","son","子"
"王夫人之大兄凤姐之父","凤姐之祖王夫人之父","son","子"
"王子腾","凤姐之祖王夫人之父","son","子"
"王子胜","凤姐之祖王夫人之父","son","子"
"王夫人","凤姐之祖王夫人之父","daughter","女"
"薛姨妈","凤姐之祖王夫人之父","daughter","女"
"王成父","凤姐之祖王夫人之父","nephew","侄"
"老舅太太","王夫人之大兄凤姐之父","wife","妻"
"王仁","王夫人之大兄凤姐之父","son","子"
"王熙凤","王夫人之大兄凤姐之父","daughter","女"
"王子腾夫人","王子腾","wife","妻"
"王子腾之女","王子腾","daughter","女"
"保宁侯之子","王子腾之女","husband","夫"
"王成","王成父","son","子"
"王狗儿","王成","son","子"
"刘氏","王狗儿","wife","妻"
"王青儿","王狗儿","daughter","女"
"王板儿","王狗儿","son","子"
"刘姥姥","刘氏","mother","母亲"
"宝钗祖父","薛公","son","子"
"薛公之孙","宝钗祖父","son","子"
"薛宝琴父","宝钗祖父","son","子"
"薛姨妈","薛公之孙","wife","妻"
"薛宝钗","薛公之孙","daughter","女"
"薛蟠","薛公之孙","son","子"
"同喜","薛姨妈","servant_girl","丫鬟"
"同贵","薛姨妈","servant_girl","丫鬟"
"莺儿","薛宝钗","servant_girl","丫鬟"
"文杏","薛宝钗","servant_girl","丫鬟"
"喜儿","薛宝钗","servant_girl","丫鬟"
"蕊官","薛宝钗","servant_girl","丫鬟"
"夏金桂","薛蟠","wife","妻"
"老苍头","薛蟠","meme_ama","乳父"
"宝蟾","夏金桂","servant_girl","丫鬟"
"小舍儿","夏金桂","servant_girl","丫鬟"
"夏奶奶","夏金桂","mother","母亲"
"夏三","夏奶奶","son","子"
"臻儿","香菱","servant_girl","丫鬟"
"薛宝琴母","薛宝琴父","wife","妻"
"薛蝌","薛宝琴父","son","子"
"薛宝琴","薛宝琴父","daughter","女"
"邢岫烟","薛蝌","wife","妻"
"梅翰林之子","薛宝琴","husband","夫"
"小螺","薛宝琴","servant_girl","丫鬟"
"荳官","薛宝琴","servant_girl","丫鬟"
"梅翰林","梅翰林之子","father","父亲"
"贾瑞之父","贾代儒","son","子"
"贾瑞之母","贾瑞之父","wife","妻"
"贾瑞","贾瑞之父","son","子"
"贾琼","贾琼之母","son","子"
"贾四姐","贾琼之母","daughter","女"
"贾王扁","贾王扁之母","son","子"
"贾喜鸾","贾王扁之母","daughter","女"
"贾芸","五嫂子卜氏","son","子"
"卜世仁","五嫂子卜氏","brother","兄弟"
"小丫头子","贾芸","servant_girl","丫鬟"
"倪儿娘子","倪二","wife","妻"
"倪二女儿","倪二","daughter","女"
"马贩子王短腿","倪二","friend","友人"
"卜世仁娘子","卜世仁","wife","妻"
"卜银姐","卜世仁","daughter","女"
"王奶奶","卜世仁","neighbour","邻居"
"卜世仁店里伙计","卜世仁","partner","伙计"
"贾芹","周氏","son","子"
"金氏","贾璜","wife","妻"
"胡氏","金氏","elder_sister_in_law","嫂"
"金荣","胡氏","son","子"
"娇杏","贾化","wife","妻"
"贾雨村子","贾化","son","子"
"应天府门子","贾化","son","子"
"张如圭","贾化","friend","友人"
"王老爷","贾化","friend","友人"
"天子之妻","应天府门子","wife","妻"
"东安郡王穆莳拜","东平郡王","son","子"
"南安王太妃","南安郡王","wife","妻"
"南安郡王之孙","南安郡王","grandson","孙子"
"西宁郡王之孙","西宁郡王","grandson","孙子"
"西宁郡王妃","西宁郡王","wife","妻"
"北静王太妃","北静郡王","daughter_in_law","儿媳"
"北静王少妃","水溶","wife","妻"
"北静郡王长府官","水溶","minister","臣"
"镇国公诰命","牛清","wife","妻"
"镇国公诰命长男","牛清","son","子"
"牛继宗","牛清","grandson","孙子"
"柳芳","柳彪","grandson","孙子"
"陈瑞文","陈翼","grandson","孙子"
"马尚","马魁","grandson","孙子"
"侯孝康","侯明","grandson","孙子"
"缮国公诰命","缮国公","wife","妻"
"石光珠","缮国公","grandson","孙子"
"蒋子宁","平原侯","grandson","孙子"
"谢鲸","定城侯","grandson","孙子"
"戚建辉","襄阳侯","grandson","孙子"
"裘良","景田侯","grandson","孙子"
"锦乡侯诰命","锦乡侯","wife","妻"
"韩奇","锦乡侯","son","子"
"冯紫英","神武将军冯唐","son","子"
"锦田侯诰命","马道婆","donor","施主"
"蕊官","地藏庵的圆心","pupil","徒弟"
"藕官","圆心","pupil","徒弟"
"智能儿","净虚","pupil","徒弟"
"智善","净虚","pupil","徒弟"
"智通","净虚","pupil","徒弟"
"于老爷","净虚","donor","施主"
"胡老爷","净虚","donor","施主"
"胡老爷太太","净虚","donor","施主"
"胡老爷公子","净虚","donor","施主"
"张大财主","净虚","donor","施主"
"花芳官","智能","pupil","徒弟"
"张金哥","张大财主","daughter","女"
"李公子","张金哥","employer","雇主"
"长安原任守备","李公子","father","父亲"
"李衙内","长安府府太爷","mothers_brother","小舅子"
"贾代化","贾演","son","子"
"焦大","贾演","servant","奴仆"
"贾敷","贾代化","son","子"
"贾敬","贾代化","son","子"
"尤氏","尤老娘","daughter","女"
"贾蔷","贾演","great_great_grandson","玄孙"
"龄官","贾蔷","girl_friend","女友"
"佩凤","贾珍","concubine","妾"
"偕鸾","贾珍","concubine","妾"
"文花","贾珍","concubine","妾"
"茄官","尤氏","servant_girl","丫鬟"
"银蝶","尤氏","servant_girl","丫鬟"
"炒豆儿","尤氏","servant_girl","丫鬟"
"秦可卿","贾蓉","wife","妻"
"胡氏","贾蓉","step_wife","续弦"
"许氏","贾蓉","step_wife","续弦"
"入画","贾惜春","servant_girl","丫鬟"
"彩屏","贾惜春","servant_girl","丫鬟"
"彩儿","贾惜春","servant_girl","丫鬟"
"瑞珠","秦可卿","servant_girl","丫鬟"
"宝珠","秦可卿","servant_girl","丫鬟"
"秦钟","秦业","son","子"
"智能儿","秦钟","girl_friend","女友"
"净虚","智能儿","master","师父"
"智善","净虚","pupil","徒弟"
"智通","净虚","pupil","徒弟"
"喜儿","贾珍","servant","奴仆"
"寿儿","贾珍","servant","奴仆"
"尤三姐","柳湘莲","girl_friend","女友"
"杏奴","柳湘莲","servant","奴仆"
"尤二姐","贾琏","concubine","妾"
"善姐","尤二姐","servant_girl","丫鬟"
"甄宝玉","李绮","husband","夫"
"贾演","贾源","elder_brother","兄"
"贾赦","贾代善","son","子"
"贾政","贾代善","son","子"
"贾敏","贾政","younger_sister","妹"
"邢夫人","贾赦","wife","妻"
"贾琏","贾赦","son","子"
"贾琮","贾赦","son","子"
"王夫人","贾政","wife","妻"
"贾元春","贾政","daughter","女"
"贾宝玉","贾政","son","子"
"贾探春","贾政","daughter","女"
"贾环","贾政","son","子"
"王熙凤","贾琏","wife","妻"
"贾巧姐","贾琏","daughter","女"
"贾兰","贾珠","son","子"
"李纨","贾珠","wife","妻"
"孙绍祖","贾迎春","husband","夫"
"李守中","李纨","father","父亲"
"李绮","李婶","daughter","女"
"甄宝玉","甄应嘉","son","子"
"林如海","贾敏","husband","夫"
"林黛玉","林如海","daughter","女"
"王嬷嬷","贾宝玉","nurser","乳母"
"彩霞","王夫人","servant_girl","丫鬟"
"傻大姐","贾母","servant_girl","丫鬟"
"晴雯","贾宝玉","servant_girl","丫鬟"
"篆儿","贾宝玉","servant_girl","丫鬟"
"柳五儿","贾宝玉","servant_girl","丫鬟"
"贾珍","贾敬","son","子"
"贾母","史侯","daughter","女"
"香菱","薛蟠","concubine","妾"
"倪二","贾芸","friend","友人"
"水溶","北静郡王","grandson","孙子"
"尤氏","贾珍","wife","妻"
"尤二姐","尤老娘","daughter","女"
"尤三姐","尤老娘","daughter","女"
"贾蓉","贾珍","son","子"
"秦可卿","秦业","daughter","女"

代码介绍

由于大部分代码都进行了注释,所以大家可以直接拷贝代码进行学习,在此不赘述代码作用

import csv
from py2neo import Graph, Node, Relationship

# 创建与 Neo4j 数据库的连接
g = Graph('http://localhost:7474', user='neo4j', password='neo4j123..', name="neo4j")

# 打开 CSV 文件
with open('HongLou.csv', 'r', encoding='utf-8') as f:
    # 创建一个 CSV 读取器
    reader = csv.reader(f)
    # 遍历 CSV 文件中的每一行
    for item in reader:
        # 跳过标题行,因为从第二行开始才是人物信息
        if reader.line_num == 1:
            continue
        # 打印当前行号和内容
        print("当前行数:", reader.line_num, "当前内容:", item)

        # 使用 CSV 中的值创建起始节点和结束节点,节点标签为 'Person',名称属性来自 CSV
        start_node = Node("Person", name=item[0])
        end_node = Node("Person", name=item[1])

        # 使用 CSV 中的值创建起始节点和结束节点之间的关系,关系类型为 CSV 中的值
        relation = Relationship(start_node, item[3], end_node)

        # 将起始节点和结束节点合并到图中,使用节点标签 'Person' 和名称属性进行匹配
        g.merge(start_node, "Person", "name")
        g.merge(end_node, "Person", "name")
        # 将关系合并到图中,使用节点标签 'Person' 和名称属性进行匹配
        g.merge(relation, "Person", "name")

 最后回到我们的neo4j中就能看到关系图谱啦

 

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

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

相关文章

陪玩社交系统开发(现成,可定制)-线下线上陪玩达人入驻服务系统软件开发(APP小程序公众号搭建)

陪源码的公司优势 1、长时间的陪玩源码开发经验,始终坚持从客户的实际需求出发 2、提供安全的陪玩系统源码开发解决方案,众多开发案例可供参考 3、需求定制不走弯路,即可使用约单APP开发成品直接使用,也支持二次开发 4、追求精…

基于单片机便携式测振仪的研制系统设计

**单片机设计介绍,基于单片机便携式测振仪的研制系统设计 文章目录 一 概要二、功能设计三、 软件设计原理图 五、 程序六、 文章目录 一 概要 基于单片机便携式测振仪的研制系统设计概要主要涉及利用单片机作为核心控制器件,结合测振原理和技术&#x…

如何保护IP地址?安全匿名上网的方法

当互联网成为每个家庭的重要组成部分后,IP地址就成了你的虚拟地址。您的请求从该地址开始,然后 Internet 将消息发送回该地址。那么,您担心您的地址被泄露吗? 对于安全意识高或者某些业务需求的用户,如果您正在寻找保护…

如何在本地使用Ollama运行开源LLMs

本文将指导您下载并使用Ollama,在您的本地设备上与开源大型语言模型(LLMs)进行交互的强大工具。 与像ChatGPT这样的闭源模型不同,Ollama提供透明度和定制性,使其成为开发人员和爱好者的宝贵资源。 我们将探索如何下载…

Django路由分发的三种方式以及命名空间namespce——附带源码解析

目录 1. 前言 2. include常规路由分发 3. include源码解析 4. 路由分发的第二种写法 5. 路由分发的第三种写法 6. 小结 7. 有关namespace 8. 最后 1. 前言 本篇文章主要是讲解路由分发的三种方式。当然,你可能在想,一般做路由分发只需要一个incl…

Kimi精选提示词,总结PPT内容

大家好,我是子云,最近真是觉得Kimi这个大模型,产品体验很棒,能力也是不错,感觉产品经理用心了。 发现一个Kimi 一个小技巧,可以学习到很多高级提示词。 Kimi输入框可以配置常用提示词,同时也可…

内存和网卡压力测试

1.内存压力测试 1.1测试目的 内存压力测试的目的是评估开发板中的内存子系统性能和稳定性,以确保它能够满足特定的应用需求。开发板通常用于嵌入式系统、物联网设备、嵌入式智能家居等场景,这些场景对内存的要求通常比较高。 其内存压力测试的主要目的…

C++设计模式:TemplateMethod模式(一)

1、概念定义 定义一个操作中的算法的骨架结构(稳定),而将一些步骤延迟(变化)到子类中。Template Method使得子类可以不改变(复用)一个算法的骨架结构即可重定义(override重写&#x…

AMRT3D数字孪生引擎

产品概述 AMRT3D引擎是由眸瑞网络科技自主研发、拥有完全自主知识产权的一款全球首款轻量化3D图形引擎,引擎以核心的轻量化技术及AMRT轻量格式为支柱,专为数字孪生项目开发打造。 AMRT3D引擎提供一整套完善的数字孪生解决方案,在数据处理方…

基于ssm的轻型卡车零部件销售平台(java项目+文档+源码)

风定落花生,歌声逐流水,大家好我是风歌,混迹在java圈的辛苦码农。今天要和大家聊的是一款基于ssm的轻型卡车零部件销售平台。项目源码以及部署相关请联系风歌,文末附上联系信息 。 项目简介: 轻型卡车零部件销售平台…

easyExcel 模版导出 中间数据纵向延伸,并且对指定列进行合并

想要达到的效果 引入maven引用 <dependency><groupId>com.alibaba</groupId><artifactId>easyexcel</artifactId><version>3.2.1</version></dependency> 按照要求创建模版 备注 : 模板注意 用{} 来表示你要用的变量 如果本…

Delphi 是一种内存安全的语言吗?

上个月&#xff0c;美国政府发布了 "回到基石 "报告&#xff1a; 通往安全和可衡量软件之路 "的报告。该报告是美国网络安全战略的一部分&#xff0c;重点关注多个领域&#xff0c;包括内存安全漏洞和质量指标。 许多在线杂志都对这份报告进行了评论&#xff0…

RT-Thread下使用NTP服务器获取时间并同步到硬件RTC

单片机:STM32F407VET6 实现功能:通过ntp服务器获取时间并同步到硬件RTC上 1.配置NTP相关参数 1.1打开netutils相关软件包 1.2 关闭软件RTC相关配置 参考资料:RT-Thread中使用NTP自动更新时间_rtthread ntp-CSDN博客 2.配置硬件RTC 2.1 在ENV里面使能硬件RTC 2.2使用STM32C…

医疗器械5G智能制造工厂数字孪生可视化平台,推进行业数字化转型

医疗设备5G智能制造工厂数字孪生可视化平台&#xff0c;推进行业数字化转型。在数字化浪潮的推动下&#xff0c;医疗设备行业正迎来一场深刻的变革。5G技术的崛起&#xff0c;智能制造工厂的兴起&#xff0c;以及数字孪生可视化平台的出现&#xff0c;正在共同推动医疗设备行业…

【数据分析实战】印尼雅加达咖啡市场分析:品牌排名与市场趋势解读

目录 背景介绍数据展示数据分析可视化1. 各市咖啡店占比&#xff1a;1.1 可视化代码1.2 可视化结果1.3 浅薄解读 2. 品牌市场份额排名&#xff1a;2.1 可视化结果1.2 浅薄解读 3. 品牌消费者满意指数&#xff1a;3.1 可视化代码3.2 可视化结果3.3 浅薄解读 写在最后 背景介绍 …

数据结构——二叉树(堆)

大家好我是小峰&#xff0c;今天我们开始学习二叉树。 首先我们来学习什么是树&#xff1f; 树概念及结构 树是一种 非线性 的数据结构&#xff0c;它是由 n &#xff08; n>0 &#xff09;个有限结点组成一个具有层次关系的集合。 把它叫做树是因 为它看起来像一棵倒挂的…

canal部署

定义 canal组件是一个基于mysql数据库增量日志解析&#xff0c;提供增量数据订阅和消费&#xff0c;支持将增量数据投递到下游消费者&#xff08;kafka&#xff0c;rocketmq等&#xff09;或者存储&#xff08;elasticearch,hbase等&#xff09;canal感知到mysql数据变动&…

AI学习-线性回归推导

线性回归 1.简单线性回归2.多元线性回归3.相关概念熟悉4.损失函数推导5.MSE损失函数 1.简单线性回归 ​ 线性回归&#xff1a;有监督机器学习下一种算法思想。用于预测一个或多个连续型目标变量y与数值型自变量x之间的关系,自变量x可以是连续、离散&#xff0c;但是目标变量y必…

IpcRenderer.invoke Error: An object could not be cloned.

这个错误信息提示“Uncaught (in promise) Error: An object could not be cloned.”通常发生在使用 Electron 的 IPC 通信过程中&#xff0c;尝试通过 ipcRenderer.invoke 或 ipcMain.handle 发送不能被克隆的对象时。JavaScript 中一些特殊对象或包含循环引用的对象无法通过 …

SQL server 查询数据库中所有的表名及行数

SQL server 查询数据库中所有的表名及行数 select a.name,b.rows from sysobjects as ainner join sysindexes as bon a.id b.id where (a.type u)and (b.indid in (0, 1)) and b.rows<50 and b.rows>20 order by a.name, b.rows desc;