使用Docker搭建本地Nexus私有仓库

0-1开始Java语言编程之路
一、Ubuntu下Java语言环境搭建
二、Ubuntu下Docker环境安装
三、使用Docker搭建本地Nexus Maven私有仓库
四、Ubuntu下使用VisualStudioCode进行Java开发

你需要Nexus

Java应用编译构建的一种主流方式就是通过Maven, Maven可以很方便的管理Java应用的各种依赖包。但是在默认情况下,maven在进行java应用编译的时候,会从maven远程仓库下载相应的依赖包。Maven公共仓库是在国外的,网络不好的情况下,依赖包的下载会相当的耗时,这时私有库就派上了用场。

通过Docker 快速搭建Nexus私有仓库

Nexus是一款开源的私有仓库,他们也提供了官方的docker镜像,使用docker部署起来非常的方便,不过也有一些小细节需要我们注意,下面我们一步一步来搭建这个本地私用库吧。

拉取最新Nexus镜像

docker pull sonatype/nexus3docker images
REPOSITORY                    TAG            IMAGE ID       CREATED         SIZE
prom/prometheus-linux-amd64   latest         051cb67876a6   6 days ago      262MB
apache/apisix                 3.9.0-debian   5e90db4294cd   2 weeks ago     326MB
sonatype/nexus3               latest         b630de26992b   4 months ago    570MB
hello-world                   latest         d2c94e258dcb   11 months ago   13.3kB
bitnami/etcd                  3.5.7          985a23c47893   12 months ago   146MB

我们可以看到 sonatype/nexus3这个镜像,570MB大小,所以下载的时候,需要一些时间,请大家耐心等待。

创建nexus数据卷

Nexus需要从远程仓库同步依赖库,所以需要持久化存储这些依赖库到本地,因此我们需要选创建一个数据卷。

另外,在Nexus第一次启动时,会在数据卷中创建初始密码文件,我们需要查看该文件,获得初始密码我们才能进行进一步的Nexus初始化工作。

#创建一个名为 nexus-data的数据卷
docker volume create --name nexus3#查看数据卷信息
docker volume inspect nexus3
[{"CreatedAt": "2024-04-17T16:32:30+08:00","Driver": "local","Labels": null,"Mountpoint": "/var/lib/docker/volumes/nexus3/_data","Name": "nexus3","Options": null,"Scope": "local"}
]root@txzq1899-ubuntu: cd /var/lib/docker/volumes/nexus3/_data
root@txzq1899-ubuntu:/var/lib/docker/volumes/nexus3/_data# pwd
/var/lib/docker/volumes/nexus3/_data
root@txzq1899-ubuntu:/var/lib/docker/volumes/nexus3/_data# ll
总计 80
drwxr-xr-x  14  200  200  4096  417 16:34 ./
drwx-----x   3 root root  4096  417 16:32 ../
-rw-r--r--   1  200  200    36  417 16:33 admin.password
drwxr-xr-x   3  200  200  4096  417 16:34 blobs/
drwxr-xr-x 336  200  200 12288  417 16:33 cache/
drwxr-xr-x   7  200  200  4096  417 16:33 db/
drwxr-xr-x   3  200  200  4096  417 16:34 elasticsearch/
drwxr-xr-x   3  200  200  4096  417 16:33 etc/
drwxr-xr-x   2  200  200  4096  417 16:33 generated-bundles/
drwxr-xr-x   2  200  200  4096  417 16:33 instances/
-rw-r--r--   1  200  200     1  417 16:33 karaf.pid
drwxr-xr-x   3  200  200  4096  417 16:33 keystores/
-rw-r--r--   1  200  200    14  417 16:33 lock
drwxr-xr-x   3  200  200  4096  417 16:34 log/
drwxr-xr-x   2  200  200  4096  417 16:33 orient/
-rw-r--r--   1  200  200     5  417 16:33 port
drwxr-xr-x   2  200  200  4096  417 16:33 restore-from-backup/
drwxr-xr-x   7  200  200  4096  417 16:34 tmp/
root@txzq1899-ubuntu:/var/lib/docker/volumes/nexus3/_data# 

这里要注意docker默认将数据卷存放在
/var/lib/docker/volumes 目录,而这个目录需要root权限才能访问。

创建并运行Nexus容器

  • –name nexus3
    • 指定容器名称为 nexus3
  • -e NEXUS_CONTEXT=nexus
    • 指定访问上下文,即通过http://localhost:8081/nexus访问
  • INSTALL4J_ADD_VM_PARAMS
    • 调整JVM参数
  • -v nexus3:/nexus-data
    • 映射数据卷
docker run -d -p 8081:8081 \--name nexus3 -e NEXUS_CONTEXT=nexus \-e INSTALL4J_ADD_VM_PARAMS="-Xms1024m -Xmx1024m -XX:MaxDirectMemorySize=1024m" \-v nexus3:/nexus-data \sonatype/nexus3 

查看容器日志

#Nexus 初次启动会比较慢,我们可以查看nexus3的容器日志。
#当我们看到 Started Sonatype Nexus OSS 3.63.0-01 
#就表示Nexus 已经启动成功了。
docker logs -f nexus3
2024-04-17 08:34:21,619+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.siesta.SiestaServlet - JAX-RS RuntimeDelegate: org.sonatype.nexus.siesta.internal.resteasy.SisuResteasyProviderFactory@2cba0cc4
2024-04-17 08:34:21,663+0000 INFO  [jetty-main-1] *SYSTEM org.jboss.resteasy.plugins.validation.i18n - RESTEASY008550: Unable to find CDI supporting ValidatorFactory. Using default ValidatorFactory
2024-04-17 08:34:23,205+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.siesta.SiestaServlet - Initialized
2024-04-17 08:34:23,215+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Initialized
2024-04-17 08:34:23,240+0000 INFO  [FelixStartLevel] *SYSTEM org.sonatype.nexus.extender.NexusLifecycleManager - Start TASKS
2024-04-17 08:34:23,279+0000 INFO  [jetty-main-1] *SYSTEM org.eclipse.jetty.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@1705e4a6{Sonatype Nexus,/nexus,file:///opt/sonatype/nexus/public/,AVAILABLE}
2024-04-17 08:34:23,404+0000 INFO  [jetty-main-1] *SYSTEM org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@195ab70a{HTTP/1.1, (http/1.1)}{0.0.0.0:8081}
2024-04-17 08:34:23,405+0000 INFO  [jetty-main-1] *SYSTEM org.eclipse.jetty.server.Server - Started @81852ms
2024-04-17 08:34:23,407+0000 INFO  [jetty-main-1] *SYSTEM org.sonatype.nexus.bootstrap.jetty.JettyServer - 
-------------------------------------------------Started Sonatype Nexus OSS 3.63.0-01-------------------------------------------------
2024-04-17 08:34:23,413+0000 INFO  [FelixStartLevel] *SYSTEM org.sonatype.nexus.quartz.internal.task.QuartzTaskInfo - Task 'Metric aggregation' [content.usage.aggregation] : state=WAITING
2024-04-17 08:34:23,498+0000 INFO  [FelixStartLevel] *SYSTEM org.sonatype.nexus.scheduling.TaskSchedulerImpl - Task 'Metric aggregation' [content.usage.aggregation] scheduled: cron

访问Nexus

  • 先打开admin.password文件,复制初始密码

打开本地Nexus:
Local Nexus3

第一次登录Nexus
第一次登录后,会提示修改管理员密码

配置阿里云代理

进到Repository设置页面,点Create Rrepository,Repository 管理

这里我们选择《maven2 proxy》选择maven2 proxy

  • 输入Name : aliyun
  • Proxy 设置,输入Remote storage :
    • http://maven.aliyun.com/nexus/content/groups/public

保存配置
在这里插入图片描述

配置maven-public(group)

回到Repository管理页面,找到maven-public,并点击 maven-public进入编辑页面

  • 在Member repositories 左则 Available List中的aliyun 添加右则的 Members中,并将aliyun 上移至第一的位置。
  • 点Save进行保存
    在这里插入图片描述

测试验证

到这里本地的Nexus 私有库就已经基本上搭建好了。
在使用之前,首先要在maven的配置文件中使用我们本地的私有仓库

通常在~/.m2/目录下,有一个 setting.xml 文件,如果没有,请创建。

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.2.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.2.0 https://maven.apache.org/xsd/settings-1.2.0.xsd"><localRepository>/home/vian/Dev_Environment/maven_repository</localRepository><servers><server><id>maven-releases</id><username>nexus-user</username><password>hello-world</password></server><server><id>maven-snapshots</id><username>nexus-user</username><password>hello-world</password></server><server><id>nexus</id><username>nexus-user</username><password>hello-world</password></server><server><id>maven-central</id><username>nexus-user</username><password>hello-world</password></server></servers><mirrors><mirror><id>maven-default-http-blocker</id><mirrorOf>external:http:*</mirrorOf><name>Pseudo repository to mirror external repositories initially using HTTP.</name><url>http://0.0.0.0/</url><blocked>true</blocked></mirror><mirror><id>nexus</id><name>本地Nexus私有仓库镜像</name><url>http://localhost:8081/nexus/repository/maven-public/</url><mirrorOf>*,!spring-milestones</mirrorOf></mirror></mirrors><profiles><profile><id>txzq-dev</id><repositories><repository><id>nexus</id><name>Public Repositories</name><url>http://localhost:8081/nexus/repository/maven-public/</url><releases><enabled>true</enabled></releases></repository><repository><id>maven-central</id><name>Central Repositories</name><url>http://localhost:8081/nexus/repository/maven-central/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository><repository><id>maven-releases</id><name>Release Repositories</name><url>http://localhost:8081/nexus/repository/maven-releases/</url><releases><enabled>true</enabled></releases><snapshots><enabled>false</enabled></snapshots></repository><repository><id>maven-snapshots</id><name>Snapshot Repositories</name><url>http://localhost:8081/nexus/repository/maven-snapshots/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories></profile></profiles><activeProfiles><activeProfile>txzq-dev</activeProfile></activeProfiles>
</settings>

我们通过Visual Studio Code 创建一个SpringBoot 项目,并找开该项目。
在这里插入图片描述
打开一个终端,通过Maven进行一次编译

mvn clean install

查看编译过程,我们可以看到在repackage阶段,已经从本地nexus下载依赖包了。


vian@txzq1899-ubuntu:/media/vian/Work/Workspace/hello-world$ mvn clean install[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< com.txzq:hello-world >------------------------
[INFO] Building hello-world 0.0.1-SNAPSHOT
[INFO]   from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- clean:3.3.2:clean (default-clean) @ hello-world ---
[INFO] Deleting /media/vian/Work/Workspace/hello-world/target
[INFO] 
[INFO] --- resources:3.3.1:resources (default-resources) @ hello-world ---
[INFO] Copying 1 resource from src/main/resources to target/classes
[INFO] Copying 0 resource from src/main/resources to target/classes
[INFO] 
[INFO] --- compiler:3.11.0:compile (default-compile) @ hello-world ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 1 source file with javac [debug release 17] to target/classes
[INFO] 
[INFO] --- resources:3.3.1:testResources (default-testResources) @ hello-world ---
[INFO] skip non existing resourceDirectory /media/vian/Work/Workspace/hello-world/src/test/resources
[INFO] 
[INFO] --- compiler:3.11.0:testCompile (default-testCompile) @ hello-world ---
[INFO] Changes detected - recompiling the module! :dependency
[INFO] Compiling 1 source file with javac [debug release 17] to target/test-classes
[INFO] 
[INFO] --- surefire:3.1.2:test (default-test) @ hello-world ---
[INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
[INFO] 
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.txzq.helloworld.HelloWorldApplicationTests
19:28:21.256 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils -- Could not detect default configuration classes for test class [com.txzq.helloworld.HelloWorldApplicationTests]: HelloWorldApplicationTests does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
19:28:21.413 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper -- Found @SpringBootConfiguration com.txzq.helloworld.HelloWorldApplication for test class com.txzq.helloworld.HelloWorldApplicationTests.   ____          _            __ _ _/\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \\\/  ___)| |_)| | | | | || (_| |  ) ) ) )'  |____| .__|_| |_|_| |_\__, | / / / /=========|_|==============|___/=/_/_/_/:: Spring Boot ::                (v3.2.4)2024-04-17T19:28:21.903+08:00  INFO 183809 --- [hello-world] [           main] c.t.h.HelloWorldApplicationTests         : Starting HelloWorldApplicationTests using Java 17.0.9 with PID 183809 (started by vian in /media/vian/Work/Workspace/hello-world)
2024-04-17T19:28:21.905+08:00  INFO 183809 --- [hello-world] [           main] c.t.h.HelloWorldApplicationTests         : No active profile set, falling back to 1 default profile: "default"
2024-04-17T19:28:23.656+08:00  INFO 183809 --- [hello-world] [           main] c.t.h.HelloWorldApplicationTests         : Started HelloWorldApplicationTests in 2.067 seconds (process running for 3.35)
Java HotSpot(TM) 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 3.697 s -- in com.txzq.helloworld.HelloWorldApplicationTests
[INFO] 
[INFO] Results:
[INFO] 
[INFO] Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
[INFO] 
[INFO] 
[INFO] --- jar:3.3.0:jar (default-jar) @ hello-world ---
[INFO] Building jar: /media/vian/Work/Workspace/hello-world/target/hello-world-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- spring-boot:3.2.4:repackage (repackage) @ hello-world ---
Downloading from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-buildpack-platform/3.2.4/spring-boot-buildpack-platform-3.2.4.pom
Downloaded from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-buildpack-platform/3.2.4/spring-boot-buildpack-platform-3.2.4.pom (3.2 kB at 2.7 kB/s)
Downloading from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-loader-tools/3.2.4/spring-boot-loader-tools-3.2.4.pom
Downloaded from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-loader-tools/3.2.4/spring-boot-loader-tools-3.2.4.pom (2.2 kB at 4.7 kB/s)
Downloading from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-buildpack-platform/3.2.4/spring-boot-buildpack-platform-3.2.4.jar
Downloaded from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-buildpack-platform/3.2.4/spring-boot-buildpack-platform-3.2.4.jar (272 kB at 331 kB/s)
Downloading from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-loader-tools/3.2.4/spring-boot-loader-tools-3.2.4.jar
Downloaded from nexus: http://localhost:8081/nexus/repository/maven-public/org/springframework/boot/spring-boot-loader-tools/3.2.4/spring-boot-loader-tools-3.2.4.jar (434 kB at 732 kB/s)
[INFO] Replacing main artifact /media/vian/Work/Workspace/hello-world/target/hello-world-0.0.1-SNAPSHOT.jar with repackaged archive, adding nested dependencies in BOOT-INF/.
[INFO] The original artifact has been renamed to /media/vian/Work/Workspace/hello-world/target/hello-world-0.0.1-SNAPSHOT.jar.original
[INFO] 
[INFO] --- install:3.1.1:install (default-install) @ hello-world ---
[INFO] Installing /media/vian/Work/Workspace/hello-world/pom.xml to /home/vian/Dev_Environment/maven_repository/com/txzq/hello-world/0.0.1-SNAPSHOT/hello-world-0.0.1-SNAPSHOT.pom
[INFO] Installing /media/vian/Work/Workspace/hello-world/target/hello-world-0.0.1-SNAPSHOT.jar to /home/vian/Dev_Environment/maven_repository/com/txzq/hello-world/0.0.1-SNAPSHOT/hello-world-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  12.542 s
[INFO] Finished at: 2024-04-17T19:28:29+08:00
[INFO] ------------------------------------------------------------------------

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

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

相关文章

全国832个贫困县名单及精准扶贫脱贫(摘帽名单)数据(2016-2020.11)

01、数据简介 自党的十八大以来&#xff0c;我国脱贫攻坚战取得了举世瞩目的伟大胜利。经过全党全国各族人民的共同努力&#xff0c;现行标准下9899万农村贫困人口全部脱贫&#xff0c;832个贫困县全部摘帽&#xff0c;12.8万个贫困村全部出列&#xff0c;区域性整体贫困得到解…

金融风控信用评分卡建模(Kaggle give me credit数据集)

1 数据预处理数据 数据来源于Kaggle的Give Me Some Credit&#xff0c;包括25万条个人财务情况的样本数据 1.1 导包读数据 import pandas as pd import numpy as np import matplotlib.pyplot as plt from sklearn.ensemble import RandomForestRegressor import seaborn as …

Excel图表智能排序

实例需求&#xff1a;表格中的多个图表如下图左侧所示&#xff0c;对于表格进行排序时&#xff0c;希望第一列中的图表跟随相应数据。 方法1&#xff1a; Sub SortTableWithChart()Dim oSht As Worksheet, RowCnt As Long, ColCnt As LongDim arrData, i As Long, oCht As Cha…

基于STM32CubeMX的嵌入式开发基础

内部没有上拉电阻&#xff0c;外部就要加一个 上拉或者下拉电阻&#xff0c;最基本上的作用是将状态不确定的信号通过一个电阻将其稳定在高电平或低电平 上拉下拉其实起的是稳定电平的作用 问题&#xff1a;单片机的外围电路设计及程序编写大多是以低电平有效来驱动电路的&…

【主流电商API接口数据采集】聚合电商API接口平台:让数据成为生产力!

API接口接入测试||文档 随着数字化商业时代的到来&#xff0c;API接口已成为电商资源连接利器&#xff0c;也是全球传统互联网企业转型的基础。 2021年 Google Cloud 研究显示&#xff0c;全球互联网企业近3/4的企业持续投入数字化转型&#xff0c;2/3的企业在持续增加投入&a…

轻松学会微信小程序开发(一)

✨✨ 欢迎大家来到景天科技苑✨✨ &#x1f388;&#x1f388; 养成好习惯&#xff0c;先赞后看哦~&#x1f388;&#x1f388; &#x1f3c6; 作者简介&#xff1a;景天科技苑 &#x1f3c6;《头衔》&#xff1a;大厂架构师&#xff0c;华为云开发者社区专家博主&#xff0c;…

Java进阶-Stream流

概述 在Java8中&#xff0c;得益于lambda所带来的函数式编程&#xff0c;引入了一个全新的Stream流的概念目的&#xff1a;用于简化集合和数组操作的api 案例 需求&#xff1a;创建一个集合存储多个字符串元素&#xff0c;将集合中所有以“z”开头的元素存储到新的集合中&am…

Torch 模型 感受野可视化

前言&#xff1a;感受野是卷积神经网络 (CNN) 中一个重要的概念&#xff0c;它表示 CNN 每一层输出的特征图上的像素点在输入图像上映射的区域。感受野的大小和形状直接影响到网络对输入图像的感知范围和精度&#xff0c;进而调整网络结构、卷积核大小和步长等参数&#xff0c;…

javaweb-maven

前端HTML,CSS,JS,Vue&#xff0c;Element&#xff0c;Nginx最后去复习&#xff0c; Java开发工程师 主要学习方向是服务端 所以进入javaweb的服务端的第一个知识点 maven 什么是maven 用于管理和构建java项目的工具 maven的官方网站 Maven – Welcome to Apache Maven …

Flink面试(1)

1.Flink 的并行度的怎么设置的&#xff1f; Flink设置并行度的几种方式 1.代码中设置setParallelism() 全局设置&#xff1a; 1 env.setParallelism(3);  算子设置&#xff08;部分设置&#xff09;&#xff1a; 1 sum(1).setParallelism(3) 2.客户端CLI设置&#xff0…

邀请全球创作者参与 The Sandbox 创作者训练营

作为首屈一指的元宇宙平台之一&#xff0c;The Sandbox 的使命是成为全球创作者的中心。随着我们对 Game Maker 的不断改进、旨在激发创作者灵感的定期 Game Jams、革命性的 "创作者挑战 "以及众多其他活动的开展&#xff0c;我们见证了大量个人加入我们充满活力的创…

opencv_5_图像像素的算术操作

方法1&#xff1a;调用库函数 void ColorInvert::mat_operator(Mat& image) { Mat dst; Mat m Mat::zeros(image.size(), image.type()); m Scalar(2, 2, 2); multiply(image, m, dst); m1 Scalar(50,50, 50); //divide(image, m, dst); //add(im…

WordPress social-warfare插件XSS和RCE漏洞【CVE-2019-9978】

WordPress social-warfare插件XSS和RCE漏洞 ~~ 漏洞编号 : CVE-2019-9978 影响版本 : WordPress social-warfare < 3.5.3 漏洞描述 : WordPress是一套使用PHP语言开发的博客平台&#xff0c;该平台支持在PHP和MySQL的服务器上架设个人博客网站。social-warfare plugin是使用…

AIGC元年大模型发展现状手册

零、AIGC大模型概览 AIGC大模型在人工智能领域取得了重大突破&#xff0c;涵盖了LLM大模型、多模态大模型、图像生成大模型以及视频生成大模型等四种类型。这些模型不仅拓宽了人工智能的应用范围&#xff0c;也提升了其处理复杂任务的能力。a.) LLM大模型通过深度学习和自然语…

MSR是个什么寄存器

MSR 这种寄存器专门用于调试、程序执行跟踪、计算机性能监控、简化软件编程、电源控制等等各种实验性功能。 什么是 MSR MSR 的概念是不易理解&#xff0c;所以这一节只说一些 MSR 的外在&#xff0c;比如形容和指令等&#xff0c;然后展开说说&#xff0c;看完整篇文章你应该…

计算机视觉 CV 八股分享 [自用](更新中......)

目录 一、深度学习中解决过拟合方法 二、深度学习中解决欠拟合方法 三、梯度消失和梯度爆炸 解决梯度消失的方法 解决梯度爆炸的方法 四、神经网络权重初始化方法 五、梯度下降法 六、BatchNorm 七、归一化方法 八、卷积 九、池化 十、激活函数 十一、预训练 十二…

【uniapp】 合成海报组件

之前公司的同事写过一个微信小程序用的 合成海报的组件 非常十分好用 最近的项目是uni的 把组件改造一下也可以用 记录一下 <template><view><canvas type"2d" class"_mycanvas" id"my-canvas" canvas-id"my-canvas" …

RT-Thread电源管理组件

电源管理组件 嵌入式系统低功耗管理的目的在于满足用户对性能需求的前提下&#xff0c;尽可能降低系统能耗以延长设备待机时间。 高性能与有限的电池能量在嵌入式系统中矛盾最为突出&#xff0c;硬件低功耗设计与软件低功耗管理的联合应用成为解决矛盾的有效手段。 现在的各种…

排序算法之桶排序

目录 一、简介二、代码实现三、应用场景 一、简介 算法平均时间复杂度最好时间复杂度最坏时间复杂度空间复杂度排序方式稳定性桶排序O(nk )O(nk)O(n^2)O(nk)Out-place稳定 稳定&#xff1a;如果A原本在B前面&#xff0c;而AB&#xff0c;排序之后A仍然在B的前面&#xff1b; 不…

Kotlin语法快速入门--条件控制和循环语句(2)

Kotlin语法入门–条件控制和循环语句&#xff08;2&#xff09; 文章目录 Kotlin语法入门--条件控制和循环语句&#xff08;2&#xff09;二、条件控制和循环语句1、if...else2、when2.1、常规用法2.2、特殊用法--并列&#xff1a;2.3、特殊用法--类型判断&#xff1a;2.4、特殊…