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

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>-->
<!--                            &lt;!&ndash; getOnlyElement is more readable than the stream analogue &ndash;&gt;-->
<!--                            <exclusion>com/google/common/collect/Iterables.getOnlyElement:(Ljava/lang/Iterable;)Ljava/lang/Object;</exclusion>-->
<!--                            &lt;!&ndash; getLast has lower complexity for array based lists than the stream analogue (O(1) vs O(log(N)) &ndash;&gt;-->
<!--                            <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>-->
<!--                            &lt;!&ndash; TODO: requires getting to common understanding which of those we want to enable &ndash;&gt;-->
<!--                            <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>-->
<!--                            &lt;!&ndash; com.google.common.io.BaseEncoding.base64 provides more reach interfaces than java.util.Base64 &ndash;&gt;-->
<!--                            <exclusion>com/google/common/io/BaseEncoding.base64:()Lcom/google/common/io/BaseEncoding;</exclusion>--><!--                            &lt;!&ndash; disable default modernizer violation &ndash;&gt;-->
<!--                            <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 &#xff08;1&#xff09;版本&#xff1a;3.6.3 &#xff08;2&#xff09;settings.xml配置 <?xml version"1.0" encoding"UTF-8"?> <settin…...

java类和对象的思想概述

0.面向对象Object OOP——名人名言&#xff1a;类是写出来的&#xff0c;对象是new出来的 **> 学习面向对象的三条路线 java类以及类成员&#xff1a;&#xff08;重点&#xff09;类成员——属性、方法、构造器、&#xff08;熟悉&#xff09;代码块、内部类面向对象特征&…...

ant design vue3中引入message消息提示,全局引入亲测有效

两种方式 第一种&#xff1a;使用provide和inject方式 第二种&#xff1a;使用全局挂载$message方式 第一种&#xff1a; //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. 总体想法&#xff1a; 制作GIS地形&#xff0c;使用Landscaping MapBox是一个好方法&#xff0c;但是区域过大&#xff0c;会占用很多内存 https://blog.csdn.net/qq_17523181/article/details/135029614 如果采用QGis&#xff0c;导出卫星图&#xff0c;在UE5里拼合出地形…...

opencv入门到精通——改变颜色空间

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

法线贴图实现地形模型皱褶、凹凸不平的纹理效果

在线工具推荐&#xff1a; 3D数字孪生场景编辑器 - GLTF/GLB材质纹理编辑器 - 3D模型在线转换 - Three.js AI自动纹理开发包 - YOLO 虚幻合成数据生成器 - 三维模型预览图生成器 - 3D模型语义搜索引擎 法线贴图在3D建模中扮演着重要的角色&#xff0c;它通过模拟表面的微…...

【SpringBoot篇】基于Redis实现生成全局唯一ID的方法

文章目录 &#x1f354;生成全局唯一ID&#x1f339;为什么要生成全局唯一id&#x1f33a;生成全局id的方法✨代码实现 &#x1f354;生成全局唯一ID 是一种在分布式系统下用来生成全局唯一id的工具 在项目中生成全局唯一ID有很多好处&#xff0c;其中包括&#xff1a; 数据…...

轻度听力损失的儿童需要早期干预吗?

一些宝宝在做听力筛查时总是不通过&#xff0c;进一步听力诊断发现宝宝有轻度的听力损失&#xff0c;刚知道这个消息时&#xff0c;家长可担心了&#xff0c;总想着宝宝是不是听不到啊&#xff1f;但是一段时间后&#xff0c;有些家长又会忽略宝宝的听力问题&#xff0c;因为部…...

【Spring Security】认证密码加密Token令牌CSRF的使用详解

&#x1f389;&#x1f389;欢迎来到我的CSDN主页&#xff01;&#x1f389;&#x1f389; &#x1f3c5;我是Java方文山&#xff0c;一个在CSDN分享笔记的博主。&#x1f4da;&#x1f4da; &#x1f31f;推荐给大家我的专栏《Spring Security》。&#x1f3af;&#x1f3af; …...

python一点通: 一文讲清Post 和 Put操作区别!

当我们使用网络服务时&#xff0c;如果我们不能小心地区分 POST 和 PUT&#xff0c;有时可能会触发错误。 在 Web 开发世界中&#xff0c;特别是在处理 RESTful API 时&#xff0c;HTTP 方法 POST 和 PUT 经常被使用&#xff0c;但常常被误解。这两者都用于向服务器发送数据&a…...

通过 Higress Wasm 插件 3 倍性能实现 Spring-cloud-gateway 功能

作者&#xff1a;韦鑫&#xff0c;Higress Committer&#xff0c;来自南京航空航天大学分布式系统实验室 导读&#xff1a;本文将和大家一同回顾 Spring Cloud Gateway 是如何满足 HTTP 请求/响应转换需求场景的&#xff0c;并为大家介绍在这种场景下使用 Higress 云原生网关的…...

0.618算法和基于Armijo准则的线搜索回退法

0.618代码如下&#xff1a; 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)-项目配置和单步跟踪

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

.NET core 自定义过滤器 Filter 实现webapi RestFul 统一接口数据返回格式

之前写过使用自定义返回类的方式来统一接口数据返回格式&#xff0c;.Net Core webapi RestFul 统一接口数据返回格式-CSDN博客 但是这存在一个问题&#xff0c;不是所有接口会按照定义的数据格式返回&#xff0c;除非每个接口都返回我们自定义的类&#xff0c;这种实现起来不…...

vue3 使用addRoute动态添加路由,页面刷新就白屏解决办法

问题&#xff0c;通过接口动态添加路由&#xff0c;第一次从登录页跳转还是正常的&#xff0c;说明路由添加成功了&#xff0c;但是刷新后就白屏了&#xff0c;且控制台报错路由匹配不到&#xff0c;在项目的main.js&#xff0c;router和路由拦截器中添加了一大堆打印后发现&am…...

探索鸿蒙:了解华为鸿蒙操作系统的基础课程

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

【Linux】进程周边007之进程控制

&#x1f440;樊梓慕&#xff1a;个人主页 &#x1f3a5;个人专栏&#xff1a;《C语言》《数据结构》《蓝桥杯试题》《LeetCode刷题笔记》《实训项目》《C》《Linux》 &#x1f31d;每一个不曾起舞的日子&#xff0c;都是对生命的辜负 目录 前言 1.进程创建 2.进程终止 2.…...

【C++】vector容器的模拟实现

目录 一&#xff0c;框架设计 二&#xff0c;构造函数 三&#xff0c;析构函数 四&#xff0c;赋值运算符 五&#xff0c;容器接口的实现 1&#xff0c;迭代器实现 2&#xff0c;“ [] ”运算符的实现 3&#xff0c;swap交换和resize重设大小 4&#xff0c;insert插入…...

华为Harmony——ArkTs语言

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

uniapp使用colorUI

colorUI 微动画 | ColorUI 使用文档 1&#xff1a;把colorui里三个文件复制到自己项目中去 App.vue </script> <style> import url(colorui/icon.css); import url(colorui/main.css); import url("colorui/animation.css");-webkit-keyframes show {…...

国防科技大学计算机基础课程笔记02信息编码

1.机内码和国标码 国标码就是我们非常熟悉的这个GB2312,但是因为都是16进制&#xff0c;因此这个了16进制的数据既可以翻译成为这个机器码&#xff0c;也可以翻译成为这个国标码&#xff0c;所以这个时候很容易会出现这个歧义的情况&#xff1b; 因此&#xff0c;我们的这个国…...

docker详细操作--未完待续

docker介绍 docker官网: Docker&#xff1a;加速容器应用程序开发 harbor官网&#xff1a;Harbor - Harbor 中文 使用docker加速器: Docker镜像极速下载服务 - 毫秒镜像 是什么 Docker 是一种开源的容器化平台&#xff0c;用于将应用程序及其依赖项&#xff08;如库、运行时环…...

【快手拥抱开源】通过快手团队开源的 KwaiCoder-AutoThink-preview 解锁大语言模型的潜力

引言&#xff1a; 在人工智能快速发展的浪潮中&#xff0c;快手Kwaipilot团队推出的 KwaiCoder-AutoThink-preview 具有里程碑意义——这是首个公开的AutoThink大语言模型&#xff08;LLM&#xff09;。该模型代表着该领域的重大突破&#xff0c;通过独特方式融合思考与非思考…...

DIY|Mac 搭建 ESP-IDF 开发环境及编译小智 AI

前一阵子在百度 AI 开发者大会上&#xff0c;看到基于小智 AI DIY 玩具的演示&#xff0c;感觉有点意思&#xff0c;想着自己也来试试。 如果只是想烧录现成的固件&#xff0c;乐鑫官方除了提供了 Windows 版本的 Flash 下载工具 之外&#xff0c;还提供了基于网页版的 ESP LA…...

SpringBoot+uniapp 的 Champion 俱乐部微信小程序设计与实现,论文初版实现

摘要 本论文旨在设计并实现基于 SpringBoot 和 uniapp 的 Champion 俱乐部微信小程序&#xff0c;以满足俱乐部线上活动推广、会员管理、社交互动等需求。通过 SpringBoot 搭建后端服务&#xff0c;提供稳定高效的数据处理与业务逻辑支持&#xff1b;利用 uniapp 实现跨平台前…...

【C语言练习】080. 使用C语言实现简单的数据库操作

080. 使用C语言实现简单的数据库操作 080. 使用C语言实现简单的数据库操作使用原生APIODBC接口第三方库ORM框架文件模拟1. 安装SQLite2. 示例代码:使用SQLite创建数据库、表和插入数据3. 编译和运行4. 示例运行输出:5. 注意事项6. 总结080. 使用C语言实现简单的数据库操作 在…...

Android15默认授权浮窗权限

我们经常有那种需求&#xff0c;客户需要定制的apk集成在ROM中&#xff0c;并且默认授予其【显示在其他应用的上层】权限&#xff0c;也就是我们常说的浮窗权限&#xff0c;那么我们就可以通过以下方法在wms、ams等系统服务的systemReady()方法中调用即可实现预置应用默认授权浮…...

有限自动机到正规文法转换器v1.0

1 项目简介 这是一个功能强大的有限自动机&#xff08;Finite Automaton, FA&#xff09;到正规文法&#xff08;Regular Grammar&#xff09;转换器&#xff0c;它配备了一个直观且完整的图形用户界面&#xff0c;使用户能够轻松地进行操作和观察。该程序基于编译原理中的经典…...

代理篇12|深入理解 Vite中的Proxy接口代理配置

在前端开发中,常常会遇到 跨域请求接口 的情况。为了解决这个问题,Vite 和 Webpack 都提供了 proxy 代理功能,用于将本地开发请求转发到后端服务器。 什么是代理(proxy)? 代理是在开发过程中,前端项目通过开发服务器,将指定的请求“转发”到真实的后端服务器,从而绕…...

C# 求圆面积的程序(Program to find area of a circle)

给定半径r&#xff0c;求圆的面积。圆的面积应精确到小数点后5位。 例子&#xff1a; 输入&#xff1a;r 5 输出&#xff1a;78.53982 解释&#xff1a;由于面积 PI * r * r 3.14159265358979323846 * 5 * 5 78.53982&#xff0c;因为我们只保留小数点后 5 位数字。 输…...