配置 HTTP 代理 (HTTP proxy)

配置 HTTP 代理 [HTTP proxy]

  • 1. Proxies
  • 2. curl
    • 2.1. Environment
    • 2.2. Proxy protocol prefixes
  • 3. Use an HTTP proxy (使用 HTTP 代理)
    • 3.1. Using the examples (使用示例)
      • 3.1.1. Linux or macOS
      • 3.1.2. Windows Command Prompt
    • 3.2. Authenticating to a proxy (向代理进行身份验证)
      • 3.2.1. Linux or macOS
      • 3.2.2. Windows Command Prompt
  • 4. 配置 HTTP 代理 (HTTP proxy)
    • 4.1. Linux 系统配置 `http_proxy` 和 `https_proxy` 环境变量
    • 4.2. Windows 系统配置 `http_proxy` 和 `https_proxy` 环境变量
      • 4.2.1. cmd
      • 4.2.2. PowerShell
  • 5. 为 WSL2 (Windows Subsystem for Linux 2) 配置 HTTP 代理
    • 5.1. `wsl --list --verbose`
    • 5.2. 在 Windows 系统上配置 Cl* for Windows
    • 5.3. 在 WSL2 (Windows Subsystem for Linux 2) 系统上配置
    • 5.4. 为 git 设置代理
  • References

1. Proxies

https://www.gnu.org/software/wget/manual/html_node/Proxies.html

proxy UK [ˈprɒk.si] US [ˈprɑːk.si]:n. 代理人,代表,代理权,代表权

Proxies are special-purpose HTTP servers designed to transfer data from remote servers to local clients.

Wget supports proxies for both HTTP and FTP retrievals. The standard way to specify proxy location, which Wget recognizes, is using the following environment variables:

  • http_proxy
  • https_proxy

If set, the http_proxy and https_proxy variables should contain the URLs of the proxies for HTTP and HTTPS connections respectively.

  • ftp_proxy

This variable should contain the URL of the proxy for FTP connections. It is quite common that http_proxy and ftp_proxy are set to the same URL.

  • no_proxy

This variable should contain a comma-separated list of domain extensions proxy should not be used for. For instance, if the value of no_proxy is ‘.mit.edu’, proxy will not be used to retrieve documents from MIT.

Some proxy servers require authorization to enable you to use them. The authorization consists of username and password, which must be sent by Wget.

You may specify your username and password either through the proxy URL or through the command-line options. Assuming that the company’s proxy is located at ‘proxy.company.com’ at port 8001, a proxy URL location containing authorization data might look like this:

http://hniksic:mypassword@proxy.company.com:8001/

2. curl

https://curl.se/docs/manpage.html

curl is a tool for transferring data from or to a server using URLs. It supports these protocols: DICT, FILE, FTP, FTPS, GOPHER, GOPHERS, HTTP, HTTPS, IMAP, IMAPS, LDAP, LDAPS, MQTT, POP3, POP3S, RTMP, RTMPS, RTSP, SCP, SFTP, SMB, SMBS, SMTP, SMTPS, TELNET, TFTP, WS and WSS.

2.1. Environment

The environment variables can be specified in lower case or upper case. The lower case version has precedence. "http_proxy" is an exception as it is only available in lower case.
环境变量可以以小写或大写形式指定,小写版本优先。"http_proxy" 是个例外,因为它仅以小写形式提供。

precedence UK [ˈpres.ɪ.dəns] US [ˈpres.ə.dens]:n. 优先,优先权

2.2. Proxy protocol prefixes

The proxy string may be specified with a protocol:// prefix to specify alternative proxy protocols.

If no protocol is specified in the proxy string or if the string does not match a supported one, the proxy is treated as an HTTP proxy.

  • http://

Makes it use it as an HTTP proxy. The default if no scheme prefix is used.

  • https://

Makes it treated as an HTTPS proxy.

3. Use an HTTP proxy (使用 HTTP 代理)

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html

3.1. Using the examples (使用示例)

The following examples show the environment variable name in all uppercase letters. However, if you specify a variable twice using different cases, the lowercase letters take precedence. We recommend that you define each variable only once to avoid system confusion and unexpected behavior.
以下示例显示了全部使用大写字母的环境变量名称。但是,如果使用不同的大小写指定一个变量两次,则优先使用小写字母。建议您只定义每个变量一次,以避免系统混淆和意外行为。

3.1.1. Linux or macOS

$ export HTTP_PROXY=http://10.15.20.25:1234
$ export HTTP_PROXY=http://proxy.example.com:1234
$ export HTTPS_PROXY=http://10.15.20.25:5678
$ export HTTPS_PROXY=http://proxy.example.com:5678$ export NO_PROXY=169.254.169.254

NO_PROXY 环境变量设置为无需代理的主机或域名。

3.1.2. Windows Command Prompt

  • To set for current session only (仅为当前会话设置)

Using set to set an environment variable changes the value used until the end of the current command prompt session, or until you set the variable to a different value.
使用 set 设置环境变量会更改使用的值,直到当前命令提示符会话结束,或者直到您将该变量设置为其他值。

C:\> set HTTP_PROXY=http://10.15.20.25:1234
C:\> set HTTP_PROXY=http://proxy.example.com:1234
C:\> set HTTPS_PROXY=http://10.15.20.25:5678
C:\> set HTTPS_PROXY=http://proxy.example.com:5678 C:\> set NO_PROXY=169.254.169.254
  • To set for all sessions (为所有会话设置)
C:\> setx HTTP_PROXY http://10.15.20.25:1234
C:\> setx HTTP_PROXY http://proxy.example.com:1234
C:\> setx HTTPS_PROXY http://10.15.20.25:5678
C:\> setx HTTPS_PROXY http://proxy.example.com:5678 C:\> setx NO_PROXY 169.254.169.254

Using setx to set an environment variable changes the value used in both the current command prompt session and all command prompt sessions that you create after running the command. It does not affect other command shells that are already running at the time you run the command.
使用 setx 设置环境变量会更改当前命令提示符会话和运行该命令后创建的所有命令提示符会话中使用的值。它不影响在运行该命令时已经运行的其他命令 shell。

3.2. Authenticating to a proxy (向代理进行身份验证)

The AWS CLI supports HTTP Basic authentication. Specify the username and password in the proxy URL, as follows.

3.2.1. Linux or macOS

$ export HTTP_PROXY=http://username:password@proxy.example.com:1234
$ export HTTPS_PROXY=http://username:password@proxy.example.com:5678

3.2.2. Windows Command Prompt

  • To set for current session only (仅为当前会话设置)

Using set to set an environment variable changes the value used until the end of the current command prompt session, or until you set the variable to a different value.
使用 set 设置环境变量会更改使用的值,直到当前命令提示符会话结束,或者直到您将该变量设置为其他值。

C:\> set HTTP_PROXY=http://username:password@proxy.example.com:1234
C:\> set HTTPS_PROXY=http://username:password@proxy.example.com:5678
  • To set for all sessions (为所有会话设置)
C:\> setx HTTP_PROXY http://username:password@proxy.example.com:1234
C:\> setx HTTPS_PROXY http://username:password@proxy.example.com:5678

Using setx to set an environment variable changes the value used in both the current command prompt session and all command prompt sessions that you create after running the command. It does not affect other command shells that are already running at the time you run the command.
使用 setx 设置环境变量会更改当前命令提示符会话和运行该命令后创建的所有命令提示符会话中使用的值。它不影响在运行该命令时已经运行的其他命令 shell。

4. 配置 HTTP 代理 (HTTP proxy)

You can configure the HTTP_PROXY and HTTPS_PROXY environment variables with either the DNS domain names or IP addresses and port numbers that your proxy servers use.
使用 HTTP 代理需要配置环境变量 http_proxyhttps_proxy

4.1. Linux 系统配置 http_proxyhttps_proxy 环境变量

ProxyServer 为代理服务器的域名或者 IPport 为端口号。如果你的代理服务器需要用户名和密码才能访问,需要填写上面的 usernamepassword 部分,否则的话,可以省略这两部分。

  • 为当前用户临时配置环境变量
export http_proxy="http://username:password@ProxyServer:port"
export https_proxy="https://username:password@ProxyServer:port"export http_proxy="http://ProxyServer:port"
export https_proxy="https://ProxyServer:port"
# With Authentication
export HTTP_PROXY=[username]:[password]@[proxy-web-or-IP-address]:[port-number]
export HTTPS_PROXY=[username]:[password]@[proxy-web-or-IP-address]:[port-number]
export FTP_PROXY=[username]:[password]@ [proxy-web-or-IP-address]:[port-number]
export NO_PROXY=localhost,127.0.0.1# Without Authentication
export HTTP_PROXY=[proxy-web-or-IP-address]:[port-number]
export HTTPS_PROXY=[proxy-web-or-IP-address]:[port-number]
export FTP_PROXY=[proxy-web-or-IP-address]:[port-number]
export NO_PROXY=localhost,127.0.0.1

通过 export 指令临时设置代理:

(base) yongqiang@yongqiang:~$ export http_proxy="http://192.105.9.13:7890"
(base) yongqiang@yongqiang:~$ export https_proxy="https://192.105.9.13:7890"

查看代理:

(base) yongqiang@yongqiang:~$ env | grep -i proxy
https_proxy=https://192.105.9.13:7890
http_proxy=http://192.105.9.13:7890
(base) yongqiang@yongqiang:~$

临时取消代理:

(base) yongqiang@yongqiang:~$ unset http_proxy
(base) yongqiang@yongqiang:~$ unset https_proxy

查看代理:

(base) yongqiang@yongqiang:~$ env | grep -i proxy
(base) yongqiang@yongqiang:~$

测试方法:

wget www.google.com
curl www.google.comwget --proxy http://192.105.9.13:7890 www.google.com
curl --proxy http://192.105.9.13:7890 www.google.com
(base) yongqiang@yongqiang:~$ wget www.google.com
--2024-06-01 23:30:18--  http://www.google.com/
Connecting to 192.105.9.13:7890... connected.
Proxy request sent, awaiting response... 302 Found
Location: http://www.google.com.hk/url?sa=p&hl=zh-CN&pref=hkredirect&pval=yes&q=http://www.google.com.hk/&ust=1717255848963743&usg=AOvVaw3YRiYLmVQtcHhr0aEN_TJG [following]
--2024-06-01 23:30:19--  http://www.google.com.hk/url?sa=p&hl=zh-CN&pref=hkredirect&pval=yes&q=http://www.google.com.hk/&ust=1717255848963743&usg=AOvVaw3YRiYLmVQtcHhr0aEN_TJG
Reusing existing connection to 192.105.9.13:7890.
Proxy request sent, awaiting response... 302 Found
Location: http://www.google.com.hk/ [following]
--2024-06-01 23:30:19--  http://www.google.com.hk/
Reusing existing connection to 192.105.9.13:7890.
Proxy request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html.1’index.html.1                           [ <=>                                                          ]  19.33K  --.-KB/s    in 0.01s2024-06-01 23:30:20 (1.98 MB/s) - ‘index.html.1’ saved [19794](base) yongqiang@yongqiang:~$
(base) yongqiang@yongqiang:~$ curl www.google.com
<HTML><HEAD><meta http-equiv="content-type" content="text/html;charset=utf-8">
<TITLE>302 Moved</TITLE></HEAD><BODY>
<H1>302 Moved</H1>
The document has moved
<A HREF="http://www.google.com.hk/url?sa=p&amp;hl=zh-CN&amp;pref=hkredirect&amp;pval=yes&amp;q=http://www.google.com.hk/&amp;ust=1717294991706701&amp;usg=AOvVaw2Ej1rgvrxOVAsV8uF9jM2M">here</A>.
</BODY></HTML>
(base) yongqiang@yongqiang:~$
  • 为当前用户永久配置环境变量

~/.bashrc 文件中添加如下内容,可将 http_proxyhttps_proxy 永久配置在当前用户的环境变量中。

export http_proxy="http://username:password@ProxyServer:port"
export https_proxy="https://username:password@ProxyServer:port"export http_proxy="http://ProxyServer:port"
export https_proxy="https://ProxyServer:port"
# With Authentication
export HTTP_PROXY=[username]:[password]@[proxy-web-or-IP-address]:[port-number]
export HTTPS_PROXY=[username]:[password]@[proxy-web-or-IP-address]:[port-number]
export FTP_PROXY=[username]:[password]@ [proxy-web-or-IP-address]:[port-number]
export NO_PROXY=localhost,127.0.0.1"# Without Authentication
export HTTP_PROXY=[proxy-web-or-IP-address]:[port-number]
export HTTPS_PROXY=[proxy-web-or-IP-address]:[port-number]
export FTP_PROXY=[proxy-web-or-IP-address]:[port-number]
export NO_PROXY=localhost,127.0.0.1

永久环境变量配置完毕后,注销并重新登录,配置生效。

To force apply your new proxy settings in the current Terminal session, execute the source command:

source ~/.bashrc
  • 为所有用户永久配置环境变量

/etc/environment/etc/profile 文件中添加如下内容,可将 http_proxyhttps_proxy 永久配置在所有用户的环境变量中。

export http_proxy="http://username:password@ProxyServer:port"
export https_proxy="https://username:password@ProxyServer:port"export http_proxy="http://ProxyServer:port"
export https_proxy="https://ProxyServer:port"
# With Authentication
export HTTP_PROXY=[username]:[password]@[proxy-web-or-IP-address]:[port-number]
export HTTPS_PROXY=[username]:[password]@[proxy-web-or-IP-address]:[port-number]
export FTP_PROXY=[username]:[password]@ [proxy-web-or-IP-address]:[port-number]
export NO_PROXY=localhost,127.0.0.1"# Without Authentication
export HTTP_PROXY=[proxy-web-or-IP-address]:[port-number]
export HTTPS_PROXY=[proxy-web-or-IP-address]:[port-number]
export FTP_PROXY=[proxy-web-or-IP-address]:[port-number]
export NO_PROXY=localhost,127.0.0.1

永久环境变量配置完毕后,注销并重新登录,配置生效。

To force apply your new proxy settings in the current Terminal session, execute the source command:

source /etc/profile

4.2. Windows 系统配置 http_proxyhttps_proxy 环境变量

4.2.1. cmd

ProxyServer 为代理服务器的域名或者 IPport 为端口号。如果你的代理服务器需要用户名和密码才能访问,需要填写上面的 usernamepassword 部分,否则的话,可以省略这两部分。

  • 临时环境变量
set http_proxy=http://username:password@ProxyServer:port
set https_proxy=https://username:password@ProxyServer:portset http_proxy=http://ProxyServer:port
set https_proxy=https://ProxyServer:port
  • 永久环境变量

http_proxyhttps_proxy 永久配置在当前用户的环境变量中。

setx "http_proxy" "http://username:password@ProxyServer:port"
setx "https_proxy" "https://username:password@ProxyServer:port"setx "http_proxy" "http://ProxyServer:port"
setx "https_proxy" "https://ProxyServer:port"

永久环境变量配置完毕后,将在新打开的终端中生效,当前终端不会立即生效。

4.2.2. PowerShell

ProxyServer 为代理服务器的域名或者 IPport 为端口号。如果你的代理服务器需要用户名和密码才能访问,需要填写上面的 usernamepassword 部分,否则的话,可以省略这两部分。

  • 临时环境变量
$env:http_proxy="http://username:password@ProxyServer:port"
$env:https_proxy="https://username:password@ProxyServer:port"$env:http_proxy="http://ProxyServer:port"
$env:https_proxy="https://ProxyServer:port"
  • 永久环境变量

http_proxyhttps_proxy 永久配置在当前用户的环境变量中。

[environment]::SetEnvironmentvariable("http_proxy", "http://username:password@ProxyServer:port", "User")
[environment]::SetEnvironmentvariable("https_proxy", "https://username:password@ProxyServer:port", "User")[environment]::SetEnvironmentvariable("http_proxy", "http://ProxyServer:port", "User")
[environment]::SetEnvironmentvariable("https_proxy", "https://ProxyServer:port", "User")

永久环境变量配置完毕后,将在新打开的终端中生效,当前终端不会立即生效。

5. 为 WSL2 (Windows Subsystem for Linux 2) 配置 HTTP 代理

5.1. wsl --list --verbose

C:\Users\cheng>wsl --list --verboseNAME            STATE           VERSION
* Ubuntu-20.04    Running         2C:\Users\cheng>

5.2. 在 Windows 系统上配置 Cl* for Windows

Cl* for Windows Download - Cl*.for.Windows-0.20.39-win.7z
E:\software\Cl*.for.Windows-0.20.39-win\Cl* for Windows.exe

  • General

允许局域网代理 Allow LAN

在这里插入图片描述

在 Gh* 控制面板里点击左侧导航栏手机代理,找到 Cl* for Windows 订阅地址并点击复制。

在这里插入图片描述

  • Profiles

在 Profiles 页面顶部,粘贴 Cl* 配置订阅链接,随后点击 Download 下载配置文件。下载成功后,Cl* for Windows 将自动切换至下载的配置文件。

在这里插入图片描述

  • Proxies

切换代理模式为规则 (Rule)。

全局 (Global):所有请求直接发往代理服务器,代理所有流量
规则 (Rule):所有请求根据配置文件规则进行分流,只代理国外流量
直连 (Direct):所有请求直接发往目的地,不代理任何流量

在这里插入图片描述

5.3. 在 WSL2 (Windows Subsystem for Linux 2) 系统上配置

通过 export 指令临时设置代理:

(base) yongqiang@yongqiang:~$ export http_proxy="http://192.105.9.13:7890"
(base) yongqiang@yongqiang:~$ export https_proxy="https://192.105.9.13:7890"

查看代理:

(base) yongqiang@yongqiang:~$ env | grep -i proxy
https_proxy=https://192.105.9.13:7890
http_proxy=http://192.105.9.13:7890
(base) yongqiang@yongqiang:~$

测试方法:

wget www.google.com
curl www.google.comwget --proxy http://192.105.9.13:7890 www.google.com
curl --proxy http://192.105.9.13:7890 www.google.com

5.4. 为 git 设置代理

临时设置 git 代理:

# Without Authentication
git config --global http.proxy http://192.105.9.13:7890
git config --global https.proxy https://192.105.9.13:7890# With Authentication
git config --global http.proxy http://username:password@192.105.9.13:7890
git config --global https.proxy https://username:password@192.105.9.13:7890

取消 git 代理:

git config --global --unset http.proxy
git config --global --unset https.proxy

git 的任何全局设置都可以用 git config --global --unset * 来取消。

查看 git 代理:

git config --global --get http.proxy
git config --global --get https.proxy

查看 git 全局设置:

git config --global -l

查看 git 的全局设置。如果设置 git 代理成功,则列表输出会有以 http.proxy= and https.proxy= 开头的行。如果取消 git 代理成功,则以 http.proxy= and https.proxy= 开头的行将不会出现在列表输出中。

使用以下命令查看并修改 git 的配置,git 的默认编辑器会打开 ~/.gitconfig 文件。

git config --global --edit
(base) yongqiang@yongqiang:~$ git config --global http.proxy http://192.105.9.13:7890
(base) yongqiang@yongqiang:~$ git config --global https.proxy https://192.105.9.13:7890
(base) yongqiang@yongqiang:~$
(base) yongqiang@yongqiang:~$ git config --global -l
user.email=***@163.com
user.name=***@163.com
core.editor=vim
filter.lfs.clean=git-lfs clean -- %f
filter.lfs.smudge=git-lfs smudge -- %f
filter.lfs.process=git-lfs filter-process
filter.lfs.required=true
https.proxy=https://192.105.9.13:7890
http.proxy=http://192.105.9.13:7890
(base) yongqiang@yongqiang:~$

References

[1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/
[2] 配置 HTTP 代理, https://support.huaweicloud.com/usermanual-hcli/hcli_22_001.html
[3] Use an HTTP proxy, https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-proxy.html
[4] Define proxy settings, https://help.ubuntu.com/stable/ubuntu-help/net-proxy.html.en

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

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

相关文章

Tailwindcss Layout布局相关样式及实战案例,5万字长文,附完整源码和效果截图

aspect 相关样式类 基础样式 ClassPropertiesaspect-autoaspect-ratio: auto;aspect-squareaspect-ratio: 1 / 1;aspect-videoaspect-ratio: 16 / 9; 案例&#xff1a;引入B站视频 Use the aspect-* utilities to set the desired aspect ratio of an element. 使用’ asp…

两款 IntelliJ IDEA 的 AI 编程插件

介绍两款 IntelliJ IDEA 的 AI 编程插件&#xff1a;通义灵码和 CodeGeeX。 通义灵码 这是由阿里推出的一个基于通义大模型的 AI 编码助手。 它提供了代码智能生成、研发智能问答等功能。通义灵码经过海量优秀开源代码数据训练&#xff0c;可以根据当前代码文件及跨文件的上下…

kafka-偏移量图解

生产者偏移量&#xff1a;生产者发送消息时写入到哪个位置&#xff08;主题的每个分区会存储一个 leo 即将写入消息的偏移量&#xff09;&#xff0c;每次写完消息 leo 会 1 消费者偏移量&#xff1a;消费者从哪个位置开始消费消息&#xff0c;小于等于 leo&#xff0c;每个组…

【Qt】对话框

文章目录 1 :peach:对话框介绍:peach:2 :peach:对话框的分类:peach:2.1 :apple:模态对话框:apple:2.2 :apple:非模态对话框:apple:2.3 :apple:混合属性对话框:apple: 3 :peach:Qt 内置对话框:peach:3.1 :apple:消息对话框 QMessageBox:apple: 1 &#x1f351;对话框介绍&#x…

pod 控制器介绍

一 pod 控制器相关理论介绍 1&#xff0c;Pod控制器 是什么 Pod控制器&#xff0c;又称之为工作负载&#xff08;workload&#xff09;&#xff0c;是用于实现管理pod的中间层&#xff0c;确保pod资源符合预期的状态&#xff0c;pod的资源出现故障时&#xff0c;会尝试进行…

[数据集][目标检测]水下管道泄漏破损检测数据集VOC+YOLO格式2069张2类别

数据集格式&#xff1a;Pascal VOC格式YOLO格式(不包含分割路径的txt文件&#xff0c;仅仅包含jpg图片以及对应的VOC格式xml文件和yolo格式txt文件) 图片数量(jpg文件个数)&#xff1a;2069 标注数量(xml文件个数)&#xff1a;2069 标注数量(txt文件个数)&#xff1a;2069 标注…

时间序列的谱分解pt.2

16.dvi (berkeley.edu)https://www.stat.berkeley.edu/~bartlett/courses/153-fall2010/lectures/16.pdfpt1 时间序列的谱分解-CSDN博客

新书推荐:1.2 动态链接库与API

本节必须掌握的知识点&#xff1a; kernel32.dll user32.dll gdi32.dll ■动态链接库 最早的软件开发过程&#xff0c;所有的功能实现都是有程序员独立完成的。在这个过程中&#xff0c;我们很快就会发现&#xff0c;有很多常用的功能模块是可以重复利用的&#xff0c;我们将…

Nginx服务的主配置文件及配置举例

Nginx服务的主配置文件 安装Nginx认识Nginx服务全局配置I/O 事件配置HTTP 配置日志格式设定 访问状态统计配置查看Nginx已安装模块修改 nginx.conf 配置文件重启服务&#xff0c;访问测试 基于授权的访问控制准备用户密码认证文件修改 nginx.conf 配置文件重启服务&#xff0c;…

java向上转型

介绍 代码 父类 package b;public class father_ {//father classString name"动物";int age10;public void sleep() {System.out.println("睡");}public void run() {System.out.println("跑");}public void eat() {System.out.println("…

ISCC2024之Misc方向WP

目录 FunZip Magic_Keyboard Number_is_the_key RSA_KU 成语学习 钢铁侠在解密 工业互联网模拟仿真数据分析 精装四合一 时间刺客 有人让我给你带个话 FunZip 题目给了一个txt&#xff0c;内容如下 一眼丁真&#xff0c;base隐写&#xff0c;使用工具即可得到flag Fl…

在Centos上为Tesla T4显卡安装NVIDIA驱动以及cuda和cudnn

前期准备&#xff1a; 升级gcc编译环境&#xff1a; 查看gcc版本&#xff1a; gcc -v &#xff08;centos默认好像是4.8.5版本&#xff09; 升级gcc&#xff1a; yum install centos-release-scl yum install devtoolset-9-gcc* 备份旧链接创建新链接&#xff1a;…

----JAVA 继承----

引言 再java中你能创造出很多的类&#xff0c;但如果这些类中的成员再另一个类中也要使用&#xff0c;那么就要用到继承来实现指定类中成员的使用了 那么也就可以写出这样的代码 再类Cat中使用了类Animal的成员&#xff0c;这里我们称Cat叫子类&#xff0c;Animal叫父类 概念…

【UE+GIS】UE5GIS CAD或shp构建3D地形

贴合地形的矢量图形实现方法 一、灰度图的制作和拉伸换算1、基于高程点集实现2、基于等高线实现3、拉伸计算 二、生成地形模型的实现方案1、3Dmax导入灰度图2、使用ArcMap/Arcpro/FME等GIS数据处理工具3、UE导入灰度图 三、地形上叠加地形渲染效果的实现方案1、贴花2、数据渲染…

Z字形变换 ---- 模拟

题目链接 题目: 分析: 题意如图所示:如果我们按照题意, 真的实现一个矩阵, 这样做的时间和空间复杂度很高, 所以我们可以试试看找规律, 优化一下我们观察他们的下标: 如果找到下标的规律, 那么我们就不用创建矩阵, 就能找到最终结果的下一个字符是什么特殊情况, 当numRows 1…

读AI未来进行式笔记01深度学习

1. AI 1.1. AI已经发展成一门涵盖许多子领域的重要学科 1.2. 机器学习是迄今为止AI应用最成功的子领域 1.2.1. 在这个领域中&#xff0c;最大的技术突破就是深度学习 1.3. “人工智能”“机器学习”和“深度学习”的时候&#xff…

Pointnet学习以及对代码的实现

由于点云不是常规数据格式&#xff0c;通常将此类数据转换为规则的 3D 体素网格或图像集合&#xff0c;然后再用神经网络进行处理。数据表示转换使生成的数据过于庞大。 PointNet是第一个直接处理原始点云的方法。只有全连接层和最大池化层&#xff0c;PointNet网络在推理速度…

代码随想录--哈希表--两数之和

题目 给定一个整数数组 nums 和一个目标值 target&#xff0c;请你在该数组中找出和为目标值的那 两个 整数&#xff0c;并返回他们的数组下标。 你可以假设每种输入只会对应一个答案。但是&#xff0c;数组中同一个元素不能使用两遍。 示例: 给定 nums [2, 7, 11, 15], t…

李廉洋:6.3黄金原油下周一开盘行情价格涨跌趋势分析及最新操作建议多空布局

黄金消息面分析&#xff1a;上周黄金市场的走势受到了PCE通胀数据和美联储政策预期的显着影响。尽管市场对黄金的长期看涨情绪依然存在&#xff0c;但短期内金价的波动性预计将持续。4月份的PCE通胀数据显示价格压力有所降温&#xff0c;这一结果与分析师预期一致&#xff0c;但…

2024年6月2日 (周日) 叶子游戏新闻

中医百科中药: 中医百科中药是一款非常强大的中药知识科普软件&#xff0c;该应用提供500多味中草药的文献资料&#xff0c;强大的搜索功能可根据功效、特点和关键词来快速查找中药&#xff0c;而且每味中药的图片、功效、主治、炮制方法等百科知识&#xff0c;可以很好的帮助你…