终端zsh_只需七个步骤,即可使您的“ ZSH”终端站起来—直观指南

2023-11-17

终端zsh

by rajaraodv

通过rajaraodv

只需七个步骤,即可使您的“ ZSH”终端站起来—直观指南 (Jazz Up Your “ZSH” Terminal In Seven Steps — A Visual Guide)

In this blog I’ll cover installing ITerm2, ZSH shell, “oh my ZSH”, Themes, ITerm2 color schemes, “oh my ZSH” plugins and enable “ligature” support to help create a beautiful and powerful Terminal.

在此博客中,我将介绍安装ITerm2,ZSH shell,“ oh my ZSH”,主题,ITerm2配色方案,“ oh my ZSH”插件,并启用“连字”支持以帮助创建美观而强大的终端。

If you want to just make your regular Bash Terminal powerful, take a look at my previous blog: “Jazz Up Your Bash Terminal”. But ZSH explained in this blog is more powerful stuff.

如果您只是想让常规的Bash Terminal功能强大,请看一下我以前的博客:“ Jazz Up Your Bash Terminal ”。 但是ZSH在此博客中解释的是更强大的功能。

摘要: (Summary:)

We’ll be covering a lot of things. This may be confusing, so here is the summary of what we will be doing.

我们将介绍很多内容。 这可能会造成混淆,所以这里是我们将要做的摘要。

  1. Install ITerm2 — This is a better alternative to the default Terminal

    安装ITerm2-这是默认终端的更好替代方案
  2. Install latest ZSH shell — This is more powerful than the regular bash shell. We will switch ITerm2 to use ZSH shell.

    安装最新的ZSH shell-比常规的bash shell更强大。 我们将ITerm2切换为使用ZSH shell。
  3. Install “Oh My ZSH “— This is a CLI tool to easily configure ZSH and add themes and plugins to ZSH

    安装“哦,我的ZSH”-这是一个CLI工具,可轻松配置ZSH并将主题和插件添加到ZSH
  4. Add two types of Themes using “Oh My ZSH” — some themes need extra steps so we will cover both

    使用“哦,我的ZSH”添加两种类型的主题-一些主题需要额外的步骤,因此我们将涵盖这两种主题
  5. Install different ITerm2 Schemes — These are just color schemes for the UI

    安装不同的ITerm2方案-这些只是UI的颜色方案
  6. Add two different Plugins using “Oh My ZSH” to improve productivity

    使用“ Oh My ZSH”添加两个不同的插件以提高生产力
  7. Enable “ligature” support so when you write an arrow =>;, it appears like a real arrow →

    启用“结扎”的支持,所以当你写一个箭头=>;,它看起来像一个真正的ARR O w制备→

第1步-安装ITerm2 (Step 1— Install ITerm2)

A lot of programmers like ITerm2 instead of the default Terminal. It is similar to the Terminal, but has lots of features of its own. It of course can run ZSH, Bash, and other shells inside it.

许多程序员喜欢ITerm2而不是默认的Terminal。 它类似于终端机,但具有许多自身功能。 它当然可以在其中运行ZSH,Bash和其他Shell。

The following video shows some of the new features of Item 2 (v3).

以下视频显示了第2项(v3)的一些新功能。

For this blog we’ll use ITerm2. When I mention “Terminal”, I mean ITerm2. Although the steps are the same for both Terminal or ITerm2.
对于此博客,我们将使用ITerm2。 当我提到“ Terminal”时,是指ITerm2。 尽管对于Terminal或ITerm2,步骤都相同。

第2步-将Shell更改为ZSH (Step 2— Change Shell To ZSH)

The following video shows why ZSH is better than just a bash shell.

以下视频显示了为什么ZSH比bash shell更好。

Option 1 — Use Mac’s own ZSH:

选项1-使用Mac自己的ZSH:

Mac comes with a ZSH out-of-the-box, so we don’t need to install it. However, sometimes it’s an older version of ZSH. Typically it’s located at /bin/zsh. To use it, all we need to do is to change shell (chsh).

Mac附带了开箱即用的ZSH,因此我们不需要安装它。 但是,有时它是ZSH的旧版本。 通常,它位于/ bin / zsh中。 要使用它,我们要做的就是更改shell(chsh)。

  1. Open the Terminal (or ITerm2) and type the following command.

    打开终端(或ITerm2),然后键入以下命令。
$ chsh -s $(which zsh)

2. Enter the password and it will change the shell, upon logout and login.

2.输入密码,注销并登录后它将更改外壳。

3. Logout and re-login

3. 注销并重新登录

4. To test, open the Terminal and type the following, and it should say zsh.

4.要进行测试,请打开“终端”并键入以下内容,并显示zsh。

$ echo $0
zsh //should return zsh

Option 2— Install Homebrew and Install latest ZSH via Homebrew

选项2 —安装Homebrew并通过Homebrew安装最新的ZSH

This option is pretty common among users, because some of the plugins only work with the latest ZSH.

此选项在用户中非常常见,因为某些插件仅与最新的ZSH一起使用。

Homebrew, simply said, is a command line installer for all sorts of software. Let’s install that first.

简而言之,Homebrew是用于各种软件的命令行安装程序。 让我们先安装它。

  1. Install Homebrew by running the following command.

    通过运行以下命令来安装Homebrew。
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2. If you get Command Line Tools for Xcode error, it means you haven’t installed the CLI tools for Xcode. If you don’t get the error, you can skip this step, because you already have it installed.

2.如果出现Xcode命令行工具错误,则表示您尚未安装Xcode的CLI工具。 如果没有收到错误,则可以跳过此步骤,因为您已经安装了它。

XCode Developer CLI tools are used by various apps that manipulate core OSX features. So make sure to install the Xcode CLI tools by running the following command.

XCode Developer CLI工具由操纵核心OSX功能的各种应用程序使用。 因此,请确保通过运行以下命令来安装Xcode CLI工具。

$ xcode-select —-install

$ xcode-select —-install

Note: The above command opens up Mac’s installer and installs the XCode Developer CLI tools. If it doesn’t work, try xcode-select -r to reset.

注意:上面的命令将打开Mac的安装程序并安装XCode Developer CLI工具。 如果不起作用,请尝试使用xcode-select -r进行重置。

3. Install ZSH via Homebrew

3.通过自制软件安装ZSH

Run the following command to install ZSH. It gets installed at /usr/local/bin/zsh PS: Mac’s default ZSH is at /bin/zsh

运行以下命令以安装ZSH。 它安装在/usr/local/bin/zsh PS:Mac的默认ZSH在/bin/zsh

brew install zsh

4. Use the Homebrew version of ZSH

4.使用ZSH的自制版本

Run the following command. You will be prompted to enter Mac’s password.

运行以下命令。 系统将提示您输入Mac的密码。

chsh -s /usr/local/bin/zsh

5. Logout and log back in.

5.注销并重新登录。

6. Test if we are using ZSH and the correct ZSH

6.测试我们是否使用ZSH和正确的ZSH

$ echo $0
zsh   //correct

$ which zsh
/usr/local/bin/zsh   //correct

第3步-“哦,我的ZSH” (Step 3— “Oh My ZSH”)

“Oh My ZSH” is a plugin that runs on top of ZSH. It provides default config for ZSH (~/.zhrc file) and also provides themes and more features.

“哦,我的ZSH”是在ZSH之上运行的插件。 它提供了ZSH(〜/ .zhrc文件)的默认配置,还提供了主题和更多功能。

From what I know, most power users who use ZSH also use “Oh My ZSH”.
据我所知,大多数使用ZSH的高级用户也使用“哦,我的ZSH”。
  1. Install “Oh My ZSH”

    安装“哦,我的ZSH”

Run the following command to install “oh My ZSH”.

运行以下命令以安装“ oh My ZSH”。

sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

2. Close and quit ITerm2 and reopen it.

2.关闭并退出ITerm2,然后重新打开。

It should look something like below. Notice that the prompt has changed and the theme is a bit different — That’s “Oh My ZSH” in action for you.

它看起来应该像下面这样。 请注意,提示已更改,主题有所不同-这就是“噢,我的ZSH”为您服务。

第4步-更改主题并安装字体 (Step 4— Change Themes And Install Fonts)

In this step, we’ll add two different “Oh My ZSH” Themes. “Oh My ZSH” comes with tons of themes. PS: But some Themes need extra steps like installing specific fonts and so on.

在这一步中,我们将添加两个不同的“ Oh My ZSH”主题。 “哦,我的ZSH”带有大量主题PS:但是某些主题需要额外的步骤,例如安装特定的字体等。

To set a Theme, simply open ~/.zshrc file (created by “Oh My ZSH”) and change the theme as shown below.

要设置主题,只需打开〜/ .zshrc文件(由“ Oh My ZSH”创建)并更改主题,如下所示。

PS: .zshrc is the config file for ZSH shell. People who don’t use “Oh My ZSH” will have to manually create this file and add any configs themselves. “Oh My ZSH” automatically creates this file if it doesn’t exist and then adds its own set of configs into this file.
PS:.zshrc是ZSH Shell的配置文件。 不使用“ Oh My ZSH”的用户将必须手动创建此文件并自己添加任何配置。 如果“ Oh My ZSH”不存在,它将自动创建该文件,然后将其自己的一组配置添加到该文件中。

主题1-让我们添加一个名为“ Avit”的主题 (Theme 1 — Let’s add a Theme called “Avit”)

  1. Open .zshrc

    打开.zshrc
$ open ~/.zshrc

2. Change the Theme to “Avit”

2.将主题更改为“ Avit”

You can browse all the “Oh My ZSH” Themes here. To change the Theme, simply change the ZSH_THEME value in ~/.zshrc file from robbyrussell to Avit.

您可以在此处浏览所有“哦,我的ZSH”主题。 要更改主题,只需将〜/ .zshrc文件中的ZSH_THEME值从robbyrussell更改Avit即可

3. Update ZSH config

3.更新ZSH配置

Run the following command to update the config.

运行以下命令以更新配置。

$ source ~/.zshrc

4. Change the background color and font size

4.更改背景颜色和字体大小

Open ITerm2 > Preferences > Profiles > Colors and change the background black color to use 20% gray as shown below.

打开ITerm2>首选项>配置文件>颜色,然后将背景黑色更改为20%灰色,如下所示。

Then open Text > Change Font and change the size to 14pt.

然后打开“文本”>“更改字体”,并将大小更改为14pt。

OK, Let’s install a different Theme that needs fonts.

好,让我们安装一个需要字体的主题。

主题2-安装“ agnoster”哦,我的ZSH主题 (Theme 2 — Installing “agnoster” Oh My ZSH theme)

This is a popular theme because it emulates the Powerline Python app that enhances the terminal. The following picture shows how it looks. But this theme also needs us to install Powerline themes.

这是一个受欢迎的主题,因为它模仿了增强终端功能的Powerline Python应用程序。 下图显示了外观。 但是,此主题还需要我们安装电力线主题。

1. Install Powerline fonts

1.安装电力线字体

$ git clone https://github.com/powerline/fonts.git
$ cd fonts
$ ./install.sh

2. Change the Theme to “agnoster”

2.将主题更改为“ agnoster”

$ open ~/.zshrc
Set ZSH_THEME="agnoster" and save the file

3. Quit ITerm2 and reopen it.

3.退出ITerm2并重新打开它。

4. Set Powerline font

4.设置电源线字体

You can set any Powerline patched font you like. All the fonts end with “for Powerline”.

您可以设置任何喜欢的Powerline修补字体。 所有字体都以“ for Powerline”结尾。

Open ITerm2 > Preferences > Profiles > Text > Change Font and set it to something that has “for Powerline”. I’m choosing “Meslo LG DZ for Powerline” font.

打开ITerm2 > Preferences > Profiles > Text > Change Font ,并将其设置为具有“用于Powerline”的名称。 我选择“ Meslo LG DZ for Powerline”字体。

Note — If you are confused about the fonts and Themes: the Themes are for “Oh My ZSH” and ZSH shell and the fonts are for the Iterm2 itself.
注—如果您对字体和主题感到困惑:主题用于“哦,我的ZSH”和ZSH Shell,字体用于Iterm2本身。

5.全部完成 (5. All Done)

At this point your Terminal should look like below:

此时,您的终端应如下所示:

步骤5 —安装iTerm2“配色方案”(ITerm2主题) (Step 5 — Install iTerm2 “color schemes” (ITerm2 Themes))

There are plenty of gorgeous color schemes for iTerm2. These schemes change the foreground color, background color, cursor color, and so on. You can find them at iTerm2-color-schemes Github repo.

iTerm2有很多华丽的配色方案。 这些方案可以更改前景色,背景色,光标颜色等。 您可以在iTerm2-color-schemes Github存储库中找到它们。

Note: These are just color schemes of the ITerm2 UI and don’t deal with the command prompt’s look and feel like “Oh My ZSH”’s themes (other than just changing colors).
注意:这些只是ITerm2 UI的配色方案,并不像“ Oh My ZSH”的主题一样处理命令提示符的外观(不仅仅是更改颜色)。

Follow these steps to install them.

请按照以下步骤进行安装。

  1. Download the iTerm2-color-schemes as a zip file and extract it

    iTerm2-color-schemes下载为zip文件并解压缩

  2. The “Schemes” folder contains all the color scheme files — they end with .itermcolors

    “ Schemes”文件夹包含所有配色方案文件-它们以.itermcolors

  3. Open iTerm2 > Preferences > Profile > Colors > Color Presets > Import

    打开iTerm2 > Preferences > Profile > Colors > Color Presets > Import

  4. In the import window, navigate to the “Schemes” folder (from step 2)

    在导入窗口中,导航到“ Schemes”文件夹(从步骤2开始)
  5. Select all the files so you can import all the color schemes at once

    选择所有文件,以便您可以一次导入所有配色方案
  6. Simply select whichever color scheme you like.

    只需选择您喜欢的任何配色方案。

My favorites are Batman and Argonaut

我最喜欢的是蝙蝠侠Argonaut

The Argonaut color scheme looks like below:

Argonaut配色方案如下所示:

第6步-安装插件 (Step 6— Install Plugins)

Plugins add more functionalities to your workflow. By default “Oh My ZSH” already has the “git” plugin! and that’s why you were able to see all those Git statuses in the prompts in earlier screenshots. Let’s add another one to see how it works.

插件为您的工作流程增加了更多功能。 默认情况下,“哦,我的ZSH”已经具有“ git”插件! 这就是为什么您能够在早期屏幕截图的提示中看到所有那些Git状态的原因。 让我们再添加一个,看看它是如何工作的。

Note: In this section, we’ll install two different plugins to show how they work.
注意:在本节中,我们将安装两个不同的插件以展示它们的工作方式。

插件1 —添加语法突出显示插件 (Plugin 1 — Add Syntax Highlighting Plugin)

The Syntax Highlighting plugin adds beautiful colors to the commands you are typing as shown below.

语法突出显示插件可为您键入的命令添加漂亮的颜色,如下所示。

  1. Clone the zsh-syntax-highlighting plugin’s repo and copy it to the “Oh My ZSH” plugins directory.

    克隆zsh-syntax-highlighting插件的存储库,并将其复制到“ Oh My ZSH”插件目录。
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting

2. Activate the plugin in ~/.zshrc by adding `zsh-syntax-highlighting to the Plugins section as shown below.

2.通过在插件部分中添加` zsh-syntax-highlighting来激活~/.zshrc中的插件,如下所示。

3. Re-read zshrc configuration

3.重新读取zshrc配置

source ~/.zshrc

插件2 —添加ZSH-AutoSuggestion插件 (Plugin 2 — Add ZSH-AutoSuggestion Plugin)

This plugin auto suggests any of the previous commands. Pretty handy! To select the completion, simply press → key.

该插件会自动建议以前的任何命令。 很方便! 要选择完成,只需按→键。

  1. Install the plugin

    安装插件
git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions
PS: ZSH_CUSTOM points to ~/.oh-my-zsh/custom
PS:ZSH_CUSTOM指向〜/ .oh-my-zsh / custom

2. Open ~/.zshrc and add zsh-autosuggestions

2.打开~/.zshrc并添加zsh-autosuggestions

步骤7 —使用连字支持 (Step 7 — Use Ligature Support)

There are various fonts that help make operators like less than, double equals, right arrow, not equals, and so on look beautiful. For example, every time you type: =>, it becomes: →.

有多种字体可以使运算符看起来像小于,双等于,右箭头,非等于等。 例如,每次键入:=>,它将变为:→。

To use this, we need fonts that support ligatures. We also need to enable it in ITerm2. FiraCode is one such font. Follow the steps to install and enable ligatures.

要使用此字体,我们需要支持连字的字体。 我们还需要在ITerm2中启用它。 FiraCode就是这样一种字体。 请按照以下步骤安装和启用连字。

  1. Download the FiraCode repo and extract the zip file (or clone it)

    下载FiraCode存储库并解压缩zip文件(或克隆它)

  2. Open the dstr > ttf folder and double click on all the *.ttf files and select the “Install font” button to install each of the font variations.

    打开dstr > ttf文件夹,双击所有*.ttf文件,然后选择“安装字体”按钮以安装每个字体变体。

  3. Navigate to ITerm2 | Preferences | Profiles | Text

    导航到ITerm2 | Preferences | Profiles | Text ITerm2 | Preferences | Profiles | Text

  4. Select Use Ligaturescheckbox

    选择 Use Ligatures 复选框

  5. Click on Change Font and select Fira Code Regular font

    单击Change Font然后选择Fira Code Regular字体

摘要 (Summary)

We have covered a lot in this blog starting from installing latest ZSH via Homebrew, Oh My ZSH, Plugins, Themes, enable “ligatures” for FiraCode font.

从通过Homebrew,Oh My ZSH,插件,主题安装最新的ZSH开始,为FiraCode字体启用“连字”,我们在此博客中介绍了很多内容。

?? Thank you!

?? 谢谢!

如果这有用,请单击拍手? 请点击以下几次以显示您的支持! ???? (If this was useful, please click the clap ? button down below a few times to show your support! ⬇⬇⬇ ??)

https://medium.com/@rajaraodv/latest

https://medium.com/@rajaraodv/latest

ECMAScript 2015+ (ECMAScript 2015+)

  1. Check out these useful ECMAScript 2015 (ES6) tips and tricks

    查看这些有用的ECMAScript 2015(ES6)提示和技巧

  2. 5 JavaScript “Bad” Parts That Are Fixed In ES6

    ES6中修复的5个JavaScript“不良”部分

  3. Is “Class” In ES6 The New “Bad” Part?

    ES6中的“类”是新的“不良”部分吗?

终端改进 (Terminal Improvements)

  1. How to Jazz Up Your Terminal — A Step By Step Guide With Pictures

    如何使您的终端更加爵士乐-带图片的分步指南

  2. Jazz Up Your “ZSH” Terminal In Seven Steps — A Visual Guide

    通过七个步骤使您的“ ZSH”终端变得爵士乐—视觉指南

万维网 (WWW)

  1. A Fascinating And Messy History Of The Web And JavaScript

    Web和JavaScript的迷人历史

虚拟DOM (Virtual DOM)

  1. Inner Workings Of The Virtual DOM

    虚拟DOM的内部运作

React表现 (React Performance)

  1. Two Quick Ways To Reduce React App’s Size In Production

    两种减少React App生产规模的快速方法

  2. Using Preact Instead Of React

    使用Preact代替React

功能编程 (Functional Programming)

  1. JavaScript Is Turing Complete — Explained

    JavaScript正在完善–解释

  2. Functional Programming In JS — With Practical Examples (Part 1)

    JS中的函数式编程—结合实际示例(第1部分)

  3. Functional Programming In JS — With Practical Examples (Part 2)

    JS中的函数式编程—结合实际示例(第2部分)

  4. Why Redux Need Reducers To Be “Pure Functions”

    为什么Redux需要Reducer成为“纯功能”

Web包装 (WebPack)

  1. Webpack — The Confusing Parts

    Webpack —令人困惑的部分

  2. Webpack & Hot Module Replacement [HMR] (under-the-hood)

    Webpack和热模块更换[HMR] ( 后台 )

  3. Webpack’s HMR And React-Hot-Loader — The Missing Manual

    Webpack的HMR和React-Hot-Loader —缺少的手册

Draft.js (Draft.js)

  1. Why Draft.js And Why You Should Contribute

    为什么选择Draft.js,为什么要贡献力量

  2. How Draft.js Represents Rich Text Data

    Draft.js如何表示富文本数据

React And Redux: (React And Redux :)

  1. Step by Step Guide To Building React Redux Apps

    构建React Redux应用程序的逐步指南

  2. A Guide For Building A React Redux CRUD App (3-page app)

    构建React Redux CRUD应用程序指南 (3页应用程序)

  3. Using Middlewares In React Redux Apps

    在React Redux应用程序中使用中间件

  4. Adding A Robust Form Validation To React Redux Apps

    向React Redux应用添加强大的表单验证

  5. Securing React Redux Apps With JWT Tokens

    使用JWT令牌保护React Redux应用程序

  6. Handling Transactional Emails In React Redux Apps

    在React Redux应用程序中处理交易电子邮件

  7. The Anatomy Of A React Redux App

    React Redux应用程序剖析

  8. Why Redux Need Reducers To Be “Pure Functions”

    为什么Redux需要Reducer成为“纯功能”

  9. Two Quick Ways To Reduce React App’s Size In Production

    两种减少React App生产规模的快速方法

如果这有用,请单击拍手? 几次点击下面的按钮表示您的支持! ???? (If this was useful, please click the clap ? button below a few times to show your support! ⬇⬇⬇ ??)

If you have questions, please feel free to ask me on Twitter: https://twitter.com/rajaraodv

如果您有任何疑问,请随时在Twitter上问我: https : //twitter.com/rajaraodv

翻译自: https://www.freecodecamp.org/news/jazz-up-your-zsh-terminal-in-seven-steps-a-visual-guide-e81a8fd59a38/

终端zsh

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

终端zsh_只需七个步骤,即可使您的“ ZSH”终端站起来—直观指南 的相关文章

  • JDBC 时间戳和日期 GMT 问题

    我有一个 JDBC 日期列 如果我使用 getDate 则会得到 date 仅部分2009 年 10 月 2 日但如果我使用 getTimestamp 我会得到完整的 date 2009 年 10 月 2 日 13 56 78 890 这正
  • 在 iPython/pandas 中绘制多条线会生成多个图

    我试图了解 matplotlib 的状态机模型 但在尝试在单个图上绘制多条线时遇到错误 据我了解 以下代码应该生成包含两行的单个图 import pandas as pd import pandas io data as web aapl
  • Python 3在for循环中更改字典键的值不起作用

    我的 python 3 代码没有按预期工作 def addFunc x y print x y def subABC x y z print x y z def doublePower base exp print 2 base exp d
  • Pandas groupby apply 执行缓慢

    我正在开发一个涉及大量数据的程序 我正在使用 python pandas 模块来查找数据中的错误 这通常工作得非常快 然而 我当前编写的这段代码似乎比应有的速度慢得多 我正在寻找一种方法来加快速度 为了让你们正确测试它 我上传了一段相当大的
  • 在seaborn中对箱线图x轴进行排序

    我的数据框round data看起来像这样 error username task path 0 0 02 n49vq14uhvy93i5uw33tf7s1ei07vngozrzlsr6q6cnh8w 39 png 1 0 10 n49vq
  • Selenium 不会在新选项卡中打开新 URL(Python 和 Chrome)

    我想使用 Selenium WebDriver 和 Python 在不同的选项卡中打开相当多的 URL 我不确定出了什么问题 driver webdriver Chrome driver get url1 time sleep 5 driv
  • 根据列索引重命名 Dataframe 列

    是否有内置函数可以按索引重命名 pandas 数据框 我以为我知道列标题的名称 但事实证明第二列中有一些十六进制字符 根据我接收数据的方式 我将来可能会在第 2 列中遇到这个问题 因此我无法将这些特定的十六进制字符硬编码到 datafram
  • Hibernate 本机查询 - char(3) 列

    我在 Oracle 中有一个表 其中列 SC CUR CODE 是 CHAR 3 当我做 Query q2 em createNativeQuery select sc cur code sc amount from sector cost
  • 列表过滤器内的 Java 8 lambda 列表

    示例 JSON id 1 products id 333 status Active id 222 status Inactive id 111 status Active id 2 products id 6 status Active
  • 如何更改 Ubuntu 14.04 上的 php-cli 版本?

    我是 Linux 新手 在篡改时破坏了一些 php 设置 如果我执行一个包含以下内容的 php 脚本 phpinfo 它显示 php 版本为 5 6 但通过命令行 如果我运行php v它返回 7 0 版本 我想让两个版本匹配 我怎样才能修复
  • partitioningBy 必须生成一个包含 true 和 false 条目的映射吗?

    The 分区依据 https docs oracle com javase 8 docs api java util stream Collectors html partitioningBy java util function Pred
  • 在 scipy 中创建新的发行版

    我试图根据我拥有的一些数据创建一个分布 然后从该分布中随机抽取 这是我所拥有的 from scipy import stats import numpy def getDistribution data kernel stats gauss
  • 沿轴 0 重复 scipy csr 稀疏矩阵

    我想重复 scipy csr 稀疏矩阵的行 但是当我尝试调用 numpy 的重复方法时 它只是将稀疏矩阵视为对象 并且只会将其作为 ndarray 中的对象重复 我浏览了文档 但找不到任何实用程序来重复 scipy csr 稀疏矩阵的行 我
  • Pip 无法在 Windows 上安装 Twisted

    我正在尝试在 Windows 8 计算机上安装 Twisted 在 Twisted 官方网站上 只有一个 Windows 版的 Wheel 文件 https twistedmatrix com trac wiki Downloads htt
  • Log4j2 ThreadContext 映射不适用于parallelStream()

    我有以下示例代码 public class Test static System setProperty isThreadContextMapInheritable true private static final Logger LOGG
  • 如何更改matplotlib中双头注释的头大小?

    Below figure shows the plot of which arrow head is very small 我尝试了下面的代码 但它不起作用 它说 引发 AttributeError 未知属性 s k 属性错误 未知属性头宽
  • 在 Linux 中禁用历史记录 [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 要在 Linux 环境中禁用历史记录 我执行了以下命令 export HISTFILESIZE 0 export HISTSIZE 0 u
  • 在父类中访问子类变量

    我有一个父类和一个继承的子类 我想知道如何访问我的父类中的子类变量 我尝试了这个但失败了 class Parent object def init self print x class Child Parent x 1 x Child Er
  • Java/Python 中的快速 IPC/Socket 通信

    我的应用程序中需要两个进程 Java 和 Python 进行通信 我注意到套接字通信占用了 93 的运行时间 为什么通讯这么慢 我应该寻找套接字通信的替代方案还是可以使其更快 更新 我发现了一个简单的修复方法 由于某些未知原因 缓冲输出流似
  • Java 11 - 将 Spring @PostConstruct 替换为 afterPropertiesSet 或使用 initMethod

    我正在使用 spring 应用程序 有时会使用 PostConstruct用于代码和测试中的设置 看来注释将被排除在外Java 11 https www baeldung com spring postconstruct predestro

随机推荐

  • 获取 gps信息_ROS传感器之GPS简介

    一 传感器分类 在自动驾驶或者机器人领域 传感器的使用按照测量对象划分 可分为两大类 一类是测量自身状态 另一类测量环境状态 前者主要包含GPS IMU和编码器 后者主要有激光雷达 毫米波雷达和相机 这里的状态主要是指位置和速度 有些传感器
  • android 登陆界面

    LoginActivity java package com example ruian import android app Activity import android app AlertDialog import android c
  • 用python将结果存进csv文件中

    def writeCsv File species row File species out open data test csv a newline csv writer csv writer out dialect excel csv
  • 代码走查和代码审查_这是经过1000多次代码审查后我学到的东西

    代码走查和代码审查 这个故事最初发表在我的博客上 如果您对这种内容感兴趣 请随时签出并订阅 在过去的三年中 我已经审查了1000多个请求 合并 请求 在那段时间里 我学到了很多东西 主要是关于如何不审阅代码 如何减轻过程的痛苦 使高质量的代
  • python字典中的值只能是字符串类型_python字典key不能是可以是啥类型

    python中字典的key不能是可变类型 字典可存储任意类型对象 其中值可以取任何数据类型 但键必须是不可变的 如字符串 数字或元组 语法格式 d key1 value1 key2 value2 字典是另一种可变容器模型 且可存储任意类型对
  • 神经搜索有多能?

    原文 Alex C G 译文 Piper Hu 本文阅读时长约为5分钟 神经搜索 是数据处理上非常新颖的一个话题 也是Jina AI目前着重关注的方向 可是到底神经搜索是什么 它能解决什么问题 与现在开发者们使用的搜索系统搭建又有什么不一样
  • javaScript节流与防抖

    一 节流 throttle 用来实现阻止在短时间内重复多次触发同一个函数 主要用途 防止使用脚本循环触发网络请求的函数的恶意行为 确保请求的真实性 当然也包括其他阻止高频触发行为的应用 实现原理图 代码实现 1 节流函数 2 functio
  • python中xpath解析网页html文档

    1 首先安装xpath解析工具第三方库 pip install i https pypi tuna tsinghua edu cn simple lxml 2 选取节点 选取未知节点 选取若干路径 举例说明 谓语用来查找某个特定的节点或者包
  • 三子棋(人机对战)

    目录 整体思路 头文件如下 为什么要使用头文件呢 头文件的使用 游戏主函数如下 功能实现如下 注意 整体思路 1 创建一个二维数组 2 初始化二维数组 3 打印棋盘 4 玩家下棋且打印棋盘 5 电脑下棋且打印棋盘 6 判断输赢 头文件如下
  • 智能合约概述——以太坊虚拟机

    以太坊虚拟机 概述 以太坊虚拟机 EVM 是智能合约的运行环境 它不仅是沙盒封装的 而且是完全隔离的 也就是说在 EVM 中运行代码是无法访问网络 文件系统和其他进程的 甚至智能合约之间的访问也是受限的 账户 以太坊中有两类账户 它们共用同
  • springmvc 项目本地开发正常,war 上了 wins下的tomcat,web 页面中文乱码

    前言 今天打包 springmvc 项目 war 包 windows 下 tomcat 运行 浏览器访问乱码 解决方案 tomcat bin 目录下 catalina bat 文件中添加 set JAVA OPTS Dfile encodi
  • 区块链之元宇宙

    区块链之元宇宙 元宇宙概念 元宇宙 Metaverse 是利用科技手段进行链接与创造的 与现实世界映射和交互的虚拟世界 具备新型社会体系的数字生活空间 元宇宙本质上是对现实世界的虚拟化 数字化过程 需要对内容生产 经济系统 用户体验以及实体
  • 智能教育装备法则

    二十一世纪 在互联网 大数据 智慧教育等新科技的带动下 我国教育信息化教育信息化产业规模将以每年平15 的速度增长 格物斯坦表示 有越来越多智能教育装备的后起之秀企业开启了他们的研发软件和硬件的能力 教育的信息化首先是教育装备的信息化和智慧
  • 浅析瀑布流布局及其原理

    一 什么是瀑布流 瀑布流 又被称作为瀑布流式布局 是一种比较流行的网站页面布局方式 视觉表现为参差不齐的多栏布局 随着页面滚动条向下滚动 这种布局还会不断加载数据块并附加至当前尾部 这种布局方式常见于一些图片为主的网站 为什么要使用瀑布流
  • 关于QT5.12.0在VS2019上使用的细节

    关于QT5 12 0在VS2019上的使用细节 博主使用的版本 QT5 12 0 VS2019 其他Qt版本同样适用 1 添加Qt的环境变量 在Win10下 编辑系统环境变量 环境变量 Path 新建添加Qt的bin目录路径 D QT 12
  • Burpsuite Professional 2023.6.2 最新版安装教程

    更新时间 2023年07月23日11 47 48 本文以mac为例 Windows上方法是类似的 1 缘由 因为我用的Burpsuite版本有点老 导致有时候给人培训的时候 面对新版Burpsuite一脸懵逼 很多操作都不太一样 所以这次直
  • 从零开始 verilog 以太网交换机(七)总结与展望

    从零开始 verilog 以太网交换机 七 总结与展望 声明 博主主页 王 嘻嘻的CSDN主页 从零开始 verilog 以太网交换机系列专栏 点击这里 未经作者允许 禁止转载 侵权必删 关注本专题的朋友们可以收获一个经典交换机设计的全流程
  • Trinitycore学习之在vscode查看远端服务器上源码配置

    1 安装vscode 去官网下载 这里下载windows版本安装包 zip https code visualstudio com Download 2 安装后 安装扩展chinese 使用中文设置 需要重启vscode 3 安装ssh相关
  • 报错:‘wget‘ 不是内部或外部命令,也不是可运行的程序

    在jupyter lab下使用wegt 导入需要用到的数据集 wget https tianchi media oss cn beijing aliyuncs com DSW 7XGBoost train csv wget 不是内部或外部命
  • 终端zsh_只需七个步骤,即可使您的“ ZSH”终端站起来—直观指南

    终端zsh by rajaraodv 通过rajaraodv 只需七个步骤 即可使您的 ZSH 终端站起来 直观指南 Jazz Up Your ZSH Terminal In Seven Steps A Visual Guide In th