Opensips安装配置(以下操作均已centOS 6.3系统为准)
1. 安装依赖软件:
a) Yum update //更新系统到最新
b) 安装以下所需依赖软件
gcc
bison
flex
make
openssl
libmysqlclient-dev
mysql-server
c) 安装radiusclient:
1. wget http://pkgs.repoforge.org/radiusclient-ng/radiusclient-ng-0.5.6-5.el6.rf.x86_64.rpm
2. rpm -ivfradiusclient-ng-0.5.6-5.el6.rf.x86_64.rpm
3. wget http://pkgs.repoforge.org/radiusclient-ng/radiusclient-ng-devel-0.5.6-5.el6.rf.x86_64.rpm
4. rpm -ivfradiusclient-ng-devel-0.5.6-5.el6.rf.x86_64.rpm
5. wget http://pkgs.repoforge.org/radiusclient-ng/radiusclient-ng-utils-0.5.6-5.el6.rf.x86_64.rpm
6. rpm -ivfradiusclient-ng-utils-0.5.6-5.el6.rf.x86_64.rpm
d) 安装xmlrpc3-
yum –y install *xmlrpc3*
e) 安装perl:
1. yum install *perl*MySQL*
2. yum install *perl*Front*
3. yum install *perl*Read*
f) 安装start-stop-daemon
1. wget http://developer.axis.com/download/distribution/apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
2. tar zxf apps-sys-utils-start-stop-daemon-IR1_9_18-2.tar.gz
3. mvapps/sys-utils/start-stop-daemon-IR1_9_18-2/ ./
4. rm -rf apps
5. cdstart-stop-daemon-IR1_9_18-2/
6. cc start-stop-daemon.c -ostart-stop-daemon
7. cp start-stop-daemon /usr/bin/start-stop-daemon
2. 安装opensips
a) cd /usr/src
b) 下载opensips源码:
wget http://opensips.org/pub/opensips/1.6.0/src/opensips-1.6.0-tls_src.tar.gz
c) 解压缩源码:
tar -xf opensips-1.6.0-tls_src.tar.gz
d) cd opensips-1.6.0-tls
e) 编译并安装:
make prefix=/ all include_modules="db_mysql aaa_radius"
make prefix=/ install include_modules="db_mysql aaa_radius"
f) 创建运行目录
mkdir /var/run/opensips
3. 配置系统运行环境
a) 添加opensips运行文件到linux启动项
i. cd/usr/src/opensips-1.6.0-tls/packaging/debian
ii. cp opensips.default/etc/default/opensips
iii. cp opensips.init /etc/init.d/opensips
b) 修改/etc/opensips/opensips.cfg
i. vim /etc/opensips/opensips.cfg
ii. 删掉fork=no行,即便有注释也删掉
c) 赋予opensips.init文件正确权限
i. cd /etc/init.d
ii. chmod 755 opensips
d) 编辑/etc/default/opensips
i. vim /etc/default/opensips
ii. 修改如下(红色字体):
# Set to yes to enable opensips, once configured properly.
RUN_OPENSIPS=yes
# User to run as
USER=root
# Group to run as
GROUP=root
# Amount of memory to allocate for the running OpenSIPS server (in Mb)
MEMORY=128
e) 编辑/etc/init.d/opensips,配置正确的opensips路径
i. vim /etc/init.d/opensips
ii. 修改如下(红色字体)
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/sbin/opensips
NAME=opensips
DESC=opensips
HOMEDIR=/var/run/opensips
PIDFILE=$HOMEDIR/$NAME.pid
4. 独立Log文件
a) 修改/etc/rsyslog.conf
i. vim /etc/rsyslog.conf
ii. 在文件最后添加一条:
local0.* /var/log/opensips.log
b) 重启rsyslog服务:
service rsyslog restart
5. 启动opensips
a) 启动opensips服务:
/etc/init.d/opensips start|stop|restart
6. 配置mysql认证支持
a) 确认db_mysql.so正常存在
ls /lib/opensips/modules/db_mysql.so
b) 修改/etc/opensips/opensipsctlrc文件,去掉如下内容的注释:
SIp_DoMAIN=115.28.38.216
DBENGINE=MYSQL
DBHoST=localhost
DBNAME=opensips
DBRWUSER=opensips
DBRWpW="opensipsrw"
DBRoUSER=opensipsro
DBRopW=opensipsro
ALIASES_TYPE="DB"
oSIpS_FIFo="/tmp/opensips_fifo"
c) 创建opensips的数据库
opensipsdbctl create
输入如下(注意红色字,一律选y):
Opensips:~# opensipsdbctl create
MySqL password for root:
INFO: test server charset
INFO: creating database opensips ...
INFO: Core Opensips tables successfully created.
Install presence related tables?(y/n): y
INFO: creatingpresence tables into opensips ...
INFO: Presence tables successfully created.
Install tables for imc cpl siptracedomainpolicy carrierroute? (y/n): y
d) 编辑/etc/opensips/opensips.cfg
修改如下(去掉如下代码的注释)
#loadmodule "db_mysql.so"
#loadmodule "auth.so"
#loadmodule "auth_db.so"
#modparam("usrloc", "db_mode", 2)
#modparam("usrloc", "db_url",
# "mysql://opensips:opensipsrw@localhost/opensips")
#modparam("auth_db", "calculate_ha1", yes)
#modparam("auth_db", "password_column","password")
#modparam("auth_db", "db_url",
# "mysql://opensips:opensipsrw@localhost/opensips")
#modparam("auth_db", "load_credentials", "")
##if (!(method=="REGISTER") && from_uri==myself) /*nomultidomain version*/
##{
## if (!proxy_authorize("", "subscriber")) {
## proxy_challenge("", "0");
## exit;
## }
## if (!db_check_from()) {
## sl_send_reply("403","Forbidden auth ID");
## exit;
## }
##
## consume_credentials();
## # caller authenticated
##}
#authenticate the REGISTER requests
(uncomment to enable auth)
##if (!www_authorize("", "subscriber"))
##{
## www_challenge("", "0");
## exit;
##}
##
##if (!db_check_to())
##{
## sl_send_reply("403","Forbidden auth ID");
## exit;
##}
e) 重启opensips服务
/etc/init.d/opensips restart
f) 添加两个用户
opensipsctl add 1000 1000
opensipsctl add 1001 1001
g) 客户端可进行登录验证
7. 配置RTPProxy处理NAT
a) 下载并安装RTPProxy
1. cd /usr/src
2. wgethttp://b2bua.org/chrome/site/rtpproxy-1.2.0.tar.gz
3. tar –xzvf rtpproxy-1.2.0.tar.gz
4. cd rtpproxy-1.2.0
5. ./configure
6. make
7. make install
b) 运行RTPProxy
rtpproxy -l 115.28.38.216 -a 10.144.59.80 -s udp:localhost:7890 -F -d INFOLOG_LOCAL1
c) 修改/etc/opensips/opensips.cfg文件
修改如下:
在#loadmodule "presence_xml.so"下面添加
loadmodule "nathelper.so"
在” #modparam("presence", "server_address","sip:192.168.1.2:5060")”下面添加:
modparam("nathelper","rtpproxy_sock", "udp:127.0.0.1:7890")
modparam("nathelper", "natping_interval", 30)
modparam("nathelper", "ping_nated_only", 0)
modparam("nathelper", "sipping_bflag", 7)
modparam("nathelper", "sipping_from","sip:pinger@127.0.0.1")
modparam("registrar","received_avp","$avp(i:42)")
modparam("nathelper","received_avp","$avp(i:42)")
在# main request routing logic下面的代码中添加如下红色字:
# main request routing logic
route{
if(!mf_process_maxfwd_header("10")) {
sl_send_reply("483","TooMany Hops");
exit;
}
#---- NAT Detection ----#
force_rport();
if (nat_uac_test("18")) {
if (is_method("REGISTER")) {
fix_nated_register();
}
else {
fix_nated_contact();
}
setflag(5);
}
if (has_totag()) {
# sequentialrequest withing a dialog should
# take thepath determined by record-routing
if(loose_route()) {
if(is_method("BYE")) {
setflag(1);# do accounting ...
setflag(3);# ... even if the transaction fails
}else if (is_method("INVITE")) {
#even if in most of the cases is useless, do RR for
#re-INVITEs alos, as some buggy clients do change route set
#during the dialog.
record_route();
}
#route it out to whatever destination was set by loose_route()
#in $du (destination URI).
route(1);
} else {
/*uncomment the following lines if you want to enable presence */
##if(is_method("SUBSCRIBE") && $rd =="your.server.ip.address") {
## # in-dialog subscribe requests
## route(2);
## exit;
##}
if( is_method("ACK") ) {
if( t_check_trans() ) {
#non loose-route, but stateful ACK; must be an ACK after
#a 487 or e.g. 404 from upstream server
t_relay();
exit;
}else {
#ACK without matching transaction ->
#ignore and discard
exit;
}
}
sl_send_reply("404","Nothere");
}
exit;
}
#initial requests
# CANCEL processing
if(is_method("CANCEL"))
{
if(t_check_trans())
t_relay();
exit;
}
t_check_trans();
# authenticate if fromlocal subscriber (uncomment to enable auth)
# authenticate allinitial non-REGISTER request that pretend to be
# generated by localsubscriber (domain from FROM URI is local)
#if(!(method=="REGISTER") && from_uri==myself) /*no multidomainversion*/
##if(!(method=="REGISTER") && is_from_local()) /*multidomain version*/
#{
# if (!proxy_authorize("","subscriber")) {
# proxy_challenge("","0");
# exit;
# }
# if (!db_check_from()) {
# sl_send_reply("403","Forbiddenauth ID");
# exit;
# }
#
# consume_credentials();
# # caller authenticated
#}
# preloaded routechecking
if (loose_route()) {
xlog("L_ERR",
"Attemptto route with preloaded Route's [$fu/$tu/$ru/$ci]");
if(!is_method("ACK"))
sl_send_reply("403","PreloadRoute denied");
exit;
}
# record routing
if(!is_method("REGISTER|MESSAGE"))
record_route();
# account only INVITEs
if(is_method("INVITE")) {
setflag(1);# do accounting
}
if (!uri==myself)
## replace withfollowing line if multi-domain support is used
##if(!is_uri_host_local())
{
append_hf("P-hint:outbound\r\n");
# if youhave some interdomain connections via TLS
##if($rd=="tls_domain1.net"){
## t_relay("tls:domain1.net");
## exit;
##} elseif($rd=="tls_domain2.net") {
## t_relay("tls:domain2.net");
## exit;
##}
route(1);
}
# requests for mydomain
## uncomment this ifyou want to enable presence server
## and comment the next 'if' block
## NOTE: uncomment also the definition ofroute[2] from below
##if( is_method("PUBLISH|SUBSCRIBE"))
## route(2);
if(is_method("PUBLISH"))
{
sl_send_reply("503","Service Unavailable");
exit;
}
if(is_method("REGISTER"))
{
#authenticate the REGISTER requests (uncomment to enable auth)
if(!www_authorize("", "subscriber"))
{
www_challenge("","0");
exit;
}
if(!db_check_to())
{
sl_send_reply("403","Forbiddenauth ID");
exit;
}
#--Request is behind NAT(flag5) save with bflag 6 -#
#----Use bflag 7 to start SIP pinging (Options) ---#
if(isflagset(5)) {
setbflag(6);
setbflag(7);
};
if(!save("location"))
sl_reply_error();
exit;
}
if ($rU==NULL) {
# requestwith no Username in RURI
sl_send_reply("484","AddressIncomplete");
exit;
}
# apply DB basedaliases (uncomment to enable)
##alias_db_lookup("dbaliases");
# do lookup withmethod filtering
if(!lookup("location","m")) {
switch($retcode) {
case-1:
case-3:
t_newtran();
t_reply("404","Not Found");
exit;
case -2:
sl_send_reply("405","Method Not Allowed");
exit;
}
}
# when routing viausrloc, log the missed calls also
setflag(2);
route(1);
}
route[1] {
# for INVITEs enablesome additional helper routes
#---- Helper route, if nat=yes in the R-URI setflag 6 ----#
#---- This is used to Process REINVITES ----#
if (subst_uri('/(sip:.*);nat=yes/\1/')){
setbflag(6);
};
#-- If caller(flag 5) or callee(flag 6) are behindNAT --#
#-- Call the route(6) to force the use of the RTPProxy --#
if (isflagset(5)||isbflagset(6)) {
route(6);
};
if (isflagset(5)){
search_append('Contact:.*sip:[^>[:cntrl:]]*',';nat=yes');
}
if(is_method("INVITE")) {
t_on_branch("2");
t_on_reply("2");
t_on_failure("1");
}
if (!t_relay()) {
sl_reply_error();
};
exit;
}
# Presence route
/* uncomment the whole following route for enabling presence
NOTE: do not forget toenable the call of this route from the main
route */
##route[2]
##{
## if (!t_newtran())
## {
## sl_reply_error();
## exit;
## };
##
## if(is_method("PUBLISH"))
## {
## handle_publish();
## t_release();
## }
## else
## if(is_method("SUBSCRIBE"))
## {
## handle_subscribe();
## t_release();
## }
##
## exit;
##}
route[6] {
#---- RTP Proxy handling ---#
if (is_method("BYE|CANCEL")) {
unforce_rtp_proxy();
}
else if (is_method("INVITE")){
#---- Activates the RTP Proxy for the CALLEE ---#
force_rtp_proxy();
t_on_failure("1");
};
}
branch_route[2] {
xlog("new branchat $ru\n");
}
onreply_route[2] {
xlog("incomingreply\n");
#---- Handling of the SDP for the 200 or 183 reply----#
#---- If behind nat (flags 5 or 6) start RTP Proxy----#
#---- Activates the RTP Proxy for the CALLER ----#
if ((isflagset(5) || isbflagset(6)) && status=~"(183)|(2[0-9][0-9])"){
force_rtp_proxy();
append_hf("P-hint:onreply_route|force_rtp_proxy \r\n");
}
#---- If the CALLEE is behind NAT, fix the CONTACTHF ----#
if (isbflagset(6)) {
#-- Insert nat=yes at the end of the Contactheader --#
#-- This helps with REINVITEs, --#
#- nat=yes will be included in the R-URI forseq.requests-#
search_append('Contact:.*sip:[^>[:cntrl:]]*',';nat=yes');
append_hf("P-hint: Onreply-route - fixcontact\r\n");
fix_nated_contact();
}
exit;
}
failure_route[1] {
#---- If a failure has ocurred, deactivate the RTpproxy ----#
if (isflagset(5) || isbflagset(6)){
unforce_rtp_proxy();
}
if (t_was_cancelled()){
exit;
}
# uncomment thefollowing lines if you want to block client
# redirect based on3xx replies.
##if(t_check_status("3[0-9][0-9]")) {
##t_reply("404","Notfound");
## exit;
##}
# uncomment thefollowing lines if you want to redirect the failed
# calls to a differentnew destination
##if(t_check_status("486|408")) {
## sethostport("192.168.2.100:5060");
## # do not set the missed call flag again
## t_relay();
##}
}
d) 重启opensips服务
/etc/init.d/opensips restart
相关文章:
Opensips安装配置(以下操作均已centOS 6.3系统为准)
1. 安装依赖软件: a) Yum update //更新系统到最新 b) 安装以下所需依赖软件 gcc bison flex make openssl libmysqlclient-dev mysql-server c) 安装radiusclient: 1. wget http://pkgs.repoforge.org/radiuscli…...
第03章 用户与权限管理
第03章 用户与权限管理 1. 用户管理 1.1 登录MySQL服务器 启动MySQL服务后,可以通过mysql命令来登录MySQL服务器,命令如下: mysql –h hostname|hostIP –P port –u username –p DatabaseName –e "SQL语句"-h参数后面接主机…...

赋能制造业高质量发展,释放采购数字化新活力——企企通亮相武汉2023国际智能制造创新论坛
摘要 “为应对成本上升、供应端不稳定、供应链上下游协同困难、决策无数据依据等问题,利用数字化手段降本增效、降低潜在风险十分关键。在AI等先进技术发展、供应链协同效应和降本诉求等机遇的驱动下,采购供应链数字化、协同化成为企业激烈竞争的优先选…...

洗地新天花板:CEYEE希亦顶配机皇T800 Pro洗地机多点发力上市开售
2023年11月1日,CEYEE希亦正式发布高端清洁产品无线洗地机希亦T800 PRO,创新性地实现了洗地场景深度清洁体验的新突破,彻底解决了清洁行业20多年来技术发展难题,颠覆式引领行业向水汽混动时代迈进,推动了整个市场向“智…...

如何创建一个react项目
文章目录 前言前言打开小黑窗口npm init vite后言 前言 hello world欢迎来到前端的新世界 😜当前文章系列专栏:react.js 🐱👓博主在前端领域还有很多知识和技术需要掌握,正在不断努力填补技术短板。(如果出现错误&am…...

面试算法49:从根节点到叶节点的路径数字之和
题目 在一棵二叉树中所有节点都在0~9的范围之内,从根节点到叶节点的路径表示一个数字。求二叉树中所有路径表示的数字之和。例如,图8.4的二叉树有3条从根节点到叶节点的路径,它们分别表示数字395、391和302,这3个数字…...

http1,https,http2,http3总结
1.HTTP 当我们浏览网页时,地址栏中使用最多的多是https://开头的url,它与我们所学的http协议有什么区别? http协议又叫超文本传输协议,它是应用层中使用最多的协议, http与我们常说的socket有什么区别吗? …...

stable-diffusion-webui环境部署
stable-diffusion-webui环境部署 1. 环境创建2. 安装依赖库3.下载底模4. 获取lora参数文件5.运行代码6. 报错信息报错1报错2 1. 环境创建 创建虚拟环境 conda create -n env_stable python3.10.0进入虚拟环境 conda activate env_stableclone源码 git clone https://github.com…...

使用Ansible中的playbook
目录 1.Playbook的功能 2.YAML 3.YAML列表 4.YAML的字典 5.playbook执行命令 6.playbook的核心组件 7.vim 设定技巧 示例 1.Playbook的功能 playbook 是由一个或多个play组成的列表 Playboot 文件使用YAML来写的 2.YAML #简介# 是一种表达资料序列的格式,类似XML #特…...

模型应用系实习生-模型训练笔记(更新至线性回归、Ridge回归、Lasso回归、Elastic Net回归、决策树回归、梯度提升树回归和随机森林回归)
sklearn机械学习模型步骤以及模型 一、训练准备(x_train, x_test, y_train, y_test)1.1 导包1.2 数据要求1.21 导入数据1.22 数据类型查看检测以及转换1.22 划分数据 二、回归2.1 线性回归2.2 随机森林回归2.3 GradientBoostingRegressor梯度提升树回归2…...

【Verilog】7.2.1 Verilog 并行 FIR 滤波器设计
FIR(Finite Impulse Response)滤波器是一种有限长单位冲激响应滤波器,又称为非递归型滤波器。 FIR 滤波器具有严格的线性相频特性,同时其单位响应是有限长的,因而是稳定的系统,在数字通信、图像处理等领域…...

【音视频 | wav】wav音频文件格式详解——包含RIFF规范、完整的各个块解析、PCM转wav代码
😁博客主页😁:🚀https://blog.csdn.net/wkd_007🚀 🤑博客内容🤑:🍭嵌入式开发、Linux、C语言、C、数据结构、音视频🍭 🤣本文内容🤣&a…...

人工智能基础_机器学习012_手写梯度下降代码演示_手动写代码完成梯度下降_并实现梯度下降可视化---人工智能工作笔记0052
可以看到上面我们那个公式,现在我们用梯度下降实现一下,比如我们有一堆数据,但是没有方程的情况下,我们来看一下如果计算,对应的w值也就是seta值对吧,没有方程我们可以使用梯度下降 这里首先我们可以设置一个0.0001.我们知道梯度下降的公式, 梯度下降刚开始的时候,下降会快,然…...

Docker安装部署[8.x]版本Elasticsearch+Kibana+IK分词器
文章目录 Docker安装部署elasticsearch拉取镜像创建数据卷创建网络elasticsearch容器,启动!踩坑:虚拟机磁盘扩容 Docker安装部署Kibana拉取镜像Kibana容器,启动! 安装IK分词器安装方式一:直接从github上下载…...

折纸达珠峰高度(forwhile循环)
对折0.1mm厚度的纸张多少次,高度可达珠峰高度8848180mm。 (本笔记适合熟悉循环和列表的 coder 翻阅) 【学习的细节是欢悦的历程】 Python 官网:https://www.python.org/ Free:大咖免费“圣经”教程《 python 完全自学教程》,不仅…...
探索网络攻防技术:自学之道
在当今数字化时代,网络攻防技术的重要性日益凸显。无论是个人用户还是企业组织,都需要具备一定的网络安全意识和基本技能来应对日益复杂的网络威胁。自学网络攻防技术成为许多人的选择,今天我们将探讨如何高效、有序地自学网络攻防技术。 如果…...

图像二值化阈值调整——cv2.threshold方法
二值化阈值调整:调整是指在进行图像二值化处理时,调整阈值的过程。阈值决定了将图像中的像素分为黑色和白色的界限,大于阈值的像素被设置为白色,小于等于阈值的像素被设置为黑色。 方法一: 取阈值为 127,…...
【C++代码】背包问题,完全背包,多重背包,打家劫舍,动态规划--代码随想录
爬楼梯(plus) 一步一个台阶,两个台阶,三个台阶,…,直到 m个台阶。问有多少种不同的方法可以爬到楼顶呢? 1阶,2阶,… m阶就是物品,楼顶就是背包。每一阶可以重复使用,例如…...
阿里云创始人王坚:云计算和GPT的关系,就是电和电机的关系
10月31日,在2023云栖大会,中国工程院院士、阿里云创始人王坚以《云计算的第三次浪潮》为主题发表演讲,他认为人工智能和云计算的结合,带来云计算的第三次浪潮,它不会在一年、两年完成,它可能会给我们十年、…...

python爬取豆瓣电影Top250数据
本次爬虫案例使用Python语言编写,使用了requests库进行网页请求,使用了BeautifulSoup库进行网页解析,使用了openpyxl库进行数据的保存。 案例中的爬虫目标是豆瓣电影Top250,通过循环访问不同页面进行数据的爬取。在每个页面上&am…...

从深圳崛起的“机器之眼”:赴港乐动机器人的万亿赛道赶考路
进入2025年以来,尽管围绕人形机器人、具身智能等机器人赛道的质疑声不断,但全球市场热度依然高涨,入局者持续增加。 以国内市场为例,天眼查专业版数据显示,截至5月底,我国现存在业、存续状态的机器人相关企…...
【磁盘】每天掌握一个Linux命令 - iostat
目录 【磁盘】每天掌握一个Linux命令 - iostat工具概述安装方式核心功能基础用法进阶操作实战案例面试题场景生产场景 注意事项 【磁盘】每天掌握一个Linux命令 - iostat 工具概述 iostat(I/O Statistics)是Linux系统下用于监视系统输入输出设备和CPU使…...
【HTML-16】深入理解HTML中的块元素与行内元素
HTML元素根据其显示特性可以分为两大类:块元素(Block-level Elements)和行内元素(Inline Elements)。理解这两者的区别对于构建良好的网页布局至关重要。本文将全面解析这两种元素的特性、区别以及实际应用场景。 1. 块元素(Block-level Elements) 1.1 基本特性 …...

selenium学习实战【Python爬虫】
selenium学习实战【Python爬虫】 文章目录 selenium学习实战【Python爬虫】一、声明二、学习目标三、安装依赖3.1 安装selenium库3.2 安装浏览器驱动3.2.1 查看Edge版本3.2.2 驱动安装 四、代码讲解4.1 配置浏览器4.2 加载更多4.3 寻找内容4.4 完整代码 五、报告文件爬取5.1 提…...
【Java学习笔记】BigInteger 和 BigDecimal 类
BigInteger 和 BigDecimal 类 二者共有的常见方法 方法功能add加subtract减multiply乘divide除 注意点:传参类型必须是类对象 一、BigInteger 1. 作用:适合保存比较大的整型数 2. 使用说明 创建BigInteger对象 传入字符串 3. 代码示例 import j…...
在Ubuntu24上采用Wine打开SourceInsight
1. 安装wine sudo apt install wine 2. 安装32位库支持,SourceInsight是32位程序 sudo dpkg --add-architecture i386 sudo apt update sudo apt install wine32:i386 3. 验证安装 wine --version 4. 安装必要的字体和库(解决显示问题) sudo apt install fonts-wqy…...

力扣热题100 k个一组反转链表题解
题目: 代码: func reverseKGroup(head *ListNode, k int) *ListNode {cur : headfor i : 0; i < k; i {if cur nil {return head}cur cur.Next}newHead : reverse(head, cur)head.Next reverseKGroup(cur, k)return newHead }func reverse(start, end *ListNode) *ListN…...
日常一水C
多态 言简意赅:就是一个对象面对同一事件时做出的不同反应 而之前的继承中说过,当子类和父类的函数名相同时,会隐藏父类的同名函数转而调用子类的同名函数,如果要调用父类的同名函数,那么就需要对父类进行引用&#…...
小木的算法日记-多叉树的递归/层序遍历
🌲 从二叉树到森林:一文彻底搞懂多叉树遍历的艺术 🚀 引言 你好,未来的算法大神! 在数据结构的世界里,“树”无疑是最核心、最迷人的概念之一。我们中的大多数人都是从 二叉树 开始入门的,它…...

【1】跨越技术栈鸿沟:字节跳动开源TRAE AI编程IDE的实战体验
2024年初,人工智能编程工具领域发生了一次静默的变革。当字节跳动宣布退出其TRAE项目(一款融合大型语言模型能力的云端AI编程IDE)时,技术社区曾短暂叹息。然而这一退场并非终点——通过开源社区的接力,TRAE在WayToAGI等…...