trino-435版本windows下源码编译
一、源码下载地址
https://github.com/trinodb/trino/tags
二、编译环境及工具准备
1、maven
(1)版本:3.6.3
(2)settings.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 http://maven.apache.org/xsd/settings-1.2.0.xsd"><localRepository>D:\maven\repo2</localRepository> <mirrors><mirror><id>alimaven</id><mirrorOf>central</mirrorOf><name>aliyun maven</name><url>https://maven.aliyun.com/repository/central/</url></mirror><mirror><id>alimaven</id><name>aliyun maven</name><url>http://maven.aliyun.com/nexus/content/groups/public/</url><mirrorOf>central</mirrorOf> </mirror></mirrors><profiles><profile><!-- maven使用jdk1.8 --> <id>jdk-1.8</id><!-- 开启jdk --> <activation><activeByDefault>true</activeByDefault><jdk>1.8</jdk></activation><properties><!-- 配置编译器信息 --><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion></properties></profile></profiles>
</settings>
2、jdk
版本:17.0.9
3、idea
版本:2023.2
三、源码编译配置
(1)取消插件:really-executable-jar-maven-plugin
(2)trino-root xml取消如下两个module
(3)trino-root xml取消scm
(4)trino-root xml取消如下配置
<!-- <plugin>-->
<!-- <groupId>org.skife.maven</groupId>-->
<!-- <artifactId>really-executable-jar-maven-plugin</artifactId>-->
<!-- <version>2.1.1</version>-->
<!-- </plugin>-->
<!-- <plugin>-->
<!-- <groupId>org.gaul</groupId>-->
<!-- <artifactId>modernizer-maven-plugin</artifactId>-->
<!-- <configuration>-->
<!-- <violationsFiles>-->
<!-- <violationsFile>${air.main.basedir}/.mvn/modernizer/violations.xml</violationsFile>-->
<!-- </violationsFiles>-->
<!-- <exclusionPatterns>-->
<!-- <exclusionPattern>org/joda/time/.*</exclusionPattern>-->
<!-- </exclusionPatterns>-->
<!-- <exclusions>-->
<!-- <!– getOnlyElement is more readable than the stream analogue –>-->
<!-- <exclusion>com/google/common/collect/Iterables.getOnlyElement:(Ljava/lang/Iterable;)Ljava/lang/Object;</exclusion>-->
<!-- <!– getLast has lower complexity for array based lists than the stream analogue (O(1) vs O(log(N)) –>-->
<!-- <exclusion>com/google/common/collect/Iterables.getLast:(Ljava/lang/Iterable;)Ljava/lang/Object;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.getLast:(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;</exclusion>-->
<!-- <!– TODO: requires getting to common understanding which of those we want to enable –>-->
<!-- <exclusion>com/google/common/collect/Iterables.transform:(Ljava/lang/Iterable;Lcom/google/common/base/Function;)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Lists.transform:(Ljava/util/List;Lcom/google/common/base/Function;)Ljava/util/List;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.isEmpty:(Ljava/lang/Iterable;)Z</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.concat:(Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.concat:(Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.concat:(Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;Ljava/lang/Iterable;)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.concat:(Ljava/lang/Iterable;)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.all:(Ljava/lang/Iterable;Lcom/google/common/base/Predicate;)Z</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.any:(Ljava/lang/Iterable;Lcom/google/common/base/Predicate;)Z</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.skip:(Ljava/lang/Iterable;I)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.limit:(Ljava/lang/Iterable;I)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.get:(Ljava/lang/Iterable;I)Ljava/lang/Object;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.getFirst:(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.getLast:(Ljava/lang/Iterable;)Ljava/lang/Object;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.cycle:(Ljava/lang/Iterable;)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.cycle:([Ljava/lang/Object;)Ljava/lang/Iterable;</exclusion>-->
<!-- <exclusion>com/google/common/collect/Iterables.getOnlyElement:(Ljava/lang/Iterable;Ljava/lang/Object;)Ljava/lang/Object;</exclusion>-->
<!-- <!– com.google.common.io.BaseEncoding.base64 provides more reach interfaces than java.util.Base64 –>-->
<!-- <exclusion>com/google/common/io/BaseEncoding.base64:()Lcom/google/common/io/BaseEncoding;</exclusion>--><!-- <!– disable default modernizer violation –>-->
<!-- <exclusion>com/google/inject/Provider</exclusion>-->
<!-- </exclusions>-->
<!-- </configuration>-->
<!-- </plugin>-->
(4)取消maven-enforcer-plugin配置
(5)配置maven插件
四、profiles配置
取消dependency-scope-check、duplicate-finder-check两个配置,防止maven install时因依赖冲突或jar依赖相关问题的出现在这里插入图片描述](https://img-blog.csdnimg.cn/direct/c4754f121fbb4d7a82b682390f7dae3c.png)
五、启动类配置
Trino comes with sample configuration that should work out-of-the-box for development. Use the following options to create a run configuration:
Main Class: io.trino.server.DevelopmentServer
VM Options: -ea -Dconfig=etc/config.properties -Dlog.levels-file=etc/log.properties -Djdk.attach.allowAttachSelf=true
Working directory: $MODULE_DIR$
Use classpath of module: trino-server-dev
The working directory should be the trino-server-dev subdirectory. In IntelliJ, using $MODULE_DIR$ accomplishes this automatically.
If VM options doesn’t exist in the dialog, you need to select Modify options and enable Add VM options
六、代码修改
由于trino源码支持的构建环境为Max OS X or Linux,因此需要适配windows环境,代码修改如下:
(1)修改方法: io.trino.server.TrinoSystemRequirements.verifyOsArchitecture,将failRequirement改为警告形式warnRequirement
warnRequirement("Trino requires Linux or Mac OS X (found %s)", osName);
(2)修改方法: io.trino.server.TrinoSystemRequirements.verifyFileDescriptor,增加windows环境判断
private static void verifyFileDescriptor(){String osName = StandardSystemProperty.OS_NAME.value();OptionalLong maxFileDescriptorCount = getMaxFileDescriptorCount();if ("Windows 10".equals(osName)) {maxFileDescriptorCount=OptionalLong.of(100000);} if (maxFileDescriptorCount.isEmpty()) {// This should never happen since we have verified the OS and JVM abovefailRequirement("Cannot read OS file descriptor limit");}if (maxFileDescriptorCount.getAsLong() < MIN_FILE_DESCRIPTORS) {failRequirement("Trino requires at least %s file descriptors (found %s)", MIN_FILE_DESCRIPTORS, maxFileDescriptorCount.getAsLong());}if (maxFileDescriptorCount.getAsLong() < RECOMMENDED_FILE_DESCRIPTORS) {warnRequirement("Current OS file descriptor limit is %s. Trino recommends at least %s", maxFileDescriptorCount.getAsLong(), RECOMMENDED_FILE_DESCRIPTORS);}}
(3)io.trino.server.PluginDiscovery#discoverPlugins 适配windows
File file = artifact.getFile();if (!(file.getPath().endsWith("/target/classes")||file.getPath().endsWith("\\target\\classes"))) {throw new RuntimeException("Unexpected file for main artifact: " + file);}
(4)修改io.trino.server.PluginDiscovery#binaryName,适配windows系统
private static String binaryName(String javaName){String property=System.getProperty("os.name");if(property.trim().toLowerCase().contains("windows")){return javaName.replace('.','\\');}return javaName.replace('.', '/');}
(5)修改io.trino.server.PluginDiscovery#javaName适配windows系统
private static String javaName(String binaryName){return binaryName.replace('/', '.').replace("\\",".");}
``
`
(6)由于阿里云仓库使用得是https,io.trino.server.HttpsArtifactResolve代码中写死的使用http因此需要重写此代码,使用阿里云仓库,将HttpsArtifactResolve复制一份替换阿里云仓库,并修改resolveArtifacts方法,代码如下:
package io.trino.server;
public class ArtifactResolverX {
public static final String USER_LOCAL_REPO = “D:\maven\repo2”;
public static final String MAVEN_CENTRAL_URI = “https://repo1.maven.org/maven2/”;
public static final String ALIYUN_MAVEN_CENTRAL_URI = "https://maven.aliyun.com/repository/public";public static final Set<String> DEPRECATED_MAVEN_CENTRAL_URIS = ImmutableSet.<String>builder().add("http://repo1.maven.org/maven2").add("http://repo1.maven.org/maven2/").add("http://repo.maven.apache.org/maven2").add("http://repo.maven.apache.org/maven2/").build();private final RepositorySystem repositorySystem;private final MavenRepositorySystemSession repositorySystemSession;private final List<RemoteRepository> repositories;public ArtifactResolverX(String localRepositoryDir, String...remoteRepositoryUris){this(localRepositoryDir, Arrays.asList(remoteRepositoryUris));}public ArtifactResolverX(String localRepositoryDir, List < String > remoteRepositoryUris){MavenServiceLocator locator = new MavenServiceLocator();locator.addService(RepositoryConnectorFactory.class, FileRepositoryConnectorFactory.class);locator.addService(RepositoryConnectorFactory.class, AsyncRepositoryConnectorFactory.class);repositorySystem = locator.getService(RepositorySystem.class);repositorySystemSession = new MavenRepositorySystemSession();LocalRepositoryManager localRepositoryManager = new SimpleLocalRepositoryManager(localRepositoryDir);repositorySystemSession.setLocalRepositoryManager(localRepositoryManager);repositorySystemSession.setTransferListener(new ConsoleTransferListener());repositorySystemSession.setRepositoryListener(new ConsoleRepositoryListener());List<RemoteRepository> repositories = new ArrayList<>(remoteRepositoryUris.size());int index = 0;for (String repositoryUri : remoteRepositoryUris) {repositories.add(new RemoteRepository("repo-" + index++, "default", repositoryUri));}this.repositories = Collections.unmodifiableList(repositories);}public List<Artifact> resolveArtifacts (Artifact...sourceArtifacts){return resolveArtifacts(Arrays.asList(sourceArtifacts));}public List<Artifact> resolveArtifacts (Iterable < ? extends Artifact > sourceArtifacts){CollectRequest collectRequest = new CollectRequest();for (Artifact sourceArtifact : sourceArtifacts) {collectRequest.addDependency(new Dependency(sourceArtifact, JavaScopes.RUNTIME));}for (RemoteRepository repository : repositories) {// Hack: avoid using deprecated Maven Central URLsif (DEPRECATED_MAVEN_CENTRAL_URIS.contains(repository.getUrl())) {repository = new RemoteRepository(repository.getId(), repository.getContentType(), MAVEN_CENTRAL_URI);}collectRequest.addRepository(repository);}DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, DependencyFilterUtils.classpathFilter(JavaScopes.RUNTIME));return resolveArtifacts(dependencyRequest);}public List<Artifact> resolvePom (File pomFile){if (pomFile == null) {throw new RuntimeException("pomFile is null");}MavenProject pom = getMavenProject(pomFile);Artifact rootArtifact = getProjectArtifact(pom);CollectRequest collectRequest = new CollectRequest();for (org.apache.maven.model.Dependency dependency : pom.getDependencies()) {collectRequest.addDependency(toAetherDependency(dependency));}// Hack: avoid using deprecated Maven Central URLs. The Central Repository no longer supports insecure// communication over plain HTTP.ImmutableList.Builder<RemoteRepository> allRepositories = ImmutableList.builder();for (RemoteRepository repository : pom.getRemoteProjectRepositories()) {if (DEPRECATED_MAVEN_CENTRAL_URIS.contains(repository.getUrl())) {repository = new RemoteRepository(repository.getId(), repository.getContentType(), MAVEN_CENTRAL_URI);}allRepositories.add(repository);}for (RemoteRepository repository : repositories) {if (DEPRECATED_MAVEN_CENTRAL_URIS.contains(repository.getUrl())) {repository = new RemoteRepository(repository.getId(), repository.getContentType(), MAVEN_CENTRAL_URI);}allRepositories.add(repository);}collectRequest.setRepositories(allRepositories.build());// Make sure we account for managed dependenciesif (pom.getDependencyManagement() != null) {for (org.apache.maven.model.Dependency managedDependency : pom.getDependencyManagement().getDependencies()) {collectRequest.addManagedDependency(toAetherDependency(managedDependency));}}DependencyRequest dependencyRequest = new DependencyRequest(collectRequest, DependencyFilterUtils.classpathFilter(JavaScopes.RUNTIME));List<Artifact> artifacts = resolveArtifacts(dependencyRequest);Map<String, Artifact> modules = getSiblingModules(pom).stream().collect(toMap(ArtifactResolverX::getArtifactKey, identity()));return Stream.concat(Stream.of(rootArtifact),artifacts.stream().map(artifact -> modules.getOrDefault(getArtifactKey(artifact), artifact))).collect(toImmutableList());}private MavenProject getMavenProject (File pomFile){try {PlexusContainer container = container();org.apache.maven.repository.RepositorySystem lrs = container.lookup(org.apache.maven.repository.RepositorySystem.class);ProjectBuilder projectBuilder = container.lookup(ProjectBuilder.class);ProjectBuildingRequest request = new DefaultProjectBuildingRequest();request.setSystemProperties(requiredSystemProperties());request.setRepositorySession(repositorySystemSession);request.setProcessPlugins(false);ArtifactRepository defaultLocalRepository = lrs.createDefaultLocalRepository();defaultLocalRepository.setUrl(USER_LOCAL_REPO);request.setLocalRepository(defaultLocalRepository);ArtifactRepository defaultRemoteRepository = lrs.createDefaultRemoteRepository();defaultRemoteRepository.setUrl(ALIYUN_MAVEN_CENTRAL_URI);request.setRemoteRepositories(Arrays.asList(new ArtifactRepository[]{defaultRemoteRepository}.clone()));ProjectBuildingResult result = projectBuilder.build(pomFile, request);return result.getProject();} catch (Exception e) {throw new RuntimeException("Error loading pom: " + pomFile.getAbsolutePath(), e);}}private Artifact getProjectArtifact (MavenProject pom){return new DefaultArtifact(pom.getArtifact().getGroupId(),pom.getArtifact().getArtifactId(),pom.getArtifact().getClassifier(),pom.getArtifact().getType(),pom.getArtifact().getVersion(),null,new File(pom.getModel().getBuild().getOutputDirectory()));}private List<Artifact> getSiblingModules (MavenProject module){if (!module.hasParent() || module.getParentFile() == null) {return ImmutableList.of();}// Parent exists and is a project reactorMavenProject parent = module.getParent();String parentDir = module.getParentFile().getParent();return parent.getModules().stream().map(moduleName -> new File(parentDir, moduleName + "/pom.xml")).filter(File::isFile).map(this::getMavenProject).map(this::getProjectArtifact).collect(toImmutableList());}/*** Returns a string identifying artifact by its maven coordinates.*/private static String getArtifactKey (Artifact artifact){return format("%s:%s:%s:%s", artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(), artifact.getClassifier());}private Properties requiredSystemProperties (){Properties properties = new Properties();properties.setProperty("java.version", System.getProperty("java.version"));return properties;}private Dependency toAetherDependency (org.apache.maven.model.Dependency dependency){Artifact artifact = new DefaultArtifact(dependency.getGroupId(), dependency.getArtifactId(), dependency.getClassifier(), dependency.getType(), dependency.getVersion());ImmutableList.Builder<Exclusion> exclusions = ImmutableList.builder();for (org.apache.maven.model.Exclusion exclusion : dependency.getExclusions()) {exclusions.add(new Exclusion(exclusion.getGroupId(), exclusion.getArtifactId(), null, "*"));}return new Dependency(artifact, dependency.getScope(), dependency.isOptional(), exclusions.build());}private List<Artifact> resolveArtifacts (DependencyRequest dependencyRequest){DependencyResult dependencyResult;try {dependencyResult = repositorySystem.resolveDependencies(repositorySystemSession, dependencyRequest);} catch (DependencyResolutionException e) {dependencyResult = e.getResult();}List<ArtifactResult> artifactResults = dependencyResult.getArtifactResults();List<Artifact> artifacts = new ArrayList<>(artifactResults.size());for (ArtifactResult artifactResult : artifactResults) {if (artifactResult.isMissing()) {artifacts.add(artifactResult.getRequest().getArtifact());} else {artifacts.add(artifactResult.getArtifact());}}return Collections.unmodifiableList(artifacts);}private static PlexusContainer container (){try {ClassWorld classWorld = new ClassWorld("plexus.core", Thread.currentThread().getContextClassLoader());ContainerConfiguration cc = new DefaultContainerConfiguration().setClassWorld(classWorld).setRealm(null).setName("maven");DefaultPlexusContainer container = new DefaultPlexusContainer(cc);// NOTE: To avoid inconsistencies, we'll use the Thread context class loader exclusively for lookupscontainer.setLookupRealm(null);container.setLoggerManager(new Slf4jLoggerManager());container.getLoggerManager().setThresholds(Logger.LEVEL_INFO);return container;} catch (PlexusContainerException e) {throw new RuntimeException("Error loading Maven system", e);}}
}
``
此外还需要修改下面的两个类,将HttpsArtifactResolver替换为ArtifactResolverX :
- io.trino.server.DevelopmentPluginsProvider
- io.trino.server.DevelopmentLoaderConfig
七、本地启动测试
1、启动服务
2、客户端连接
使用client/trino-cli下的jar,启动方式:java -jar trino-cli-435-executable.jar --server http://localhost:8080
3、执行命令
4、ui展示
登录只需填写用户名trino
相关文章:

trino-435版本windows下源码编译
一、源码下载地址 https://github.com/trinodb/trino/tags 二、编译环境及工具准备 1、maven (1)版本:3.6.3 (2)settings.xml配置 <?xml version"1.0" encoding"UTF-8"?> <settin…...

java类和对象的思想概述
0.面向对象Object OOP——名人名言:类是写出来的,对象是new出来的 **> 学习面向对象的三条路线 java类以及类成员:(重点)类成员——属性、方法、构造器、(熟悉)代码块、内部类面向对象特征&…...
ant design vue3中引入message消息提示,全局引入亲测有效
两种方式 第一种:使用provide和inject方式 第二种:使用全局挂载$message方式 第一种: //main.ts import { createApp } from vue; import App from ./App; import Antd,{ message } from ant-design-vue; import ant-design-vue/es/mess…...

UE5 Landscape 制作GIS卫星图地形
1. 总体想法: 制作GIS地形,使用Landscaping MapBox是一个好方法,但是区域过大,会占用很多内存 https://blog.csdn.net/qq_17523181/article/details/135029614 如果采用QGis,导出卫星图,在UE5里拼合出地形…...

opencv入门到精通——改变颜色空间
目录 目标 改变颜色空间 对象追踪 如何找到要追踪的HSV值? 目标 在本教程中,你将学习如何将图像从一个色彩空间转换到另一个,像BGR↔灰色,BGR↔HSV等 除此之外,我们还将创建一个应用程序,以提取视频中的…...

法线贴图实现地形模型皱褶、凹凸不平的纹理效果
在线工具推荐: 3D数字孪生场景编辑器 - GLTF/GLB材质纹理编辑器 - 3D模型在线转换 - Three.js AI自动纹理开发包 - YOLO 虚幻合成数据生成器 - 三维模型预览图生成器 - 3D模型语义搜索引擎 法线贴图在3D建模中扮演着重要的角色,它通过模拟表面的微…...

【SpringBoot篇】基于Redis实现生成全局唯一ID的方法
文章目录 🍔生成全局唯一ID🌹为什么要生成全局唯一id🌺生成全局id的方法✨代码实现 🍔生成全局唯一ID 是一种在分布式系统下用来生成全局唯一id的工具 在项目中生成全局唯一ID有很多好处,其中包括: 数据…...

轻度听力损失的儿童需要早期干预吗?
一些宝宝在做听力筛查时总是不通过,进一步听力诊断发现宝宝有轻度的听力损失,刚知道这个消息时,家长可担心了,总想着宝宝是不是听不到啊?但是一段时间后,有些家长又会忽略宝宝的听力问题,因为部…...

【Spring Security】认证密码加密Token令牌CSRF的使用详解
🎉🎉欢迎来到我的CSDN主页!🎉🎉 🏅我是Java方文山,一个在CSDN分享笔记的博主。📚📚 🌟推荐给大家我的专栏《Spring Security》。🎯🎯 …...
python一点通: 一文讲清Post 和 Put操作区别!
当我们使用网络服务时,如果我们不能小心地区分 POST 和 PUT,有时可能会触发错误。 在 Web 开发世界中,特别是在处理 RESTful API 时,HTTP 方法 POST 和 PUT 经常被使用,但常常被误解。这两者都用于向服务器发送数据&a…...

通过 Higress Wasm 插件 3 倍性能实现 Spring-cloud-gateway 功能
作者:韦鑫,Higress Committer,来自南京航空航天大学分布式系统实验室 导读:本文将和大家一同回顾 Spring Cloud Gateway 是如何满足 HTTP 请求/响应转换需求场景的,并为大家介绍在这种场景下使用 Higress 云原生网关的…...

0.618算法和基于Armijo准则的线搜索回退法
0.618代码如下: import math # 定义函数h(t) t^3 - 2t 1 def h(t): return t**3 - 2*t 1 # 0.618算法 def golden_section_search(a, b, epsilon): ratio 0.618 while (b - a) > epsilon: x1 b - ratio * (b - a) x2 a ratio * (b - a) h_…...

DPDK单步跟踪(3)-项目配置和单步跟踪
项目配置 下面都是示例的情况,请大家根据自己的工程来修改 ## 首先是配置CMake build setting Debug setting 这里最重要的是: –proc-type secondary 表示这是以secondary模式启动的dpdk客户端。 ## path mapping 然后根据自己的需要,配置…...

.NET core 自定义过滤器 Filter 实现webapi RestFul 统一接口数据返回格式
之前写过使用自定义返回类的方式来统一接口数据返回格式,.Net Core webapi RestFul 统一接口数据返回格式-CSDN博客 但是这存在一个问题,不是所有接口会按照定义的数据格式返回,除非每个接口都返回我们自定义的类,这种实现起来不…...
vue3 使用addRoute动态添加路由,页面刷新就白屏解决办法
问题,通过接口动态添加路由,第一次从登录页跳转还是正常的,说明路由添加成功了,但是刷新后就白屏了,且控制台报错路由匹配不到,在项目的main.js,router和路由拦截器中添加了一大堆打印后发现&am…...

探索鸿蒙:了解华为鸿蒙操作系统的基础课程
目录 学习目标: 学习内容: 学习时间: 学习产出: 介绍鸿蒙操作系统的起源和发展历程。 理解鸿蒙操作系统的核心概念和体系结构。 学习如何搭建和配置鸿蒙开发环境。 掌握基础的鸿蒙应用开发技术,包括应用的创建、…...

【Linux】进程周边007之进程控制
👀樊梓慕:个人主页 🎥个人专栏:《C语言》《数据结构》《蓝桥杯试题》《LeetCode刷题笔记》《实训项目》《C》《Linux》 🌝每一个不曾起舞的日子,都是对生命的辜负 目录 前言 1.进程创建 2.进程终止 2.…...
【C++】vector容器的模拟实现
目录 一,框架设计 二,构造函数 三,析构函数 四,赋值运算符 五,容器接口的实现 1,迭代器实现 2,“ [] ”运算符的实现 3,swap交换和resize重设大小 4,insert插入…...

华为Harmony——ArkTs语言
文章目录 一、简单示例二、声明式UI描述创建组件无参有参数 配置属性配置事件配置子组件 三、自定义组件基本用法基本结构成员函数/变量 一、简单示例 我们以一个具体的示例来说明ArkTS的基本组成。如下图所示,当开发者点击按钮时,文本内容从“Hello Wo…...

uniapp使用colorUI
colorUI 微动画 | ColorUI 使用文档 1:把colorui里三个文件复制到自己项目中去 App.vue </script> <style> import url(colorui/icon.css); import url(colorui/main.css); import url("colorui/animation.css");-webkit-keyframes show {…...
在鸿蒙HarmonyOS 5中实现抖音风格的点赞功能
下面我将详细介绍如何使用HarmonyOS SDK在HarmonyOS 5中实现类似抖音的点赞功能,包括动画效果、数据同步和交互优化。 1. 基础点赞功能实现 1.1 创建数据模型 // VideoModel.ets export class VideoModel {id: string "";title: string ""…...
Oracle查询表空间大小
1 查询数据库中所有的表空间以及表空间所占空间的大小 SELECTtablespace_name,sum( bytes ) / 1024 / 1024 FROMdba_data_files GROUP BYtablespace_name; 2 Oracle查询表空间大小及每个表所占空间的大小 SELECTtablespace_name,file_id,file_name,round( bytes / ( 1024 …...

376. Wiggle Subsequence
376. Wiggle Subsequence 代码 class Solution { public:int wiggleMaxLength(vector<int>& nums) {int n nums.size();int res 1;int prediff 0;int curdiff 0;for(int i 0;i < n-1;i){curdiff nums[i1] - nums[i];if( (prediff > 0 && curdif…...

04-初识css
一、css样式引入 1.1.内部样式 <div style"width: 100px;"></div>1.2.外部样式 1.2.1.外部样式1 <style>.aa {width: 100px;} </style> <div class"aa"></div>1.2.2.外部样式2 <!-- rel内表面引入的是style样…...
Java入门学习详细版(一)
大家好,Java 学习是一个系统学习的过程,核心原则就是“理论 实践 坚持”,并且需循序渐进,不可过于着急,本篇文章推出的这份详细入门学习资料将带大家从零基础开始,逐步掌握 Java 的核心概念和编程技能。 …...
4. TypeScript 类型推断与类型组合
一、类型推断 (一) 什么是类型推断 TypeScript 的类型推断会根据变量、函数返回值、对象和数组的赋值和使用方式,自动确定它们的类型。 这一特性减少了显式类型注解的需要,在保持类型安全的同时简化了代码。通过分析上下文和初始值,TypeSc…...

认识CMake并使用CMake构建自己的第一个项目
1.CMake的作用和优势 跨平台支持:CMake支持多种操作系统和编译器,使用同一份构建配置可以在不同的环境中使用 简化配置:通过CMakeLists.txt文件,用户可以定义项目结构、依赖项、编译选项等,无需手动编写复杂的构建脚本…...
命令行关闭Windows防火墙
命令行关闭Windows防火墙 引言一、防火墙:被低估的"智能安检员"二、优先尝试!90%问题无需关闭防火墙方案1:程序白名单(解决软件误拦截)方案2:开放特定端口(解决网游/开发端口不通)三、命令行极速关闭方案方法一:PowerShell(推荐Win10/11)方法二:CMD命令…...
C++ 类基础:封装、继承、多态与多线程模板实现
前言 C 是一门强大的面向对象编程语言,而类(Class)作为其核心特性之一,是理解和使用 C 的关键。本文将深入探讨 C 类的基本特性,包括封装、继承和多态,同时讨论类中的权限控制,并展示如何使用类…...
深入解析 ReentrantLock:原理、公平锁与非公平锁的较量
ReentrantLock 是 Java 中 java.util.concurrent.locks 包下的一个重要类,用于实现线程同步,支持可重入性,并且可以选择公平锁或非公平锁的实现方式。下面将详细介绍 ReentrantLock 的实现原理以及公平锁和非公平锁的区别。 ReentrantLock 实现原理 基本架构 ReentrantLo…...