noSQL的小练习

目录

Redis:

1、 string类型数据的命令操作:    

2、 list类型数据的命令操作:    

3、 hash类型数据的命令操作:

MongoDB: 

1. 创建一个数据库 名字grade 

2. 数据库中创建一个集合名字 class

3. 集合中插入若干数据 文档格式如下

4. 查找  

5. 增加、更新、删除、统计       


 

Redis:

1、 string类型数据的命令操作:
    (1) 设置键值:
    (2) 读取键值:
    (3) 数值类型自增1:
    (4) 数值类型自减1:
    (5) 查看值的长度:
127.0.0.1:6379> SET name 'erHua'    #(1) 设置键值:
OK
127.0.0.1:6379> GET name       #(2) 读取键值:
"erHua"
127.0.0.1:6379> SET num 7
OK
127.0.0.1:6379> INCR num    #(3) 数值类型自增1:
(integer) 8
127.0.0.1:6379> GET num
"8"
127.0.0.1:6379> DECR num    #(4) 数值类型自减1:
(integer) 7
127.0.0.1:6379> GET num
"7"
127.0.0.1:6379> STRLEN name    #(5) 查看值的长度:
(integer) 5
127.0.0.1:6379> STRLEN num
(integer) 1

注意:

127.0.0.1:6379> SET name '二花'
OK
127.0.0.1:6379> GET name 
"\xe4\xba\x8c\xe8\x8a\xb1"
  • REDIS数据库默认使用UTF-8编码进行存储,而不是直接使用可视化的中文字符。
  • 因此,当在Redis中存储中文字符串"二花"时,它会以UTF-8编码进行存储,并返回相应的字节序列 “\xe4\xba\x8c\xe8\x8a\xb1”。
  • 在Redis中,没有直接从脚本中调用编码转换函数的内置命令。因此,无法在Redis命令行界面直接进行解码。
  • 如果想在Redis中获取可视化的中文字符,最好的办法是在使用Redis的客户端应用程序中进行解码,例如在Python、Java或JavaScript中执行相应的解码操作。这样可以更方便地处理字节序列并获得可读的中文字符。
2、 list类型数据的命令操作:
    

   (1)对列表city插入元素:Shanghai Suzhou Hangzhou

127.0.0.1:6379> LPUSH city Shanghai Suzhou Hangzhou(integer) 3
127.0.0.1:6379> LRANGE city 0 -1  
1) "Hangzhou"
2) "Suzhou"
3) "Shanghai"

    (2)将列表city里的头部的元素移除

127.0.0.1:6379> lpop city  
"Hangzhou"
127.0.0.1:6379> lrange city 0 -1
1) "Suzhou"
2) "Shanghai"    

    (3)将name列表的尾部元素移除到number列表的头部

127.0.0.1:6379> LPUSH name iguBigu UmsyDipsy MacaBaca TomBlyber
127.0.0.1:6379> LPUSH 1 3 5 7 9127.0.0.1:6379> MULTI     #在不知道name会弹出什么值时不使用事务
OK
127.0.0.1:6379(TX)> RPOP name
QUEUED
127.0.0.1:6379(TX)> LPUSH number iguBigu
QUEUED
127.0.0.1:6379(TX)> EXEC
1) "iguBigu"
2) (integer) 6127.0.0.1:6379> lrange number 0 -1
1) "iguBigu"
2) "9"
3) "7"
4) "5"
5) "3"
6) "1"
127.0.0.1:6379> lrange name 0 -1
1) "TomBlyber"
2) "MacaBaca"
3) "UmsyDipsy

    (4) 对一个已存在的列表插入新元素

127.0.0.1:6379> LPUSHX name LittleDot    #插入一个小点点
(integer) 4
127.0.0.1:6379> lrange name 0 -1
1) "LittleDot"
2) "TomBlyber"
3) "MacaBaca"
4) "UmsyDipsy"

    (5)查看list的值长度 

127.0.0.1:6379> LLEN name
(integer) 4
3、 hash类型数据的命令操作:

    (1) 设置一个hash表,order表里包括的键值信息有:id:1,customer_name:张三

127.0.0.1:6379> HSET order id 1 customer_name '张三' 
(integer) 2

   (2) 创建一个hash表,表里的键值批量插入

127.0.0.1:6379> HMSET order n1 v1 n2 v2 n3 v3 n4 v4
OK

   (3) 获取order对应的map的所有key

127.0.0.1:6379> HKEYS order
1) "id"
2) "customer_name"
3) "n1"
4) "n2"
5) "n3"
6) "n4"

   (4) 获取order对应的map的键值数量

127.0.0.1:6379> HLEN order
(integer) 6

   (5) 获取order表里的id值 

127.0.0.1:6379> HMGET order id
1) "1"

MongoDB: 

1. 创建一个数据库 名字grade 
> use grade
switched to db grade
> db
grade
2. 数据库中创建一个集合名字 class
> db.createCollection('class')
{ "ok" : 1 }
3. 集合中插入若干数据 文档格式如下

{name:'zhang',age;10,sex:'m',hobby:['a','b','c']}
hobby: draw  sing  dance  basketball football  pingpong  computer 

> db.class.insertMany([
...   {name: 'LiitleDot', age: 4, sex: 'f', hobby: ['sing', 'dance']},
...   {name: 'IguBigu', age: 14, sex: 'm', hobby: ['football', 'draw', 'pingpong']},
...   {name: 'MacaBaca', age: 6, sex: 'm', hobby: ['draw', 'dance', 'pingpong', 'sing']},
...   {name: 'TomBlyber', age: 7, sex: 'f', hobby: ['draw']},
...   {name: 'UmsyDipsy', age: 11, sex: 'f', hobby: ['pingpong']},
...   {name: 'LittleBean', age: 5, sex: 'm', hobby: ['pingpong', 'sing']},
...   {name: 'FlyingFish', age: 8, sex: 'f', hobby: ['draw', 'dance', 'pingpong']}
... ]);
{"acknowledged" : true,"insertedIds" : [ObjectId("64b29f7744d96627bff90f54"),ObjectId("64b29f7744d96627bff90f55"),ObjectId("64b29f7744d96627bff90f56"),ObjectId("64b29f7744d96627bff90f57"),ObjectId("64b29f7744d96627bff90f58"),ObjectId("64b29f7744d96627bff90f59"),ObjectId("64b29f7744d96627bff90f5a")]
}
4. 查找  

    查看班级所有人信息

> db.class.find();
{ "_id" : ObjectId("64b29f7744d96627bff90f54"), "name" : "LiitleDot", "age" : 4, "sex" : "f", "hobby" : [ "sing", "dance" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f55"), "name" : "IguBigu", "age" : 14, "sex" : "m", "hobby" : [ "football", "draw", "pingpong" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f56"), "name" : "MacaBaca", "age" : 6, "sex" : "m", "hobby" : [ "draw", "dance", "pingpong", "sing" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f57"), "name" : "TomBlyber", "age" : 7, "sex" : "f", "hobby" : [ "draw" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f58"), "name" : "UmsyDipsy", "age" : 11, "sex" : "f", "hobby" : [ "pingpong" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f59"), "name" : "LittleBean", "age" : 5, "sex" : "m", "hobby" : [ "pingpong", "sing" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f5a"), "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong" ] }
> 

    查看班级中年龄为8岁的学生信息

> db.class.find( {age:8} );
{ "_id" : ObjectId("64b29f7744d96627bff90f5a"), "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong" ] }

    查看年龄大于10岁的学生信息

> db.class.find( {age:{$gt:10}} );
{ "_id" : ObjectId("64b29f7744d96627bff90f55"), "name" : "IguBigu", "age" : 14, "sex" : "m", "hobby" : [ "football", "draw", "pingpong" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f58"), "name" : "UmsyDipsy", "age" : 11, "sex" : "f", "hobby" : [ "pingpong" ] }

    查看年龄在 4---8岁之间的学生信息 

> db.class.find({age:{$gte:4,$lte:10}});
{ "_id" : ObjectId("64b29f7744d96627bff90f54"), "name" : "LiitleDot", "age" : 4, "sex" : "f", "hobby" : [ "sing", "dance" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f56"), "name" : "MacaBaca", "age" : 6, "sex" : "m", "hobby" : [ "draw", "dance", "pingpong", "sing" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f57"), "name" : "TomBlyber", "age" : 7, "sex" : "f", "hobby" : [ "draw" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f59"), "name" : "LittleBean", "age" : 5, "sex" : "m", "hobby" : [ "pingpong", "sing" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f5a"), "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong" ] }

    找到年龄为6岁且为男生的学生

> db.class.find( {age:6,sex:'m'} );
{ "_id" : ObjectId("64b29f7744d96627bff90f56"), "name" : "MacaBaca", "age" : 6, "sex" : "m", "hobby" : [ "draw", "dance", "pingpong", "sing" ] }

    找到年龄小于7岁或者大于10岁的学生

> db.class.find({
...   $or: [
...     { age: { $lt: 7 } },
...     { age: { $gt: 10 } }
...   ]
... });
{ "_id" : ObjectId("64b29f7744d96627bff90f54"), "name" : "LiitleDot", "age" : 4, "sex" : "f", "hobby" : [ "sing", "dance" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f55"), "name" : "IguBigu", "age" : 14, "sex" : "m", "hobby" : [ "football", "draw", "pingpong" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f56"), "name" : "MacaBaca", "age" : 6, "sex" : "m", "hobby" : [ "draw", "dance", "pingpong", "sing" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f58"), "name" : "UmsyDipsy", "age" : 11, "sex" : "f", "hobby" : [ "pingpong" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f59"), "name" : "LittleBean", "age" : 5, "sex" : "m", "hobby" : [ "pingpong", "sing" ] }

    找到年龄是8岁或者11岁的学生

> db.class.find({ $or: [{ age:8},{ age:11}] });
{ "_id" : ObjectId("64b29f7744d96627bff90f58"), "name" : "UmsyDipsy", "age" : 11, "sex" : "f", "hobby" : [ "pingpong" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f5a"), "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong" ] }

    找到兴趣爱好有两项的学生

> db.class.find({ hobby: {$size:2} });
{ "_id" : ObjectId("64b29f7744d96627bff90f54"), "name" : "LiitleDot", "age" : 4, "sex" : "f", "hobby" : [ "sing", "dance" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f59"), "name" : "LittleBean", "age" : 5, "sex" : "m", "hobby" : [ "pingpong", "sing" ] }

    找到兴趣爱好有draw的学生

> db.class.find({ hobby:'draw' });
{ "_id" : ObjectId("64b29f7744d96627bff90f55"), "name" : "IguBigu", "age" : 14, "sex" : "m", "hobby" : [ "football", "draw", "pingpong" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f56"), "name" : "MacaBaca", "age" : 6, "sex" : "m", "hobby" : [ "draw", "dance", "pingpong", "sing" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f57"), "name" : "TomBlyber", "age" : 7, "sex" : "f", "hobby" : [ "draw" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f5a"), "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong" ] }

    找到既喜欢画画又喜欢跳舞的学生

> db.class.find({ hobby:{$all: ['draw','dance']} });
{ "_id" : ObjectId("64b29f7744d96627bff90f56"), "name" : "MacaBaca", "age" : 6, "sex" : "m", "hobby" : [ "draw", "dance", "pingpong", "sing" ] }
{ "_id" : ObjectId("64b29f7744d96627bff90f5a"), "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong" ] }

    统计爱好有三项的学生人数

> db.class.find({ hobby: {$size:3} }).count();
2

    找出本班年龄第二大的学生

> db.class.find().sort({age:-1}).skip(1).limit(1);
{ "_id" : ObjectId("64b29f7744d96627bff90f58"), "name" : "UmsyDipsy", "age" : 11, "sex" : "f", "hobby" : [ "pingpong" ] }

    查看学生的兴趣范围

>  db.class.aggregate([
... {$unwind:'$hobby'},
... {$group: {
...           _id: null,hobbies: {$addToSet:'$hobby'}
...          }
... } ]);
{ "_id" : null, "hobbies" : [ "pingpong", "football", "dance", "sing", "draw" ] }

    将学生按年龄排序找到年龄最大的三个

> db.class.aggregate([ 
... {$sort: {age:-1}} , {$limit:3} ,{$project:{_id:0 ,name:1 ,sex:1 ,age:1 ,hobby:1}}
... ]);
{ "name" : "IguBigu", "age" : 14, "sex" : "m", "hobby" : [ "football", "draw", "pingpong" ] }
{ "name" : "UmsyDipsy", "age" : 11, "sex" : "f", "hobby" : [ "pingpong" ] }
{ "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong" ] }

    删除所有 年纪大于14或者小于4岁的学生

> db.class.remove({ $or:[ {age:{$lt:4}},{age:{$gt:14} }] });
WriteResult({ "nRemoved" : 0 })
5. 增加、更新、删除、统计
       

         1. 将小点点的年龄变为8岁 兴趣爱好变为 跳舞 画画

> db.class.replaceOne(
... {name:'LiitleDot'},
... {name:'LiitleDot',gae:8 ,habby:['dance','draw']} 
... );
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }> db.class.find({name:'LiitleDot'});
{ "_id" : ObjectId("64b2b4a0779acd38c6a2bf81"), "name" : "LiitleDot", "gae" : 8, "habby" : [ "dance", "draw" ] }

        2. 追加唔西·迪西趣爱好  唱歌

> db.class.updateOne(
...   {name: 'UmsyDipsy'},
...   {$push: {hobby: 'sing'}}
... );
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }> db.class.find({name: 'UmsyDipsy'});
{ "_id" : ObjectId("64b29f7744d96627bff90f58"), "name" : "UmsyDipsy", "gae" : 8, "sex" : "m", "hobby" : [ "draw", "sing" ] }

        3.汤姆布利柏趣爱好增加  吹牛 打篮球

> db.class.updateOne(
...   {name: 'TomBlyber'},
...   {$push: {hobby: ['TalkBig', 'basketball']}}
... );
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }> db.class.find({name:'TomBlyber'});
{ "_id" : ObjectId("64b29f7744d96627bff90f57"), "name" : "TomBlyber", "hobby" : [ "draw","TalkBig", "basketball" ] }


        4. 飞飞鱼增加爱好,跑步和唱歌,但是不要和以前的重复

> db.class.updateOne(
...   {name: 'FlyingFish'},
...   {$addToSet: {hobby: {$each: ['跑步', '唱歌']}}}
... );
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }> db.class.find({name: FlyibngFish});
{ "_id" : ObjectId("64b29f7744d96627bff90f5a"), "name" : "FlyingFish", "age" : 8, "sex" : "f", "hobby" : [ "draw", "dance", "pingpong", "跑步", "唱歌" ] }

        5. 该班所有同学年龄加1

 db.class.updateMany({},{$inc :{age:1}});
{ "acknowledged" : true, "matchedCount" : 7, "modifiedCount" : 7 }> db.class.find({},{_id:0,name:1,age:1})
{ "name" : "LiitleDot", "age" : 9 }
{ "name" : "IguBigu", "age" : 15 }
{ "name" : "MacaBaca", "age" : 7 }
{ "name" : "TomBlyber", "age" : 8 }
{ "name" : "UmsyDipsy", "age" : 12 }
{ "name" : "LittleBean", "age" : 6 }
{ "name" : "FlyingFish", "age" : 9 }

        6. 删除小豆豆的sex属性

> db.class.updateOne({"name" : "LittleBean"},{$unset:{sex:1}});
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }
> db.class.find({"name" : "LittleBean"});
{ "_id" : ObjectId("64b2cce5f8a301175474d607"), "name" : "LittleBean", "age" : 6, "hobby" : [ "pingpong", "sing" ] }

        7. 删除玛卡·巴卡兴趣中的第一项

> db.class.updateOne(
... {"name" : "MacaBaca"},
... {$pop:{hobby:-1}}
... );
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }> db.class.find( {"name" : "MacaBaca"});
{ "_id" : ObjectId("64b2cce5f8a301175474d604"), "name" : "MacaBaca", "age" : 7, "sex" : "m", "hobby" : [ "dance", "pingpong", "sing" ] }


        8. 将依古·比古兴趣中的画画爱好删除

> db.class.updateOne( 
... {"name" : "IguBigu"},
... {$pull: {hobby:'draw'}}
... );
{ "acknowledged" : true, "matchedCount" : 1, "modifiedCount" : 1 }> db.class.find( {"name" : "IguBigu"});
{ "_id" : ObjectId("64b2cce5f8a301175474d603"), "name" : "IguBigu", "age" : 15, "sex" : "m", "hobby" : [ "football", "pingpong" ] }

增加分数域 score:{'chinese':88,'english':78,'math':98}
        1. 按照性别分组统计每组人数

> db.class.aggregate([
...   {
...     $group: {_id: "$sex", count: { $sum: 1 }
...     }
...   }
... ]);
{ "_id" : "f", "count" : 4 }
{ "_id" : "m", "count" : 2 }
{ "_id" : null, "count" : 1 }

        2. 按照姓名分组,过滤出有重名的同学

> db.class.aggregate([
...   {
...     $group: {_id: "$name",  count: { $sum: 1 } }
...   },
...   
...    {
...     $match: { count: { $gt: 1 } }
...   },
...   
...    {
...     $project: {_id: 0, name: "$_id", count: 1}
...   }
... ]);
{ "count" : 2, "name" : "xiaowang" }

        3. 统计每名男生的语文成绩

> db.class.aggregate([
...   {
...     $match: {sex: "m"}
...   },
...   {
...     $project: {_id: 0,  name: "$name",  "score": '$score.chinese'}
...   }
... ]);{ "name" : "IguBigu", "score" : 92 }
{ "name" : "MacaBaca", "score" : 85 }
{ "name" : "xiaowang" }
{ "name" : "xiaowang" }

        4. 将女生按照英语分数降序排列

> db.class.aggregate([
...   {
...     $match: {sex: "f"}
...   },
...   {
...     $sort: {"score.english": -1}
...   },
...   {
...     $project: {_id: 0,  name: "$name",  englishScore: "$score.english" }
...   }
... ]);{ "name" : "TomBlyber", "englishScore" : 91 }
{ "name" : "LiitleDot", "englishScore" : 88 }
{ "name" : "UmsyDipsy", "englishScore" : 86 }
{ "name" : "FlyingFish", "englishScore" : 58 }

 

 

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

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

相关文章

C++基础算法二分篇

📟作者主页:慢热的陕西人 🌴专栏链接:C算法 📣欢迎各位大佬👍点赞🔥关注🚓收藏,🍉留言 主要讲解二分算法,分别讲解了整数二分和浮点二分 文章目录…

MobPush:Android SDK 集成指南

开发工具:Android Studio 集成方式:Gradle在线集成 安卓版本支持:minSdkVersion 19 集成准备 注册账号 使用PushSDK之前,需要先在MobTech官网注册开发者账号,并获取MobTech提供的AppKey和AppSecret,详情可…

elasticsearch基本操作

elasticsearch 下面参数详细解释 java 搜索查询看官方文档 https://www.elastic.co/guide/en/elasticsearch/client/java-api-client/8.8/connecting.html#_your_first_request{"name" : "Tom Foster","cluster_name" : "elasticsearch&q…

vue3+vite+ts+vant 开发浙里办H5应用流程和注意事项

vue3vitets 开发浙里办H5应用流程和注意事项 最近有个项目是要开发到浙里办的一个H5项目,记录一些问题; 浙里办irs系统内node版本和npm版本如下建议切到他们的版本再进行开发这样问题少一点 1.因为浙里办有自己的irs系统 需要吧前端整体的代码传上去 除了 打包后的dist 和 no…

【Win10系统下载Python3】

Python3官网:https://www.python.org/downloads/windows/ 注

TCP/IP网络编程 第十二章:I/O复用

基于I/O复用的服务器端 多进程服务器端的缺点和解决方法 为了构建并发服务器,只要有客户端连接请求就会创建新进程。这的确是实际操作中采用的种方案,但并非十全十美,因为创建进程时需要付出极大代价。这需要大量的运算和内存空间&#xff…

Unity Arduino 串口通信

一、Unity端发送消息&#xff0c;Arduino端接收消息 通过串口通信 Arduino端 #include <Arduino.h>#define PIN_KEY 5 uint item;void setup() {item 0;Serial.begin(115200);pinMode(PIN_KEY, OUTPUT); }void loop() {if(Serial.available()>0){item Serial.rea…

同比环比数据可视化

引言 数据分析和可视化在现代商业环境中变得越来越重要。随着数据的迅速增长&#xff0c;我们需要有效的工具来解释和理解这些数据。 数据可视化提供了一种直观的方式&#xff0c;帮助我们从海量数据中提取有意义的见解&#xff0c;以支持业务决策。 同比环比图作为一种常见的…

ceph集群(二)

ceph 一、资源池 Pool 管理二、创建 CephFS 文件系统 MDS 接口三、创建 Ceph 块存储系统 RBD 接口四、创建 Ceph 对象存储系统 RGW 接口五、OSD 故障模拟与恢复 一、资源池 Pool 管理 上次我们已经完成了 Ceph 集群的部署&#xff0c;但是我们如何向 Ceph 中存储数据呢&#x…

Nginx 解析漏洞复现

Nginx 解析漏洞复现 一、环境搭建二、漏洞原理三、漏洞复现 一、环境搭建 如下介绍kali搭建的教程 cd ~/vulhub/nginx/nginx_parsing_vulnerability // 进入指定环境 docker-compose up -d // 启动环境docker-compose ps使用这条命令查看当前正在运行的环境 访问http://y…

MFC第十八天 非模式对话框、对话框颜色管理、记事本项目(查找替换、文字和背景色、Goto(转到)功能的开发)

文章目录 非模式对话框非模式对话框的特点非模式对话框与QQ聊天窗口开发非模态对话框&#xff08;Modeless Dialog&#xff09;和模态对话框&#xff08;Modal Dialog&#xff09;区别 记事本开发CFindReplaceDialog类的成员查找替换(算法分析)使用RichEdit控件 开发Goto(转到)…

[LINUX]之字符串去掉前后空格

去掉字符串前后空格通过使用awk $1$1命令实现 echo " test " | awk $1$1

STM32实现MLX90614非接触测温串口显示(标准库与HAL库实现)

目录 模块选择 编程环境 MLX90614基本原理 通信协议&#xff08;SMBus通信&#xff0c;类IIC通信&#xff09; 代码实现 STM32与模块之间接线表 1.标准库实现温度采集 2.HAL库实现温度采集 模块选择 STM32F103C8T6 MLX90614 非接触式红外测温传感器 编程环境 KEIL5&…

图数据库:neo4j学习笔记

参考资料&#xff1a;neo4j 教程_w3cschool Springboot集成Neo4j_喝醉的咕咕鸟的博客-CSDN博客 SpringBoot 整合 Neo4j_springboot neo4j_$懒小猿$的博客-CSDN博客 图数据库Neo4j实战&#xff08;全网最详细教程&#xff09;_neo4j使用教程_星川皆无恙的博客-CSDN博客 代码片段…

04 QT坐标系

在QT中默认左上角为原点&#xff0c;即&#xff08;0,0&#xff09;点。x轴右侧为正方向&#xff0c;y轴以下侧为正方向

nosql作业

nosql作业 文章目录 作业一&#xff1a;string list hash结构中&#xff0c;每个至少完成5个命令&#xff0c;包含插入 修改 删除 查询&#xff0c;list 和hash还需要增加遍历的操作命令1、 string类型数据的命令操作&#xff1a;2、 list类型数据的命令操作&#xff1a;3、 ha…

.NET网络编程——TCP通信

一、网络编程的基本概念 : 1. 网络 就是将不同区域的电脑连接到一起&#xff0c;组成局域网、城域网或广域网。把分部在不同地理区域的计算机于专门的外部设备用通信线路 互联成一个规模大、功能强的网络系统&#xff0c;从而使众多的计算机可以方便地互相传递信息&#xff0c…

坐标系变换的坑

坐标系变换的坑 坐标系变换本来是很简单的事情&#xff0c;公式也很简单。但是卡了我很多天&#xff0c;原因是&#xff1a;两个坐标系的位姿&#xff0c;虽然都是右手系&#xff0c;但我的在顺时针旋转是yaw角是递增的&#xff0c;同事发给我的却是逆时针递减的。 理论上很简…

Jenkins+Robot 接口自动化测试

目录 前言&#xff1a; 设计目标 项目说明 目录结构 配置 jenkins 1.安装插件 2.配置项目 前言&#xff1a; JenkinsRobot是一种常见的接口自动化测试方案&#xff0c;可以实现自动化的接口测试和持续集成。Jenkins是一个流行的持续集成工具&#xff0c;而Robot Framew…

55 # 实现可写流

先在 LinkedList.js 给链表添加一个移除方法 class Node {constructor(element, next) {this.element element;this.next next;} }class LinkedList {constructor() {this.head null; // 链表的头this.size 0; // 链表长度}// 可以直接在尾部添加内容&#xff0c;或者根据…