当前位置: 首页 > news >正文

neo4j查询语言Cypher详解(三)--函数

函数

Cypher中的函数如果输入参数为null,则返回null。

以字符串作为输入的函数都对Unicode字符进行操作,而不是对标准字符进行操作。例如,size()函数应用于任何Unicode字符将返回1,即使该字符不适合一个字符的16位。

可以通过 SHOW FUNCTIONS 查看函数定义。

函数签名中参数格式:eg:

all(variable :: VARIABLE 		//:: VARIABLE,说明是个变量,可用于后面的 WHERE 部分IN 
list :: LIST OF ANY? 			//list,是个LIST泛型。
WHERE predicate :: ANY?			// predicate,是任意的断言
) 
:: (BOOLEAN?)					//函数返回值类型为BOOLEAN

断言函数

FunctionSignatureDescription
all()all(variable :: VARIABLE IN list :: LIST OF ANY? WHERE predicate :: ANY?) :: (BOOLEAN?)Returns true if the predicate holds for all elements in the given list.
any()any(variable :: VARIABLE IN list :: LIST OF ANY? WHERE predicate :: ANY?) :: (BOOLEAN?)Returns true if the predicate holds for at least one element in the given list.
exists()exists(input :: ANY?) :: (BOOLEAN?)Returns true if a match for the pattern exists in the graph.
isEmpty()isEmpty(input :: LIST? OF ANY?) :: (BOOLEAN?)Checks whether a list is empty.
isEmpty()isEmpty(input :: MAP?) :: (BOOLEAN?)Checks whether a map is empty.
isEmpty()isEmpty(input :: STRING?) :: (BOOLEAN?)Checks whether a string is empty.
none()none(variable :: VARIABLE IN list :: LIST OF ANY? WHERE predicate :: ANY?) :: (BOOLEAN?)Returns true if the predicate holds for no element in the given list.
single()single(variable :: VARIABLE IN list :: LIST OF ANY? WHERE predicate :: ANY?) :: (BOOLEAN?)Returns true if the predicate holds for exactly one of the elements in the given list.

标量函数

FunctionSignatureDescription
coalesce()coalesce(input :: ANY?) :: (ANY?)返回第一个非null值。
endNode()endNode(input :: RELATIONSHIP?) :: (NODE?)Returns the end node of a relationship.
head()head(list :: LIST? OF ANY?) :: (ANY?)Returns the first element in a list.
id()id(input :: NODE?) :: (INTEGER?)Deprecated Returns the id of a node. Replaced by elementId()
id(input :: RELATIONSHIP?) :: (INTEGER?)Deprecated Returns the id of a relationship. Replaced by elementId().
last()last(list :: LIST? OF ANY?) :: (ANY?)
length()length(input :: PATH?) :: (INTEGER?)Returns the length of a path.
properties()properties(input :: MAP?) :: (MAP?)返回一个对象的所有属性,作为一个map
properties(input :: NODE?) :: (MAP?)返回一个节点的所有属性,作为一个map
properties(input :: RELATIONSHIP?) :: (MAP?)返回一个关系的所有属性,作为一个map
randomUUID()randomUUID() :: (STRING?)
size()size(input :: LIST? OF ANY?) :: (INTEGER?)Returns the number of items in a list.
size(input :: STRING?) :: (INTEGER?)Returns the number of Unicode characters in a string.
startNode()startNode(input :: RELATIONSHIP?) :: (NODE?)
toBoolean()toBoolean(input :: STRING?) :: (BOOLEAN?)
toBoolean(input :: BOOLEAN?) :: (BOOLEAN?)
toBoolean(input :: INTEGER?) :: (BOOLEAN?)
toBooleanOrNull()toBooleanOrNull(input :: ANY?) :: (BOOLEAN?)转换为boolean,不能转换返回null。
toFloat()toFloat(input :: NUMBER?) :: (FLOAT?)
toFloat(input :: STRING?) :: (FLOAT?)
toFloatOrNull()toFloatOrNull(input :: ANY?) :: (FLOAT?)转换为小数,不能转换返回null。
toInteger()toInteger(input :: NUMBER?) :: (INTEGER?)
toInteger(input :: BOOLEAN?) :: (INTEGER?)
toInteger(input :: STRING?) :: (INTEGER?)
toIntegerOrNull()toIntegerOrNull(input :: ANY?) :: (INTEGER?)转换为整形,不能转换返回null。
type()type(input :: RELATIONSHIP?) :: (STRING?)Returns the string representation of the relationship type.

示例

CREATE (p:Person {name: 'Stefan', city: 'Berlin'})
RETURN properties(p)
//OUT PUT:
//: {"city":"Berlin","name":"Stefan"}

聚合函数

FunctionSignatureDescription
avg()avg(input :: DURATION?) :: (DURATION?)
avg(input :: FLOAT?) :: (FLOAT?)
avg(input :: INTEGER?) :: (INTEGER?)
collect()collect(input :: ANY?) :: (LIST? OF ANY?)收集数据作为一个LIST。
count()count(input :: ANY?) :: (INTEGER?)
max()max(input :: ANY?) :: (ANY?)
min()min(input :: ANY?) :: (ANY?)
percentileCont()percentileCont(input :: FLOAT?, percentile :: FLOAT?) :: (FLOAT?)
percentileDisc()percentileDisc(input :: FLOAT?, percentile :: FLOAT?) :: (FLOAT?)
`percentileDisc(input :: INTEGER?, percentile :: FLOAT?) :: (INTEGER?)
stdev()stdev(input :: FLOAT?) :: (FLOAT?)
stdevp()stdevp(input :: FLOAT?) :: (FLOAT?)
sum()sum(input :: DURATION?) :: (DURATION?)
`sum(input :: FLOAT?) :: (FLOAT?)
`sum(input :: INTEGER?) :: (INTEGER?)

集合函数

FunctionSignatureDescription
keys()keys(input :: MAP?) :: (LIST? OF STRING?)返回MAP的所有KEY LIST
keys(input :: NODE?) :: (LIST? OF STRING?)返回节点的所有属性 LIST
keys(input :: RELATIONSHIP?) :: (LIST? OF STRING?)返回关系的所有属性 LIST
labels()labels(input :: NODE?) :: (LIST? OF STRING?)Returns a list containing the string representations for all the labels of a node.
nodes()nodes(input :: PATH?) :: (LIST? OF NODE?)Returns a list containing all the nodes in a path.
range()range(start :: INTEGER?, end :: INTEGER?) :: (LIST? OF INTEGER?)Returns a list comprising all integer values within a specified range.
range(start :: INTEGER?, end :: INTEGER?, step :: INTEGER?) :: (LIST? OF INTEGER?)Returns a list comprising all integer values within a specified range created with step length.
reduce()`reduce(accumulator :: VARIABLE = initial :: ANY?, variable :: VARIABLE IN list :: LIST OF ANY?expression :: ANY) :: (ANY?)`
relationships()relationships(input :: PATH?) :: (LIST? OF RELATIONSHIP?)Returns a list containing all the relationships in a path.
reverse()reverse(input :: LIST? OF ANY?) :: (LIST? OF ANY?)Returns a list in which the order of all elements in the original list have been reversed.
tail()tail(input :: LIST? OF ANY?) :: (LIST? OF ANY?)Returns all but the first element in a list.
toBooleanList()toBooleanList(input :: LIST? OF ANY?) :: (LIST? OF BOOLEAN?)
toFloatList()toFloatList(input :: LIST? OF ANY?) :: (LIST? OF FLOAT?)
toIntegerList()toIntegerList(input :: LIST? OF ANY?) :: (LIST? OF INTEGER?)
toStringList()toStringList(input :: LIST? OF ANY?) :: (LIST? OF STRING?)

示例

toBooleanList()

RETURN toBooleanList(null) as noList,
toBooleanList([null, null]) as nullsInList,
toBooleanList(['a string', true, 'false', null, ['A','B']]) as mixedList
noListnullsInListmixedList
<null>[<null>,<null>][<null>,true,false,<null>,<null>]

总结:

  • 参数不是个LIST,报错
  • LIST 中的null,不转换,保留
  • LIST中的不可转换元素,结果为null。
  • BOOLEAN类型的元素,保留原始值

toFloatListtoIntegerListtoStringListtoBooleanList 规则类似。

数值函数

FunctionSignatureDescription
abs()abs(input :: FLOAT?) :: (FLOAT?)
abs(input :: INTEGER?) :: (INTEGER?)
ceil()ceil(input :: FLOAT?) :: (FLOAT?)
floor()floor(input :: FLOAT?) :: (FLOAT?)
isNaN()isNaN(input :: FLOAT?) :: (BOOLEAN?)Returns true if the floating point number is NaN.
isNaN(input :: INTEGER?) :: (BOOLEAN?)
rand()rand() :: (FLOAT?)
round()round(input :: FLOAT?) :: (FLOAT?)
round(value :: FLOAT?, precision :: NUMBER?) :: (FLOAT?)
round(value :: FLOAT?, precision :: NUMBER?, mode :: STRING?) :: (FLOAT?)
sign()sign(input :: FLOAT?) :: (INTEGER?)
sign(input :: INTEGER?) :: (INTEGER?)

对数函数

FunctionSignatureDescription
e()e() :: (FLOAT?)返回e。
exp()exp(input :: FLOAT?) :: (FLOAT?)返回e^n。
log()log(input :: FLOAT?) :: (FLOAT?)返回自然对数,以e为底
log10()log10(input :: FLOAT?) :: (FLOAT?)返回以10位底的对数
sqrt()sqrt(input :: FLOAT?) :: (FLOAT?)平方差

三角函数

FunctionSignatureDescription
acos()acos(input :: FLOAT?) :: (FLOAT?)
asin()`asin(input :: FLOAT?) :: (FLOAT?)
atan()atan(input :: FLOAT?) :: (FLOAT?)
atan2()atan2(y :: FLOAT?, x :: FLOAT?) :: (FLOAT?)
cos()cos(input :: FLOAT?) :: (FLOAT?)
cot()cot(input :: FLOAT?) :: (FLOAT?)
degrees()degrees(input :: FLOAT?) :: (FLOAT?)将弧度转换为角度
haversin()haversin(input :: FLOAT?) :: (FLOAT?)半正矢计算
pi()pi() :: (FLOAT?)
radians()radians(input :: FLOAT?) :: (FLOAT?)将角度转换为弧度
sin()sin(input :: FLOAT?) :: (FLOAT?)
tan()tan(input :: FLOAT?) :: (FLOAT?)

字符串函数

FunctionSignatureDescription
left()left(original :: STRING?, length :: INTEGER?) :: (STRING?)
ltrim()ltrim(input :: STRING?) :: (STRING?)
replace()replace(original :: STRING?, search :: STRING?, replace :: STRING?) :: (STRING?)
reverse()reverse(input :: STRING?) :: (STRING?)
right()`right(original :: STRING?, length :: INTEGER?) :: (STRING?)
rtrim()rtrim(input :: STRING?) :: (STRING?)
split()split(original :: STRING?, splitDelimiter :: STRING?) :: (LIST? OF STRING?)
split(original :: STRING?, splitDelimiters :: LIST? OF STRING?) :: (LIST? OF STRING?)
substring()substring(original :: STRING?, start :: INTEGER?) :: (STRING?)从0开始
substring(original :: STRING?, start :: INTEGER?, length :: INTEGER?) :: (STRING?)
toLower()toLower(input :: STRING?) :: (STRING?)
toString()toString(input :: ANY?) :: (STRING?)
toStringOrNull()toStringOrNull(input :: ANY?) :: (STRING?)
toUpper()toUpper(input :: STRING?) :: (STRING?)
trim()trim(input :: STRING?) :: (STRING?)

时间函数

FunctionSignatureDescription
date()date(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATE?)创建DATE
date.realtime()date.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATE?)使用 realtime clock 创建当前DATE
date.statement()date.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATE?)使用 statement clock 创建当前DATE
date.transaction()date.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATE?)使用 transaction clock 创建当前DATE
date.truncate()date.truncate(unit :: STRING?, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?, fields = null :: MAP?) :: (DATE?)截断DATE
datetime()datetime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATETIME?)
datetime.fromepoch()datetime.fromepoch(seconds :: NUMBER?, nanoseconds :: NUMBER?) :: (DATETIME?)
datetime.fromepochmillis()datetime.fromepochmillis(milliseconds :: NUMBER?) :: (DATETIME?)
datetime.realtime()datetime.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATETIME?)
datetime.statement()datetime.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATETIME?)
datetime.transaction()datetime.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (DATETIME?)
datetime.truncate()datetime.truncate(unit :: STRING?, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?, fields = null :: MAP?) :: (DATETIME?)
localdatetime()localdatetime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALDATETIME?)
localdatetime.realtime()localdatetime.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALDATETIME?)
localdatetime.statement()localdatetime.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALDATETIME?)
localdatetime.transaction()localdatetime.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALDATETIME?)
localdatetime.truncate()localdatetime.truncate(unit :: STRING?, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?, fields = null :: MAP?) :: (LOCALDATETIME?)
localtime()localtime(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALTIME?)
localtime.realtime()localtime.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALTIME?)
localtime.statement()localtime.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALTIME?)
localtime.transaction()localtime.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (LOCALTIME?)
localtime.truncate()localtime.truncate(unit :: STRING?, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?, fields = null :: MAP?) :: (LOCALTIME?)
time()time(input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (TIME?)
time.realtime()time.realtime(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (TIME?)
time.statement()time.statement(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (TIME?)
time.transaction()time.transaction(timezone = DEFAULT_TEMPORAL_ARGUMENT :: ANY?) :: (TIME?)
time.truncate()time.truncate(unit :: STRING?, input = DEFAULT_TEMPORAL_ARGUMENT :: ANY?, fields = null :: MAP?) :: (TIME?)

时钟控制

  • transaction: 同一个事务,时间返回相同值。
  • statement: 同一个语句的同一次调用,时间返回相同值。
  • realtime: 系统时间。

截断单位

  • millennium:千年
  • century:世纪
  • decade:十年
  • year:
  • weekYear:
  • quarter:
  • month:
  • week:
  • day:
  • hour:
  • minute:
  • second:
  • millisecond: 毫秒
  • microsecond: 微秒

示例

date([{timezone}])
RETURN date() AS currentDate
RETURN date({timezone: 'America/Los Angeles'}) AS currentDateInLAdate({year [, month, day]})
UNWIND [
date({year: 1984, month: 10, day: 11}),
date({year: 1984, month: 10}),
date({year: 1984})
] AS theDate
RETURN theDatedate({year [, week, dayOfWeek]})
UNWIND [
date({year: 1984, week: 10, dayOfWeek: 3}),
date({year: 1984, week: 10}),
date({year: 1984})
] AS theDate
RETURN theDate

所有时间函数,都支持通过一个Map对象构造时间实例。

duration函数

FunctionSignatureDescription
duration()duration(input :: ANY?) :: (DURATION?)
duration.between()duration.between(from :: ANY?, to :: ANY?) :: (DURATION?)计算2个时间差
duration.inDays()duration.inDays(from :: ANY?, to :: ANY?) :: (DURATION?)
duration.inMonths()duration.inMonths(from :: ANY?, to :: ANY?) :: (DURATION?)
duration.inSeconds()duration.inSeconds(from :: ANY?, to :: ANY?) :: (DURATION?)

示例

duration([ {years, quarters, months, weeks, days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds} ])duration(temporalAmount)   // temporalAmount STRING类型

duration标准字符串格式:P[nY][nM][nW][nD][T[nH][nM][nS]],具体见:https://neo4j.com/docs/cypher-manual/current/values-and-types/temporal/#cypher-temporal-specifying-durations

duration.between(instant1, instant2)

字段

  • years
  • quarters
  • months
  • weeks
  • days
  • hours
  • minutes
  • seconds
  • milliseconds
  • microseconds
  • nanoseconds

空间函数

FunctionSignatureDescription
point.distance()`point.distance(from :: POINT?, to :: POINT?) :: (FLOAT?)
point() - Cartesian 2Dpoint(input :: MAP?) :: (POINT?)
point() - Cartesian 3Dpoint(input :: MAP?) :: (POINT?)
point() - WGS 84 2D`point(input :: MAP?) :: (POINT?)
point() - WGS 84 3D`point(input :: MAP?) :: (POINT?)
point.withinBBox()point.withinBBox(point :: POINT?, lowerLeft :: POINT?, upperRight :: POINT?) :: (BOOLEAN?)

加载 CSV 函数

FunctionSignatureDescription
file()file() :: (STRING?)返回文件路径
linenumber()linenumber() :: (INTEGER?)返回行数

Graph functions

FunctionSignatureDescription
graph.names()graph.names() :: (LIST? OF STRING?)
graph.propertiesByName()graph.propertiesByName(name :: STRING?) :: (MAP?)
graph.byName()USE graph.byName(name :: STRING?)

用户自定义函数

TypeDescriptionUsageDeveloping
ScalarFor each row the function takes parameters and returns a result.Using UDFExtending Neo4j (UDF)
AggregatingConsumes many rows and produces an aggregated result.Using aggregating UDFExtending Neo4j (Aggregating UDF)

附录

参考

https://neo4j.com/docs/cypher-manual/current/functions/

相关文章:

neo4j查询语言Cypher详解(三)--函数

函数 Cypher中的函数如果输入参数为null&#xff0c;则返回null。 以字符串作为输入的函数都对Unicode字符进行操作&#xff0c;而不是对标准字符进行操作。例如&#xff0c;size()函数应用于任何Unicode字符将返回1&#xff0c;即使该字符不适合一个字符的16位。 可以通过 …...

kafka权威指南(阅读摘录)

零复制 Kafka 使用零复制技术向客户端发送消息——也就是说&#xff0c;Kafka 直接把消息从文件&#xff08;或者更确切地说是 Linux 文件系统缓存&#xff09;里发送到网络通道&#xff0c;而不需要经过任何中间缓冲区。这是 Kafka 与其他大部分数据库系统不一样的地方&#…...

【爬虫实践】使用Python从网站抓取数据

一、说明 本周我不得不为客户抓取一个网站。我意识到我做得如此自然和迅速&#xff0c;分享它会很有用&#xff0c;这样你也可以掌握这门艺术。【免责声明&#xff1a;本文展示了我的抓取做法&#xff0c;如果您有更多相关做法请在评论中分享】 二、计划策略 2.1 策划 确定您…...

win10 2022unity设置中文

提示&#xff1a;文章写完后&#xff0c;目录可以自动生成&#xff0c;如何生成可参考右边的帮助文档 文章目录 前言解决方法 前言 在Edit->preferences里找不到language选项。 解决方法 【1】打开下面地址 注意 :把{version}换成你当前安装的版本&#xff0c;比如说如果…...

python表白代码大全可复制,python表白代码大全简单

大家好&#xff0c;小编来为大家解答以下问题&#xff0c;python表白代码大全可复制&#xff0c;python表白程序代码完整版&#xff0c;现在让我们一起来看看吧&#xff01; 今天是20230520&#xff0c;有人说&#xff1a;5代表的是人生五味&#xff0c;酸甜苦辣咸&#xff1b;…...

wordpress 打开缓慢处理

gravatar.com 头像网站被墙 追踪发现请求头像时长为21秒 解决方案一 不推荐&#xff0c;容易失效&#xff0c;网址要是要稳定为主&#xff0c;宁愿头像显示异常&#xff0c;也不能网址打不开 网上大部分搜索到的替换的CDN网址都过期了&#xff0c;例如&#xff1a;gravatar.du…...

Adobe ColdFusion 反序列化漏洞复现(CVE-2023-29300)

0x01 产品简介 Adobe ColdFusion是美国奥多比&#xff08;Adobe&#xff09;公司的一套快速应用程序开发平台。该平台包括集成开发环境和脚本语言。 0x02 漏洞概述 Adobe ColdFusion存在代码问题漏洞&#xff0c;该漏洞源于受到不受信任数据反序列化漏洞的影响&#xff0c;攻击…...

林【2018】

关键字: BST插入叶子结点、ADT结伴操作、队列插入前r-1、哈希函数二次探测法(1,-1,4,-4)、队列元素个数、折半查找失败次数、广义表链表结构、B-树构建、单链表指定位置插入数组元素 一、判断 二、单选 h(49)+1,-1,+4,-4...

ffmpeg+nginx实现rtsp协议摄像头web端播放

ffmpegnginx实现rtsp协议摄像头web端播放 环境准备准备nginx环境添加rtmp模块添加hls转发 使用ffmpeg&#xff0c;将摄像头rtsp转为rtmp并推送到nginxVLC播放验证 环境准备 nginx&#xff08;需要安装rtmp模块&#xff09;ffmpeg 6.0vlc播放器&#xff08;本地播放验证&#x…...

【周赛第69期】满分题解 软件工程选择题 枚举 dfs

目录 选择题1.2.3.4.面向对象设计七大原则 编程题S数最小H值 昨晚没睡好&#xff0c;脑子不清醒&#xff0c;痛失第1名 选择题 1. 关于工程效能&#xff0c;以下哪个选项可以帮助提高团队的开发效率&#xff1f; A、频繁地进行代码审查 B、使用自动化测试工具 C、使用版本控…...

P2015 二叉苹果树

P2015 二叉苹果树 类似于带限制背包问题&#xff0c;但不知道也能做。 n , q n,q n,q 范围小&#xff0c;大胆设 dp 状态。设 f u , i \large f_{u,i} fu,i​ 表示 u u u 子树内保留 i i i 根树枝的最大苹果数&#xff0c;可得状态转移方程 f u , i f u , j f v , i − …...

Linux 内核音频数据传递主要流程

Linux 用户空间应用程序通过声卡驱动程序&#xff08;一般牵涉到多个设备驱动程序&#xff09;和 Linux 内核 ALSA 框架导出的 PCM 设备文件&#xff0c;如 /dev/snd/pcmC0D0c 和 /dev/snd/pcmC0D0p 等&#xff0c;与 Linux 内核音频设备驱动程序和音频硬件进行数据传递。PCM 设…...

torch.device函数

torch.device 是 PyTorch 中用于表示计算设备&#xff08;如CPU或GPU&#xff09;的类。它允许你在代码中指定你希望在哪个设备上执行张量和模型操作&#xff0c;本文主要介绍了 torch.device 函数的用法和功能。 本文主要包含以下内容&#xff1a; 1.创建设备对象2.将张量和模…...

火车头采集器AI伪原创【php源码】

大家好&#xff0c;本文将围绕python作业提交什么文件展开说明&#xff0c;python123怎么提交作业是一个很多人都想弄明白的事情&#xff0c;想搞清楚python期末作业程序需要先了解以下几个事情。 火车头采集ai伪原创插件截图&#xff1a; I have a python project, whose fold…...

Python中常见的6种数据类型

数字&#xff08;Numbers&#xff09;&#xff1a;数字类型用于表示数值&#xff0c;包括整数&#xff08;int&#xff09;和浮点数&#xff08;float&#xff09;。 字符串&#xff08;Strings&#xff09;&#xff1a;字符串类型用于表示文本&#xff0c;由一系列字符组成。字…...

消息队列项目(2)

我们使用 SQLite 来进行对 Exchange, Queue, Binding 的硬盘保存 对 Message 就保存在硬盘的文本中 SQLite 封装 这里是在 application.yaml 中来引进对 SQLite 的封装 spring:datasource:url: jdbc:sqlite:./data/meta.dbusername:password:driver-class-name: org.sqlite.…...

解决MAC M1处理器运行Android protoc时出现的错误

Protobuf是Google开发的一种新的结构化数据存储格式&#xff0c;一般用于结构化数据的序列化&#xff0c;也就是我们常说的数据序列化。这个序列化协议非常轻量级和高效&#xff0c;并且是跨平台的。目前&#xff0c;它支持多种主流语言&#xff0c;比传统的XML、JSON等方法更具…...

C#使用SnsSharp实现鼠标键盘钩子,实现全局按键响应

gitee下载地址&#xff1a;https://gitee.com/linsns/snssharp 一、键盘事件&#xff0c;使用SnsKeyboardHook 按键事件共有3个&#xff1a; KeyDown(按键按下) KeyUp(按键松开) KeyPress(按键按下并松开) 以KeyDown事件为例&#xff0c;使用代码如下&…...

Zookeeper基础操作

搭建Zookeeper服务器 windows下部署 下载地址: https://mirrors.cloud.tencent.com/apache/zookeeper/zookeeper-3.7.1/ 修改配置文件 打开conf目录&#xff0c;将 zoo_sample.cfg复制一份&#xff0c;命名为 zoo.cfg打开 zoo.cfg&#xff0c;修改 dataDir路径&#xff0c…...

【CSS】说说响应式布局

目录 一、是什么 二、怎么实现 1、媒体查询 2、百分比 3、vw/vh 4、小结 三、总结 一、是什么 响应式设计简而言之&#xff0c;就是一个网站能够兼容多个终端——而不是为每个终端做一个特定的版本。 响应式网站常见特点&#xff1a; 同时适配PC 平板 手机等…...

FFmpeg 低延迟同屏方案

引言 在实时互动需求激增的当下&#xff0c;无论是在线教育中的师生同屏演示、远程办公的屏幕共享协作&#xff0c;还是游戏直播的画面实时传输&#xff0c;低延迟同屏已成为保障用户体验的核心指标。FFmpeg 作为一款功能强大的多媒体框架&#xff0c;凭借其灵活的编解码、数据…...

2.Vue编写一个app

1.src中重要的组成 1.1main.ts // 引入createApp用于创建应用 import { createApp } from "vue"; // 引用App根组件 import App from ./App.vue;createApp(App).mount(#app)1.2 App.vue 其中要写三种标签 <template> <!--html--> </template>…...

在 Nginx Stream 层“改写”MQTT ngx_stream_mqtt_filter_module

1、为什么要修改 CONNECT 报文&#xff1f; 多租户隔离&#xff1a;自动为接入设备追加租户前缀&#xff0c;后端按 ClientID 拆分队列。零代码鉴权&#xff1a;将入站用户名替换为 OAuth Access-Token&#xff0c;后端 Broker 统一校验。灰度发布&#xff1a;根据 IP/地理位写…...

图表类系列各种样式PPT模版分享

图标图表系列PPT模版&#xff0c;柱状图PPT模版&#xff0c;线状图PPT模版&#xff0c;折线图PPT模版&#xff0c;饼状图PPT模版&#xff0c;雷达图PPT模版&#xff0c;树状图PPT模版 图表类系列各种样式PPT模版分享&#xff1a;图表系列PPT模板https://pan.quark.cn/s/20d40aa…...

【开发技术】.Net使用FFmpeg视频特定帧上绘制内容

目录 一、目的 二、解决方案 2.1 什么是FFmpeg 2.2 FFmpeg主要功能 2.3 使用Xabe.FFmpeg调用FFmpeg功能 2.4 使用 FFmpeg 的 drawbox 滤镜来绘制 ROI 三、总结 一、目的 当前市场上有很多目标检测智能识别的相关算法&#xff0c;当前调用一个医疗行业的AI识别算法后返回…...

算法笔记2

1.字符串拼接最好用StringBuilder&#xff0c;不用String 2.创建List<>类型的数组并创建内存 List arr[] new ArrayList[26]; Arrays.setAll(arr, i -> new ArrayList<>()); 3.去掉首尾空格...

并发编程 - go版

1.并发编程基础概念 进程和线程 A. 进程是程序在操作系统中的一次执行过程&#xff0c;系统进行资源分配和调度的一个独立单位。B. 线程是进程的一个执行实体,是CPU调度和分派的基本单位,它是比进程更小的能独立运行的基本单位。C.一个进程可以创建和撤销多个线程;同一个进程中…...

【学习笔记】erase 删除顺序迭代器后迭代器失效的解决方案

目录 使用 erase 返回值继续迭代使用索引进行遍历 我们知道类似 vector 的顺序迭代器被删除后&#xff0c;迭代器会失效&#xff0c;因为顺序迭代器在内存中是连续存储的&#xff0c;元素删除后&#xff0c;后续元素会前移。 但一些场景中&#xff0c;我们又需要在执行删除操作…...

掌握 HTTP 请求:理解 cURL GET 语法

cURL 是一个强大的命令行工具&#xff0c;用于发送 HTTP 请求和与 Web 服务器交互。在 Web 开发和测试中&#xff0c;cURL 经常用于发送 GET 请求来获取服务器资源。本文将详细介绍 cURL GET 请求的语法和使用方法。 一、cURL 基本概念 cURL 是 "Client URL" 的缩写…...

【免费数据】2005-2019年我国272个地级市的旅游竞争力多指标数据(33个指标)

旅游业是一个城市的重要产业构成。旅游竞争力是一个城市竞争力的重要构成部分。一个城市的旅游竞争力反映了其在旅游市场竞争中的比较优势。 今日我们分享的是2005-2019年我国272个地级市的旅游竞争力多指标数据&#xff01;该数据集源自2025年4月发表于《地理学报》的论文成果…...