Merge pull request #41 from LCTT/master

更新
This commit is contained in:
zEpoch
2021-07-18 20:38:49 +08:00
committed by GitHub
41 changed files with 3137 additions and 1916 deletions

View File

@@ -0,0 +1,55 @@
[#]: collector: "lujun9972"
[#]: translator: "mcfd"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13589-1.html"
[#]: subject: "My top 7 keywords in Rust"
[#]: via: "https://opensource.com/article/20/10/keywords-rust"
[#]: author: "Mike Bursell https://opensource.com/users/mikecamel"
我的 7 大 Rust 关键字
======
> 从 Rust 标准库学习一些有用的关键字。
![Rustacean t-shirt][1]
我使用 [Rust][2] 已经有几个月了,写的东西比我预期的要多——尽管随着我的学习,我改进了所写的代码,并完成了一些超出我最初意图的更复杂的任务,相当多的东西已经被扔掉了。
我仍然喜欢它,并认为谈论一些在 Rust 中反复出现的重要关键字可能会有好处。我会提供我个人对它们的作用的总结:为什么你需要考虑如何使用它们,以及任何其他有用的东西,特别是对于刚接触 Rust 的新手或来自另一种语言的人(如 Java请阅读我的文章 [为什么作为一个 Java 程序员的我喜欢学习 Rust][3])。
事不宜迟,让我们开始吧。获取更多信息的好地方总是 Rust 官方文档 —— 你可能想从 [std 标准库][4]开始。
1. `const` – 你可以用 `const` 来声明常量,而且你应该这样做。虽然这不是造火箭,但请一定要用 `const` ,如果你要在不同的模块中使用常量,那请创建一个 `lib.rs` 文件Rust 默认的),你可以把所有的常量放在一个命名良好的模块中。我曾经在不同模块的不同文件中发生过 `const` 变量名(和值)的冲突,仅仅是因为我太懒了,除了在不同文件中剪切和粘贴之外,我本可以通过创建一个共享模块来节省大量的工作。
2. `let` – 你并不 _总是_ 需要用 `let` 语句声明一个变量但当你这样做时你的代码会更加清晰。此外如果可以请一定要添加变量类型。Rust 会尽最大努力猜测它应该是什么类型的变量,但它不一定总能在运行时做到这一点(在这种情况下,编译器 [Cargo][5] 会提示你),它甚至可能做不到你期望的那样。在后一种情况下,对于 Cargo 来说,抱怨你所赋值的函数(例如)与声明不一致,总比 Rust 试图帮助你做错事,而你却不得不在其他地方花费大量时间来进行调试要简单。
3. `match`  `match` 对我来说是新鲜事物,我喜欢使用它。它与其他编程语言中的 `switch` 没有什么不同,但在 Rust 中被广泛使用。它使代码更清晰易读如果你做了一些愚蠢的事情例如错过一些可能的情况Cargo 会很好地提示你。我一般的经验法则是,在管理不同的选项或进行分支时,如果可以使用 `match`,那就请一定要使用它。
4. `mut`  在声明一个变量时如果它的值在声明后会发生变化那么你需要声明它是可变的LCTT 译注Rust 中变量默认是不可变的)。常见的错误是在某个变量 _没有_ 变化的情况下声明它是可变的,这时编译器会警告你。如果你收到了 Cargo 的警告,说一个可变的变量没有被改变,而你认为它被 _改变_ 了,那么你可能要检查该变量的范围,并确保你使用的是正确的那个。
5. `return` – 实际上我很少使用 `return`,它用于从函数中返回一个值,但是如果你只是在函数的最后一行提供值(或提供返回值的函数),通常会变得更简单,能更清晰地阅读。警告:在很多情况下,你 __ 忘记省略这一行末尾的分号(`;`),如果你这样做,编译器会不高兴的。
6. `unsafe` – 如其意:如果你想做一些不能保证 Rust 内存安全的事情,那么你就需要使用这个关键字。我绝对无意在现在或将来的任何时候宣布我的任何 Rust 代码不安全Rust 如此友好的原因之一是它阻止了这种黑客行为。如果你真的需要这样做,再想想,再想想,然后重新设计代码。除非你是一个非常低级的系统程序员,否则要 _避免_ 使用 `unsafe`
7. `use` – 当你想使用另一个 crate 中的东西时,例如结构体、变量、函数等,那么你需要在你要使用它的代码的代码块的开头声明它。另一个常见的错误是,你这样做了,但没有在 `Cargo.toml` 文件中添加该 crate (最好有一个最小版本号)。
我知道,这不是我写过的最复杂的文章,但这是我在开始学习 Rust 时会欣赏的那种文章。我计划在关键函数和其他 Rust 必知知识方面编写类似的文章:如果你有任何要求,请告诉我!
* * *
_本文最初发表于 [Alice, Eve, and Bob][6] 经作者许可转载。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/keywords-rust
作者:[Mike Bursell][a]
选题:[lujun9972][b]
译者:[mcfd](https://github.com/mcfd)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mikecamel
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rustacean-tshirt.jpg?itok=u7LBmyaj "Rustacean t-shirt"
[2]: https://www.rust-lang.org/
[3]: https://opensource.com/article/20/5/rust-java
[4]: https://doc.rust-lang.org/std/
[5]: https://doc.rust-lang.org/cargo/
[6]: https://aliceevebob.com/2020/09/01/rust-my-top-7-keywords/

View File

@@ -0,0 +1,121 @@
[#]: subject: (How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install)
[#]: via: (https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (turbokernel)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13585-1.html)
如何在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网
======
![](https://img.linux.net.cn/data/attachment/album/202107/16/104745wne0x111onmafxj9.jpg)
在最小化服务器安装中,设置互联网或网络是非常容易的。在本指南中,我们将解释如何在 CentOS、RHEL、Rocky Linux 最小安装中设置互联网或网络。
当你刚刚完成任何服务器发行版的最小化安装时你没有任何图形界面或桌面环境可以用于设置你的网络或互联网。因此当你只能使用终端时了解如何设置联网是很重要的。NetworkManager 以及 systemd 服务为完成这项工作提供了必要的工具。以下是具体使用方法。
### 在 CentOS、RHEL、Rocky Linux 最小化安装中设置互联网
完成安装后,启动服务器终端。理想情况下,你应该会看到提示符。使用 root 或 admin 账户登录。
然后,首先尝试使用 `nmcli` 检查网络接口的状态和细节。`nmcli` 是一个控制 NetworkManager 服务的命令行工具。使用以下命令进行检查。
```
nmcli device status
```
这将显示设备名称、状态等。
![nmcli device status][1]
运行工具 `nmtui` 来配置网络接口。[nmtui][2] 是 NetworkManager 工具的一部分,它为你提供了一个漂亮的用户界面来配置网络。这是 NetworkManager-tui 包的一部分,当你完成最小服务器的安装时它应该默认安装。
```
nmtui
```
`nmtui` 窗口中点击编辑一个连接。
![nmtui Select options][3]
选择网口名称:
![Select Interface to Edit][4]
在编辑连接窗口,为 IPv4 和 IPv6 选择自动。并选择自动连接。完成后按 “OK”。
![nmtui Edit Connection][5]
通过使用如下 [systemd systemctl][6] 命令,重新启动 NetworkManager 服务。
```
systemctl restart NetworkManager
```
如果一切顺利,在 CentOS、RHEL、Rocky Linux 服务器的最小化安装中你应该可以连接到网络和互联网了,前提是你的网络有互联网连接。你可以用 `ping` 来验证它是否正常。
![setup internet minimal server CentOS Rocky Linux RHEL][7]
### 额外技巧:在最小化服务器中设置静态 IP
当你把网络配置设置为自动,当你连接到互联网时,网口会动态地分配 IP。在某些情况下当你建立一个局域网 LAN 时,你可能想给你的网口分配静态 IP。这超级简单。
打开你的网络的网络配置脚本。根据你的设备修改高亮部分:
```
vi /etc/sysconfig/network-scripts/ifcfg-ens3
```
在上面的文件中,用 `IPADDR` 属性添加你想要的 IP 地址。保存该文件。
```
IPADDR=192.168.0.55
```
`/etc/sysconfig/network` 中为你的网络添加网关:
```
NETWORKING=yes
HOSTNAME=debugpoint
GATEWAY=10.1.1.1
```
`/etc/resolv.conf``resolv.conf` 中添加任意公共 DNS 服务器:
```
nameserver 8.8.8.8
nameserver 8.8.4.4
```
并重新启动网络服务:
```
systemctl restart NetworkManager
```
这样就完成了静态 IP 的设置。你也可以使用 `ip addr` 命令检查详细的 IP 信息。
我希望这个指南能帮助你在你的最小化服务器中设置网络、互联网和静态 IP。如果你有任何问题请在评论区告诉我。
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/
作者:[Arindam][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[turbokernel](https://github.com/turbokernel)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmcli-device-status.jpg
[2]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmtui
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Select-options.jpg
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Select-Interface-to-Edit.jpg
[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Edit-Connection.jpg
[6]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/setup-internet-minimal-server-CentOS-Rocky-Linux-RHEL.jpg

View File

@@ -0,0 +1,115 @@
[#]: subject: (Can Windows 11 Influence Linux Distributions?)
[#]: via: (https://news.itsfoss.com/can-windows-11-influence-linux/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: (zz-air)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13588-1.html)
Windows 11 能影响 Linux 发行版吗?
======
> Windows 11 正在为全球的桌面用户制造新闻。它会影响 Linux 发行版走向桌面用户吗?
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/windows-linux-desktop-influence.png?w=1200&ssl=1)
微软的 Windows11 终于发布了。有些人将其与 macOS 进行比较,另一些人则比较其细枝末节发现与 GNOME 和 KDE 的相似之处(这没有多大意义)。
但是,在所有的热议当中,我对另一件事很好奇—— **微软的 Windows 11 能影响桌面 Linux 发行版未来的决策吗?**
在这里,我将提到一些我的想法,即如果它以前发生过,为什么会发生?以及 Linux 发行版未来会怎样。
### 一些 Linux 发行版已经关注类似 Windows 的体验:但是,为什么呢?
微软的 Windows 是最受欢迎的桌面操作系统,因其易操作、软件支持和硬件兼容占据了 88% 的市场分额。
相反, Linux 占有 **大约 2% 的市场分额,** [即使 Linux 比 Windows 有更多的优势][1]。
那么 Linux 能做什么来说服更多的用户将 Linux 作为他们的桌面操作系统呢?
每个桌面操作系统的主要关注点应该是用户体验。当微软和苹果设法为大众提供舒适的用户体验时Linux 发行版并没有设法在这方面取得巨大的胜利。
然而,你将会发现有几个 [Linux 发行版打算取代 Windows 10][2]。这些 Linux 发行版试图提供一个熟悉的用户界面,鼓励 Windows 用户考虑切换到 Linux 。
而且,由于这些发行版的存在,[在 2021 年切换到 Linux][3] 比以往任何时候都更有意义。
因此,为了让更多的用户跳转到 Linux ,微软 Window 多年来已经影响了许多发行版。
### Windows 11 在某些方面比 Linux 好?
用户界面随着 Windows 的发展而不断的发展。即使这是主观的,它似乎是大多数桌面用户的选择。
所以我要说 Windows 11 在这方面做了一些有吸引力的改进。
![][4]
不仅仅局限于 UI/UX ,比如在任务栏中集成微软团队的聊天功能,可以方便用户与任何人即时联系。
**虽然 Linux 发行版没有自己成熟的服务,但是像这样定制的更多开箱即用的集成,应该会使新用户更容易上手。**
并且这让我想起了 Windows 11 的另一个方面——个性化的新闻和信息提要。
当然,微软会为此收集数据,你可能需要使用微软账号登录。但这也减少了用户寻找独立应用程序来跟踪天气、新闻和其他日常信息的摩擦。
Linux 不会强迫用户做出这些选择,但是像这样的特性/集成可以作为额外的选项添加,可以以选择的形式呈现给用户。
**换句话说,在与操作系统集成的同时,使事物更容易访问,应该可以摆脱陡峭的学习曲线。**
而且,可怕的微软商店也在 Windows 11 上进行了重大升级。
![][5]
不幸的是,对于 Linux 发行版,我没有看到对应用中心进行多少有意义的升级,来使其在视觉上更吸引人,更有趣。
elementaryOS 可能正努力专注于 UX/UI ,并不断发展应用中心的体验,但对于大多数其他发行版,没有重大的升级。
![Linux Mint 20.1 中的软件管理器][6]
虽然我很欣赏深度 Linux 在这方面所做的,但它并不是许多用户第一次尝试 Linux 时的热门选择。
### Windows 11 引入了更多的竞争Linux 必须跟上
随着 Windows 11 的推出,作为桌面选择的 Linux 将面临更多的竞争。
虽然在 Linux 世界中,我们确实有一些 Windows 10 经验的替代品,但还没有针对 Windows 11 的。
但这让我们看到了来自 Linux 社区的明显反击—— **一个针对 Windows 11 的 Linux 发行版**
不管是讨厌还是喜欢微软最新的 Windows 11 设计方案,在接下来的几年里,大众将会接受它。
并且,为了使 Linux 成为一个引人注目的桌面替代品Linux 发行版的设计语言也必须发展。
不仅仅是桌面市场,还有笔记本专用的设计选择也需要对 Linux 发行版进行重大改进。
像 [Pop!_OS_System 76][7] 这些选择一直试图为 Linux 提供这种体验,这是一个良好的开端。
我认为 Zorin OS 可以作为一个引入 “**Windows 11**” 布局的发行版,作为让更多用户尝试 Linux 的一个选择。
别忘了,在 Windows 11 将 Android 应用程序支持作为一项功能推向市场之后,[深度 Linux 就引入了 Android 应用程序支持。][8]
所以,你看,当微软的 Windows 采取行动时,对 Linux 也会产生连锁反应。而深度 Linux 的 Android 应用支持只是一个开始……让我们看看接下来还会出现什么。
_你对 Windows 11 影响 Linux 桌面的未来有什么看法?我们也需要进化吗?或者我们应该继续与众不同,不受大众选择的影响?_
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/can-windows-11-influence-linux/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[zz-air](https://github.com/zz-air)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-better-than-windows/
[2]: https://itsfoss.com/windows-like-linux-distributions/
[3]: https://news.itsfoss.com/switch-to-linux-in-2021/
[4]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/windows-11-home.png?w=1024&ssl=1
[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/windows-10-app-store.png?w=1024&ssl=1
[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/software-manager-linux-mint.png?w=862&ssl=1
[7]: https://pop.system76.com
[8]: https://news.itsfoss.com/deepin-linux-20-2-2-release/

View File

@@ -3,16 +3,18 @@
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13581-1.html)
在 Linux 命令行上编辑 PDF
======
使用 qpdf 和 poppler-utils 来分割、修改和合并 PDF 文件。
![Text editor on a browser, in blue][1]
你收到的许多文件都是 PDF 格式的。有时这些 PDF 需要被处理。例如,可能需要删除或添加页面,或者你可能需要签署或修改一个特定的页面
> 使用 qpdf 和 poppler-utils 来分割、修改和合并 PDF 文件
![](https://img.linux.net.cn/data/attachment/album/202107/15/093249xh6dmg846py8bgbc.jpg)
你收到的许多文件都是 PDF 格式的。有时这些 PDF 需要进行处理。例如,可能需要删除或添加页面,或者你可能需要签署或修改一个特定的页面。
不管是好是坏,这就是我们所处的现实。
@@ -23,7 +25,7 @@
在 Linux 上,你可以用你的包管理器(如 `apt``dnf`)来安装 `qpdf``poppler-utils`。比如在 Fedora 上:
```
`$ sudo dnf install qpdf poppler-utils`
$ sudo dnf install qpdf poppler-utils
```
在 macOS 上,使用 [MacPorts][2] 或 [Homebrew][3]。在 Windows 上,使用 [Chocolatey][4]。
@@ -33,31 +35,27 @@
`qpdf` 命令可以做很多事情,但我主要用它来:
1. 将一个 PDF 分割成不同的页面
2. 将 PDF 文件合并成一个文件
2. 将多个 PDF 文件合并成一个文件
要将一个 PDF 分割成不同的页面:
```
`qpdf --split-pages original.pdf split.pdf`
qpdf --split-pages original.pdf split.pdf
```
这就会生成像 `split-01.pdf``split-02.pdf` 这样的文件。每个文件都是一个单页的 PDF 文件。
合并文件比较微妙:
```
`qpdf --empty concatenated.pdf --pages split-*.pdf --`
qpdf --empty concatenated.pdf --pages split-*.pdf --
```
这就是 `qpdf` 默认的做法。`--empty` 选项告诉 qpdf 从一个空文件开始。结尾处的两个破折号(`--`)表示没有更多的文件需要处理。这是一个参数反映内部模型的例子,而不是人们使用它的目的,但至少它能运行并产生有效的 PDF
### poppler-utils
这个软件包包含几个工具,但我用得最多的是 [pdftoppm][5],它把 PDF 文件转换为可移植的像素图(`ppm`)文件。我通常在用 `qpdf`分割页面后使用它,并需要将特定页面转换为我可以修改的图像。`ppm` 格式并不为人所知,但重要的是大多数图像处理方法,包括 [ImageMagick][6]、[Pillow][7] 等,都可以使用它。这些工具中的大多数也可以将文件保存为 PDF。
这个软件包包含几个工具,但我用得最多的是 [pdftoppm][5],它把 PDF 文件转换为可移植的像素图(`ppm`)文件。我通常在用 `qpdf` 分割页面后使用它,并需要将特定页面转换为我可以修改的图像。`ppm` 格式并不为人所知,但重要的是大多数图像处理方法,包括 [ImageMagick][6]、[Pillow][7] 等,都可以使用它。这些工具中的大多数也可以将文件保存为 PDF。
### 工作流程
@@ -68,11 +66,9 @@
* 根据需要修改图像,并将其保存为 PDF。
* 使用 `qpdf` 将各页合并成一个 PDF。
### 其他工具
有许多很好的开源命令来处理 PDF无论你是[缩小它们][8]、[从文本文件创建它们][9]、[转换文档][10],还是尽[完全避免它们][11]。你最喜欢的开源 PDF 工具是什么?请在评论中分享它们。
有许多很好的开源命令来处理 PDF无论你是 [缩小它们][8]、[从文本文件创建它们][9]、[转换文档][10],还是尽[完全避免它们][11]。你最喜欢的开源 PDF 工具是什么?请在评论中分享它们。
--------------------------------------------------------------------------------
@@ -81,7 +77,7 @@ via: https://opensource.com/article/21/7/qpdf-command-line
作者:[Moshe Zadka][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -4,38 +4,38 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (turbokernel)
[#]: publisher: ( )
[#]: url: ( )
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13582-1.html)
在 Linux 命令行中生成密码
======
在命令行上创建符合特定规范的密码。
![Password lock][1]
大多数网站或应用都要求用户创建带有安全密码的账户,以便他们能够迎合用户体验。虽然这有利网站开发者,但肯定不会让用户的生活更轻松
> 在命令行上创建符合特定规范的密码
![](https://img.linux.net.cn/data/attachment/album/202107/15/094657l4l494c0080u2ca4.jpg)
大多数网站或应用都要求用户创建带有安全密码的账户,以便他们能够迎合用户体验。虽然这有利于网站开发者,但肯定不会让用户的生活更轻松。
有时,创建密码的规则是如此严格,以至于难以生成一个强壮且合规的组合。如果有一个工具可以生成符合网站或应用程序要求的任何规则的安全密码,那就容易多了。
这就是 pwgen 的用武之地。根据它的[手册页][2]“pwgen 生成的密码在设计上很容易被人类记住,同时又尽可能的安全。” 它返回多个符合你所提供的规则的密码选项,这样你就可以选择一个你喜欢的(而且可能更容易记住)。
这就是 `pwgen` 的用武之地。根据它的 [手册页][2]“pwgen 生成的密码是为了让人容易记住,同时又尽可能的安全。” 它返回符合你所提供的规则的多个密码选项,这样你就可以选择一个你喜欢的(而且可能更容易记住)。
### 安装 pwgen
在 Linux 上,你可以通过包管理器安装 pwgen。例如在 Fedora 上:
在 Linux 上,你可以通过包管理器安装 `pwgen`。例如,在 Fedora 上:
```
`$ sudo dnf install pwgen`
$ sudo dnf install pwgen
```
在 macOS 上,使用 [MacPorts][3] 或 [Homebrew][4]。在 Windows 上,使用 [Chocolatey][5]。
在 macOS 上,可以使用 [MacPorts][3] 或 [Homebrew][4]。在 Windows 上,可以使用 [Chocolatey][5]。
### 使用 pwgen 生成密码
有几种方式可以通过向 pwgen 传递参数来生成密码,这取决于你所需的参数。这里有一些例子。更多的参数选项请查阅手册页。
有几种方式可以通过向 `pwgen` 传递参数来生成密码,这取决于你所需的参数。这里有一些例子。更多的参数选项请查阅手册页。
如果你需要一个安全的、难以记忆的特定长度的密码,请运行 `pwgen --secure`(或简写 `-s`),后面跟上你所需的密码长度:
```
$ pwgen -s 25
pnFBg9jB8AlKL3feOuS2ZwMGb xlmDRoaLssduXTdGV6jkQhUGY O3IUB3CH7ry2kD4ZrSoODzWez
@@ -54,25 +54,23 @@ gLmYUTp0XZJWvIVbA5rFvBT54 LEm6QVeTMinc056DC9c4V55cV ipV45Ewj704365byKhY8zn766
运行 `pwgen -symbols`(或简写 `-y`),再加上所需的密码长度,生成包含特殊字符的密码:
```
$ pwgen -y 25
Osh0chahxe0won9aech4ese?v pemoh2ohm9aim;iu4Eiy"ah0y Taiqu;o2aeSh+o4aedoagait3
Vei;phoh5owai5jui+t|ei3ot teu!w7mahxoh0Po7ohph8Iez6 quie#phooCeu2lohm5shaPaer
eTh5AechaexieToh9ez5eeZ;e nuloh1ico0Nool:eG<aiv`ah, Heeghuo8ahzii1Iep~ie_ch7p
eTh5AechaexieToh9ez5eeZ;e nuloh1ico0Nool:eG<aiv`ah, Heeghuo8ahzii1Iep~ie_ch7p
oe6Xee6uchei7Oroothail~iL ahjie!Chee.W4wah[wuu]phoo ees7ieb!i[ibahhei1xoz2Woh
Atei9ooLu7lo~sh&gt;aig@ae9No OVahh2OhNgahtu8iethaR@i7o ouFai8ahP@eil4Ieh5le5ipu5
Atei9ooLu7lo~sh>aig@ae9No OVahh2OhNgahtu8iethaR@i7o ouFai8ahP@eil4Ieh5le5ipu5
eeT4tahW0ieng9fe?i5auM3ie seet0ohc4aiJei]koiGha2zu% iuh@oh4eix0Vuphi?o,hei9me
loh0Aeph=eix(ohghe6chee3z ahgh2eifiew8dahG_aeph8woo oe!B4iasaeHo`ungie3taekoh
cei!c&lt;ung&amp;u,shee6eir7Eigo va6phou8ooYuoquohghi-n6Qu eeph4ni\chi2shohg3Die1hia
cei!c<ung&u,shee6eir7Eigo va6phou8ooYuoquohghi-n6Qu eeph4ni\chi2shohg3Die1hia
uCagha8Toos2bahLai7phuph` Zue2thieng9ohhoo~shoh6ese Aet7Lio1ailee^qu4hiech5ie
dee]kuwu9OhTh3shoi2eijoGe daethahH6ahV3eekoo9aep$an aehiiMaquieHee9moh`l_oh4l
aec#ii6Chophu3aigh*ai#le4 looleihoog:uo4Su"thiediec eeTh{o7Eechah7eeJ2uCeish!
oi3jaiphoof$aiy;ieriexeiP Thozool3aipi|cahfu0Ha~e1e az/u8iel2Jaeph2vooshai9Wi
```
运行 `pwgen --capitalize`(或缩写 `-c`),后面跟上密码长度,生成包含大写字母的密码:
运行 `pwgen --capitalize`或缩写 `-c`,后面跟上密码长度,生成包含大写字母的密码:
```
$ pwgen -c 25
@@ -93,7 +91,7 @@ tohHe3uu2eXieheeQuoh7eit8 aiMieCeizeivu1ooch8aih0sh Riojei2yoah0AiWeiRoMieQu0
### 让它变得简单
由于人脑更倾向于选择模式,所以强壮随机密码难以生成。通过使用 pwgen你可以轻松生成密码。借助于优秀的[开源密码管理器][6],你可以完全从易于使用但难以猜测的密码中获益。
由于人脑更倾向于选择模式,所以强壮随机密码难以生成。通过使用 `pwgen`,你可以轻松生成密码。借助于优秀的 [开源密码管理器][6],你可以完全从易于使用但难以猜测的密码中获益。
--------------------------------------------------------------------------------

View File

@@ -0,0 +1,116 @@
[#]: subject: (Encrypt and decrypt files with a passphrase on Linux)
[#]: via: (https://opensource.com/article/21/7/linux-age)
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (turbokernel)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13592-1.html)
在 Linux 上用密码加密和解密文件
======
> age 是一个简单的、易于使用的工具,允许你用一个密码来加密和解密文件。
![](https://img.linux.net.cn/data/attachment/album/202107/18/102604m808ppq4ddd8w910.jpg)
文件的保护和敏感文档的安全加密是用户长期以来关心的问题。即使越来越多的数据被存放在网站和云服务上,并由具有越来越安全和高强度密码的用户账户来保护,但我们能够在自己的文件系统中存储敏感数据仍有很大的价值,特别是我们能够快速和容易地加密这些数据时。
[age][2] 能帮你这样做。它是一个小型且易于使用的工具,允许你用一个密码加密一个文件,并根据需要解密。
### 安装 age
`age` 可以从众多 Linux 软件库中 [安装][3]。
在 Fedora 上安装它:
```
$ sudo dnf install age -y
```
在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5] 来安装。在 Windows 上,使用 [Chocolatey][6] 来安装。
### 用 age 加密和解密文件
`age` 可以用公钥或用户自定义密码来加密和解密文件。
#### 在 age 中使用公钥
首先,生成一个公钥并写入 `key.txt` 文件:
```
$ age-keygen -o key.txt
Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9
```
### 使用公钥加密
要用你的公钥加密一个文件:
```
$ touch mypasswds.txt | age -r \
ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 \
> mypass.tar.gz.age
```
在这个例子中,我使用生成的公钥加密文件 `mypasswds.txt`,保存在名为 `mypass.tar.gz.age` 的加密文件中。
### 用公钥解密
如需解密加密文件,使用 `age` 命令和 `--decrypt` 选项:
```
$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age
```
在这个例子中,`age` 使用存储在 `key.text` 中的密钥,并解密了我在上一步创建的加密文件。
### 使用密码加密
不使用公钥的情况下对文件进行加密被称为对称加密。它允许用户设置密码来加密和解密一个文件。要做到这一点:
```
$ age --passphrase --output mypasswd-encrypted.txt mypasswd.txt
Enter passphrase (leave empty to autogenerate a secure one):
Confirm passphrase:
```
在这个例子中,`age` 提示你输入一个密码,它将通过这个密码对输入文件 `mypasswd.txt` 进行加密,并生成加密文件 `mypasswd-encrypted.txt`
### 使用密码解密
如需将用密码加密的文件解密,可以使用 `age` 命令和 `--decrypt` 选项:
```
$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt
```
在这个例子中,`age` 提示你输入密码,只要你提供的密码与加密时设置的密码一致,`age` 随后将 `mypasswd-encrypted.txt` 加密文件的内容解密为 `passwd-decrypt.txt`
### 不要丢失你的密钥
无论你是使用密码加密还是公钥加密你都_不能_丢失加密数据的凭证。根据设计如果没有用于加密的密钥通过 `age` 加密的文件是不能被解密的。所以,请备份你的公钥,并记住这些密码!
### 轻松实现加密
`age` 是一个真正强大的工具。我喜欢把我的敏感文件,特别是税务记录和其他档案数据,加密到 `.tz` 文件中,以便以后访问。`age` 是用户友好的,使其非常容易随时加密。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/linux-age
作者:[Sumantro Mukherjee][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[turbokernel](https://github.com/turbokernel)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sumantro
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files)
[2]: https://github.com/FiloSottile/age
[3]: https://github.com/FiloSottile/age#installation
[4]: https://opensource.com/article/20/11/macports
[5]: https://opensource.com/article/20/6/homebrew-mac
[6]: https://opensource.com/article/20/3/chocolatey

View File

@@ -0,0 +1,95 @@
[#]: subject: (Linux Mint 20.2 is Now Available With New Features and Tools)
[#]: via: (https://news.itsfoss.com/linux-mint-20-2-release/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: (lcf33)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13584-1.html)
包含新功能和工具的 Linux Mint 20.2 已经发布
======
>Linux Mint 20.2 是一次令人兴奋的升级,它有新的应用程序、更新提醒和桌面环境的升级。是时候升级了?
![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/linux-mint-20-2.jpg?w=1200&ssl=1)
几周前Linux Mint 20.2 beta 版 [发布][1]了。现在Linux Mint 20.2 最终稳定版也发布了。
这个版本是基于 Ubuntu 20.04 的 LTS长期支持版本支持 2025 年截止。
来看下这个版本有什么新特性,以及如何获取它。
### Linux Mint 20.2: 有什么新特性?
这个版本主要两点是增加了更新通知。该功能鼓励用户更新系统,以确保安全性。
该功能不像 [Windows 系统那样强制更新][2],但它会留意你多久没有更新系统,检查系统运行时间,然后提醒你更新。
![][3]
更棒的是,你可以配置更新通知。
其他主要升级还有:桌面环境 **Cinnamon 5**,新的**批量改名工具** Bulky**用 Sticky Notes 取代 GNote** 作为默认笔记应用。
![][4]
批量文件改名工具可以在所有桌面版本中使用,但不包括 Xfce。因为 Xfce 默认的文件管理器Thunar已经有该功能。
Cinnamon 5 不是很让人激动,不过有一些内在性能改进,并增加了限制内存使用的选项。
![][5]
Sticky Notes 是用 GTK 3 开发的,支持 HiDPI并提供了更多的功能。同时与系统托盘整合得更好。
![][6]
### 其他改进
在网络上共享文件的 [Warpinator 应用程序][7] 得到了一些升级,变得更有用。
其他桌面环境的升级包括 Xfce 4.16 和 MATE 1.24。除此之外,你还会发现一些细微的 UI 改进和错误修复。
特别是解决了 NVIDIA 显卡**对混合图形的支持**的问题,这对笔记本电脑用户来说是个好消息。
要了解更多变更详情,你可以参考任一桌面版本的 [官方公告][8]。
### 下载或升级至 Linux Mint 20.2
你可以直接在官方网站 [下载页面][9] 找到稳定版本。
- [下载 Linux Mint 20.2][9]
如果已经安装了 Linux Mint 20 或者 20.1。你可以先检查所有可用更新,然后更新管理器会收到更新。
接下来,确保你做了备份(如果你想的话,可以使用 timeshift 工具),然后从**编辑**菜单种静茹更新管理器的系统升级选项,如下所示。
![][10]
当你单击后,屏幕上会出现升级的提示。你也可以通过 [官方升级说明][11] 获得进一步帮助。
_你完成升级了吗?你对最新版本有什么看法?欢迎在下面的评论中分享你的想法。_
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/linux-mint-20-2-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[lcf33](https://github.com/lcf33)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/linux-mint-20-2-beta-release/
[2]: https://news.itsfoss.com/linux-mint-updates-notice/
[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/linux-mint-update-reminder.png?w=494&ssl=1
[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/bulky-mint.png?w=570&ssl=1
[5]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/cinnamon-memory.png?w=800&ssl=1
[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/mint-sticky-notes-ui.png?resize=1568%2C937&ssl=1
[7]: https://news.itsfoss.com/warpinator-android-app/
[8]: https://blog.linuxmint.com/?p=4102
[9]: https://linuxmint.com/download.php
[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/mint-upgrade.png?w=533&ssl=1
[11]: https://blog.linuxmint.com/?p=4111

View File

@@ -0,0 +1,64 @@
[#]: subject: (Box64 Emulator Released for Arm64 Linux)
[#]: via: (https://news.itsfoss.com/box64-emulator-released/)
[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/)
[#]: collector: (lujun9972)
[#]: translator: (zd200572)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13591-1.html)
Box64 模拟器发布 Arm64 Linux 版本
======
> 在 Box64 模拟器的帮助下,在 ARM 设备上运行 x64 Linux 程序。想试试吗?
![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/box64-arm.jpg?w=1200&ssl=1)
[Box86][1] 是一个流行的 X86 模拟器,刚进行了一次巨大的升级。发布了 [Box64][2],也就是对应的 ARM64 版本。
可能你还不了解这个模拟器Box64_86 允许你在 ARM 系统上运行 32 或 64 位的 X86/64 Linux 程序。换句话说,它能让你在树莓派或者 [树莓派替代品][3] 上运行 Linux 桌面程序。
幸运的是,现在我们有 Box86 和 Box64 的支持,无论你的 ARM 系统是什么类型。
### Box64 是什么?
![][4]
你可能听说过苹果的 Rosetta 2它是一个翻译层允许为老款 MacIntel X86 处理器)设计的应用程序在新的 M1ARM 处理器)驱动的 Mac 上运行。Box64 与之类似,允许为 X86 设计的应用程序运行在 ARM Linux 设备上。
由于它的 Dynarec 模块,它能够做到这一点,同时又是 100% 开源的、免费的,而且速度惊人。它通过重新编译 ARM 程序来提升速度,这意味着和其他 ARM 原生应用一样快。
但是,即使 Box64 无法重新编译应用,它仍然可以使用即时模拟,也有令人印象深刻的结果。
许多树莓派用户很熟悉 Box86这是一个大约一年前发布的类似程序。二者最大的区别是 Box86 只兼容 Arm32而 Box64 只兼容 Arm64。
这就是 Box64一个非常棒的兼容层允许你在 ARM 电脑上运行 x86_64 应用。
### 总结
如果你问我认为 Box64 怎么样,我会说这是一个绝对的游戏规则改变者。在难以置信的性能和巨大的潜力之间,这个兼容层肯定会在未来的 ARM 电脑中扮演一个重要角色。
如果你想知道它的工作原理,以及如何开始使用它,请查看其 [GitHub 页面][5]。
就这样吧,现在你自己去潜入其中并测试吧。
你觉得 Box64 怎样?写下你的评论让我知道。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/box64-emulator-released/
作者:[Jacob Crume][a]
选题:[lujun9972][b]
译者:[zde200572](https://github.com/zd200572)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/jacob/
[b]: https://github.com/lujun9972
[1]: http://github.com/ptitseb/box86
[2]: http://github.com/ptitseb/box64
[3]: https://itsfoss.com/raspberry-pi-alternatives/
[4]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/Box64Logo-1024x287-1.png?w=1024&ssl=1
[5]: https://github.com/ptitseb/box64

View File

@@ -2,7 +2,7 @@
[#]: via: (https://news.itsfoss.com/pdf-mix-tool-1-0-1-release/)
[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (lcf33)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -1,98 +0,0 @@
[#]: subject: (Linux Mint 20.2 is Now Available With New Features and Tools)
[#]: via: (https://news.itsfoss.com/linux-mint-20-2-release/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Linux Mint 20.2 is Now Available With New Features and Tools
======
Linux Mint 20.2 beta [arrived][1] a few weeks ago. And now, the final stable release for Linux Mint 20.2 is here.
This release is an LTS upgrade based on Ubuntu 20.04 that is supported until 2025.
Let us take a quick look at whats new with this release and how do you get it.
### Linux Mint 20.2: Whats New?
The key highlight of this release is the addition of update notification, which should encourage more users to keep their systems up-to-date to ensure best security.
It will [not force updates like Windows][2], but it will keep an eye out for how long you dont apply updates, check systems uptime, and then prompt you with an update reminder notification.
![][3]
You also get to configure the update notifications, which is great.
Other major upgrades include **Cinnamon 5** desktop environment, a new bulk **file renaming tool** (Bulky), and **Sticky Notes replacing GNote** as the default note application.
![][4]
The file renaming tool is available for all the desktop editions, excluding Xfce, because its default file manager (Thunar) already supports the feature.
Cinnamon 5 is not exactly exciting, but there are some under-the-hood improvements to its performance and nice little option to limit its RAM usage.
![][5]
And Sticky Notes is developed in GTK 3, supports HiDPI and offers more features, along with better integration with the system tray.
![][6]
### Other Improvements
[Warpinator app][7] to share files across a network has received some upgrades making it more useful.
Other desktop environment upgrades include Xfce 4.16 and MATE 1.24. In addition to that, you will find certain subtle UI improvements and several bug fixes.
Especially addressing issues with NVIDIA graphics, along with the **support for hybrid graphics**, great news for Laptop users!
To know more about some of the detailed changes, you can refer to the [official announcement][8] for one of the desktop editions.
### Download or Upgrade to Linux Mint 20.2
You can find the stable releases directly from the official websites [download page][9].
[Download Linux Mint 20.2][9]
If you have Linux Mint 20 or 20.1 installed, you can choose to first apply all the available updates and then an update to your Update Manager.
Next, make sure that you have a backup (use timeshift if you want) and then head to the Update Managers System Upgrade option from the **Edit** menu as shown below.
![][10]
When you click on it, you will be greeted with the on-screen instructions to go ahead with the upgrade. You may also refer to the [official upgrade instructions][11] for further help.
_Have you upgraded yet? What do you think about the latest release? Feel free to share your thoughts in the comments down below._
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/linux-mint-20-2-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/linux-mint-20-2-beta-release/
[2]: https://news.itsfoss.com/linux-mint-updates-notice/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2MCIgd2lkdGg9IjQ5NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9IjU3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://news.itsfoss.com/warpinator-android-app/
[8]: https://blog.linuxmint.com/?p=4102
[9]: https://linuxmint.com/download.php
[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MCIgd2lkdGg9IjUzMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[11]: https://blog.linuxmint.com/?p=4111

View File

@@ -1,66 +0,0 @@
[#]: subject: (Box64 Emulator Released for Arm64 Linux)
[#]: via: (https://news.itsfoss.com/box64-emulator-released/)
[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Box64 Emulator Released for Arm64 Linux
======
[Box86][1], the popular x86 emulator, has just received a huge upgrade. This comes in the form of [Box64][2], the ARM64 equivalent.
If you did not know, Box64_86 lets you run 64-bit or 32-bit Linux programs on ARM systems. In other words, it makes it possible for you to access desktop Linux programs on your Raspberry Pi or [Raspberry Pi alternatives][3].
Fortunately, now we have Box86 and Box64 to the rescue no matter what type of ARM system youve got.
### What is Box64?
![][4]
You may have heard about Apples Rosetta 2, a translation layer that allows apps designed for older Macs to run on the new M1-powered Macs. Box64 is something similar that allows apps designed for x86 to run on ARM Linux devices.
It manages to do this all while being 100% open-source, free, and surprisingly fast, thanks to its Dynarec module. This improves speed by re-compiling the program for ARM, meaning that it runs the same as any other ARM-supported app.
However, even if Box64 is unable to recompile the app, it can still run it using on-the-fly emulation, with impressive results here too.
Many Raspberry Pi users will be familiar with Box86, a similar program that has been around for about a year now. The biggest difference is that Box86 is only compatible with Arm32, while Box64 is only compatible with Arm64.
So thats Box64, the awesome compatibility layer that allows users to run x86_64 apps on your ARM-based PCs.
### Wrapping Up
If you were to ask me what I think about Box64, I would say its an absolute game changer. Between the incredible performance and massive potential, this compatibility layer is sure to play a huge role in the future ARM-based Linux PCs.
Check out its [GitHub page][5] if you are curious to know how it works, and how you can get started with it.
With that, Ill leave you now to dive into and test for yourself.
_What do you think of Box64? Let me know down in the comments below!_
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/box64-emulator-released/
作者:[Jacob Crume][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/jacob/
[b]: https://github.com/lujun9972
[1]: http://github.com/ptitseb/box86
[2]: http://github.com/ptitseb/box64
[3]: https://itsfoss.com/raspberry-pi-alternatives/
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIxOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://github.com/ptitseb/box64

View File

@@ -2,7 +2,7 @@
[#]: via: (https://opensource.com/article/21/5/my-linux-story)
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (Shiboi77)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
@@ -28,7 +28,7 @@ via: https://opensource.com/article/21/5/my-linux-story
作者:[Chris Hermansen][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[Shiboi77](https://github.com/Shiboi77)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -1,56 +0,0 @@
[#]: subject: (How Real-World Apps Lose Data)
[#]: via: (https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html)
[#]: author: (Simon Arneaud https://theartofmachinery.com)
[#]: collector: (lujun9972)
[#]: translator: (PearFL)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How Real-World Apps Lose Data
======
A great thing about modern app development is that there are cloud providers to worry about things like hardware failures or how to set up RAID. Decent cloud providers are extremely unlikely to lose your apps data, so sometimes I get asked what backups are really for these days. Here are some real-world stories that show exactly what.
### Story #1
This first story is from a data science project: it was basically a big, complex pipeline that took data collected from ongoing research and crunched it in various ways to feed some cutting-edge model. The user-facing application hadnt been launched yet, but a team of data scientists and developers had been working on building the model and its dataset for several months.
The people working on the project had their own development environments for experimental work. Theyd do something like `export ENVIRONMENT=simonsdev` in a terminal, and then all the software running in that terminal would run against that environment instead of the production environment.
The team was under a lot of pressure to get a user-facing app launched so that stakeholders could actually see some results from their several months of investment. One Saturday, an engineer tried to catch up with some work. He finished an experiment he was doing late in the evening, and decided to tidy up and go home. He fired off a cleanup script to delete everything from his development environment, but strangely it took a lot longer than usual. Thats when he realised hed lost track of which terminal was configured to point to which environment.
### Story #2
Story #2 is from a commercial web and mobile app. The backend had a microservice architecture worked on by a team of engineers. That meant deployments required co-ordination, but things were simplified a bit using a formal release process and automation. New code would get reviewed and merged into master when ready, and every so often a senior developer would tag a release for each microservice, which would then automatically deploy to the staging environment. The releases in the staging environment would periodically get collected together into a meta-release that got signoff from various people (it was a compliance environment) before being automatically deployed to production.
One day a developer was working on a complex feature, and the other developers working on that microservice agreed that the work-in-progress code should be committed to master with the understanding that it shouldnt be actually released yet. To cut a long story short, not everyone in the team got the message, and the code got into the release pipeline. Worse, the experimental code required a new way to represent user profile data, so it had an ad-hoc data migration that ran on launch into production and corrupted all user profiles.
### Story #3
Story #3 is from another web app. This one had a much simpler architecture: most of the code was in one app, and the data was in a database. However, this app had also been written under a lot of deadline pressure. It turned out that early on in development, when radical database schema changes were common, a feature was added to detect such changes and clean up old data. This was actually useful for early development before launch, and was always meant to be a temporary feature for development environments only. Unfortunately, the code was forgotten about in the rush to build the rest of the app and get to launch. Until, of course, one day it got triggered in the production environment.
### Postmortem
With any outage postmortem, its easy to lose sight of the big picture and end up blaming everything on some little detail. A special case of that is finding some mistake someone made and then blaming that person. All of the engineers in these stories were actually good engineers (companies that hire SRE consultants arent the ones to cut corners with their permanent hires), so firing them and replacing them wouldnt have solved any problem. Even if you have 100x developers, that 100x is still finite, so mistakes will happen with enough complexity and pressure. The big-picture solution is back ups, which help you however you lose the data (including from malware, which is a hot topic in the news lately). If youre not okay with having zero copies of it, dont have one copy.
Story #1 had a bad end: there were no backups. The project was set back by nearly six months of data collection. By the way, some places only keep a single daily snapshot as a backup, and this story is a good example of how that can go wrong, too: if the data loss happened on Saturday and recovery was attempted on Monday, the one-day backup would only have an empty database from the Sunday.
Story #2 wasnt fun, but worked out much better. Backups were available, but the data migration was reversible, too. The unfun part was that the release was done just before lunch and the fix had to be coded up while the production site was down. The main reason Im telling this story is as a reminder that backups arent just about catastrophic data loss. Partial data corruption happens, too, and can be extra messy.
Story #3 was so-so. A small amount of data was lost permanently, but most was recovered from the backup. Everyone on the team felt pretty bad about not flagging the now-extremely-obviously-dangerous code. I wasnt involved in the early development, but I felt bad because the recovery took a lot longer than it should have. With a well-tested recovery process, I think the site should have been back online in under 15mins total. But the recovery didnt work first time, and I had to debug why not and retry. When a production site is down and its on you to get it up again, every 10s feels like an eternity. Thankfully, the stakeholders were much more understanding than some. They were actually relieved that a one-off disaster that could have sunk the company only resulted in minutes of lost data and under an hour of downtime.
Its extremely common in practice for the backup to “work” but the recovery to fail. Often the recovery works when tested on small datasets, but fails on production-sized datasets. Disaster is most likely to strike when everyone is stressed out, and having the production site down only increases the pressure. Its a really good idea to test and document the full recovery process while times are good.
--------------------------------------------------------------------------------
via: https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html
作者:[Simon Arneaud][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://theartofmachinery.com
[b]: https://github.com/lujun9972

View File

@@ -1,110 +0,0 @@
[#]: subject: (A brief history of FreeDOS)
[#]: via: (https://opensource.com/article/21/6/history-freedos)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
A brief history of FreeDOS
======
Throughout its nearly 30-year journey, FreeDOS has been the modern DOS.
![Person typing on a 1980's computer][1]
A master was explaining the nature of [The Tao of Programming][2] to one of his novices. "The Tao is embodied in all software—regardless of how insignificant," said the master.
"Is Tao in a hand-held calculator?" asked the novice.
"It is," came the reply.
"Is the Tao in a video game?" continued the novice.
"It is even in a video game," said the master.
"And is the Tao in the DOS for a personal computer?"
The master coughed and shifted his position slightly. "The lesson is over for today," he said.
The Tao of Programming, Geoffrey James, InfoBooks, 1987
Computing used to be limited only to expensive mainframes and "Big Iron" computer systems like the PDP11. But the advent of the microprocessor brought about a computing revolution in the 1970s. You could finally have a computer in your home—the "personal computer" had arrived!
The earliest personal computers I remember seeing included the Commodore, TRS-80, and Apple. The personal computer became such a hot topic that IBM decided to enter the market. After a rapid development cycle, IBM released the IBM 5150 Personal Computer (the original "IBM PC") in August 1981.
Creating a computer from scratch is no easy task, so IBM famously used "off-the-shelf" hardware to build the PC, and licensed other components from outside developers. One of those was the operating system, licensed from Microsoft. In turn, Microsoft acquired 86-DOS from Seattle Computer Products, applied various updates, and debuted the new version with the IBM PC as IBM PC-DOS.
### Early DOS
Running in memory _up to_ 640 kilobytes, DOS really couldn't do much more than manage the hardware and allow the user to launch applications. As a result, the PC-DOS 1.0 command line was pretty anemic, only including a few commands to set the date and time, manage files, control the terminal, and format floppy disks. DOS also included a BASIC language interpreter, which was a standard feature in all personal computers of the era.
It wasn't until PC-DOS 2.0 that DOS became more interesting, adding new commands to the command line, and including other useful tools. But for me, it wasn't until MS-DOS 5.0 in 1991 that DOS began to feel "modern." Microsoft overhauled DOS in this release, updating many of the commands and replacing the venerable Edlin editor with a new full-screen editor that was more user-friendly. DOS 5 included other features that I liked, as well, such as a new BASIC interpreter based on Microsoft QuickBASIC Compiler, simply called QBASIC. If you've ever played the Gorillas game on DOS, it was probably in MS-DOS 5.0.
Despite these upgrades, I wasn't entirely satisfied with the DOS command line. DOS never strayed far from the original design, which proved limiting. DOS gave the user a few tools to do some things from the command line—otherwise, you were meant to use the DOS command line to launch applications. Microsoft assumed the user would spend most of their time in a few key applications, such as a word processor or spreadsheet.
But developers wanted a more functional DOS, and a sub-industry sprouted to offer neat tools and programs. Some were full-screen applications, but many were command-line utilities that enhanced the DOS command environment. When I learned a bit of C programming, I started writing my own utilities that extended or replaced the DOS command line. And despite the rather limited underpinnings of MS-DOS, I found that the third-party utilities, plus my own, created a powerful DOS command line.
### FreeDOS
In early 1994, I started seeing a lot of interviews with Microsoft executives in tech magazines saying the next version of Windows would totally do away with DOS. I'd used Windows before—but if you remember the era, you know Windows 3.1 wasn't a great platform. Windows 3.1 was clunky and buggy—if an application crashed, it might take down the entire Windows system. And I didn't like the Windows graphical user interface, either. I preferred doing my work at the command line, not with a mouse.
I considered Windows and decided, “If Windows 3.2 or Windows 4.0 will be anything like Windows 3.1, I want nothing to do with it.” But what were my options? I'd already experimented with Linux at this point, and thought [Linux was great][3]—but Linux didn't have any applications. My word processor, spreadsheet, and other programs were on DOS. I needed DOS.
Then I had an idea! I thought, “If developers can come together over the internet to write a complete Unix operating system, surely we can do the same thing with DOS.” After all, DOS was a fairly straightforward operating system compared to Unix. DOS ran one task at a time (single-tasking) and had a simpler memory model. It shouldn't be _that_ hard to write our own DOS.
So on June 29, 1994, I [posted an announcement][4] to `comp.os.msdos.apps`, on a message board network called Usenet:
ANNOUNCEMENT OF PD-DOS PROJECT:
A few months ago, I posted articles relating to starting a public domain version of DOS. The general support for this at the time was strong, and many people agreed with the statement, "start writing!" So, I have...
Announcing the first effort to produce a PD-DOS. I have written up a "manifest" describing the goals of such a project and an outline of the work, as well as a "task list" that shows exactly what needs to be written. I'll post those here, and let discussion follow.
_* A note about the name—I wanted this new DOS to be something that everyone could use, and I naively assumed that when everyone could use it, it was "public domain." I quickly realized the difference, and we renamed "PD-DOS" to "Free-DOS"—and later dropped the hyphen to become "FreeDOS."_
A few developers reached out to me, to offer utilities they had created to replace or enhance the DOS command line, similar to my own efforts. We pooled our utilities and created a useful system that we released as "Alpha 1" in September 1994, just a few months after announcing the project. Development was pretty swift in those days, and we followed up with "Alpha 2" in December 1994, "Alpha 3" in January 1995, and "Alpha 4" in June 1995.
### A modern DOS
Since then, we've always focused on making FreeDOS a "modern" DOS. And much of that modernization is centered on creating a rich command-line environment. Yes, DOS still needs to support applications, but we believe FreeDOS needs a strong command-line environment, as well. That's why FreeDOS includes dozens of useful tools, including commands to navigate directories, manage files, play music, connect to networks, ... and a collection of Unix-like utilities such as `less`, `du`, `head`, `tail`, `sed`, and `tr`.
While FreeDOS development has slowed, it has not stopped. Developers continue to write new programs for FreeDOS, and add new features to FreeDOS. I'm particularly excited about several great additions to FreeDOS 1.3 RC4, the latest release candidate for the forthcoming FreeDOS 1.3. A few recent updates:
* Mateusz Viste created a new ebook reader called Ancient Machine Book (AMB) that we've leveraged as the new help system in FreeDOS 1.3 RC4
* Rask Ingemann Lambertsen, Andrew Jenner, TK Chia, and others are updating the IA-16 version of GCC, including a new _libi86_ library that provides some degree of compatibility with the Borland Turbo C++ compiler's C library
* Jason Hood has updated an unloadable CD-ROM redirector substitute for Microsoft's MSCDEX, supporting up to 10 drives
* SuperIlu has created DOjS, a Javascript development canvas with an integrated editor, graphics and sound output, and mouse, keyboard, and joystick input
* Japheth has created a DOS32PAE extender that is able to use huge amounts of memory through PAE paging
Despite all of the new development on FreeDOS, we remain true to our DOS roots. As we continue working toward FreeDOS 1.3 "final," we carry several core assumptions, including:
* **Compatibility is key**—FreeDOS isn't really "DOS" if it can't run classic DOS applications. While we provide many great open source tools, applications, and games, you can run your legacy DOS applications, too.
* **Continue to run on old PCs (XT, '286, '386, etc)**—FreeDOS 1.3 will remain 16-bit Intel but will support new hardware with expanded driver support, where possible. For this reason, we continue to focus on a single-user command-line environment.
* **FreeDOS is open source software**—I've always said that FreeDOS isn't a "free DOS" if people can't access, study, and modify the source code. FreeDOS 1.3 will include software that uses recognized open source licenses as much as possible. But DOS actually pre-dates the GNU General Public License (1989) and the Open Source Definition (1998) so some DOS software might use its own "free with source code" license that isn't a standard "open source" license. As we consider packages to include in FreeDOS, we continue to evaluate any licenses to ensure they are suitably "open source," even if they are not officially recognized.
We welcome your help in making FreeDOS great! Please join us on our email list—we welcome all newcomers and contributors. We communicate over an email list, but the list is fairly low volume so is unlikely to fill up your Inbox.
Visit the FreeDOS website at [www.freedos.org][5].
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/history-freedos
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer)
[2]: https://www.mit.edu/~xela/tao.html
[3]: https://opensource.com/article/17/5/how-i-got-started-linux-jim-hall-freedos
[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ
[5]: https://www.freedos.org/

View File

@@ -1,117 +0,0 @@
[#]: subject: (Can Windows 11 Influence Linux Distributions?)
[#]: via: (https://news.itsfoss.com/can-windows-11-influence-linux/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: (zz-air)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Can Windows 11 Influence Linux Distributions?
======
Microsofts Windows 11 has been finally revealed. While some compare it to macOS, others compare the nitty-gritty details to find similarities with GNOME and KDE (which does not make much sense).
But, among all the buzz, I am curious about something else — **Can Microsofts Windows 11 influence the future design decisions of desktop Linux distributions?**
Here I shall mention some of my thoughts on why it might happen, if it has happened before, and what the future holds for Linux distributions.
### Some Linux Distributions Already Focus on Windows-like Experience: But, why?
Microsofts Windows is the most popular desktop operating system with **88% of the market share** for its ease of use, software support, and hardware compatibility.
On the contrary, Linux has **about 2% of the market share,** even with all the added [benefits of Linux over Windows][1].
So what can Linux do to convince more users to try Linux as their desktop operating system?
The main focus of every desktop operating system should be the user experience. While Microsoft and Apple have managed to provide a comfortable user experience for the masses, Linux distributions did not manage to get a big win on that front.
However, you will find several [Linux distributions that aim to replace Windows 10][2]. These Linux distributions try to provide a familiar user interface that could encourage a Windows user to consider switching to Linux.
And, due to the existence of such distributions, [switching to Linux in 2021][3] makes more sense than ever.
Hence, to get more users to jump-ship to Linux, Microsoft Windows has influenced many distributions for years now.
### Is Windows 11 Better than Linux in Some Way?
The user interface is constantly evolving with Windows. Even if thats subjective, it is what most desktop users seem to be going for.
So Id say Windows 11 has made some attractive improvements on that front.
![][4]
Not just limited to the UI/UX, things like integrating Microsoft Teams chat features in the taskbar makes it convenient for users to instantly connect with anyone.
**While Linux distributions do not have their own full-fledged services, more out-of-the-box integrations tailored like this should make the onboarding experience easier for new users.**
And that brings me to another aspect of Windows 11—a personalized news and information feed.
Sure, Microsoft collects data for that, and you may have to sign in using a Microsoft account. But this is yet something that reduces friction for the users to go and look for a separate app to keep track of weather, news, and other daily information.
Linux does not force these choices for a user but features/integrations like this can be added as additional options which can be presented in the form of a choice to users.
**In other words, making things more accessible while integrated with the OS should get rid of a steep learning curve.**
And, the dreaded Microsoft Store has also got a serious upgrade with Windows 11.
![][5]
Unfortunately, for Linux distributions, I dont see much meaningful upgrade to the app centers to make it visually appealing, and something interesting.
elementaryOS is probably making a good effort to focus on the UX/UI, and the evolving the experience with app center but for the most other distros, no significant upgrade.
![Software Manager in Linux Mint 20.1][6]
While I appreciate what Deepin Linux does in this regard, but it isnt the popular choice for many users who try Linux for the first time.
### Windows 11 Introduces More Competition: Linux Has to Keep Up
With the launch of Windows 11, Linux as a desktop choice will get more competition.
While we do have some replacements for Windows 10 experience in the Linux world, theres nothing that targets Windows 11, yet.
But this brings us to the obvious counter-response from the Linux community **a Linux distribution that takes a dab at Windows 11**.
No matter whether you hate or love Microsofts latest design approach to Windows 11, the masses will adopt it over the next few years.
And to keep Linux as a compelling desktop alternative, the design language with Linux distributions must evolve as well.
Not just the desktop market—but laptop-exclusive design choices also need a significant improvement for Linux distributions.
Some options like [Pop!_OS by System76][7] have been trying to offer that experience for Linux, which is a good start.
I think Zorin OS can be one of the distributions to introduce a “**Windows 11**” layout as an option to get more users to try Linux.
Not to forget—[Deepin Linux introduced Android app support][8] right after Windows 11 marketed it as a feature.
So, you see when Microsofts Windows makes a move, it does have a ripple effect on Linux, too. And Deepin Linuxs Android app support is just the start…Lets see what else comes up next.
_What do you think about Windows 11 influencing the future of Linux desktop? Do we need to evolve as well? Or should we continue being different and not get influenced by what the masses choose?_
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/can-windows-11-influence-linux/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[zz-air](https://github.com/zz-air)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-better-than-windows/
[2]: https://itsfoss.com/windows-like-linux-distributions/
[3]: https://news.itsfoss.com/switch-to-linux-in-2021/
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://pop.system76.com
[8]: https://news.itsfoss.com/deepin-linux-20-2-2-release/

View File

@@ -0,0 +1,66 @@
[#]: subject: (Dear Mozilla, Please Remove This Annoying Feature from Firefox)
[#]: via: (https://news.itsfoss.com/mozilla-annoying-new-tab/)
[#]: author: (Abhishek https://news.itsfoss.com/author/root/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Dear Mozilla, Please Remove This Annoying Feature from Firefox
======
Despite its receding user base, Mozilla Firefox has remained my primary browser. Mozilla has revamped Firefox in the last couple of years and have added several features to it specially focused on protecting user privacy. I respect that.
However, there is one feature that annoys the hell out of me. This so-called feature relates to the auto-update of Firefox in the background.
Auto-upgrade immediately remind of Windows updates. I mean, Windows is infamous for the forced restarts and updates, right?
![Image Credit: Digital Trend][1]
But why am I talking about this in reference to Firefox? Because Firefox, too, has a Windows-que feature.
It updates Firefox in the background. No problem there. Thats not entirely a bad thing.
But then if you try to open a website in the new tab, it wont let you do that unless you restart the browser.
![][2]
And that small thing stops the users from keep going with their work. What the hell, Mozilla!
You may argue that its not that much of a pain. A quick restart wont bring your world down, Abhishek.
Right but imagine you are busy at work. You have more than 20 tabs opened. Thats normal if you are trying to troubleshoot as a developer, sysadmin, student or just trying to learn something in your field of interest.
You cannot open a new webpage anymore. You have to restart the browser and when you restart, you have to click on each tab manually because Firefox does not load the previously opened webpages on its own. Sure you can see the tabs but the web pages are not actually loaded.
This should be considered a bug, not a feature. Users should be given a choice to between rebooting right away or doing it later.
I dont remember any other browser infringing like this on its users, not even Google Chrome. But somehow Mozilla eggheads thought that this is a good “feature” to add to their open source browser.
No, Mozilla! This is not a feature. This is a bug and should be fixed. You just cannot annoy your users like this otherwise they will be forced to use [alternate browsers like Brave][3] or Vivaldi and of course, Chrome.
I end my rant and leave the field open for you. What do you think of these forced restarts by Mozilla Firefox?
### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/mozilla-annoying-new-tab/
作者:[Abhishek][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyNyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: https://news.itsfoss.com/chrome-like-browsers-2021/

View File

@@ -1,295 +0,0 @@
stevending is translating
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (9 open source JavaScript frameworks for front-end web development)
[#]: via: (https://opensource.com/article/20/5/open-source-javascript-frameworks)
[#]: author: (Bryant Son https://opensource.com/users/brson)
9 open source JavaScript frameworks for front-end web development
======
A breakdown of many JavaScript options for frameworks—their strengths
and key features.
![Computer screen with files or windows open][1]
About a decade ago, the JavaScript developer community began to witness fierce battles emerging among JavaScript frameworks. In this article, I will introduce some of the most well-known of these frameworks. And it's important to note that these are all open source JavaScript projects, meaning that you can freely utilize them under an [open source license][2] and even contribute to the source code and communities.
If you prefer to follow along as I explore these frameworks, you can watch my video.
Before getting started, though, it will be useful to learn some of the terminology JavaScript developers commonly use when discussing frameworks.
Term | What It Is
---|---
[Document Object Model (DOM)][3] | A tree-structure representation of a website where each node is an object representing part of the webpage. The World Wide Web Consortium (W3C), the international standards organization for the World Wide Web, maintains the definition of the DOM.
[Virtual DOM][4] | A "virtual" or "ideal" representation of a user interface (UI) is kept in memory and synced with the "real" DOM by a library such as [ReactDOM][5]. To explore further, please read ReactJS's virtual DOM and internals documentation.
[Data Binding][6] | A programming concept to provide a consistent interface for accessing data on websites. Web elements are associated with a property or attribute of an element maintained by the DOM. For example, when you need to fill out a password in a webpage form, the data binding mechanism can check with the password validation logic to ensure that the password is in a valid format.
Now that we are clear about common terms, let's explore what open source JavaScript frameworks are out there.
Framework | About | License | Release Date
---|---|---|---
[ReactJS][7] | Created by Facebook, currently the most popular JavaScript framework | MIT License | May 24, 2013
[Angular][8] | Popular JavaScript framework created by Google | MIT License | Jan 5, 2010
[VueJS][9] | Rapidly growing JavaScript framework | MIT License | Jul 28, 2013
[MeteorJS][10] | Powerful framework that is more than a JavaScript framework | MIT License | Jan 18, 2012
[KnockoutJS][11] | Open source Model-View-ViewModel (MVVM) framework | MIT License | Jul 5, 2010
[EmberJS][12] | Another open source Model-View-ViewModel framework | MIT License | Dec 8, 2011
[BackboneJS][13] | JavaScript framework with RESTful JSON and Model-View-Presenter pattern | MIT License | Sep 30, 2010
[Svelte][14] | Open source JavaScript framework not using virtual DOM | MIT License | Nov 20, 2016
[AureliaJS][15] | A collection of Modern JavaScript modules | MIT License | Feb 14, 2018
For context, here is the publicly available data on popularity based on NPM package downloads per framework, thanks to [npm trends][16].
![Framework downloads graph][17]
### ReactJS
![React page][18]
[ReactJS][19] was invented by Facebook, and it is the clear leader among JavaScript frameworks today, though it was invented well after Angular. React introduces a concept called a virtual DOM, an abstract copy where developers can utilize only the ReactJS features that they want, without having to rewrite the entire project to work within the framework. In addition, the active open source community with the React project has definitely been the workhorse behind the growth. Here are some of React's key strengths:
* Reasonable learning curve—React developers can easily create the React components without rewriting the entire code in JavaScript. See the benefits of ReactJS and how it makes it the programming easier on ReactJS's [front page][20].
* Highly optimized for performance—React's virtual DOM implementation and other features boost app rendering performance. See ReactJS's [description][21] of how its performance can be benchmarked and measured in terms of how the app performs.
* Excellent supporting tools—[Redux][22], [Thunk][23], and [Reselect][24] are some of the best tools for building well-structured, debuggable code.
* One way data binding—The model used in Reach flows from owner to child only making it simpler to trace cause and effect in code. Read more about it on ReactJS's [page on data binding][25].
Who is using ReactJS? Since Facebook invented it, the company itself heavily uses React for its frontpage, and [Instagram][26] is said to be completely based on the ReactJS library. You might be surprised to know that other well-known companies like [New York Times][27], [Netflix][28], and [Khan Academy][29] also implement ReactJS in their technology stacks.
What may be even more surprising is the availability of jobs for ReactJS developers, as you can see below from research done by Stackoverflow. Hey, you can work on an open source project and get paid to do it. That is pretty cool!
![React jobs page][30]
Stackoverflow shows the huge demand for ReactJS developers—[Source: Developer Hiring Trends in 2017—Stackoverflow Blog][31]
 
[ReactJS's GitHub][7] currently shows over 13K commits and 1,377 contributors to the open source project. And it is an open source project under MIT License.
![React GitHub page][32]
### Angular
![Angular homepage][33]
React may now be the leading JavaScript framework in terms of the number of developers, but [Angular][34] is close behind. In fact, while React is the more popular choice among open source developers and startup companies, larger corporations tend to prefer Angular (a few are listed below). The main reason is that, while Angular might be more complicated, its uniformity and consistency works well for larger projects. For example, I have worked on both Angular and React throughout my career, and I observed that the larger companies generally consider Angular's strict structure a strength. Here are some other key strengths of Angular:
* Well-designed Command Line Interface: Angular has an excellent Command Line Interface (CLI) tool to easily bootstrap and to develop with Angular. ReactJS also offers the Command Line Interface as well as other tools, but Angular has extensive support and excellent documentation, as you can see on [this page][35].
* One way data binding—Similarly to React, the one-way data binding model makes the framework less susceptible to unwanted side effects.
* Great support for TypeScript—Angular has excellent alignment with [TypeScript][36], which is effectively JavaScript more type enforcement. It also transcompiling to JavaScript, making it a great option to enforce types for less buggy code.
Well-known websites like YouTube, [Netflix][37], [IBM][38], and [Walmart][39] all have implemented Angular into their applications. I personally started front-end JavaScript development with Angular by educating myself on the subject. I have worked on quite a few personal and professional projects involving Angular, but that was Angular 1.x, which was called by AngularJS at the time. When Google decided to upgrade the version to 2.0, they completely revamped the framework, and then it became Angular. The new Angular was a complete transformation of the previous AngularJS, which drove off some existing developers while bringing new developers.
[Angular's][8] [GitHub][8] page shows 17,781 commits and 1,133 contributors at the time of this writing. It is also an open source project with an MIT License, so you can feel free to use it for your project or to contribute.
 
![Angular GitHub page][40]
### VueJS
![Vue JS page][41]
[VueJS][42] is a very interesting framework. It is a newcomer to the JavaScript framework scene, but its popularity has increased significantly over the course of a few years. VueJS was created by [Evan Yu][43], a former Google engineer who had worked on the Angular project. The framework got so popular that many front-end engineers now prefer VueJS over other JavaScript frameworks. The chart below depicts how fast the framework gained traction over time.
![Vue JS popularity graph][44]
Here are some of the key strengths of VueJS:
* Easier learning curve—Even compared to Angular or React, many front-end developers feel that VueJS has the lowest learning curve.
* Small size—VueJS is relatively lightweight compared to Angular or React. In its [official documentation][45], its size is stated to be only about 30 KB, while the project generated by Angular, for example, is over 65 KB.
* Concise documentation—Vue has thorough but concise and clear documentation. See [its official documentation][46] for yourself.
[VueJS's GitHub][9] shows 3,099 commits and 239 contributors.
![Vue JS GitHub page][47]
### MeteorJS
![Meteor page][48]
[MeteorJS][49] is a free and open source [isomorphic framework][50], which means, just like NodeJS, it runs both client and server-side JavaScript. Meteor can be used in conjunction with any other popular front-end framework like Angular, React, Vue, Svelte, etc.
Meteor is used by several corporations such as Qualcomm, Mazda, and Ikea, and many applications like Dispatch and Rocket.Chat. [See the case studies on its official website.][51]
![Meteor case study][52]
Some of the key features of Meteor include:
* Data on the wire—The server sends the data, not HTML, and the client renders it. Data on the wire refers mostly to the way that Meteor forms a WebSocket connection to the server on page load, and then transfers the data needed over that connection.
* Develop everything in JavaScript—Client-side, application server, webpage, and mobile interface can be all designed with JavaScript.
* Supports most major frameworks—Angular, React, and Vue can be all combined and used in conjunction with Meteor. Thus, you can still use your favorite framework, like React or Angular, but still leverage some of the great features that Meteor offers.
As of now, [Meteor's][10] [GitHub][10] shows 22,804 commits and 428 contributors. That is quite a lot for open source activities!
![Meteor GitHub page][53]
### EmberJS
![EmberJS page][54]
[EmberJS][55] is an open source JavaScript framework based on the [Model-view-viewModel(MVVM)][56] pattern. If you've never heard about EmberJS, you'll definitely be surprised how many companies are using it. Apple Music, Square, Discourse, Groupon, LinkedIn, Twitch, Nordstorm, and Chipotle all leverage EmberJS as one of their technology stacks. Check [EmberJS's official page][57] to discover all applications and customers that use EmberJS.
Although Ember has similar benefits to the other frameworks we've discussed, here are some of its unique differentiators:
* Convention over configuration—Ember standardizes naming conventions and automatically generates the result code. This approach has a little more of a learning curve but ensures that programmers follow best-recommended practices.
* Fully-fledged templating mechanism—Ember relies on straight text manipulation, building the HTML document dynamically while knowing nothing about DOM.
As one might expect from a framework used by many applications, [Ember's GitHub][58] page shows 19,808 commits and 785 contributors. That is huge!
![EmberJS GitHub page][59]
### KnockoutJS
![KnockoutJS page][60]
[KnockoutJS][61] is a standalone open source JavaScript framework adopting a [Model-View-ViewModel (MVVM)][56] pattern with templates. Although fewer people may have heard about this framework compared to Angular, React, or Vue, the project is still quite active among the development community and leverages features such as:
* Declarative binding—Knockout's declarative binding system provides a concise and powerful way to link data to the UI. It's generally easy to bind to simple data properties or to use a single binding. Read more about it [here at KnockoutJS's official documentation page][62].
* Automatic UI refresh
* Dependency tracking templating
[Knockout's GitHub][11] page shows about 1,766 commits and 81 contributors. Those numbers are not as significant compared to the other frameworks, but the project is still actively maintained.
![Knockout GitHub page][63]
### BackboneJS
![BackboneJS page][64]
[BackboneJS][65] is a lightweight JavaScript framework with a RESTful JSON interface and is based on Model-View-Presenter (MVP) design paradigm.
The framework is said to be used by [Airbnb][66], Hulu, SoundCloud, and Trello. You can find all of these case studies on [Backbone's page][67].
The [BackboneJS GitHub][13] page shows 3,386 commits and 289 contributors.
![BackboneJS GitHub page][68]
### Svelte
![Svelte page][69]
[Svelte][70] is an open source JavaScript framework that generates the code to manipulate DOM instead of including framework references. This process of converting an app into JavaScript at build time rather than run time might offer a slight boost in performance in some scenarios.
[Svelte's][14] [GitHub][14] page shows 5,729 commits and 296 contributors as of this writing.
![Svelte GitHub page][71]
### AureliaJS
![Aurelia page][72]
Last on the list is [Aurelia][73]. Aurelia is a front-end JavaScript framework that is a collection of modern JavaScript modules. Aurelia has the following interesting features:
* Fast rendering—Aurelia claims that its framework can render faster than any other framework today.
* Uni-directional data flow—Aurelia uses an observable-based binding system that pushes the data from the model to the view.
* Build with vanilla JavaScript—You can build all of the website's components with plain JavaScript.
[Aurelia's][15] [GitHub][15] page shows 788 commits and 96 contributors as of this writing.
![Aurelia GitHub page][74]
So that is what I found when looking at what is new in the JavaScript framework world. Did I miss any interesting frameworks? Feel free to share your ideas in the comment section!
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/5/open-source-javascript-frameworks
作者:[Bryant Son][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/brson
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
[2]: https://opensource.com/article/17/9/open-source-licensing
[3]: https://www.w3schools.com/js/js_htmldom.asp
[4]: https://reactjs.org/docs/faq-internals.html
[5]: https://reactjs.org/docs/react-dom.html
[6]: https://en.wikipedia.org/wiki/Data_binding
[7]: https://github.com/facebook/react
[8]: https://github.com/angular/angular
[9]: https://github.com/vuejs/vue
[10]: https://github.com/meteor/meteor
[11]: https://github.com/knockout/knockout
[12]: https://github.com/emberjs/ember.js
[13]: https://github.com/jashkenas/backbone
[14]: https://github.com/sveltejs/svelte
[15]: https://github.com/aurelia/framework
[16]: https://www.npmtrends.com/angular-vs-react-vs-vue-vs-meteor-vs-backbone
[17]: https://opensource.com/sites/default/files/uploads/open-source-javascript-framework-downloads-opensourcedotcom_0.png (Framework downloads graph)
[18]: https://opensource.com/sites/default/files/uploads/3_react.jpg (React page)
[19]: https://reactjs.org
[20]: https://reactjs.org/
[21]: https://reactjs.org/docs/perf.html
[22]: https://redux.js.org/
[23]: https://github.com/reduxjs/redux-thunk
[24]: https://github.com/reduxjs/reselect
[25]: https://reactjs.org/docs/two-way-binding-helpers.html
[26]: https://instagram-engineering.com/react-native-at-instagram-dd828a9a90c7
[27]: https://open.nytimes.com/introducing-react-tracking-declarative-tracking-for-react-apps-2c76706bb79a
[28]: https://medium.com/dev-channel/a-netflix-web-performance-case-study-c0bcde26a9d9
[29]: https://khan.github.io/react-components/
[30]: https://opensource.com/sites/default/files/uploads/4_reactjobs_0.jpg (React jobs page)
[31]: https://stackoverflow.blog/2017/03/09/developer-hiring-trends-2017
[32]: https://opensource.com/sites/default/files/uploads/5_reactgithub.jpg (React GitHub page)
[33]: https://opensource.com/sites/default/files/uploads/6_angular.jpg (Angular homepage)
[34]: https://angular.io
[35]: https://cli.angular.io/
[36]: https://www.typescriptlang.org/
[37]: https://netflixtechblog.com/netflix-likes-react-509675426db
[38]: https://developer.ibm.com/technologies/javascript/tutorials/wa-react-intro/
[39]: https://medium.com/walmartlabs/tagged/react
[40]: https://opensource.com/sites/default/files/uploads/7_angulargithub.jpg (Angular GitHub page)
[41]: https://opensource.com/sites/default/files/uploads/8_vuejs.jpg (Vue JS page)
[42]: https://vuejs.org
[43]: https://www.freecodecamp.org/news/between-the-wires-an-interview-with-vue-js-creator-evan-you-e383cbf57cc4/
[44]: https://opensource.com/sites/default/files/uploads/9_vuejspopularity.jpg (Vue JS popularity graph)
[45]: https://vuejs.org/v2/guide/comparison.html#Size
[46]: https://vuejs.org/v2/guide/
[47]: https://opensource.com/sites/default/files/uploads/10_vuejsgithub.jpg (Vue JS GitHub page)
[48]: https://opensource.com/sites/default/files/uploads/11_meteor_0.jpg (Meteor Page)
[49]: https://www.meteor.com
[50]: https://en.wikipedia.org/wiki/Isomorphic_JavaScript
[51]: https://www.meteor.com/showcase
[52]: https://opensource.com/sites/default/files/uploads/casestudy1_meteor.jpg (Meteor case study)
[53]: https://opensource.com/sites/default/files/uploads/12_meteorgithub.jpg (Meteor GitHub page)
[54]: https://opensource.com/sites/default/files/uploads/13_emberjs.jpg (EmberJS page)
[55]: https://emberjs.com
[56]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel
[57]: https://emberjs.com/ember-users
[58]: https://github.com/emberjs
[59]: https://opensource.com/sites/default/files/uploads/14_embergithub.jpg (EmberJS GitHub page)
[60]: https://opensource.com/sites/default/files/uploads/15_knockoutjs.jpg (KnockoutJS page)
[61]: https://knockoutjs.com
[62]: https://knockoutjs.com/documentation/binding-syntax.html
[63]: https://opensource.com/sites/default/files/uploads/16_knockoutgithub.jpg (Knockout GitHub page)
[64]: https://opensource.com/sites/default/files/uploads/17_backbonejs.jpg (BackboneJS page)
[65]: https://backbonejs.org
[66]: https://medium.com/airbnb-engineering/our-first-node-js-app-backbone-on-the-client-and-server-c659abb0e2b4
[67]: https://sites.google.com/site/backbonejsja/examples
[68]: https://opensource.com/sites/default/files/uploads/18_backbonejsgithub.jpg (BackboneJS GitHub page)
[69]: https://opensource.com/sites/default/files/uploads/19_svelte.jpg (Svelte page)
[70]: https://svelte.dev
[71]: https://opensource.com/sites/default/files/uploads/20_svletegithub.jpg (Svelte GitHub page)
[72]: https://opensource.com/sites/default/files/uploads/21_aurelia.jpg (Aurelia page)
[73]: https://aurelia.io
[74]: https://opensource.com/sites/default/files/uploads/22_aureliagithub.jpg (Aurelia GitHub page)

View File

@@ -1,542 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (An advanced guide to NLP analysis with Python and NLTK)
[#]: via: (https://opensource.com/article/20/8/nlp-python-nltk)
[#]: author: (Girish Managoli https://opensource.com/users/gammay)
An advanced guide to NLP analysis with Python and NLTK
======
Get deeper into the foundational concepts behind natural language
processing.
![Brain on a computer screen][1]
In my [previous article][2], I introduced natural language processing (NLP) and the Natural Language Toolkit ([NLTK][3]), the NLP toolkit created at the University of Pennsylvania. I demonstrated how to parse text and define stopwords in Python and introduced the concept of a corpus, a dataset of text that aids in text processing with out-of-the-box data. In this article, I'll continue utilizing datasets to compare and analyze natural language.
The fundamental building blocks covered in this article are:
* WordNet and synsets
* Similarity comparison
* Tree and treebank
* Named entity recognition
### WordNet and synsets
[WordNet][4] is a large lexical database corpus in NLTK. WordNet maintains cognitive synonyms (commonly called synsets) of words correlated by nouns, verbs, adjectives, adverbs, synonyms, antonyms, and more.
WordNet is a very useful tool for text analysis. It is available for many languages (Chinese, English, Japanese, Russian, Spanish, and more), under many licenses (ranging from open source to commercial). The first WordNet was created by Princeton University for English under an MIT-like license.
A word is typically associated with multiple synsets based on its meanings and parts of speech. Each synset usually provides these attributes:
**Attribute** | **Definition** | **Example**
---|---|---
Name | Name of the synset | Example: The word "code" has five synsets with names `code.n.01`, `code.n.02`, `code.n.03`, `code.v.01`, `code.v.02`
POS | Part of speech of the word for this synset | The word "code" has three synsets in noun form and two in verb form
Definition | Definition of the word (in POS) | One of the definitions of "code" in verb form is: "(computer science) the symbolic arrangement of data or instructions in a computer program"
Examples | Examples of word's use | One of the examples of "code": "We should encode the message for security reasons"
Lemmas | Other word synsets this word+POC is related to (not strictly synonyms, but can be considered so); lemmas are related to other lemmas, not to words directly | Lemmas of `code.v.02` (as in "convert ordinary language into code") are `code.v.02.encipher`, `code.v.02.cipher`, `code.v.02.cypher`, `code.v.02.encrypt`, `code.v.02.inscribe`, `code.v.02.write_in_code`
Antonyms | Opposites | Antonym of lemma `encode.v.01.encode` is `decode.v.01.decode`
Hypernym | A broad category that other words fall under | A hypernym of `code.v.01` (as in "Code the pieces with numbers so that you can identify them later") is `tag.v.01`
Meronym | A word that is part of (or subordinate to) a broad category | A meronym of "computer" is "chip"
Holonym | The relationship between a parent word and its subordinate parts | A hyponym of "window" is "computer screen"
There are several other attributes, which you can find in the `nltk/corpus/reader/wordnet.py` source file in `<your python install>/Lib/site-packages`.
Some code may help this make more sense.
This helper function:
```
def synset_info(synset):
    print("Name", synset.name())
    print("POS:", synset.pos())
    print("Definition:", synset.definition())
    print("Examples:", synset.examples())
    print("Lemmas:", synset.lemmas())
    print("Antonyms:", [lemma.antonyms() for lemma in synset.lemmas() if len(lemma.antonyms()) &gt; 0])
    print("Hypernyms:", synset.hypernyms())
    print("Instance Hypernyms:", synset.instance_hypernyms())
    print("Part Holonyms:", synset.part_holonyms())
    print("Part Meronyms:", synset.part_meronyms())
    print()
[/code] [code]`synsets = wordnet.synsets('code')`
```
shows this:
```
5 synsets:
Name code.n.01
POS: n
Definition: a set of rules or principles or laws (especially written ones)
Examples: []
Lemmas: [Lemma('code.n.01.code'), Lemma('code.n.01.codification')]
Antonyms: []
Hypernyms: [Synset('written_communication.n.01')]
Instance Hpernyms: []
Part Holonyms: []
Part Meronyms: []
...
Name code.n.03
POS: n
Definition: (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions
Examples: []
Lemmas: [Lemma('code.n.03.code'), Lemma('code.n.03.computer_code')]
Antonyms: []
Hypernyms: [Synset('coding_system.n.01')]
Instance Hpernyms: []
Part Holonyms: []
Part Meronyms: []
...
Name code.v.02
POS: v
Definition: convert ordinary language into code
Examples: ['We should encode the message for security reasons']
Lemmas: [Lemma('code.v.02.code'), Lemma('code.v.02.encipher'), Lemma('code.v.02.cipher'), Lemma('code.v.02.cypher'), Lemma('code.v.02.encrypt'), Lemma('code.v.02.inscribe'), Lemma('code.v.02.write_in_code')]
Antonyms: []
Hypernyms: [Synset('encode.v.01')]
Instance Hpernyms: []
Part Holonyms: []
Part Meronyms: []
```
Synsets and lemmas follow a tree structure you can visualize:
```
def hypernyms(synset):
    return synset.hypernyms()
synsets = wordnet.synsets('soccer')
for synset in synsets:
    print(synset.name() + " tree:")
    pprint(synset.tree(rel=hypernyms))
    print()
[/code] [code]
code.n.01 tree:
[Synset('code.n.01'),
 [Synset('written_communication.n.01'),
   ...
code.n.02 tree:
[Synset('code.n.02'),
 [Synset('coding_system.n.01'),
   ...
code.n.03 tree:
[Synset('code.n.03'),
   ...
code.v.01 tree:
[Synset('code.v.01'),
 [Synset('tag.v.01'),
   ...
code.v.02 tree:
[Synset('code.v.02'),
 [Synset('encode.v.01'),
   ...
```
WordNet does not cover all words and their information (there are about 170,000 words in English today and about 155,000 in the latest version of WordNet), but it's a good starting point. After you learn the concepts of this building block, if you find it inadequate for your needs, you can migrate to another. Or, you can build your own WordNet!
#### Try it yourself
Using the Python libraries, download Wikipedia's page on [open source][5] and list the synsets and lemmas of all the words.
### Similarity comparison
Similarity comparison is a building block that identifies similarities between two pieces of text. It has many applications in search engines, chatbots, and more.
For example, are the words "football" and "soccer" related?
```
syn1 = wordnet.synsets('football')
syn2 = wordnet.synsets('soccer')
# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2
for s1 in syn1:
    for s2 in syn2:
        print("Path similarity of: ")
        print(s1, '(', s1.pos(), ')', '[', s1.definition(), ']')
        print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']')
        print("   is", s1.path_similarity(s2))
        print()
[/code] [code]
Path similarity of:
Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ]
Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ]
   is 0.5
Path similarity of:
Synset('football.n.02') ( n ) [ the inflated oblong ball used in playing American football ]
Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ]
   is 0.05
```
The highest path similarity score of the words is 0.5, indicating they are closely related.
What about "code" and "bug"? Similarity scores for these words used in computer science are:
```
Path similarity of:
Synset('code.n.01') ( n ) [ a set of rules or principles or laws (especially written ones) ]
Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ]
   is 0.1111111111111111
...
Path similarity of:
Synset('code.n.02') ( n ) [ a coding system used for transmitting messages requiring brevity or secrecy ]
Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ]
   is 0.09090909090909091
...
Path similarity of:
Synset('code.n.03') ( n ) [ (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions ]
Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ]
   is 0.09090909090909091
```
These are the highest similarity scores, which indicates they are related.
NLTK provides several similarity scorers, such as:
* path_similarity
* lch_similarity
* wup_similarity
* res_similarity
* jcn_similarity
* lin_similarity
See the Similarity section of the [WordNet Interface][6] page to determine the appropriate one for your application.
#### Try it yourself
Using Python libraries, start from the Wikipedia [Category: Lists of computer terms][7] page and prepare a list of terminologies, then see how the words correlate.
### Tree and treebank
With NLTK, you can represent a text's structure in tree form to help with text analysis.
Here is an example:
A simple text pre-processed and part-of-speech (POS)-tagged:
```
import nltk
text = "I love open source"
# Tokenize to words
words = nltk.tokenize.word_tokenize(text)
# POS tag the words
words_tagged = nltk.pos_tag(words)
```
You must define a grammar to convert the text to a tree structure. This example uses a simple grammar based on the [Penn Treebank tags][8].
```
# A simple grammar to create tree
grammar = "NP: {&lt;JJ&gt;&lt;NN&gt;}"
```
Next, use the grammar to create a tree:
```
# Create tree
parser = nltk.RegexpParser(grammar)
tree = parser.parse(words_tagged)
pprint(tree)
```
This produces:
```
`Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])])`
```
You can see it better graphically.
```
`tree.draw()`
```
![NLTK Tree][9]
(Girish Managoli, [CC BY-SA 4.0][10])
This structure helps explain the text's meaning correctly. As an example, identify the [subject][11] in this text:
```
subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"]
def subject(sentence_tree):
    for tagged_word in sentence_tree:
        # A crude logic for this case -  first word with these tags is considered subject
        if tagged_word[1] in subject_tags:
            return tagged_word[0]
print("Subject:", subject(tree))
```
It shows "I" is the subject:
```
`Subject: I`
```
This is a basic text analysis building block that is applicable to larger applications. For example, when a user says, "Book a flight for my mom, Jane, to NY from London on January 1st," a chatbot using this block can interpret the request as:
**Action**: Book
**What**: Flight
**Traveler**: Jane
**From**: London
**To**: New York
**Date**: 1 Jan (of the next year)
A treebank refers to a corpus with pre-tagged trees. Open source, conditional free-for-use, and commercial treebanks are available for many languages. The most commonly used one for English is Penn Treebank, extracted from the _Wall Street Journal_, a subset of which is included in NLTK. Some ways of using a treebank:
```
words = nltk.corpus.treebank.words()
print(len(words), "words:")
print(words)
tagged_sents = nltk.corpus.treebank.tagged_sents()
print(len(tagged_sents), "sentences:")
print(tagged_sents)
[/code] [code]
100676 words:
['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...]
3914 sentences:
[[('Pierre', 'NNP'), ('Vinken', 'NNP'), (',', ','), ('61', 'CD'), ('years', 'NNS'), ('old', 'JJ'), (',', ','), ('will', 'MD'), ('join', 'VB'), ('the', 'DT'), ('board', 'NN'), ('as', 'IN'), ('a', 'DT'), ('nonexecutive', 'JJ'), ('director', 'NN'), ...]
```
See tags in a sentence:
```
sent0 = tagged_sents[0]
pprint(sent0)
[/code] [code]
[('Pierre', 'NNP'),
 ('Vinken', 'NNP'),
 (',', ','),
 ('61', 'CD'),
 ('years', 'NNS'),
...
```
Create a grammar to convert this to a tree:
```
grammar = '''
    Subject: {&lt;NNP&gt;&lt;NNP&gt;}
    SubjectInfo: {&lt;CD&gt;&lt;NNS&gt;&lt;JJ&gt;}
    Action: {&lt;MD&gt;&lt;VB&gt;}
    Object: {&lt;DT&gt;&lt;NN&gt;}
    Stopwords: {&lt;IN&gt;&lt;DT&gt;}
    ObjectInfo: {&lt;JJ&gt;&lt;NN&gt;}
    When: {&lt;NNP&gt;&lt;CD&gt;}
'''
parser = nltk.RegexpParser(grammar)
tree = parser.parse(sent0)
print(tree)
[/code] [code]
(S
  (Subject Pierre/NNP Vinken/NNP)
  ,/,
  (SubjectInfo 61/CD years/NNS old/JJ)
  ,/,
  (Action will/MD join/VB)
  (Object the/DT board/NN)
  as/IN
  a/DT
  (ObjectInfo nonexecutive/JJ director/NN)
  (Subject Nov./NNP)
  29/CD
  ./.)
```
See it graphically:
```
`tree.draw()`
```
![NLP Treebank image][12]
(Girish Managoli, [CC BY-SA 4.0][10])
The concept of trees and treebanks is a powerful building block for text analysis.
#### Try it yourself
Using the Python libraries, download Wikipedia's page on [open source][5] and represent the text in a presentable view.
### Named entity recognition
Text, whether spoken or written, contains important data. One of text processing's primary goals is extracting this key data. This is needed in almost all applications, such as an airline chatbot that books tickets or a question-answering bot. NLTK provides a named entity recognition feature for this.
Here's a code example:
```
`sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'`
```
See if name and place are recognized in this sentence. Pre-process as usual:
```
import nltk
words = nltk.word_tokenize(sentence)
pos_tagged = nltk.pos_tag(words)
```
Run the named-entity tagger:
```
ne_tagged = nltk.ne_chunk(pos_tagged)
print("NE tagged text:")
print(ne_tagged)
print()
[/code] [code]
NE tagged text:
(S
  (PERSON Peterson/NNP)
  first/RB
  suggested/VBD
  the/DT
  name/NN
  ``/``
  open/JJ
  source/NN
  ''/''
  at/IN
  (FACILITY Palo/NNP Alto/NNP)
  ,/,
  (GPE California/NNP))
```
Name tags were added; extract only the named entities from this tree:
```
print("Recognized named entities:")
for ne in ne_tagged:
    if hasattr(ne, "label"):
        print(ne.label(), ne[0:])
[/code] [code]
Recognized named entities:
PERSON [('Peterson', 'NNP')]
FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')]
GPE [('California', 'NNP')]
```
See it graphically:
```
`ne_tagged.draw()`
```
![NLTK Treebank tree][13]
(Girish Managoli, [CC BY-SA 4.0][10])
NLTK's built-in named-entity tagger, using PENN's [Automatic Content Extraction][14] (ACE) program, detects common entities such as ORGANIZATION, PERSON, LOCATION, FACILITY, and GPE (geopolitical entity).
NLTK can use other taggers, such as the [Stanford Named Entity Recognizer][15]. This trained tagger is built in Java, but NLTK provides an interface to work with it (See [nltk.parse.stanford][16] or [nltk.tag.stanford][17]).
#### Try it yourself
Using the Python libraries, download Wikipedia's page on [open source][5] and identify people who had an influence on open source and where and when they contributed.
### Advanced exercise
If you're ready for it, try building this superstructure using the building blocks discussed in these articles.
Using Python libraries, download Wikipedia's [Category: Computer science page][18] and:
* Identify the most-occurring unigrams, bigrams, and trigrams and publish it as a list of keywords or technologies that students and engineers need to be aware of in this domain.
* Show the names, technologies, dates, and places that matter in this field graphically. This can be a nice infographic.
* Create a search engine. Does your search engine perform better than Wikipedia's search?
### What's next?
NLP is a quintessential pillar in application building. NLTK is a classic, rich, and powerful kit that provides the bricks and mortar to build practically appealing, purposeful applications for the real world.
In this series of articles, I explained what NLP makes possible using NLTK as an example. NLP and NLTK have a lot more to offer. This series is an inception point to help get you started.
If your needs grow beyond NLTK's capabilities, you could train new models or add capabilities to it. New NLP libraries that build on NLTK are coming up, and machine learning is being used extensively in language processing.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/8/nlp-python-nltk
作者:[Girish Managoli][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/gammay
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen)
[2]: https://opensource.com/article/20/8/intro-python-nltk
[3]: http://www.nltk.org/
[4]: https://en.wikipedia.org/wiki/WordNet
[5]: https://en.wikipedia.org/wiki/Open_source
[6]: https://www.nltk.org/howto/wordnet.html
[7]: https://en.wikipedia.org/wiki/Category:Lists_of_computer_terms
[8]: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html
[9]: https://opensource.com/sites/default/files/uploads/nltk-tree.jpg (NLTK Tree)
[10]: https://creativecommons.org/licenses/by-sa/4.0/
[11]: https://en.wikipedia.org/wiki/Subject_(grammar)
[12]: https://opensource.com/sites/default/files/uploads/nltk-treebank.jpg (NLP Treebank image)
[13]: https://opensource.com/sites/default/files/uploads/nltk-treebank-2a.jpg (NLTK Treebank tree)
[14]: https://www.ldc.upenn.edu/collaborations/past-projects/ace
[15]: https://nlp.stanford.edu/software/CRF-NER.html
[16]: https://www.nltk.org/_modules/nltk/parse/stanford.html
[17]: https://www.nltk.org/_modules/nltk/tag/stanford.html
[18]: https://en.wikipedia.org/wiki/Category:Computer_science

View File

@@ -1,55 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (My top 7 keywords in Rust)
[#]: via: (https://opensource.com/article/20/10/keywords-rust)
[#]: author: (Mike Bursell https://opensource.com/users/mikecamel)
My top 7 keywords in Rust
======
Learn a handful of useful keywords from the Rust standard library.
![Rustacean t-shirt][1]
I've been using [Rust][2] for a few months now, writing rather more of it than I expected—though quite a lot of that has been thrown away as I've learned, improved what I'm writing, and taken some more complex tasks beyond what I originally intended.
I still love it and thought it might be good to talk about some of the important keywords that come up again and again in Rust. I'll provide my personal summary of what they do, why you need to think about how you use them, and anything else that's useful, particularly for people who are new to Rust or coming from another language (such as Java; see my article [_Why I'm enjoying learning Rust as a Java programmer_][3]).
Without further ado, let's get going. A good place for further information is always the official Rust documentation—you'll probably want to start with the [std library][4].
1. **const**  You get to declare constants with const, and you should. This isn't rocket science, but do declare with const, and if you're going to use constants across different modules, then do the right thing and create a `lib.rs` file (the Rust default) into which you can put all of them with a nicely named module. I've had clashes of const variable names (and values!) across different files in different modules simply because I was too lazy to do anything other than cut and paste across files when I could have saved myself lots of work simply by creating a shared module.
2. **let**  You don't _always_ need to declare a variable with a let statement, but your code will be clearer when you do. What's more, always add the type if you can. Rust will do its very best to guess what it should be, but it may not always be able to do so at runtime (in which case [Cargo][5], the compiler, will tell you), or it may even not do what you expect. In the latter case, it's always simpler for Cargo to complain that the function you're assigning from (for instance) doesn't match the declaration than for Rust to try to help you do the wrong thing, only for you to have to spend ages debugging elsewhere.
3. **match**  match was new to me, and I love it. It's not dissimilar to "switch" in other languages but is used extensively in Rust. It makes for legible code, and Cargo will have a good go at warning you if you do something foolish (such as miss possible cases). My general rule of thumb, where I'm managing different options or doing branching, is to ask whether I can use match. If I can, I will.
4. **mut**  When declaring a variable, if it's going to change after its initialisation, then you need to declare it mutable. A common mistake is to declare something mutable when it _isn't_ changed—but the compiler will warn you about that. If you get a warning from Cargo that a mutable variable isn't changed when you think it _is_, then you may wish to check the scope of the variable and make sure that you're using the right version.
5. **return**  I actually very rarely use return, which is for returning a value from a function, because it's usually simpler and clearer to read if you just provide the value (or the function providing the return value) at the end of the function as the last line. Warning: you _will_ forget to omit the semicolon at the end of this line on many occasions; if you do, the compiler won't be happy.
6. **unsafe**  This does what it says on the tin: If you want to do things where Rust can't guarantee memory safety, then you're going to need to use this keyword. I have absolutely no intention of declaring any of my Rust code unsafe now or at any point in the future; one of the reasons Rust is so friendly is because it stops this sort of hackery. If you really need to do this, think again, think yet again, and then redesign. Unless you're a seriously low-level systems programmer, _avoid_ unsafe.
7. **use**  When you want to use an item, e.g., struct, variable, function, etc. from another crate, then you need to declare it at the beginning of the block where you'll be using it. Another common mistake is to do this but fail to add the crate (preferably with a minimum version number) to the `Cargo.toml` file.
This isn't the most complicated article I've ever written, I know, but it's the sort of article I would have appreciated when I was starting to learn Rust. I plan to create similar articles on key functions and other Rust must-knows: let me know if you have any requests!
* * *
_This article was originally published on [Alice, Eve, and Bob][6] and is reprinted with the author's permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/keywords-rust
作者:[Mike Bursell][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mikecamel
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rustacean-tshirt.jpg?itok=u7LBmyaj (Rustacean t-shirt)
[2]: https://www.rust-lang.org/
[3]: https://opensource.com/article/20/5/rust-java
[4]: https://doc.rust-lang.org/std/
[5]: https://doc.rust-lang.org/cargo/
[6]: https://aliceevebob.com/2020/09/01/rust-my-top-7-keywords/

View File

@@ -1,163 +0,0 @@
[#]: subject: (Programming 101: Input and output with Java)
[#]: via: (https://opensource.com/article/21/3/io-java)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Programming 101: Input and output with Java
======
Learn how Java handles reading and writing data.
![Coffee beans and a cup of coffee][1]
When you write a program, your application may need to read from and write to files stored on the user's computer. This is common in situations when you want to load or store configuration options, you need to create log files, or your user wants to save work for later. Every language handles this task a little differently. This article demonstrates how to handle data files with Java.
### Installing Java
Regardless of your computer's platform, you can install Java from [AdoptOpenJDK][2]. This site offers safe and open source builds of Java. On Linux, you may also find AdoptOpenJDK builds in your software repository.
I recommend using the latest long-term support (LTS) release. The latest non-LTS release is best for developers looking to try the latest Java features, but it likely outpaces what most users have installed—either by default on their system or installed previously for some other Java application. Using the LTS release ensures you're up-to-date with what most users have installed.
Once you have Java installed, open your favorite text editor and get ready to code. You might also want to investigate an [integrated development environment for Java][3]. BlueJ is ideal for new programmers, while Eclipse and Netbeans are nice for intermediate and experienced coders.
### Reading a file with Java
Java uses the `File` library to load files.
This example creates a class called `Ingest` to read data from a file. When you open a file in Java, you create a `Scanner` object, which scans the file you provide, line by line. In fact, a `Scanner` is the same concept as a cursor in a text editor, and you can control that "cursor" for reading and writing with `Scanner` methods like `nextLine`:
```
import java.io.File;
import java.util.Scanner;
import java.io.FileNotFoundException;
public class Ingest {
  public static void main([String][4][] args) {
   
      try {
          [File][5] myFile = new [File][5]("example.txt");
          Scanner myScanner = new Scanner(myFile);
          while (myScanner.hasNextLine()) {
              [String][4] line = myScanner.nextLine();
              [System][6].out.println(line);
          }
          myScanner.close();
      } catch ([FileNotFoundException][7] ex) {
          ex.printStackTrace();  
      } //try
    } //main
} //class
```
This code creates the variable `myfile` under the assumption that a file named `example.txt` exists. If that file does not exist, Java "throws an exception" (this means it found an error in what you attempted to do and says so), which is "caught" by the very specific `FileNotFoundException` library. The fact that there's a library specific to this exact error betrays how common this error is.
Next, it creates a `Scanner` and loads the file into it. I call it `myScanner` to differentiate it from its generic class template. A `while` loop sends `myScanner` over the file, line by line, for as long as there _is_ a next line. That's what the `hasNextLine` method does: it detects whether there's any data after the "cursor." You can simulate this by opening a file in a text editor: Your cursor starts at the very beginning of the file, and you can use the keyboard to scan through the file with the cursor until you run out of lines.
The `while` loop creates a variable `line` and assigns it the data of the current line. Then it prints the contents of `line` just to provide feedback. A more useful program would probably parse each line to extract whatever important data it contains.
At the end of the process, the `myScanner` object closes.
### Running the code
Save your code as `Ingest.java` (it's a Java convention to give classes an initial capital letter and name the file to match). If you try to run this simple application, you will probably receive an error because there is no `example.txt` for the application to load yet:
```
$ java ./Ingest.java
java.io.[FileNotFoundException][7]:
example.txt (No such file or directory)
```
What a perfect opportunity to write a Java application that writes data to a file!
### Writing data to a file with Java
Whether you're storing data that your user creates with your application or just metadata about what a user did in an application (for instance, game saves or recent songs played), there are lots of good reasons to store data for later use. In Java, this is achieved through the `FileWriter` library, this time by opening a file, writing data into it, and then closing the file:
```
import java.io.FileWriter;
import java.io.IOException;
public class Exgest {
  public static void main([String][4][] args) {
    try {
        [FileWriter][8] myFileWriter = new [FileWriter][8]("example.txt", true);
        myFileWriter.write("Hello world\n");
        myFileWriter.close();
    } catch ([IOException][9] ex) {
        [System][6].out.println(ex);
    } // try
  } // main
}
```
The logic and flow of this class are similar to reading a file. Instead of a `Scanner`, it creates a `FileWriter` object with the name of a file. The `true` flag at the end of the `FileWriter` statement tells `FileWriter` to _append_ text to the end of the file. To overwrite a file's contents, remove the `true`:
```
`FileWriter myFileWriter = new FileWriter("example.txt", true);`
```
Because I'm writing plain text into a file, I added my own newline character (`\n`) at the end of the data (`Hello world`) written into the file.
### Trying the code
Save this code as `Exgest.java`, following the Java convention of naming the file to match the class name.
Now that you have the means to create and read data with Java, you can try your new applications, in reverse order:
```
$ java ./Exgest.java
$ java ./Ingest.java
Hello world
$
```
Because it appends data to the end, you can repeat your application to write data as many times as you want to add more data to your file:
```
$ java ./Exgest.java
$ java ./Exgest.java
$ java ./Exgest.java
$ java ./Ingest.java
Hello world
Hello world
Hello world
$
```
### Java and data
You're don't write raw text into a file very often; in the real world, you probably use an additional library to write a specific format instead. For instance, you might use an XML library to write complex data, an INI or YAML library to write configuration files, or any number of specialized libraries to write binary formats like images or audio.
For full information, refer to the [OpenJDK documentation][10].
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/3/io-java
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee)
[2]: https://adoptopenjdk.net
[3]: https://opensource.com/article/20/7/ide-java
[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file
[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filenotfoundexception
[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter
[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception
[10]: https://access.redhat.com/documentation/en-us/openjdk/11/

View File

@@ -2,7 +2,7 @@
[#]: via: (https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -2,7 +2,7 @@
[#]: via: (https://itsfoss.com/hash-linux-review/)
[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (mcfd)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -1,134 +0,0 @@
[#]: subject: (How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install)
[#]: via: (https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install
======
Setting up the internet or network is super easy in minimal server
installations. In this guide, we will explain how you can setup internet
or network in CentOS, RHEL, Rocky Linux minimal install.
Once you install the minimal install of any server distributions, you would not have any GUI or desktop environment to set up your network or internet. Hence it is important to know how you can set up internet when you only have access to the terminal. The NetworkManager utility provides necessary tools armed with systemd services to get the job done. Heres how.
### Setup Internet in CentOS, RHEL, Rocky Linux Minimal Install
* After you have completed the installation, boot into the server terminal. Ideally, you should be prompted with a terminal. Login using root or admin account.
* Then first, try to check the state of the network interface and details using nmcli. The nmcli is a command-line tool for controlling the NetworkManager service. Use the following command to check.
```
nmcli device status
```
This would display the device name, status etc.
![nmcli device status][1]
* Run the tool `nmtui` to configure the network interface. The [nmtui][2] is part of the NetworkManager tool which gives you a nice UI to configure the network. This is part of the package NetworkManager-tui and should be installed by default when you have completed the installation of the minimal server.
```
nmtui
```
* Click on Edit a connection in the nmtui window.
![nmtui Select options][3]
* Select the interface name
![Select Interface to Edit][4]
* In the Edit Connection window, choose Automatic for IPv4 and IPv6. And select Automatically Connect. Press ok once done.
![nmtui Edit Connection][5]
* Restart the NetworkManager service via the [systemd systemctl][6] using the following command.
```
systemctl restart NetworkManager
```
* If all goes well, you should be connected to the network and internet in the minimal installation of CentOS, RHEL, Rocky Linux server. Provided your network has internet connectivity. You can use ping to verify whether it is working.
![setup internet minimal server CentOS Rocky Linux RHEL][7]
### Additional Tip: Set up Static IP in minimal server
When you set the network configuration as automatic, the interface dynamically assigns the IP when you connected to the internet. In some situations where you are setting up a local area network (LAN), you may want to assign static IP to your network interface. Its super easy.
Open the network configuration script for your network. Change the highlighted part for your own device.
```
vi /etc/sysconfig/network-scripts/ifcfg-ens3
```
In the above file, add the IP address you desire with property IPADDR. Save the file.
```
IPADDR=192.168.0.55
```
Add the gateway for your network in `/etc/sysconfig/network`.
```
NETWORKING=yes
HOSTNAME=debugpoint
GATEWAY=10.1.1.1
```
Add any public DNS server in resolv.conf located at `/etc/resolv.conf`.
nameserver 8.8.8.8
nameserver 8.8.4.4
And restart the network service.
```
systemctl restart NetworkManager
```
This will complete the setup of the static IP. You can also check the IP details using `ip addr` command.
I hope this guide helps you to set up the network, internet, and static IP in your minimal server. Let me know in the comment section, if you may have any questions.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/06/setup-internet-minimal-install-server/
作者:[Arindam][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmcli-device-status.jpg
[2]: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmtui
[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Select-options.jpg
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Select-Interface-to-Edit.jpg
[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/nmtui-Edit-Connection.jpg
[6]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/setup-internet-minimal-server-CentOS-Rocky-Linux-RHEL.jpg

View File

@@ -1,99 +0,0 @@
[#]: subject: (Converseen for Batch Processing Images on Linux)
[#]: via: (https://itsfoss.com/converseen/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Converseen for Batch Processing Images on Linux
======
Converseen is a free and open source software for batch image conversion. With this tool, you can convert multiple images to another format, resize, change their aspect ratio, rotate or flip them all at once.
This is a handy tool for someone like me who has to deal with multiple screenshots of different size but has to resize them all before uploading to the website.
Batch conversion tools help a lot in such cases. This could be done in the Linux command line with the wonderful [ImageMagick][1] but a GUI tool is a lot easier to use here. Actually, Converseen uses ImageMagick underneath the Qt-based GUI.
### Batch process images with Converseen
You can use [Converseen][2] to convert, resize, rotate and flip multiple images with a mouse click.
You have plenty of supporting options for the batch conversion. You can add additional images to your selection or remove some of them. You can choose to convert only a few of your selected images.
While resizing the images, you can choose to keep the aspect ratio. Keep in mind that out of width and height, the one you changed/typed last is the one controlling the aspect ratio. So, if you want to resize keeping the same aspect ratio but according to the width, dont touch the height field.
![][3]
You can also choose to save the converted images with different name in the same directory or some other location. You may also overwrite the existing images.
You cannot add folder but you can select and add multiple images at once.
You can convert the images to a number of formats like JPEG, JPG, TIFF, SVG and more.
There is also an option to give the transparent background a certain color while changing the format. You can also set the quality of the compression level.
![][4]
Converseen says that it can also import PDF files and convert the entire PDF or part of it into images. However, it crashed in Ubuntu 21.04 each time I tried to convert a PDF file.
### Install Converseen on Linux
Converseen is a popular application. It is available in the repositories of most Linux distributions.
You can search for it in your distributions software center:
![][5]
You may, of course, use your distributions package manager to install it via command line.
On Debian and Ubuntu-based distributions, use:
```
sudo apt install converseen
```
On Fedora, use:
```
sudo dnf install converseen
```
On Arch and Manjaro, use:
```
sudo pacman -Sy converseen
```
Converseen is also available for Windows and FreeBSD. You can get the instructions on the download page of the project website.
[Download Converseen][6]
Its source code is [available][7] on the projects GitHub repository.
If you are looking for an even easier way to resize a single image, you can use this nifty trick and [resize and rotate images with right click context menu in Nautilus file manager][8].
Overall, Converseen is a useful GUI tool for batch image conversion. Its not perfect but it works for the most part. Have you ever used Converseen or do you use a similar tool? How is your experience with it?
--------------------------------------------------------------------------------
via: https://itsfoss.com/converseen/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://imagemagick.org/index.php
[2]: https://converseen.fasterland.net/
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-interface.png?resize=800%2C400&ssl=1
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-features-overview_copy.png?resize=800%2C497&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/install-converseen-linux.jpeg?resize=800%2C527&ssl=1
[6]: https://converseen.fasterland.net/download/
[7]: https://github.com/Faster3ck/Converseen
[8]: https://itsfoss.com/resize-images-with-right-click/

View File

@@ -0,0 +1,143 @@
[#]: subject: (5 Rust tools worth trying on the Linux command line)
[#]: via: (https://opensource.com/article/21/7/rust-tools-linux)
[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
5 Rust tools worth trying on the Linux command line
======
Try some new commands for common tasks.
![Terminal command prompt on orange background][1]
Linux inherited a lot from Unix, which has been around for a half-century. This means most of the tools you use in your Linux terminal probably either have a very long history or were written to emulate those historical commands. It's a point of pride in the POSIX world that tools don't _need_ constant reinvention. In fact, there's a subset of Linux users today who could run a version of Linux from [before they were born][2] without having to learn anything new. It's tried, true, and reliable.
That doesn't mean there hasn't been evolution, though. All the commands Linux users know and love have been improved over the years. Some have even been replaced entirely and are so common now that few people still care to remember the old ones. Can you imagine Linux without SSH? Well, believe it or not, the `ssh` command replaced one called `rsh`.
I'm often on the lookout for new commands because I'm always intrigued by the possibility of getting things done more efficiently. If there's a better, faster, or more robust command out there for doing a common task, I want to know about it. And while there's equal opportunity for any language to invent new Linux commands, Rust developers have been delivering an impressive collection of useful general-purpose utilities.
### Replace man with tealdeer
Tealdeer provides the `tldr` command, which displays an abbreviated, no-nonsense summary of how a command is used. It's not that manual and info pages aren't useful, because they are, but sometimes they can be a little verbose and a little obtuse. Tealdeer keeps its hints clear and concise, with examples of how to use the command you're struggling to recall.
```
$ tldr tar
  Archiving utility.
  Often combined with a compression method, such as gzip or bzip2.
  More information: &lt;[https://www.gnu.org/software/tar\&gt;][3].
  [c]reate an archive and write it to a [f]ile:
      tar cf target.tar file1 file2 file3
  [c]reate a g[z]ipped archive and write it to a [f]ile:
      tar czf target.tar.gz file1 file2 file3
  [c]reate a g[z]ipped archive from a directory using relative paths:
      tar czf target.tar.gz --directory=path/to/directory .
[...]
```
Read the full article [about tldr][4].
### Replace du with dust
The `du` command gives feedback about disk usage. It's a relatively simple task; likewise, the command is pretty simple, too. The `dust` command is `du` written in Rust, and it uses color-coding and bar graphs for users who prefer added visual context.
```
$ dust
 5.7M   ┌── exa                                                                    ██ │   2%
 5.9M   ├── tokei                                                                  ██ │   2%
 6.1M   ├── dust                                  │                                   ██ │   2%
 6.2M   ├── tldr                                  │                                   ██ │   2%
 9.4M   ├── fd                                    │                                   ██ │   4%
 2.9M   │ ┌── exa                                                                ░░░█ │   1%
  15M   │ ├── rustdoc                                                            ░███ │   6%
  18M   ├─┴ bin                                                                  ████ │   7%
  27M   ├── rg                                    │                               ██████ │  11%
 1.3M      ┌── libz-sys-1.1.3.crate            │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   0%
 1.4M      ├── libgit2-sys-0.12.19+1.1.0.crate │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   1%
 4.5M    ┌─┴ github.com-1ecc6299db9ec823       │  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█ │   2%
 4.5M   │ ┌─┴ cache                               │  ░░░░░░░░░░░░░░░░░░░░░░░░
[...]
```
Read the full article [about dust][5].
### Replace find with fd
The `find` command is a useful tool for finding files on your computer, but its syntax can be difficult to master. Not only are there a lot of options, but the order of those options can be significant, depending on what you're doing. Some people have [written scripts][6] to abstract the task away from the command. Other people just write a new tool altogether, like `fd`.
Syntax doesn't get any easier than this:
```
$ fd example
Documents/example.txt
Documents/example-java
Downloads/example.com/index.html
```
Read the full article [about fd][7].
### Replace ls with exa
You might not think that the `ls` command would have much room for improvement. But `exa` proves that even the most mundane utility can benefit from small adjustments. For instance, why not have a list command with built-in Git awareness? Why not get extra metadata in your file lists? 
Read the full [article about exa][8].
### Try Tokei
Unlike the other tools on this list, the `tokei` utility doesn't replace one command, but it does demonstrate how the Linux terminal is—as always—an environment very much in constant growth. The terminal may contain lots of legacy commands, but there are new and exciting commands surfacing all the time.
When I'm looking at a project in my local file system, and I need to know what languages it contains, I rely on a tool like Tokei. It's a program that displays statistics about a codebase, with wide support for 150 programming languages. I don't need to remember what languages have been used, or how many lines of code there are, or how many blanks or spaces or comments are there. It's a complete code-analysis tool, making my entry into and navigation of the code easy.
```
$ tokei ~/exa/src ~/Work/wildfly/jaxrs
==================
Language   Files Lines Code Comments Blank
Java        46    6135  4324  945     632
XML         23    5211  4839  473     224
\---------------------------------
Rust
Markdown
\-----------------------------------
Total
```
Read the full [article about tokei][9].
### Find your favorite
Open source users never have to settle for just a small set of commands, or even just one version of a command. Find the commands you love, whether they're new ideas for emerging workflows, or reimplementations of old tools, or timeless classics that are just as good today as they were decades ago. Find the commands that make your life better and enjoy!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/rust-tools-linux
作者:[Sudeshna Sur][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sudeshna-sur
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background)
[2]: https://opensource.com/article/16/12/yearbook-linux-test-driving-distros
[3]: https://www.gnu.org/software/tar\>
[4]: https://opensource.com/article/21/6/tealdeer
[5]: https://opensource.com/article/21/6/dust
[6]: https://opensource.com/article/20/2/find-file-script
[7]: https://opensource.com/article/21/6/fd
[8]: https://opensource.com/article/21/3/replace-ls-exa
[9]: https://opensource.com/article/21/6/tokei

View File

@@ -0,0 +1,160 @@
[#]: subject: (Getting Started with Podman on Fedora)
[#]: via: (https://fedoramagazine.org/getting-started-with-podman-in-fedora/)
[#]: author: (Yazan Monshed https://fedoramagazine.org/author/yazanalmonshed/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Getting Started with Podman on Fedora
======
![][1]
Podman logo from the Podman project <https://github.com/containers/podman/tree/main/logo>
[Podman][2] is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. In this article, we will introduce podman and how to use it with a small application build using nodejs. The app will be very simple and clean.
### Install Podman
Podman command is the same as [docker][3] just type in your terminal **alias docker=podman** if you have docker already installed
Podman is installed by default in Fedora. But if you dont have it for any reason, you can install it using the following command:
```
sudo dnf install podman
```
For fedora [silverblue][4] users, podman is already installed in your OS.
After installation, run the hello world image to ensure everything is working:
```
podman pull hello-world
podman run hello-world
```
If everything is working well you will see the following output in your terminal:
```
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1.The Docker client contacted the Docker daemon.
2.The Docker daemon pulled the "hello-world" image from the Docker Hub. (amd64)
3.The Docker daemon created a new container from that image which runs the executable that produces the output you are currently reading.
4.The Docker daemon streamed that output to the Docker client, which sent it to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
```
### Simple Nodejs App
First, we will create a folder **webapp** , type the following command in your terminal
```
mkdir webapp && cd webapp
```
Now create the file ****_package.json_ This file includes all the dependencies that the project needs to work well. Copy the following code inside the file _package.json ._
```
{
"dependencies": {
"express": "*"
},
"scripts": {
"start": "node index.js"
}
}
```
Create the file _index.js_ and add the following code there:
```
const express = require('express')
const app = express();
app.get('/', (req, res)=> {
res.send("Hello World!")
});
app.listen(8081, () => {
console.log("Listing on port 8080");
});
```
You can download source code from [here][5].
### Create Dockerfile
First of all, create a file called _Dockerfile_ and make sure the first character is a capital, NOT lower case, then add the following code there:
```
FROM node:alpine
WORKDIR usr/app
COPY ./ ./
RUN npm install
CMD ["npm", "start"]
```
Be sure you are inside the folder _webapp_ then show the image and then type the following command:
```
podman build .
```
Make sure to add the **dot**. The image is created on your machine and you can show it using the following command:
```
podman images
```
The last step is to run the image inside a container by typing the following command:
```
podman run -p 8080:8080 <image-name>
```
Now open your browser in _localhost:8080_ and you will see that your app works.
### Stopping and Remove Container
To exit from the container use _CTRL-C._ You can remove the container by using the container id. Get the id and stop the container using these commands:
```
podman ps -a
podman stop <container_id>
```
You can delete the images from your machine by using the following command:
```
podman rmi <image_id>
```
Read more about podman and how it works on the [official website][2]
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/getting-started-with-podman-in-fedora/
作者:[Yazan Monshed][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/yazanalmonshed/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2020/06/Get_Started_w_Podman_on_Fedora-816x345.jpg
[2]: https://podman.io/
[3]: https://www.docker.com/
[4]: https://silverblue.fedoraproject.org/
[5]: https://github.com/YazanALMonshed/webapp

View File

@@ -0,0 +1,284 @@
[#]: subject: (How different programming languages read and write data)
[#]: via: (https://opensource.com/article/21/7/programming-read-write)
[#]: author: (Alan Smithee https://opensource.com/users/alansmithee)
[#]: collector: (lujun9972)
[#]: translator: (MjSeven)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How different programming languages read and write data
======
Every programming language has a unique way of accomplishing a task;
that's why there are so many languages to choose from.
![Code going into a computer.][1]
In his article _[How different programming languages do the same thing][2]_, Jim Hall demonstrates how 13 different languages accomplish the same exact task with different syntax. The lesson is that programming languages tend to have many similarities, and once you know one programming language, you can learn another by figuring its syntax and structure.
In the same spirit, Jim's article compares how different programming languages read and write data. Whether that data comes from a configuration file or from a file a user creates, processing data on a storage device is a common task for coders. It's not practical to cover all programming languages in this way, but a recent Opensource.com series provides insight into different approaches taken by these coding languages:
* [C][3]
* [C++][4]
* [Java][5]
* [Groovy][6]
* [Lua][7]
* [Bash][8]
* [Python][9]
### Reading and writing data
The process of reading and writing data with a computer is similar to how you read and write data in real life. To access data in a book, you first open it, then you read words or you write new words into the book, and then you close the book.
When your code needs to read data from a file, you provide your code with a file location, and then the computer brings that data into its RAM and parses it from there. Similarly, when your code needs to write data to a file, the computer places new data into the system's in-memory write buffer and synchronizes it to the file on the storage device.
Here's some pseudo-code for these operations:
1. Load a file in memory.
2. Read the file's contents, or write data to the file.
3. Close the file.
### Reading data from a file
You can see three trends in how the languages in the Opensource.com series read files.
#### C
In C, opening a file can involve retrieving a single character (up to the `EOF` designator, signaling the end of the file) or a block of data, depending on your requirements and approach. It can feel like a mostly manual process, depending on your goal, but the general process is exactly what the other languages mimic.
```
FILE *infile;
int ch;
infile = [fopen][10](argv[1], "r");
 
do {
  ch = [fgetc][11](infile);
  if (ch != EOF) {
    [printf][12]("%c", ch);
  }
 } while (ch != EOF);
[fclose][13](infile);
```
You can also choose to load some portion of a file into the system buffer and then work out of the buffer.
```
FILE *infile;
char buffer[300];
 
infile = [fopen][10](argv[1], "r");
while (![feof][14](infile)) {
  size_t buffer_length;
  buffer_length = [fread][15](buffer, sizeof(char), 300, infile);
}
[printf][12]("%s", buffer);
[fclose][13](infile);
```
#### C++
C++ simplifies a few steps, allowing you to parse data as strings.
```
std::string sFilename = "example.txt";
std::ifstream fileSource(sFilename);
std::string buffer;
while (fileSource &gt;&gt; buffer) {
  std::cout &lt;&lt; buffer &lt;&lt; std::endl;
}
```
#### Java
Java and Groovy are similar to C++. They use a class called `Scanner` to set up a data object or stream containing the contents of the file of your choice. You can "scan" through the file by tokens (byte, line, integer, and many others).
```
[File][16] myFile = new [File][16]("example.txt");
Scanner myScanner = new Scanner(myFile);
  while (myScanner.hasNextLine()) {
    [String][17] line = myScanner.nextLine();
    [System][18].out.println(line);
  }
myScanner.close();
```
#### Groovy
```
def myFile = new [File][16]('example.txt')
def myScanner = new Scanner(myFile)
  while (myScanner.hasNextLine()) {
    def line = myScanner.nextLine()
    println(line)
  }
myScanner.close()
```
#### Lua
Lua and Python abstract the process further. You don't have to consciously create a data stream; you just assign a variable to the results of an `open` function and then parse the contents of the variable. It's quick, minimal, and easy.
```
myFile = io.open('example.txt', 'r')
lines = myFile:read("*all")
print(lines)
myFile:close()
```
#### Python
```
f = open('example.tmp', 'r')
for line in f:
    print(line)
f.close()
```
### Writing data to a file
In terms of code, writing is the inverse of reading. As such, the process for writing data to a file is basically the same as reading data from a file, except using different functions.
#### C
In C, you can write a character to a file with the `fputc` function.
```
`fputc(ch, outfile);`
```
Alternately, you can write data to the buffer with `fwrite`.
```
`fwrite(buffer, sizeof(char), buffer_length, outfile);`
```
#### C++
Because C++ uses the `ifstream` library to open a buffer for data, you can write data to the buffer, as with C (except with C++ libraries).
```
`std::cout << buffer << std::endl;`
```
#### Java
In Java, you can use the `FileWriter` class to create a data object that you can write data to. It works a lot like the `Scanner` class, except going the other way.
```
[FileWriter][19] myFileWriter = new [FileWriter][19]("example.txt", true);
myFileWriter.write("Hello world\n");
myFileWriter.close();
```
#### Groovy
Similarly, Groovy uses `FileWriter` but with a slightly "groovier" syntax.
```
new [FileWriter][19]("example.txt", true).with {
  write("Hello world\n")
  flush()
}
```
#### Lua
Lua and Python are similar, both using functions called `open` to load a file, `write` to put data into it, and `close` to close the file.
```
myFile = io.open('example.txt', 'a')
io.output(myFile)
io.write("hello world\n")
io.close(myFile)
```
#### Python
```
myFile = open('example.txt', 'w')
myFile.write('hello world')
myFile.close()
```
### File modes
Many languages specify a "mode" when opening files. Modes vary, but this is common notation:
* **w** to write
* **r** to read
* **r+** to read and write
* **a** to append only
Some languages, such as Java and Groovy, let you determine the mode based on which class you use to load the file.
Whichever way your programming language determines a file's mode, it's up to you to ensure that you're _appending_ data—unless you intend to overwrite a file with new data. Programming languages don't have built-in prompts to warn you against data loss, the way file choosers do.
### New language and old tricks
Every programming language has a unique way of accomplishing a task; that's why there are so many languages to choose from. You can and should choose the language that works best for you. But once you understand the basic constructs of programming, you can also feel free to try out different languages, without fear of not knowing how to accomplish basic tasks. More often than not, the pathways to a goal are similar, so they're easy to learn as long as you keep the basic concepts in mind.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/programming-read-write
作者:[Alan Smithee][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alansmithee
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.)
[2]: https://opensource.com/article/21/4/compare-programming-languages
[3]: https://opensource.com/article/21/3/file-io-c
[4]: https://opensource.com/article/21/3/ccc-input-output
[5]: https://opensource.com/article/21/3/io-java
[6]: https://opensource.com/article/21/4/groovy-io
[7]: https://opensource.com/article/21/3/lua-files
[8]: https://opensource.com/article/21/3/input-output-bash
[9]: https://opensource.com/article/21/6/reading-and-writing-files-python
[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html
[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html
[12]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html
[14]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html
[15]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html
[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file
[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter

View File

@@ -0,0 +1,197 @@
[#]: subject: (Linux for Education: Best Distributions for Kids, Teachers & Schools)
[#]: via: (https://itsfoss.com/educational-linux-distros/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Linux for Education: Best Distributions for Kids, Teachers & Schools
======
Can kids use Linux distributions? And is it suitable for school use?
Well, that depends on what are your options and what you choose to go with. No matter whether you want something for a kid or the school teacher, there are options available.
Hence, to give you a head start, we have curated a list of [best Linux distributions][1] tailored for education.
### Best Linux Distribution for Kids
For a kid, a distribution has to offer a user-friendly UI minus the advanced functionalities.
You may argue that it can be done with any mainstream, [beginner-friendly distro like Ubuntu][2], Mint or Zorin. You are right, but if a distribution comes with [essential tools][3] baked in and makes it easy to use, kids will quickly learn to use it and have fun.
#### 1\. Endless OS
![Image Credits: Distrowatch][4]
Endless OS is a popular option to go for as a Linux distro tailored for education.
It is based on Debian and uses GNOME desktop environment. Even though it restricts usage of its OS on more than five hundred computers in a year, it is free to download.
The user interface is easy to use and looks attractive for installation in a modern PC. You get variety of applications pre-installed. Hence, this comes handy for computers with no internet access.
[Endless OS][5]
#### 2\. Ubermix
![][6]
Ubermix is an Ubuntu-based Linux distribution that aims to reduce the complexity by tweaking the user interface, getting rid of unnecessary apps, and adding essential tools/apps for education.
It also offers a way to easily recover from a system issue in case there is a problem. An optional parental control feature is present for content filtering and [screen time controls][7], which is indeed useful.
Ubermix is actively maintained and provides plenty of instructions for installation and troubleshooting on its official website.
[ubermix][8]
#### 3\. Kano OS (for Raspberry Pi)
![][9]
Kano is a computing kit tailored for educating children from 6 to 14 years. Its like a premium version of Raspberry Pi with plenty of DIY and coding activities for the young ones.
Preview | Product | Price |
---|---|---|---
![Kano Computer Kit A Computer Anyone Can Make][10] ![Kano Computer Kit A Computer Anyone Can Make][10] | [Kano Computer Kit A Computer Anyone Can Make][11] | $345.00[][12] | [Buy on Amazon][13]
Kano also has Debian based [operating system for Raspberry Pi][14]. You dont need to have Kano kit for this purpose. You can use it on your Raspberry Pi.
It aims to provide the benefits of it—curated for education when coupled with their computer kits. Ranging from coding apps to games, there should be something for everyone.
You will also find useful parental control settings to limit/tweak the experience for your kid. For additional help, the [official help resources][15] will come in handy as well.
[Kano OS][16]
#### 4\. AcademiX GNU/Linux
![][17]
Yet another distribution based on Debian focused for learning.
Not just for primary-level education, but the programs included in the operating system should be useful for university students as well. It also includes virtual interactive labs and virtual microscope.
**While it makes learning easy with the utilities pre-installed, teachers can also use it to create content and publish.**
So, it can be an all-in-one choice for a lot of potential learners and teachers in school.
[AcademiX][18]
#### 5\. Sugar (makes any distro kids friendly)
![][19]
Sugar is not a full-fledged OS but a learning platform (environment) that can be installed on top of any Linux distro to set it up for learning.
Not just to help your kid learn with an easy-to-use interface, it also helps collaborating, sharing, and learning pre-installed software tools.
It is also available for Raspberry Pi computers. And a [Flatpak package][20] lets you easily install some of its activities in any Linux distribution.
[Sugar][21]
#### 6\. Li-f-e
Linux for education (Li-f-e) was originally a project by OpenSUSE and this is a continuation of that.
Even though it is not backed by OpenSUSE now (I couldnt find any references), it could be a useful option for kids and schools.
This is based on Ubuntu MATE and offers several built-in applications as per some of the textbooks. It does not offer anything extraordinary but more like Ubuntu for education, which is actively maintained at the time of writing this.
[Li-f-e][22]
### Best Linux Distribution for Schools
The ones I mentioned so far were tailored to be used by children for their education and learning. But education has two parts: students and teachers.
This is why this list is divided into two parts. This second part lists some options that can be a good fit for school administrators, management, and teachers.
Of course, you can always use Linux Mint, elementary OS, or Ubuntu if you want to utilize a stable and reliable Linux desktop OS to manage your school (or) content creation. However, there are some choices that are customized for the purpose.
#### 1\. Debian Edu/Skolelinux
![Image Credits: Distrowatch][23]
Skolelinux is a Debian-based distribution that comes packed with several applications and networking services fit for students and teachers in school.
It is also known as Debian Edu. You get the ability to opt for offline installation by downloading the required ISO or the base system with online installation for the rest.
Even though kids can use it after setup, it requires a bit of learning curve to configure and maintain. Hence, this is more inclined towards school administrators or teachers than kids.
[Skolelinux][24]
#### 2\. Linux Schools (Karoshi Server)
A Linux distribution with the perks of Ubuntu LTS built for school servers. If you want to setup a server and monitor/control a network of connected servers, Linux Schools (or Karoshi Server) is a good fit.
It lets you administer a network of servers using a web interface. You do not need in-depth knowledge about Linux system administration to utilize it.
[Linux Schools][25]
#### 3\. Escuelas Linux
![][26]
[Escuelas Linux][27] is based on Bodhi Linux. It comes baked in with several applications fit for educational environments.
It has custom tools for resetting the distro in the post-installed state in seconds. There is also options to reinstate users. Apart from that, it comes with applications for distributing educational material within the network, screen broadcasting, mirroring, remote command execution, message sending, screen locking and muting sound to the studentss computers.
Considering it is based on Bodhi Linux, which is one of the [best lightweight Linux distros][28], this can be a good pick for older systems.
You also get an added developer pack, which is optional to install, if you need advanced tools like NetBeans, Git, Android Studio.
[Escuelas Linux][29]
In addition to these options, there is also [EduBOSS][30], an education version of BOSS Linux which is tailored for Indian schools, if that is relevant to you.
### Wrapping Up
While there are 100s of Linux distribution, only a handful exist that are specially crafted for education.
It is a good thing that there some viable options for students, teachers, and school administration.
After all, Linux can be used everywhere and by anyone. Am I right?
--------------------------------------------------------------------------------
via: https://itsfoss.com/educational-linux-distros/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/best-linux-distributions/
[2]: https://itsfoss.com/best-linux-beginners/
[3]: https://itsfoss.com/essential-linux-applications/
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/endless-os-distrowatch.png?resize=800%2C500&ssl=1
[5]: https://endlessos.com/home/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/ubermix-4-official.png?resize=800%2C452&ssl=1
[7]: https://itsfoss.com/activitywatch/
[8]: https://ubermix.org/download.html
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/kano-os.png?resize=800%2C570&ssl=1
[10]: https://i1.wp.com/m.media-amazon.com/images/I/41-VaIktpgL._SL160_.jpg?ssl=1
[11]: https://www.amazon.com/dp/B073VTCS66?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Kano Computer Kit A Computer Anyone Can Make)
[12]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime)
[13]: https://www.amazon.com/dp/B073VTCS66?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon)
[14]: https://itsfoss.com/raspberry-pi-os/
[15]: https://help.kano.me/hc/en-us/sections/360001083699-Kano-OS
[16]: https://kano.me/row/downloadable
[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/academix-edu.png?resize=800%2C450&ssl=1
[18]: https://academixproject.com/en/home/
[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/sugarlabs.jpg?resize=992%2C744&ssl=1
[20]: https://itsfoss.com/what-is-flatpak/
[21]: https://www.sugarlabs.org
[22]: https://sourceforge.net/projects/cyberorg-home/files/Li-f-e/
[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/skolelinux.png?resize=800%2C450&ssl=1
[24]: http://www.skolelinux.org
[25]: https://www.linuxschools.com/forum/index-main.php
[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/escuelas-linux.jpg?resize=800%2C450&ssl=1
[27]: https://itsfoss.com/escuelas-linux/
[28]: https://itsfoss.com/lightweight-linux-beginners/
[29]: https://escuelaslinux.sourceforge.io/english/index.html
[30]: https://bosslinux.in/eduboss

View File

@@ -0,0 +1,112 @@
[#]: subject: (Apps for daily needs part 1: web browsers)
[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/)
[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Apps for daily needs part 1: web browsers
======
![][1]
Photo by [Brooke Cagle][2] on [Unsplash][3]
One of the important apps for daily needs is a web browser. Thats because surfing the internet is an activity most people do in front of the computer. This article will introduce some of the open source web browsers that you can use on Fedora Linux. You need to install the software mentioned. All the browsers mentioned in this article are already available in the official Fedora repository. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4].
### Firefox
Firefox is a fast and privacy-focused browser that works across many devices. It was created by [Mozilla][5] and is a browser with complete features offering many extensions. You can add many powerful functions and useful features to your Firefox browser. It uses just enough memory to create a smooth experience so your computer stays responsive to other tasks. You can create an account that will allow you to share configurations on multiple devices, so you dont need to set up Firefox on each device.
![][6]
Firefox offers the following features:
* Private Browsing mode
* Ad tracker blocking
* Password manager
* Sync between devices
* Picture-in-Picture
More information about Firefox browser is available at this link: [https://www.mozilla.org/en-US/firefox][7]
### GNOME Web
GNOME Web is a browser for GNOME desktop which is the default desktop environment for Fedora Workstation. It may be very appropriate as your main browser if you use Fedora Workstation with GNOME as the default desktop environment. This browser has a simple, clean, and beautiful look. GNOME Web has fewer features than Firefox, but it is sufficient for common uses.
![][8]
GNOME Web offers the following features:
* Incognito mode
* GNOME desktop integration
* built-in adblocker
* Intelligent tracking prevention
More information about GNOME Web is available at this link: <https://wiki.gnome.org/Apps/Web>
### Chromium
Chromium is an open-source web browser from the Chromium Project and has a minimalist user interface. It has a similar appearance to Chrome, because it actually serves as the base for Chrome and several other browsers. Many people use Chromium because they are used to Chrome.
![][9]
Chromium offers the following features:
* Incognito mode
* Extensions
* Autofill for passwords
More information about Chromium browser is available at this link: <https://www.chromium.org/Home>
### qutebrowser
This browser is a little bit different than the browsers mentioned above. qutebrowser is a keyboard-focused browser with a minimal GUI. Therefore, you wont find the buttons normally found in other browsers, like back, home, reload, etc. Instead, you can type commands with the keyboard to run functions in the qutebrowser. It uses Vim-style key bindings, so its suitable for Vim users. You should try this browser if you are interested in getting a different experience in surfing the internet.
![][10]
qutebrowser offers the following features:
* Adblock
* Private browsing mode
* Quickmarks
More information about qutebrowser browser is available at this link: <https://qutebrowser.org/>
### Conclusion
Everyone has different needs in using the internet, especially for browsing. Each browser mentioned in this article has different features. So choose a browser that suits your daily needs and preferences. If you use the browsers mentioned in this article, share your story in the comments. And if you use a browser other than the one mentioned in this article, please mention it. Hopefully this article can help you in choosing the browser that you will use for your daily needs on Fedora.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/
作者:[Arman Arisman][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/armanwu/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-1-Browsers-2-816x345.jpg
[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText
[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/
[5]: https://www.mozilla.org/en-US/
[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Firefox-1-1024x707.png
[7]: https://www.mozilla.org/en-US/firefox/
[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Web-1024x658.png
[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-Chromium-1-1024x690.png
[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/Browsers-qb-1024x687.png

View File

@@ -0,0 +1,80 @@
[#]: subject: (What does the Open-Closed Principle mean for refactoring?)
[#]: via: (https://opensource.com/article/21/7/open-closed-principle-refactoring)
[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
What does the Open-Closed Principle mean for refactoring?
======
Resolve the tension between protecting clients from unwanted changes and
extending the capabilities of services.
![Brain on a computer screen][1]
In his 1988 book, _[Object-Oriented Software Construction][2]_, professor [Bertrand Meyer][3] defined the [Open-Closed Principle][4] as:
> "A module will be said to be open if it is still available for extension. For example, it should be possible to add fields to the data structures it contains or new elements to the set of functions it performs.
>
> "A module will be said to be closed if it is available for use by other modules. This assumes that the module has been given a well-defined, stable description (the interface in the sense of information hiding)."
A more succinct way to put it would be:
> Software entities (classes, modules, functions, etc.) should be open for extension, but closed for modification.
Similarly (and in parallel to Meyer's findings), [Alistair Cockburn][5] defined the [Protected Variation][6] pattern:
> "Identify points of predicted variation and create a stable interface around them."
Both of these deal with volatility in software. When, as is always the case, you need to make some change to a software module, the ripple effects can be disastrous. The root cause of disastrous ripple effects is tight coupling, so the Open-Closed Principle and Protected Variation Pattern teach us how to properly decouple various modules, components, functions, and so forth.
### Does the Open-Closed Principle preclude refactoring?
If a module (i.e., a named block of code) must remain closed to any modifications, does that mean you're not allowed to touch it once it gets deployed? And if yes, wouldn't that eliminate any possibility of refactoring?
Without the ability to refactor the code, you are forced to adopt the Finality Principle. This holds that rework is not allowed (why would stakeholders agree to pay you to work again on something they already paid for?) and you must carefully craft your code, because you will get only one chance to do it right. This is in total contradiction to the discipline of refactoring.
If you are allowed to extend the deployed code but not change it, are you doomed to swim forever in the waterfall rivers? Being given only one shot at doing anything is a recipe for disaster.
Let's review the approach to solve this conundrum.
### How to protect clients from unwanted changes
Clients (meaning modules or functions that use some block of code) utilize some functionality by adhering to the protocol as originally implemented in the component or service. However, as the component or service inevitably changes, the original "partnership" between the service or component and various clients breaks down. Clients "discover" the change by breakage, which is always an unpleasant surprise that often ruins the initial trust.
Clients must be protected from those breakages. The only way to do so is by introducing a layer of abstraction between the clients and the service or component. In software engineering lingo, we call that layer of abstraction an "interface" (or an API).
Interfaces and APIs hide the implementation. Once you arrange for a service to be delivered via an interface or API, you free yourself from the worries of changing the implementation code. No matter how much you change the service's implementation, your clients remain blissfully unaffected.
That way, you are back to your comfortable world of iterations. You are now completely free to refactor, to rearrange the code, and to keep rearranging it in pursuit of a more optimal solution.
The thing in this arrangement that remains closed for modification is the interface or API. The volatility of an interface or API is the thing that threatens to break the established trust between the service and its clients. Interfaces and APIs must remain open for extension. And that extension happens behind the scenes—by refactoring and adding new capabilities while guaranteeing non-volatility of the public-facing protocol.
### How to extend capabilities of services
While services remain non-volatile from the client's perspective, they also remain open for business when it comes to enhancing their capabilities. This Open-Closed Principle is implemented through refactoring.
For example, if the first increment of the `OrderPayment` service offers mere bare-bones capabilities (e.g., able to process the order total and calculate sales tax), the next increment can be safely added by respecting the Open-Closed Principle. Without breaking the handshake between the clients and the `OrderPayment` service, you can refactor the implementation behind the `OrderPayment` API by adding new blocks of code.
So, the second increment could contain the ability to calculate shipping costs. And so on, you get the picture; you accomplish the Protected Variation Pattern by observing the Open-Closed Principle. It's all about carefully modeling business abstractions.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/open-closed-principle-refactoring
作者:[Alex Bunardzic][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alex-bunardzic
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen)
[2]: https://en.wikipedia.org/wiki/Object-Oriented_Software_Construction
[3]: https://en.wikipedia.org/wiki/Bertrand_Meyer
[4]: https://en.wikipedia.org/wiki/Open%E2%80%93closed_principle
[5]: https://en.wikipedia.org/wiki/Alistair_Cockburn
[6]: https://martinfowler.com/ieeeSoftware/protectedVariation.pdf

View File

@@ -0,0 +1,84 @@
[#]: subject: (How to avoid waste when writing code)
[#]: via: (https://opensource.com/article/21/7/avoid-waste-coding)
[#]: author: (Alex Bunardzic https://opensource.com/users/alex-bunardzic)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to avoid waste when writing code
======
The more we can reduce waste in software development, the better off
everyone will be.
![Learning to program][1]
The long road toward quality is filled with diversions, false starts, and detours. The enemy of quality is waste, because waste is never desirable. No one pays anyone to deliver waste. We sometimes tolerate waste as part of the process of making something useful and desirable, but the more we can reduce waste while making something, the better.
In software engineering, waste can be expressed in a few ways:
1. Defects
2. Idling and waiting
3. Overproduction
4. Overprocessing
5. Any other activity that doesn't directly put value in users' hands
Let's examine each of these five types of waste.
### Defects
There seems to be a prevailing sentiment in the software industry that bugs (defects) are inevitable. It's not if—but when and how many—bugs find their way into production.
You can fight that defeatist sentiment by reminding software engineers that each and every bug is authored. Bugs don't occur spontaneously. They're created by us, human beings trying to do the best software development we can. But nobody's perfect. Of course we don't create bugs intentionally, but they do happen. They're often a result of rushing things through, or perhaps due to inadequate education and training.
Whatever the reason, bugs are _caused_, which means we can eliminate bugs by solving the problems that cause them.
### Idling and waiting
Our business partners funding our software development efforts tend to perceive any time we're not producing shipping code as time spent idling. Why are we idling, and what are we waiting on? It's a reasonable question to ask, if you consider they're paying potentially thousands of dollars per hour to keep the team going.
Idling is wasteful. It does not contribute to the bottom line and may be a sign of confusion. If the team says they're waiting on someone to return from their leave of absence, that signals poor organizing skills. No team should ever get to the point where they paint themselves into a corner and are suffering from a single point of failure. If a team member can't participate, other members should step in and continue the work. If that's not possible, you are dealing with a very brittle, inflexible, and unreliable team.
Of course, there are many other possible reasons the team is idling. Maybe there is confusion about the current highest priority, so the team is hanging and waiting to learn about the correct priority.
There are many other [reasonable causes of idling][2], which is why this type of waste seems hardest to get on top of. Whatever the case, mature organizations take precautionary steps to minimize potential idling and waiting time.
### Overproduction
Often labeled "gold plating," overproduction is one of the most insidious forms of waste. Software engineers are notorious for their propensity to go overboard in their enthusiasm for building features and nifty capabilities. And because software, as its name implies, is very pliable and malleable, there is very little pushback against the onslaught of bloat.
This dreadful bloat creates a lot of waste. Fighting bloat is what prudent software engineering discipline is all about.
### Overprocessing
One of the biggest problems in software engineering is known as Geek-At-Keyboard (GAK). A common misconception is that software engineers spend most of their time writing code. That is far from the truth. Most of the time spent on regular daily activities (aside from attending meetings) goes toward keyboard activities unrelated to writing code: messing with configurations and environments, manually running and navigating the app, typing and retyping test data, stepping through the debugger, etc.
All those activities are waste. They don't contribute to delivering value. One of the most effective remedies for minimizing unproductive GAK time is [test-driven development][3] (TDD). Writing tests before writing code is a proven method for avoiding overprocessing. The test-first approach is a very effective way of eliminating waste.
### Other activities that don't put value in users' hands
In the early days of our profession, value was measured by the number of lines of code produced per unit of time (per day, week, month, etc.). Later, this rather ineffective way of measuring value was abandoned in favor of working code. There is no convincing correlation between the number of lines of code and working code. And once working code became the measure of value, the number of lines of code became irrelevant.
Today, we recognize that [working code][4] is also a meaningless metric. Just because code compiles, builds, and works doesn't mean it is doing anything of value. Successfully running code could be doing inane processing, such as counting from 0 to 10 and then back to 0. It is much more important to focus on code that meets end users' expectations.
Helping end users fulfill their goals when using your software product is the only measure of value. Any other activity that does not contribute to that value should be regarded as waste.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/avoid-waste-coding
作者:[Alex Bunardzic][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alex-bunardzic
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/learn-programming-code-keyboard.png?itok=xaLyptT4 (Learning to program)
[2]: https://opensource.com/article/21/2/simplicity
[3]: https://opensource.com/article/20/1/test-driven-development
[4]: https://opensource.com/article/20/7/code-tdd

View File

@@ -0,0 +1,140 @@
[#]: subject: (Up for a Challenge? Try These Advanced Linux Distros [Not Based on Debian, Arch or Red Hat])
[#]: via: (https://itsfoss.com/advanced-linux-distros/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Up for a Challenge? Try These Advanced Linux Distros [Not Based on Debian, Arch or Red Hat]
======
There are hundreds of Linux distributions. Some are for general purpose usage, while some are specifically tailored for education, robotics, hacking, gaming and what not.
Youll notice that most of them originate from Debian/Ubuntu, Arch and Red Hat/Fedora. If you like distrohopping and experiment with a range of distributions, you may soon get bored out of it. Most Linux distributions would feel too similar after a point and apart from a few visual changes here and there, you wont get a different experience.
Does that sound familiar? If yes, let me list some advanced, independent, Linux distributions to test your expertise.
### Advanced Linux distributions for experts
![][1]
You may argue against the use of term “expert” here. After all, expert Linux users dont necessarily need to use advanced Linux distributions. They can easily utilize their expertise on [beginner-friendly distributions like Linux Mint][2].
The term expert here is intended for people who wont easily get overwhelmed when they are taken out of their comfort zone and land in an unfamiliar environment.
Alright then. Lets see which distributions you can use to test your expertise on.
#### NixOS
![NixOS Linux illustration][3]
[NixOS][4] is a unique distribution in the terms of how it approaches everything from the kernel to configuration to applications.
NixOS is built on top of the Nix package manager and everything from the kernel to configuration is based on it. All packages are kept in isolation from each other.
It ensures that installing or upgrading one package does not break other packages. You can also easily roll back to previous versions.
The isolation feature also helps you in trying new tools without hesitation, creating development environments and more.
Sounds good enough to give it a try? You call, truly.
#### Void Linux
![Void Linux illustration][5]
[Void Linux][6] is another independent Linux distribution which was implemented from scratch. It is a rolling release distribution but it focuses on stability rather than being bleeding edge like Arch Linux.
Void Linux has its own XBPS package management system for installing and removing software with option to build packages from sources (from XBPS source packages collection).
Another thing that sets Void Linux apart from the crowd of other distribution is its use of [runit][7] as init system instead of systemd.
Can Void Linux fill the void in your distrohopping life? Find it out yourself.
#### Slackware
![Slackware Linux illustration][8]
The oldest active Linux distribution, [Slackware][9], can surely be counted as an expert Linux distribution.
Which is amusing because once upon a time, many new Linux users started their Linux journey with Slackware. But that was back in the mid-90s and it is safe to assume that those newbies have turned into veteran with their neck beard touching the ground.
Originally, Slackware was based on Softlanding Linux System (SLS), one of the earliest Linux distributions in 1992.
Slackware is an advanced Linux distribution with aim to produce the most “UNIX-like” Linux distribution out there.
No slacking here. Be ready to use the command line extensively in Slackware.
#### Gentoo
![Gentoo Linux illustration][10]
[Gentoo Linux][11] is named after the fast swimming Gentoo penguin. It reflects the speed optimization capabilities of Gentoo Linux.
How? Its software distribution system, Portage, gives it extreme configurability and performance. Portage keeps a collection of build scripts for the packages and it automatically builds a custom version of package based on end users preference and optimized for end users hardware.
This build stuff is why there are many jokes and meme in Linux-verse about compiling everything in Gentoo.
Can you catch up with the Gentoo?
#### Clear Linux
![Clear Linux illustration][12]
[Clear Linux][13] is not your general purpose desktop Linux distribution. It is an open source, rolling release distribution, created from the ground up by Intel and obviously, it is highly tuned for Intel platforms.
Clear Linux OS primarily targets professionals in the field of IT, DevOps, Cloud/Container deployments, and AI.
The package management is done through [swupd][14] but unlike regular package managers, versioning happens at the individual file level. This means that it generates an entirely new OS version when any software change takes place in the system.
Is it clear enough to try Clear Linux?
#### Linux From Scratch
![Linux From Scratch illustration][15]
If you think installing Arch Linux was a challenge, try [Linux From Scratch][16] (LFS). As the name suggests, here you ~~get~~ have to do everything from scratch.
From installing to using, you do everything at a low level and thats the beauty of it. You are not installing a pre-compiled Linux distribution here. You build your own customized Linux system entirely from the source code.
It is often suggested to use Linux From Scratch to learn the core functioning of the Linux and it is indeed a learning experience.
Still scratching your head about Linux From Scratch? You can [read it][17][s][17] [documentation in book format][17].
#### Conclusion
There are a few more independent Linux distributions. Mageia and Solus are two of the relatively more popular ones. I did not include them in this list because I consider them more friendly and not as complicated to use as others on the list. Feel free to disagree with me in the comments.
It is your turn now. Have you used any advanced Linux distributions ever? Was it in the past or are you still using it?
--------------------------------------------------------------------------------
via: https://itsfoss.com/advanced-linux-distros/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/advanced-linux-distros.png?resize=800%2C450&ssl=1
[2]: https://itsfoss.com/best-linux-beginners/
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/nix-os.png?resize=800%2C350&ssl=1
[4]: https://nixos.org/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/void-linux.png?resize=800%2C350&ssl=1
[6]: https://voidlinux.org/
[7]: http://smarden.org/runit/
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/slackware.png?resize=800%2C350&ssl=1
[9]: http://www.slackware.com/
[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gentoo-linux.png?resize=800%2C350&ssl=1
[11]: https://www.gentoo.org/
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clear-linux.png?resize=800%2C350&ssl=1
[13]: https://clearlinux.org/
[14]: https://docs.01.org/clearlinux/latest/guides/clear/swupd.html#swupd-guide
[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/linux-from-scratch.png?resize=800%2C350&ssl=1
[16]: https://www.linuxfromscratch.org/
[17]: https://www.linuxfromscratch.org/lfs/read.html

View File

@@ -2,26 +2,40 @@
[#]: via: (https://twobithistory.org/2021/03/08/arpanet-protocols.html)
[#]: author: (Two-Bit History https://twobithistory.org)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (Lin-vy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How the ARPANET Protocols Worked
ARPANET 协议是如何工作的
======
The ARPANET changed computing forever by proving that computers of wildly different manufacture could be connected using standardized protocols. In my [post on the historical significance of the ARPANET][1], I mentioned a few of those protocols, but didnt describe them in any detail. So I wanted to take a closer look at them. I also wanted to see how much of the design of those early protocols survives in the protocols we use today.
ARPANET 通过证明完全不同制造商的计算机能够使用标准化的协议连接起来,从而永久的改变了计算。在我的[关于 ARPANET 的历史意义的帖子][1]中,我提到了其中的一些协议,但没有详细描述它们。所以我想更进一步探索它们。也想看看那些早期协议的设计在我们今天使用的协议中有多少被保留了下来。
The ARPANET protocols were, like our modern internet protocols, organized into layers.[1][2] The protocols in the higher layers ran on top of the protocols in the lower layers. Today the TCP/IP suite has five layers (the Physical, Link, Network, Transport, and Application layers), but the ARPANET had only three layers—or possibly four, depending on how you count them.
ARPANET 协议类似与如今的互联网协议,也是通过分层形式来组织管理的。[1][2] 较高层协议运行在较低层协议之上。如今的 TCP/IP 协议栈有5层物理层、数据链路层、网络层、传输层、以及应用层但是这个 ARPANET 仅有3层或者可能4层这取决于你们怎样去数它们。
Im going to explain how each of these layers worked, but first an aside about who built what in the ARPANET, which you need to know to understand why the layers were divided up as they were.
我将会解释每一层是如何工作的,但首先,你需要知道谁在 ARPANET 中构建了些什么,以及需要了解为什么层要被划分成这样。
### Some Quick Historical Context
短暂的历史背景
The ARPANET was funded by the US federal government, specifically the Advanced Research Projects Agency within the Department of Defense (hence the name “ARPANET”). The US government did not directly build the network; instead, it contracted the work out to a Boston-based consulting firm called Bolt, Beranek, and Newman, more commonly known as BBN.
ARPANET 由美国联邦政府资助确切的说是位于美国国防部内的高级研究计划属因此命名为“ARPANET”。美国政府并没有直接建设这个网络而是它把这项工作外包给了基于波士顿的一家名为 Bolt, Beranek, 和 Newman, 通常更多时候被称为 BBN 的咨询公司。
BBN, in turn, handled many of the responsibilities for implementing the network but not all of them. What BBN did was design and maintain a machine known as the Interface Message Processor, or IMP. The IMP was a customized Honeywell minicomputer, one of which was delivered to each site across the country that was to be connected to the ARPANET. The IMP served as a gateway to the ARPANET for up to four hosts at each host site. It was basically a router. BBN controlled the software running on the IMPs that forwarded packets from IMP to IMP, but the firm had no direct control over the machines that would connect to the IMPs and become the actual hosts on the ARPANET.
反过来BBN 承担了实现这个网络的大部门责任但不是全部。BBN 所做的是设计和维护一个称为接口消息处理器或者简称IMP的机器。
The host machines were controlled by the computer scientists that were the end users of the network. These computer scientists, at host sites across the country, were responsible for writing the software that would allow the hosts to talk to each other. The IMPs gave hosts the ability to send messages to each other, but that was not much use unless the hosts agreed on a format to use for the messages. To solve that problem, a motley crew consisting in large part of graduate students from the various host sites formed themselves into the Network Working Group, which sought to specify protocols for the host computers to use.
So if you imagine a single successful network interaction over the ARPANET, (sending an email, say), some bits of engineering that made the interaction successful were the responsibility of one set of people (BBN), while other bits of engineering were the responsibility of another set of people (the Network Working Group and the engineers at each host site). That organizational and logistical happenstance probably played a big role in motivating the layered approach used for protocols on the ARPANET, which in turn influenced the layered approach used for TCP/IP.

View File

@@ -0,0 +1,56 @@
[#]: subject: (How Real-World Apps Lose Data)
[#]: via: (https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html)
[#]: author: (Simon Arneaud https://theartofmachinery.com)
[#]: collector: (lujun9972)
[#]: translator: (PearFL)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
真实世界的应用程序是如何丢失数据?
======
现代应用程序开发的一大优点是云提供商会担心硬件故障或如何设置RAID等问题。优秀的云供应商不太可能丢失你的应用数据, 所以有时我会被询问现在的备份究竟是什么呢?下面是一些现实世界的故事。
### 故事 #1
第一个故事来自一个数据科学项目:它基本上是一个从正在进行的研究中来收集数据的庞大而复杂的管道,然后用各种不同的方式处理以满足一些尖端模型的需要。这个面向用户的应用程序还没有启动,但是一个由数据科学家和开发人员组成的团队已经为建立这个模型和它的数据集工作了好几个月。
在项目中工作的人有他们自己的实验工作的开发环境。他们会在终端中做一些类似' export ENVIRONMENT=simonsdev '的事情,然后所有在终端上运行的软件都会在那个环境下运行,而不是在生产环境下。
该团队需要承受着巨大的压力去推出面向用户的应用程序,以便利益相关者能够从他们几个月的投资中真正看到一些回报。一个星期六,一位工程师试图赶完一些工作。他在晚上很晚的时候做完了一个实验,决定收拾东西回家。他启动了一个清理脚本来删除他的开发环境中的所有内容,但奇怪的是,这比平时花费了更长的时间。那时他意识到他已经忘记了哪个终端被配置为指向哪个环境。
### 故事 #2
第二个故事来自于一个商业网页和手机应用。后端有一个由一组工程师负责的微服务体系结构。这意味着部署需要协调,但是使用正式的发布过程和自动化简化了一些。新代码在准备好后会被审查并合并到 master 中,并且高级开发人员经常会为每个微服务标记一个版本,然后自动部署到暂存环境。临时环境中的版本会定期收集到一个元版本中,在自动部署到生产之前,该版本会得到不同人的认可(这是一个合规环境)。
有一天,一位开发人员正在开发一个复杂的功能,而其他开发该微服务的开发人员一致认为,应该致力于掌握正在进行的代码,并理解它不应该被实际发布。长话短说,并不是团队中的每个人都收到了消息,而是代码进入了发布管道。更糟糕的是,实验代码需要一种新的方式来表示用户配置文件数据,因此它有一个临时数据迁移,在启动到生产时运行并损坏所有用户配置文件。
### 故事 #3
第三个故事来自另一款网络应用。这个有一个更简单的架构:大部分代码在一个应用程序中,数据在数据库中。然而,这个应用程序也是在很大的截止日期压力下编写的。事实证明,在开发初期,当彻底的数据库架构更改很常见时,添加了一项功能来检测此类更改并清理旧数据。这实际上对发布前的早期开发很有用,并且始终仅作为开发环境的临时功能。不幸的是,在匆忙构建应用的其余部分并启动时,我们忘记了代码。当然,直到有一天它在生产环境中被触发。
### 事后分析
对于任何停机问题的事后分析很容易忽视大局最终将一切归咎于一些小细节。一个特例是发现某人犯了一些错误然后责怪那个人。这些故事中的所有工程师实际上都是优秀的工程师雇佣SRE顾问的公司不是为了偷工减料所以解雇他们换掉他们并不能解决任何问题。即使你拥有100个开发人员这100个开发人员仍然是有限的所以在足够的复杂性和压力下错误也会发生。最重要的解决方案是备份它可以帮助你在丢失数据的情况下(包括来自恶意软件的数据,这是最近新闻中的一个热门话题)。如果你无法容忍零拷贝,就不要只有一个副本。
故事1的结局很糟糕没有备份。该项目因近六个月的数据收集而推迟。顺便说一句有些地方只保留一个每日快照作为备份这个故事也是一个很好的例子说明了这是如何出错的如果数据丢失发生在星期六并且准备在星期一尝试恢复那么一日备份就只能得到星期日的空数据。
故事2并不有趣但效果要好得多。备份可用但数据迁移也是可逆的。不有趣的部分是发布是在午餐前完成的并且必须在生产站点关闭时对修复进行编码。我讲这个故事的主要原因是为了提醒大家备份并不仅仅是灾难性的数据丢失。部分数据损坏也会发生而且可能会更加混乱。
故事3仅仅只是一般。尽管少量数据永久丢失但大部分数据可以从备份中恢复。团队中的每个人都对现在没有注释的极其危险的代码感到非常糟糕。我没有参与早期的开发但我感觉很糟糕因为恢复数据所需的时间比正常情况要长得多。通过经过良好测试的恢复过程我认为该站点应该在总共不到 15 分钟的时间内重新上线。但是第一次恢复没有成功我不得不调试为什么不能成功然后重试。当一个生产站点宕机了需要你重新启动它每10秒就会感觉很漫长。 值得庆幸的是,涉众比某些人理解得多。他们实际上松了一口气,因为一次数分钟的数据丢失和不到一小时的停机时间本就可以使公司陷入瘫痪的灾难。
在实践中,进行了备份“工作”但恢复失败是非常常见的。很多时候,小型数据集上进行恢复测试是可以正常工作的,但在生产规模的大数据集上就会失败。当每个人都压力过大时,灾难最有可能发生,而关闭生产站点只会增加压力。在时间合适的时候测试和记录完整的恢复过程是一个非常好的主意。
--------------------------------------------------------------------------------
via: https://theartofmachinery.com/2021/06/06/how_apps_lose_data.html
作者:[Simon Arneaud][a]
选题:[lujun9972][b]
译者:[PearFL](https://github.com/PearFL)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://theartofmachinery.com
[b]: https://github.com/lujun9972

View File

@@ -0,0 +1,106 @@
[#]: subject: (A brief history of FreeDOS)
[#]: via: (https://opensource.com/article/21/6/history-freedos)
[#]: author: (Jim Hall https://opensource.com/users/jim-hall)
[#]: collector: (lujun9972)
[#]: translator: (zxy-wyx)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
FreeDOS 简史
======
经历了近30年的发展, FreeDOS 已经成为了世界先进的 DOS。
![第一批使用计算机的人][1]
一个老师正在给他的一个学生讲[编程之道][2]。 “编程之道包含在所有的软件中--不管它多么微不足道,” 老师说道。
“编程之道在手提电脑里面吗?” 学生问道。
“是的,” 老师回答道。
“编程之道在电脑游戏里面吗?”学生继续问道
“他甚至在电脑游戏里面," 老师说。
“那编程之道在个人电脑的操作系统里面吗?”
老师咳嗽了一下,稍稍改变了姿势,说道,“今天的课结束了。”
编程之道, Geoffrey James, 信息类书籍, 1987
过去,计算仅限于昂贵的大型机和“超大型计算机”计算机系统,如 PDP 11。但是微处理器的出现在 20 世纪 70 年代带来了一场计算机革命。 你终于可以在家里有一台电脑了——“个人电脑浪潮”已经到了!
我记得看到的最早的个人电脑包括 Commodore, TRS-80, 和 Apple。个人电脑成了一个热门话题所以 IBM 决定进入这个市场。 在经历了一个短暂的开发周期之后IBM 于 1981 年 8 月发布了 IBM 5150 个人计算机(最初的“IBM PC”)。
从零开始创建一台计算机并非易事,因此 IBM 用现成的硬件来构建 PC 而闻名,并从外部开发人员那里获得了其他组件的许可。 其中之一是微软授权的操作系统。反过来,微软从西雅图电脑产品公司获得了 86-DOS ,进行了各种更新,并在 IBM PC 上推出了新版本的 IBM PC-DOS。
###早期的 DOS
早期的 DOS 在内存中运行最多为 640 千字节, DOS 只能管理硬件允许用户启动应用程序。因此PC-DOS 1.0 命令行非常贫乏只包含了一些设置日期和时间、管理文件、控制终端和格式化软盘的命令。DOS 还包括一个基本的语言解释器,这是这个时代所有个人计算机的一个基本功能。
直到 PC-DOS 2.0DOS 才变得更加有趣在命令行中添加了新的命令并包含了其他有用的工具。但对我来说直到1991 年 MS-DOS 5.0 才开始感觉到先进。微软在这个版本中对 DOS 进行了全面改革,更新了许多命令,并用一个新的全屏编辑器取代了老旧的 Edlin 编辑器,这个编辑器对用户更加友好。 DoS 5 还包括我喜欢的其他特性,比如基于 Microsoft QuickBASIC Compiler, 简称 QBASIC. 如果你曾经在 DOS 上玩过 the Gorillas 游戏, 可能是在 MS-DOS 5.0 中运行。
尽管进行了这些升级,但我对 DOS 命令行并不完全满意。DOS 从来没有偏离原来的设计改变有限。DOS 为用户提供了一些工具,可以从命令行执行一些事情--否则,你就应该使用 DOS 命令行来启动应用程序。微软认为用户大部分时间都会花在几个关键的应用程序上,比如文字处理器或电子表格。
但是开发人员想要一个功能更强的 DOS此时一个子行业正在萌芽以提供整洁的工具和程序。有些是全屏应用程序但也有许多是增强 DOS 命令环境的命令行实用程序. 当我学到一点 C 编程时,我开始编写自己的实用程序,扩展或替换 DOS 命令行。尽管 MS-DOS 的基础相当有限但我发现第三方实用程序加上我自己的工具创建了一个功能强大的DOS命令行。
### FreeDOS
1994 年初,我开始在科技杂志上看到很多微软高管的采访,他们说下一个版本的 Windows 将完全取代 DOS。 我以前使用过 Windows但如果你还记得那个时代你就知道 Windows 3.1 不是一个很好的平台。 Windows 3.1 是笨重的和有很多漏洞的——如果一个应用程序崩溃,它可能会摧毁整个 Windows 系统。我也不喜欢 Windows 的图形用户界面。我更喜欢在命令行做我的工作,而不是用鼠标。
我考虑了 Windows并决定“如果 Windows3.2 或 Windows4.0 将类似于 Windows3.1,我我将不会去使用它。” 但我有什么选择?此时,我已经对 Linux 进行了实验,并认为 [linux很棒][3]—但是 Linux 没有任何应用程序。我的文字处理器、电子表格和其他程序都在 DOS 上。我需要 DOS。
然后我有了个主意!我想,“如果开发人员能够在互联网上共同编写一个完整的 Unix 操作系统,那么我们当然可以在 DOS 中做同样的事情。”毕竟,与 Unix 相比DOS 是一个相当简单的操作系统。DOS 一次运行一个任务(单任务),并且有一个更简单的内存模型。写我们自己的 DOS 应该不难。
因此,在 1994 年 6 月 29 日,我在一个名为 Usenet 的留言板网络上向 comp.os.msdos.apps[发布了一个公告][4] 。
PD-DOS 项目宣布:
几个月前,我发表了关于启动 DOS 公共领域版本的文章。 当时对此的普遍支持很强烈,许多人都同意这样的说法:“开始创作吧!”所以我有..。
第一次宣布努力生产 PD-DOS。我已经写了一个“清单”描述了这样一个项目的目标和工作大纲以及一个“任务列表”它准确地显示了需要写什么。我会把这些贴在这里然后讨论一下。
*关于这个名字的注释--我希望这个新的 DOS 成为每个人都可以使用的东西,我天真地认为,当每个人都可以使用它时,它就是“公共领域”。我很快就意识到了这种差别,所以我们把 “PD-DOS” 改名为 “Free-DOS”然后去掉连字符变成 “FreeDOS”。
一些开发人员联系我,提供他们为替换或增强 DOS 命令行而创建的实用程序,类似于我自己的努力。就在项目宣布几个月后,我们汇集了我们的实用程序,并创建了一个实用的系统,我们在 1994 年 9 月发布了一个名为 “Alpha 1” 的系统。当时的发展相当迅速,我们在 1994 年 12 月采用了 “Alpha 2”1995 年 1 月采用了“Alpha 3”1995 年 6 月采用了“Alpha 4”。
### 一个现代的 DOS
从那以后,我们一直致力于使 FreeDOS 成为“现代” DOS。而大部分现代化都集中在创建一个丰富的命令行环境上。是的DOS 仍然需要支持应用程序,但是我们相信 FreeDOS 也需要一个强大的命令行环境。这就是为什么 FreeDOS 包含了许多有用的工具,包括导航目录、管理文件、播放音乐、连接网络的命令,……以及类似 Unix 的实用程序集合,如 “Less”、“Du”、“Head”、“tail”、“Se”和“trt”。
虽然 FreeDOS 的开发已经放缓,但它并没有停止。开发人员继续为 FreeDOS 编写新程序,并向 FreeDOS 添加新功能。我对 FreeDOS 1.3 RC4 的几个重要补充感到特别兴奋FreeDOS 1.3 RC4 是即将发布的FreeDOS 1.3 的最新候选版本。最近的一些更新如下:
*Mateusz Viste 创建了一个新的电子书阅读器,名为 Ancient Machine Book (AMB),我们利用它作为 FreeDOS 1.3 RC4 中的新帮助系统。
*Rask Ingemann Lambertsen、Andrew Jenner、TK Chia 和其他人正在更新 GCC 的 ia-16 版本包括一个新的_libi86_库它提供了与 Borland TurboC++ 编译器的 C 库的某种程度的兼容性。
*Jason Hood 更新了一个可下载的 CD-ROM 重定向器,以替代微软的 MSCDEX最多支持10个驱动器。
*SuperIlu 已经创建了 DOjS这是一个 Javascript 开发画布,具有集成的编辑器、图形和声音输出,以及鼠标、键盘和操纵杆输入。
*Japheth 已经创建了一个 DOS32PAE 扩展程序,它能够通过 PAE 分页使用大量的内存。
尽管 FreeDOS 有了新的发展,我们仍然忠于我们的 DOS 根基。在我们继续朝着 FreeDOS 1.3 “最终”的方向努力时,我们提出了几个核心假设,包括:
***兼容性是关键**-如果FreeDOS不能运行经典DOS应用程序它就不是真正的DOS。虽然我们提供了许多优秀的开源工具、应用程序和游戏但您也可以运行遗留的DOS应用程序。
***继续在旧 PC 上运行(XT286,386 等)**-FreeDOS 1.3 将保持 16 位英特尔,但在可能的情况下将支持扩展驱动程序支持的新硬件。为此,我们继续专注于单用户命令行环境。
***FreeDOS 是开源软件**-我一直说如果人们不能访问、学习和修改源代码FreeDOS 就不是“免费 DOS”。FreeDOS 1.3 将包括尽可能多地使用公认的开源许可证的软件。但 DOS 实际上早于 GNU 通用公共许可证 (1989)和开放源码定义 (1998),因此一些 DOS 软件可能会使用自己的“免费源代码”许可证,而这并不是标准的“开源”许可。当我们认为软件包包括在 FreeDOS我们将继续评估任何许可证以确保它们是合适的“开放源码”即使它们没有得到正式承认。
我们欢迎您的帮助使FreeDOS强大 请加入我们的电子邮件名单-我们欢迎所有新来者和投稿人。我们通过电子邮件列表进行交流,但是列表的容量非常小,所以不太可能填满你的收件箱。
访问FreeDOS网站[www.freedos.org][5].
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/6/history-freedos
作者:[Jim Hall][a]
选题:[lujun9972][b]
译者:[zxy-wyx](https://github.com/zxy-wyx)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jim-hall
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer)
[2]: https://www.mit.edu/~xela/tao.html
[3]: https://opensource.com/article/17/5/how-i-got-started-linux-jim-hall-freedos
[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ
[5]: https://www.freedos.org/

View File

@@ -0,0 +1,277 @@
[#]: collector: (lujun9972)
[#]: translator: (stevending1st)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (9 open source JavaScript frameworks for front-end web development)
[#]: via: (https://opensource.com/article/20/5/open-source-javascript-frameworks)
[#]: author: (Bryant Son https://opensource.com/users/brson)
9 个用于 web 前端开发的 JavaScript 开源框架
======
根据 JavaScript 框架的优点和功能的分类。
![Computer screen with files or windows open][1]
大约十年前JavaScript 社区开始见证一场 JavaScript 框架的激战。在本文中我将介绍其中最著名的一些框架。值得注意的是,这些都是开源的 JavaScript 项目,这意味着你可以在 [开源许可证][2] 下自由地使用它们,甚至为它们的源代码和社区做出贡献。
你如果喜欢和我一起探索框架,可以看我的视频。
不过,在开始之前,了解一些 JavaScript 开发者谈论框架时常用的术语,将对后续的内容大有裨益。
术语 | 释义
---|---
[文档对象模型DOM][3] | 网站用树结构表示每一个节点都是代表网页一部分的对象。万维网联盟W3C是万维网的国际标准组织维护着 DOM 的定义。
[虚拟 DOM][4] | 用户界面UI以“虚拟”或“理想”的方式保存在内存中并通过 [ReactDOM][5] 等一些库与“真实” DOM 同步。要进一步探索,请阅读 ReactJS 的虚拟 DOM 和内部文档。
[数据绑定][6] | 一个编程概念为访问网站上的数据提供一致的接口。Web 元素与 DOM 维护的元素的 property 或 attribute 相关联(译者注:根据 MDN 的解释Javascript 的 property 是对象的特征通常描述与数据结构相关的特征attribute 是指元素所有属性节点的一个实时集合)。例如,当需要在网页表单中填写密码时,数据绑定机制可以用密码验证逻辑检验,确保密码格式有效。
我们已经清楚了常用的术语,下面我们来探索一下开源的 JavaScript 框架有哪些。
框架 | 简介 | 许可证 | 发布日期
---|---|---|---
[ReactJS][7] | 目前最流行的 JavaScript 框架,由 Facebook 创建 | MIT 许可证 | 2013-5-24
[Angular][8] | Google 创建的流行的 JavaScript 框架 | MIT 许可证 | 2010-1-5
[VueJS][9] | 快速增长的 JavaScript 框架 | MIT 许可证 | 2013-7-28
[MeteorJS][10] | 比 JavaScript 框架更强大的框架 | MIT 许可证 | 2012-1-18
[KnockoutJS][11] | 开源的 MVVMModel-View-ViewModel模型-视图-视图模型) 框架 | MIT 许可证 | 2010-7-5
[EmberJS][12] | 另一个开源的 MVVM 框架 | MIT 许可证 | 2011-12-8
[BackboneJS][13] | 带有 RESTful JSON 和 Model-View-Presenter 模式的 JavaScript 框架 | MIT 许可证 | 2010-9-30
[Svelte][14] | 不使用虚拟 DOM 的 JavaScript 开源框架 | MIT 许可证 | 2016-11-20
[AureliaJS][15] | 现代 JavaScript 模块的集合 | MIT 许可证 | 2018-2-14
为了说明情况,下面是每个框架的 NPM 包下载量的公开数据,感谢 [npm trends][16]。
![Framework downloads graph][17]
### ReactJS
![React page][18]
[ReactJS][19] 是由 Facebook 研发的,它虽然在 Angular 之后发布,但明显是当今 JavaScript 框架的领导者。React 引入了一个虚拟 DOM 的概念,这是一个抽象副本,开发者能在框架内仅使用他们想要的 ReactJS 功能而无需重写整个项目。此外React 项目活跃的开源社区无疑成为增长背后的主力军。下面是一些 React 的主要优势:
* 合理的学习曲线——React 开发者可以轻松地创建 React 组件,而不需要重写整个 JavaScript 的代码。在 ReactJS 的 [首页][20] 查看它的好处以及它如何使编程更容易。
* 高度优化的性能——React 的虚拟 DOM 的实现和其他功能提升了应用程序的渲染性能。请查看 ReactJS 的关于如何对其性能进行基准测试,并对应用性能进行衡量的相关 [描述][21]。
* 优秀的支持工具——[Redux][22]、[Thunk][23] 和 [Reselect][24] 是构建良好、可调式代码的最佳工具。
* 单项数据绑定——模型使用 Reach 流,只从所有者流向子模块,这使得在代码中追踪因果关系更加简单。请在 ReactJS 的 [数据绑定页][25] 阅读更多相关资料。
谁在使用 ReactJSFacebook 自从发明它,就大量使用 React 构建公司首页,据说 [Instagram][26] 完全基于 ReactJS 库。你可能会惊讶地发现,其他知名公司如 [New York Times][27]、[Netflix][28] 和 [Khan Academy][29] 也在他们的技术栈中使用了 ReactJS。
更令人惊讶的是 ReactJS 开发者的工作可用性,正如在下面 Stackoverflow 所做的研究中看到的,嘿,可以从事开源项目并获得报酬。这很酷!
![React jobs page][30]
Stackoverflow 的研究显示了对 ReactJS 开发者的巨大需求——[来源2017年开发者招聘趋势——Stackoverflow 博客][31]
[ReactJS 的 GitHub][7] 目前显示超过 13,000 次提交和 1,377 位贡献者。它是一个在 MIT 许可证下的开源项目。
![React GitHub page][32]
### Angular
![Angular homepage][33]
对于大多数开发者来说,也许现在 React 是领先的 JavaScript 框架,但是 [Angular][34] 紧随其后。事实上,开源开发者和初创公司更乐于选择 React而较大的公司往往更喜欢 Angular下面列出了一些例子。主要原因是虽然 Angular 可能更复杂,但它的统一性和一致性适用于大型项目。例如,在我整个职业生涯中一直研究 Angular 和 React我观察到大公司通常认为 Angular 严格的结构是一种优势。下面是 Angular 的另外一些关键优势:
* 精心设计的命令行工具——Angular 有一个优秀的命令行工具CLI可以轻松引导和使用 Angular 进行开发。ReactJS 提供命令行工具和其他工具,同时 Angular 有广泛的支持和出色的文档,你可以参见 [这个页面][35]。
* 单项数据绑定——和 React 类似,单向数据绑定模型使框架受更少的不必要的副作用的影响。
* 更好的 TypeScript 支持——Angular 与 [TypeScript][36] 有很好的一致性,它其实是 JavaScript 强制类型的拓展。它还可以转译为 JavaScript强制类型是减少错误代码的绝佳选择。
像 YouTube、[Netflix][37]、[IBM][38] 和 [Walmart][39] 等知名网站,都已在其应用程序中采用了 Angular。我通过自学使用 Angular 来开始学习前端 JavaScript 开发。我参与了许多涉及 Angular 的个人和专业项目,但那是当时被称为 AngularJS 的 Angular 1.x。当 Google 决定将版本升级到 2.0 时,他们对框架进行了彻底的改造,然后成了 Angular。新的 Angular 是对之前的 AngularJS 的彻底改造,这一举动带来了一部分新开发者也驱逐了一部分原有的开发者。
截止到撰写本文,[Angular 的 GitHub][8] 页面显示 17,781 次提交和 1,133 位贡献者。它也是一个遵循 MIT 许可证的开源项目,因此你可以自由地在你的项目或贡献中使用。
![Angular GitHub page][40]
### VueJS
![Vue JS page][41]
[VueJS][42] 是一个非常有趣的框架。它是 JavaScript 框架领域的新来者但是在过去几年里它的受欢迎程度显著增加。VueJS 由 [尤雨溪][43] 创建,他是曾参与过 Angular 项目的谷歌工程师。该框架现在变得如此受欢迎,以至于许多前端工程师更喜欢 VueJS 而不是其他 JavaScript 框架。下图描述了该框架随着时间的推移获得关注的速度。
![Vue JS popularity graph][44]
这里有一些 VueJS 的主要优点:
* 更容易地学习曲线——与 Angular 或 React 相比,许多前端开发者都认为 VueJS 有更平滑的学习曲线。
* 小体积——与 Angular 或 React 相比VueJS 相对轻巧。在 [官方文档][45] 中,它的大小据说只有约 30 KB而 Angular 生成的项目超过 65 KB。
* 简明的文档——VueJS 有全面清晰的文档。请自行查看它的 [官方文档][46]。
[VueJS 的 GitHub][9] 显示该项目有 3,099 次提交和 239 位贡献者。
![Vue JS GitHub page][47]
### MeteorJS
![Meteor page][48]
[MeteorJS][49] 是一个免费开源的 [同构框架][50],这意味着它和 NodeJS 一样,同时运行客户端和服务器的 JavaScript。Meteor 能够和任何其他流行的前端框架一起使用,如 Angular、React、Vue、Svelte 等。
Meteor 被高通、Mazda 和宜家等多家公司以及如 Dispatch 和 Rocket.Chat 等多个应用程序使用。[您可以其在官方网站上查看更多案例][51]。
![Meteor case study][52]
Meteor 的一些主要功能包括:
* 在线数据——服务器发送数据而不是 HTML并由客户端渲染。在线数据主要是指 Meteor 在页面加载时通过一个 WebSocket 连接服务器,然后通过该链接传输所需要的数据。
* 用 JavaScript 开发一切——客户端、应用服务、网页和移动界面都可以用 JavaScript 设计。
* 支持大多数主流框架——Angular、React 和 Vue 都可以与 Meteor 结合。因此,你仍然可以使用最喜欢的框架如 React 或 Angular这并不防碍 Meteor 为你提供一些优秀的功能。
截止到目前,[Meteor 的 GitHub][10] 显示 22804 次提交和 428 位贡献者。这对于开源项目来说相当多了。
![Meteor GitHub page][53]
### EmberJS
![EmberJS page][54]
[EmberJS][55] 是一个基于 [模型-视图-视图模型MVVM][56] 模式的开源 JavaScript 框架。如果你从来没有听说过 EmberJS你肯定会惊讶于有多少公司在使用它。Apple Music、Square、Discourse、Groupon、LinkedIn、Twitch、Nordstorm 和 Chipotle 都将 EmberJS 作为公司的技术栈之一。你可以通过查询 [EmberJS 的官方页面][57] 来发掘所有使用 EmberJS 的应用和客户。
Ember 虽然和我们讨论过的其他框架有类似的好处,但这里有些独特的区别:
* 约定优于配置——Ember 标准化命名约定并自动生成结果代码。这种方法学习曲线有些陡峭,但可以确保程序员遵循最佳实践。
* 成熟的模板机制——Ember 依赖于直接文本操作,直接构建 HTML 文档,而并不关心 DOM。
正如所期待的那样,作为一个被许多应用程序使用的框架,[Ember 的 GitHub][58] 页面显示该项目拥有 19,808 次提交和 785 位贡献者。这是一个巨大的数字!
![EmberJS GitHub page][59]
### KnockoutJS
![KnockoutJS page][60]
[KnockoutJS][61] 是一个独立开源的 JavaScript 框架,采用 [模板-视图-视图模型MVVM][56] 模式与模板。尽管与 Angular、React 或 Vue 相比,听说过这个框架的人可能比较少,这个项目在开发者社区仍然相当活跃,并且有以下功能:
* 声明式绑定——Knockout 的声明式绑定系统提供了一种简洁而强大的方式来将数据链接到 UI。绑定简单的数据属性或使用单向绑定很简单。请在 [KnockoutJS 的官方文档页面][62] 阅读更多相关信息。
* 自动 UI 刷新。
* 依赖跟踪模板。
[Knockout 的 GitHub][11] 页面显示约有 1,766 次提交和 81 位贡献者。与其他框架相比,这些数据并不重要,但是该项目仍然在积极维护中。
![Knockout GitHub page][63]
### BackboneJS
![BackboneJS page][64]
[BackboneJS][65] 是一个具有 RESTful JSON 接口,基于 Model-View-PresenterMVP设计范式的轻量级 JavaScript 框架。
这个框架据说已经被 [Airbnb][66]、Hulu、SoundCloud 和 Trello 使用。你可以在 [Backbone 的页面][67] 找到上面所有这些案例来研究。
[BackboneJS 的 GitHub][13] 页面显示有 3,386 次提交和 289 位贡献者。
![BackboneJS GitHub page][68]
### Svelte
![Svelte page][69]
[Svelte][70] 是一个开源的 JavaScript 框架,它生成操作 DOM 的代码,而不是包含框架引用。在构建时而非运行时将应用程序转换为 JavaScript 的过程,在某些情况下可能会带来轻微的性能提升。
[Svelte 的 GitHub][14] 页面显示,截止到本文撰写为止,该项目有 5,729 次提交和 296 位贡献者。
![Svelte GitHub page][71]
### AureliaJS
![Aurelia page][72]
最后我们介绍一下 [Aurelia][73]。Aurelia 是一个前端 JavaScript 框架,是一个现代 JavaScript 模块的集合。Aurelia 有以下有趣的功能:
* 快速渲染——Aurelia 宣称比当今其他任何框架的渲染速度都快。
* 单向数据流——Aurelia 使用一个基于观察的绑定系统,将数据从模型推送到视图。
* 使用 vanilla JavaScript 架构——可以用 vanilla JavaScript 构建网站的所有组件。
[Aurelia 的 GitHub][15] 页面显示,截止到撰写本文为止该项目有 788 次提交和 96 位贡献者。
![Aurelia GitHub page][74]
这就是我在查看 JavaScript 框架世界时发现的新内容。我错过了其他有趣的框架吗?欢迎在评论区分享你的想法。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/5/open-source-javascript-frameworks
作者:[Bryant Son][a]
选题:[lujun9972][b]
译者:[stevending1st](https://github.com/stevending1st)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/brson
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open)
[2]: https://opensource.com/article/17/9/open-source-licensing
[3]: https://www.w3schools.com/js/js_htmldom.asp
[4]: https://reactjs.org/docs/faq-internals.html
[5]: https://reactjs.org/docs/react-dom.html
[6]: https://en.wikipedia.org/wiki/Data_binding
[7]: https://github.com/facebook/react
[8]: https://github.com/angular/angular
[9]: https://github.com/vuejs/vue
[10]: https://github.com/meteor/meteor
[11]: https://github.com/knockout/knockout
[12]: https://github.com/emberjs/ember.js
[13]: https://github.com/jashkenas/backbone
[14]: https://github.com/sveltejs/svelte
[15]: https://github.com/aurelia/framework
[16]: https://www.npmtrends.com/angular-vs-react-vs-vue-vs-meteor-vs-backbone
[17]: https://opensource.com/sites/default/files/uploads/open-source-javascript-framework-downloads-opensourcedotcom_0.png (Framework downloads graph)
[18]: https://opensource.com/sites/default/files/uploads/3_react.jpg (React page)
[19]: https://reactjs.org
[20]: https://reactjs.org/
[21]: https://reactjs.org/docs/perf.html
[22]: https://redux.js.org/
[23]: https://github.com/reduxjs/redux-thunk
[24]: https://github.com/reduxjs/reselect
[25]: https://reactjs.org/docs/two-way-binding-helpers.html
[26]: https://instagram-engineering.com/react-native-at-instagram-dd828a9a90c7
[27]: https://open.nytimes.com/introducing-react-tracking-declarative-tracking-for-react-apps-2c76706bb79a
[28]: https://medium.com/dev-channel/a-netflix-web-performance-case-study-c0bcde26a9d9
[29]: https://khan.github.io/react-components/
[30]: https://opensource.com/sites/default/files/uploads/4_reactjobs_0.jpg (React jobs page)
[31]: https://stackoverflow.blog/2017/03/09/developer-hiring-trends-2017
[32]: https://opensource.com/sites/default/files/uploads/5_reactgithub.jpg (React GitHub page)
[33]: https://opensource.com/sites/default/files/uploads/6_angular.jpg (Angular homepage)
[34]: https://angular.io
[35]: https://cli.angular.io/
[36]: https://www.typescriptlang.org/
[37]: https://netflixtechblog.com/netflix-likes-react-509675426db
[38]: https://developer.ibm.com/technologies/javascript/tutorials/wa-react-intro/
[39]: https://medium.com/walmartlabs/tagged/react
[40]: https://opensource.com/sites/default/files/uploads/7_angulargithub.jpg (Angular GitHub page)
[41]: https://opensource.com/sites/default/files/uploads/8_vuejs.jpg (Vue JS page)
[42]: https://vuejs.org
[43]: https://www.freecodecamp.org/news/between-the-wires-an-interview-with-vue-js-creator-evan-you-e383cbf57cc4/
[44]: https://opensource.com/sites/default/files/uploads/9_vuejspopularity.jpg (Vue JS popularity graph)
[45]: https://vuejs.org/v2/guide/comparison.html#Size
[46]: https://vuejs.org/v2/guide/
[47]: https://opensource.com/sites/default/files/uploads/10_vuejsgithub.jpg (Vue JS GitHub page)
[48]: https://opensource.com/sites/default/files/uploads/11_meteor_0.jpg (Meteor Page)
[49]: https://www.meteor.com
[50]: https://en.wikipedia.org/wiki/Isomorphic_JavaScript
[51]: https://www.meteor.com/showcase
[52]: https://opensource.com/sites/default/files/uploads/casestudy1_meteor.jpg (Meteor case study)
[53]: https://opensource.com/sites/default/files/uploads/12_meteorgithub.jpg (Meteor GitHub page)
[54]: https://opensource.com/sites/default/files/uploads/13_emberjs.jpg (EmberJS page)
[55]: https://emberjs.com
[56]: https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93viewmodel
[57]: https://emberjs.com/ember-users
[58]: https://github.com/emberjs
[59]: https://opensource.com/sites/default/files/uploads/14_embergithub.jpg (EmberJS GitHub page)
[60]: https://opensource.com/sites/default/files/uploads/15_knockoutjs.jpg (KnockoutJS page)
[61]: https://knockoutjs.com
[62]: https://knockoutjs.com/documentation/binding-syntax.html
[63]: https://opensource.com/sites/default/files/uploads/16_knockoutgithub.jpg (Knockout GitHub page)
[64]: https://opensource.com/sites/default/files/uploads/17_backbonejs.jpg (BackboneJS page)
[65]: https://backbonejs.org
[66]: https://medium.com/airbnb-engineering/our-first-node-js-app-backbone-on-the-client-and-server-c659abb0e2b4
[67]: https://sites.google.com/site/backbonejsja/examples
[68]: https://opensource.com/sites/default/files/uploads/18_backbonejsgithub.jpg (BackboneJS GitHub page)
[69]: https://opensource.com/sites/default/files/uploads/19_svelte.jpg (Svelte page)
[70]: https://svelte.dev
[71]: https://opensource.com/sites/default/files/uploads/20_svletegithub.jpg (Svelte GitHub page)
[72]: https://opensource.com/sites/default/files/uploads/21_aurelia.jpg (Aurelia page)
[73]: https://aurelia.io
[74]: https://opensource.com/sites/default/files/uploads/22_aureliagithub.jpg (Aurelia GitHub page)

View File

@@ -0,0 +1,534 @@
[#]: collector: (lujun9972)
[#]: translator: (tanloong)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (An advanced guide to NLP analysis with Python and NLTK)
[#]: via: (https://opensource.com/article/20/8/nlp-python-nltk)
[#]: author: (Girish Managoli https://opensource.com/users/gammay)
用 Python 和 NLTK 进行 NLP 分析的高级教程
======
进一步学习自然语言处理的基本概念
![Brain on a computer screen][1]
在[之前的文章][2]里,我介绍了<ruby>自然语言处理<rt>NLP</rt></ruby>和宾夕法尼亚大学研发的自然语言处理工具包 ([NLTK][3])。我演示了用 Python 解析文本和定义停用词的方法,并介绍了语料库的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。
这篇文章主要包括以下部分:
* <ruby>词网<rt>WordNet</rt></ruby>和<ruby>同义词集<rt>synset</rt></ruby>
* <ruby>相似度比较<rt>Similarity comparison</rt></ruby>
* <ruby>树<rt>Tree</rt></ruby>和<ruby>树库<rt>treebank</rt></ruby>
* <ruby>命名实体识别<rt>Named entity recognition</rt></ruby>
### WordNet 和<ruby>同义词集<rt>synsets</rt></ruby>
[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多<ruby>认知同义词<rt>cognitive synonyms</rt></ruby> (一个认知同义词常被称作 synset)。在 WordNet 里,名词、动词、形容词和副词,各自被组织成一个同义词的网络。
WordNet 是文本分析的一个很有用的工具。它有面向多种语言的版本 (汉语、英语、日语、俄语和西班牙语等),也使用多种许可证 (从开源许可证到商业许可证都有)。初代版本的 WordNet 由普林斯顿大学研发,面向英语,使用<ruby>类 MIT 许可证<rt>MIT-like license</rt></ruby>。
因为一个词可能有多个意义或多个词性,所以可能与多个 synset 相关联。每个 synset 通常提供下列属性:
|**属性** | **定义** | **例子**|
|---|---|---|
|<ruby>名称<rt>Name</rt></ruby>| 此 synset 的名称 | 单词 code 有 5 个 synset名称分别是 `code.n.01``code.n.02``code.n.03``code.v.01``code.v.02`|
|<ruby>词性<rt>POS</rt></ruby>| 此 synset 的词性 | 单词 code 有 3 个名词词性的 synset 和 2 个动词词性的 synset|
|<ruby>定义<rt>Definition</rt></ruby>| 该词作对应词性时的定义 | 动词 code 的一个定义是:(计算机科学) 数据或计算机程序指令的<ruby>象征性排列<rt>symbolic arrangement</rt></ruby>|
|<ruby>例子<rt>Examples</rt></ruby>| 使用该词的例子 | code 一词的例子:<ruby>为了安全,我们应该给信息编码。<rt>We should encode the message for security reasons</rt></ruby>|
|<ruby>词元<rt>Lemmas</rt></ruby>| 与该词相关联的其他 synset (包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元直接与其他词元相关联,而不是直接与<ruby>单词<rt>words/rt></ruby>相关联|`code.v.02` 的词元是`code.v.02.encipher``code.v.02.cipher``code.v.02.cypher``code.v.02.encrypt``code.v.02.inscribe``code.v.02.write_in_code`|
|<ruby>反义词<rt>Antonyms</rt></ruby>| 意思相反的词 | 词元 `encode.v.01.encode` 的反义词是 `decode.v.01.decode`|
|<ruby>上义词<rt>Hypernym</rt></ruby>|该词所属的一个范畴更大的词 | `code.v.01` 的一个上义词是 `tag.v.01`|
|<ruby>分项词<rt>Meronym</rt></ruby>| 属于该词组成部分的词 | computer 的一个分项词是 chip |
|<ruby>总项词<rt>Holonym</rt></ruby>| 该词作为组成部分所属的词 | window 的一个总项词是 computer screen|
synset 还有一些其他属性,在 `<你的 Python 安装路径>/Lib/site-packages` 下的 `nltk/corpus/reader/wordnet.py`,你可以找到它们。
下面的代码或许可以帮助理解。
这个函数:
```
from nltk.corpus import wordnet
def synset_info(synset):
print("Name", synset.name())
print("POS:", synset.pos())
print("Definition:", synset.definition())
print("Examples:", synset.examples())
print("Lemmas:", synset.lemmas())
print("Antonyms:", [lemma.antonyms() for lemma in synset.lemmas() if len(lemma.antonyms()) > 0])
print("Hypernyms:", synset.hypernyms())
print("Instance Hypernyms:", synset.instance_hypernyms())
print("Part Holonyms:", synset.part_holonyms())
print("Part Meronyms:", synset.part_meronyms())
print()
synsets = wordnet.synsets('code')
print(len(synsets), "synsets:")
for synset in synsets:
synset_info(synset)
```
将会显示:
```
5 synsets:
Name code.n.01
POS: n
Definition: a set of rules or principles or laws (especially written ones)
Examples: []
Lemmas: [Lemma('code.n.01.code'), Lemma('code.n.01.codification')]
Antonyms: []
Hypernyms: [Synset('written_communication.n.01')]
Instance Hpernyms: []
Part Holonyms: []
Part Meronyms: []
...
Name code.n.03
POS: n
Definition: (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions
Examples: []
Lemmas: [Lemma('code.n.03.code'), Lemma('code.n.03.computer_code')]
Antonyms: []
Hypernyms: [Synset('coding_system.n.01')]
Instance Hpernyms: []
Part Holonyms: []
Part Meronyms: []
...
Name code.v.02
POS: v
Definition: convert ordinary language into code
Examples: ['We should encode the message for security reasons']
Lemmas: [Lemma('code.v.02.code'), Lemma('code.v.02.encipher'), Lemma('code.v.02.cipher'), Lemma('code.v.02.cypher'), Lemma('code.v.02.encrypt'), Lemma('code.v.02.inscribe'), Lemma('code.v.02.write_in_code')]
Antonyms: []
Hypernyms: [Synset('encode.v.01')]
Instance Hpernyms: []
Part Holonyms: []
Part Meronyms: []
```
<ruby>同义词集<rt>synsets</rt></ruby>和<ruby>词元<rt>lemmas</rt></ruby>在 WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现:
```
def hypernyms(synset):
    return synset.hypernyms()
synsets = wordnet.synsets('soccer')
for synset in synsets:
    print(synset.name() + " tree:")
    pprint(synset.tree(rel=hypernyms))
    print()
[/code] [code]
code.n.01 tree:
[Synset('code.n.01'),
 [Synset('written_communication.n.01'),
   ...
code.n.02 tree:
[Synset('code.n.02'),
 [Synset('coding_system.n.01'),
   ...
code.n.03 tree:
[Synset('code.n.03'),
   ...
code.v.01 tree:
[Synset('code.v.01'),
 [Synset('tag.v.01'),
   ...
code.v.02 tree:
[Synset('code.v.02'),
 [Synset('encode.v.01'),
   ...
```
WordNet 并没有涵盖所有的单词和其信息 (现今英语有约 17,0000 个单词,最新版的 WordNet 涵盖了约 15,5000 个),但它开了个好头。掌握了 WordNet 的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的<ruby>“词网”<rt>WordNet</rt></ruby>
#### 自主尝试
使用 Python 库,下载维基百科的 [open source][5] 页面,并列出该页面所有单词的<ruby>同义词集<rt>synsets</rt></ruby>和<ruby> 词元<rt>lemmas</rt></ruby>。
### 相似度比较
相似度比较的目的是识别出两篇文本的相似度,在搜索引擎、聊天机器人等方面有很多应用。
比如,相似度比较可以识别 football 和 soccer 是否有相似性。
```
syn1 = wordnet.synsets('football')
syn2 = wordnet.synsets('soccer')
# A word may have multiple synsets, so need to compare each synset of word1 with synset of word2
# 一个单词可能有多个 synset需要把 word1 的每个 synset 和 word2 的每个 synset 分别比较
for s1 in syn1:
    for s2 in syn2:
        print("Path similarity of: ")
        print(s1, '(', s1.pos(), ')', '[', s1.definition(), ']')
        print(s2, '(', s2.pos(), ')', '[', s2.definition(), ']')
        print("   is", s1.path_similarity(s2))
        print()
[/code] [code]
Path similarity of:
Synset('football.n.01') ( n ) [ any of various games played with a ball (round or oval) in which two teams try to kick or carry or propel the ball into each other's goal ]
Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ]
   is 0.5
Path similarity of:
Synset('football.n.02') ( n ) [ the inflated oblong ball used in playing American football ]
Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players try to kick or head a ball into the opponents' goal ]
   is 0.05
```
两个词各个 synset 之间<ruby>路径相似度<rt>path similarity</rt></ruby>最大的是 0.5,表明它们关联性很大 ([<ruby>路径相似度<rt>path similarity</rt></ruby>][6]指两个词的意义在<ruby>上下义关系的词汇分类结构<rt>hypernym/hypnoym taxonomy</rt></ruby>中的最短距离)。
那么 code 和 bug 呢?这两个计算机领域的词的相似度是:
```
Path similarity of:
Synset('code.n.01') ( n ) [ a set of rules or principles or laws (especially written ones) ]
Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ]
   is 0.1111111111111111
...
Path similarity of:
Synset('code.n.02') ( n ) [ a coding system used for transmitting messages requiring brevity or secrecy ]
Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ]
   is 0.09090909090909091
...
Path similarity of:
Synset('code.n.03') ( n ) [ (computer science) the symbolic arrangement of data or instructions in a computer program or the set of such instructions ]
Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or machine ]
   is 0.09090909090909091
```
这些是这两个词各 synset 之间<ruby>路径相似度<rt>path similarity</rt></ruby>的最大值,这些值表明两个词是有关联性的。
NLTK 提供多种<ruby>相似度计分器<rt>similarity scorers</rt></ruby>,比如:
* path_similarity
* lch_similarity
* wup_similarity
* res_similarity
* jcn_similarity
* lin_similarity
要进一步了解这些<ruby>相似度计分器<rt>similarity scorers</rt></ruby>,请查看 [WordNet Interface][6] 的 Similarity 部分。
#### 自主尝试
使用 Python 库,从维基百科的 [Category: Lists of computer terms][7] 生成一个术语列表,然后计算各术语之间的相似度。
### <ruby>树<rt>tree</rt></ruby>和<ruby>树库<rt>treebank</rt></ruby>
使用 NLTK你可以把文本表示成树状结构以便进行分析。
这里有一个例子:
这是一份简短的文本,对其做预处理和词性标注:
```
import nltk
text = "I love open source"
# Tokenize to words
words = nltk.tokenize.word_tokenize(text)
# POS tag the words
words_tagged = nltk.pos_tag(words)
```
要把文本转换成树状结构,你必须定义一个<ruby>语法<rt>grammar</rt></ruby> 。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。
```
# A simple grammar to create tree
grammar = "NP: {&lt;JJ&gt;&lt;NN&gt;}"
```
然后用这个<ruby>语法<rt>grammar</rt></ruby>创建一颗<ruby>树<rt>tree</rt></ruby>
```
# Create tree
parser = nltk.RegexpParser(grammar)
tree = parser.parse(words_tagged)
pprint(tree)
```
运行上面的代码,将得到:
```
Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])])
```
你也可以图形化地显示结果。
```
tree.draw()
```
![NLTK Tree][9]
(Girish Managoli, [CC BY-SA 4.0][10])
这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的主语 ([subject][11])
```
subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"]
def subject(sentence_tree):
    for tagged_word in sentence_tree:
        # A crude logic for this case -  first word with these tags is considered subject
        if tagged_word[1] in subject_tags:
            return tagged_word[0]
print("Subject:", subject(tree))
```
结果显示主语是 I
```
Subject: I
```
这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票1 月 1 号伦敦飞纽约的“,机器人可以用这种分析方法解读这个指令:
**动作**: 预订
**动作的对象**: 机票
**乘客**: Jane
**出发地**: 伦敦
**目的地**: 纽约
**日期**: (明年) 1 月 1 号
<ruby>树库<rt>treebank</rt></ruby>指由许多预先标注好的<ruby>树<rt>tree</rt></ruby>构成的语料库。现在已经有面向多种语言的树库,既有开源的,也有限定条件下才能免费使用的,以及商用的。其中使用最广泛的是面向英语的宾州树库。宾州树库取材于<ruby> _华尔街日报_ <rt>Wall Street Journal</rt></ruby>。NLTK 也包含了宾州树库作为一个子语料库。下面是一些使用<ruby>树库<rt>treebank</rt></ruby>的方法:
```
words = nltk.corpus.treebank.words()
print(len(words), "words:")
print(words)
tagged_sents = nltk.corpus.treebank.tagged_sents()
print(len(tagged_sents), "sentences:")
print(tagged_sents)
[/code] [code]
100676 words:
['Pierre', 'Vinken', ',', '61', 'years', 'old', ',', ...]
3914 sentences:
[[('Pierre', 'NNP'), ('Vinken', 'NNP'), (',', ','), ('61', 'CD'), ('years', 'NNS'), ('old', 'JJ'), (',', ','), ('will', 'MD'), ('join', 'VB'), ('the', 'DT'), ('board', 'NN'), ('as', 'IN'), ('a', 'DT'), ('nonexecutive', 'JJ'), ('director', 'NN'), ...]
```
查看一个句子里的各个<ruby>标签<rt>tags</rt></ruby>
```
sent0 = tagged_sents[0]
pprint(sent0)
[/code] [code]
[('Pierre', 'NNP'),
 ('Vinken', 'NNP'),
 (',', ','),
 ('61', 'CD'),
 ('years', 'NNS'),
...
```
定义一个<ruby>语法<rt>grammar</rt></ruby>来把这个句子转换成树状结构:
```
grammar = '''
    Subject: {&lt;NNP&gt;&lt;NNP&gt;}
    SubjectInfo: {&lt;CD&gt;&lt;NNS&gt;&lt;JJ&gt;}
    Action: {&lt;MD&gt;&lt;VB&gt;}
    Object: {&lt;DT&gt;&lt;NN&gt;}
    Stopwords: {&lt;IN&gt;&lt;DT&gt;}
    ObjectInfo: {&lt;JJ&gt;&lt;NN&gt;}
    When: {&lt;NNP&gt;&lt;CD&gt;}
'''
parser = nltk.RegexpParser(grammar)
tree = parser.parse(sent0)
print(tree)
[/code] [code]
(S
  (Subject Pierre/NNP Vinken/NNP)
  ,/,
  (SubjectInfo 61/CD years/NNS old/JJ)
  ,/,
  (Action will/MD join/VB)
  (Object the/DT board/NN)
  as/IN
  a/DT
  (ObjectInfo nonexecutive/JJ director/NN)
  (Subject Nov./NNP)
  29/CD
  ./.)
```
图形化地显示:
```
tree.draw()
```
![NLP Treebank image][12]
(Girish Managoli, [CC BY-SA 4.0][10])
<ruby>树<rt>trees</rt></ruby>和<ruby>树库<rt>treebanks</rt></ruby>的概念是文本分析的一个强大的组成部分。
#### 自主尝试
使用 Python 库,下载维基百科的 [open source][5] 页面,将得到的文本以图形化的树状结构展现出来。
### <ruby>命名实体识别<rt>Named entity recognition</rt></ruby>
无论口语还是书面语都包含着重要数据。文本处理的主要目标之一,就是提取出关键数据。几乎所有应用场景所需要提取关键数据,比如航空公司的订票机器人或者问答机器人。 NLTK 为此提供了一个<ruby>命名实体识别<rt>named entity recognition</rt></ruby>的功能。
这里有一个代码示例:
```
sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'
```
验证这个句子里的<ruby>人名<rt>name</rt></ruby>和<ruby>地名<rt>place</rt></ruby>有没有被识别出来。照例先预处理:
```
import nltk
words = nltk.word_tokenize(sentence)
pos_tagged = nltk.pos_tag(words)
```
运行<ruby>命名实体标注器<rt>named-entity tagger</rt></ruby>
```
ne_tagged = nltk.ne_chunk(pos_tagged)
print("NE tagged text:")
print(ne_tagged)
print()
[/code] [code]
NE tagged text:
(S
  (PERSON Peterson/NNP)
  first/RB
  suggested/VBD
  the/DT
  name/NN
  ``/``
  open/JJ
  source/NN
  ''/''
  at/IN
  (FACILITY Palo/NNP Alto/NNP)
  ,/,
  (GPE California/NNP))
```
上面的结果里,命名实体被识别出来并做了标注;只提取这个<ruby>树<rt>tree</rt></ruby>里的命名实体:
```
print("Recognized named entities:")
for ne in ne_tagged:
    if hasattr(ne, "label"):
        print(ne.label(), ne[0:])
[/code] [code]
Recognized named entities:
PERSON [('Peterson', 'NNP')]
FACILITY [('Palo', 'NNP'), ('Alto', 'NNP')]
GPE [('California', 'NNP')]
```
图形化地显示:
```
ne_tagged.draw()
```
![NLTK Treebank tree][13]
(Girish Managoli, [CC BY-SA 4.0][10])
NLTK 内置的<ruby>命名实体标注器<rt>named-entity tagger</rt></ruby>,使用的是宾州法尼亚大学的 [Automatic Content Extraction][14] (ACE) 程序。 该标注器能够识别<ruby>组织机构<rt>ORGANIZATION</rt></ruby><ruby>、人名<rt>PERSON</rt></ruby><ruby>、地名<rt>LOCATION</rt></ruby><ruby>、设施<rt>FACILITY</rt></ruby>和<ruby>地缘政治实体<rt>geopolitical entity</rt></ruby>等常见<ruby>实体<rt>entites</rt></ruby>。
NLTK 也可以使用其他<ruby>标注器<rt>tagger</rt></ruby>,比如 [Stanford Named Entity Recognizer][15]. 这个经过训练的标注器用 Java 写成,但 NLTK 提供了一个使用它的接口 (详情请查看 [nltk.parse.stanford][16] 或 [nltk.tag.stanford][17])。
#### 自主尝试
使用 Python 库,下载维基百科的 [open source][5] 页面,并识别出对<ruby>开源<rt>open source</rt></ruby>有影响力的人的名字,以及他们为<ruby>开源<rt>open source</rt></ruby>做贡献的时间和地点。
### 高级实践
如果你准备好了,尝试用这篇文章以及此前的文章介绍的知识构建一个<ruby>超级结构<rt>superstructure</rt></ruby>。
使用 Python 库,下载维基百科的 [Category: Computer science page][18],然后:
* 找出其中频率最高的<ruby>单词<rt>unigrams</rt></ruby><ruby>、二元搭配<rt>bigrams</rt></ruby>和<ruby>三元搭配<rt>trigrams</rt></ruby>,将它们作为一个关键词列表或者技术列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。
* 图形化地显示这个领域里重要的人名、技术、日期和地点。这会是一份很棒的信息图。
* 构建一个搜索引擎。你的搜索引擎性能能够超过维基百科吗?
### 下一步?
自然语言处理是<ruby>应用构建<rt>application building</rt></ruby>的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。
在这个系列的文章里,我用 NLTK 作为例子,展示了自然语言处理可以做什么。自然语言处理和 NLTK 还有太多东西值得探索,这个系列的文章只是帮助你探索它们的切入点。
如果你的需求增长到 NLTK 已经满足不了了,你可以训练新的模型或者向 NLTK 添加新的功能。基于 NLTK 构建的新的自然语言处理库正在不断涌现,机器学习也正被深度用于自然语言处理。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/8/nlp-python-nltk
作者:[Girish Managoli][a]
选题:[lujun9972][b]
译者:[tanloong](https://github.com/tanloong)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/gammay
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/brain_computer_solve_fix_tool.png?itok=okq8joti (Brain on a computer screen)
[2]: https://opensource.com/article/20/8/intro-python-nltk
[3]: http://www.nltk.org/
[4]: https://en.wikipedia.org/wiki/WordNet
[5]: https://en.wikipedia.org/wiki/Open_source
[6]: https://www.nltk.org/howto/wordnet.html
[7]: https://en.wikipedia.org/wiki/Category:Lists_of_computer_terms
[8]: https://www.ling.upenn.edu/courses/Fall_2003/ling001/penn_treebank_pos.html
[9]: https://opensource.com/sites/default/files/uploads/nltk-tree.jpg (NLTK Tree)
[10]: https://creativecommons.org/licenses/by-sa/4.0/
[11]: https://en.wikipedia.org/wiki/Subject_(grammar)
[12]: https://opensource.com/sites/default/files/uploads/nltk-treebank.jpg (NLP Treebank image)
[13]: https://opensource.com/sites/default/files/uploads/nltk-treebank-2a.jpg (NLTK Treebank tree)
[14]: https://www.ldc.upenn.edu/collaborations/past-projects/ace
[15]: https://nlp.stanford.edu/software/CRF-NER.html
[16]: https://www.nltk.org/_modules/nltk/parse/stanford.html
[17]: https://www.nltk.org/_modules/nltk/tag/stanford.html
[18]: https://en.wikipedia.org/wiki/Category:Computer_science

View File

@@ -0,0 +1,163 @@
[#]: subject: (Programming 101: Input and output with Java)
[#]: via: (https://opensource.com/article/21/3/io-java)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
编程秘笈Java 中的输入和输出
======
学习 Java 如何外理数据的读与写
![Coffee beans and a cup of coffee][1]
当你写一个程序时,你的应用程序可能需要读取和写入存储在用户计算机上的文件。这在你想加载或存储配置选项,你需要创建日志文件,或你的用户想要保存工作以待后用的情况下是很常见的。每种语言处理这项任务的方式都有所不同。本文演示了如何用 Java 处理数据文件。
### 安装 Java
不管你的计算机是什么平台,你都可以从 [AdoptOpenJDK][2] 安装 Java。这个网站提供安全和开源的 Java 构建。在 Linux 上,你的软件库中也可能找到 AdvertOpenJDK 的构建。
我建议你使用最新的长期支持LTS版本。最新的非 LTS 版本对希望尝试最新 Java 功能的开发者来说是最好的,但它很可能超过大多数用户所安装的版本——要么是系统上默认安装的,要么是以前为其他 Java 应用安装的。使用 LTS 版本可以确保你与大多数用户所安装的版本保持一致。
一旦你安装好了 Java就可以打开你最喜欢的文本编辑器并准备开始写代码了。你可能还想要研究一下 [Java 集成开发环境][3]。BlueJ 是新程序员的理想选择,而 Eclipse 和 Netbeans 对中级和有经验的编码者更友好。
### 利用 Java 读取文件
Java 使用 `File` 类来加载文件。
这个例子创建了一个叫 `Ingest` 的类来读取文件中数据。当你要在 Java 中打开一个文件时,你创建了一个 `Scanner` 对象,它可以逐行扫描你提供的文件。事实上,`Scanner` 与文本编辑器中的光标是相同的概念,这样你可以用 `Scanner` 的一些方法(如 `nextLine`)来控制这个“光标”以进行读写。
```
import java.io.File;
import java.util.Scanner;
import java.io.FileNotFoundException;
public class Ingest {
  public static void main([String][4][] args) {
   
      try {
          [File][5] myFile = new [File][5]("example.txt");
          Scanner myScanner = new Scanner(myFile);
          while (myScanner.hasNextLine()) {
              [String][4] line = myScanner.nextLine();
              [System][6].out.println(line);
          }
          myScanner.close();
      } catch ([FileNotFoundException][7] ex) {
          ex.printStackTrace();  
      } //try
    } //main
} //class
```
这段代码首先在假设存在一个名为 `example.txt` 的文件的情况下创建了变量 `myfile`。如果该文件不存在Java 就会“抛出一个异常”(这意味着它在你试图做的事情中发现了一个错误,并这样告诉你),这个异常是被非常明确的 `FileNotFoundException` 类所“捕获”。事实上,有一个专门的类来处理这个明确的错误,这说明这个错误是多么常见。
接下来,它创建了一个 `Scanner` 并将文件加载到其中。我把它叫做 `myScanner`,以区别于它的通用类模板。接着,一个 `while` 循环将 `myScanner` 逐行送入文件中只要_存在_下一行。这就是 `hasNextLine` 方法的作用:它检测“光标”之后是否还有数据。你可以通过在文本编辑器中打开一个文件来模拟这个过程:你的光标从文件的第一行开始,你可以用键盘控制光标来向下扫描文件,直到你用完了所有的行。
`while` 循环创建了一个变量 `line`,并将文件当前行的数据分配给它。然后将 `line` 的内容打印出来以提供反馈。一个更有用的程序可能会解析每一行的内容,从而提取它所包含的任何重要数据。
在这个过程结束时,关闭 `myScanner` 对象。
### 运行代码
将你的代码保存到 `Ingest.java` 文件(这是一个 Java 惯例,将类名的首字母大写,并以类名来命名相应的文件)。如果你试图运行这个简单的应用程序,你可能会接收到一个错误信息,这是因为还没有 `example.txt` 文件供应用程序加载:
```
$ java ./Ingest.java
java.io.[FileNotFoundException][7]:
example.txt (No such file or directory)
```
正好可以编写一个将数据写入文件的 Java 应用程序,多么完美的时机!
### 利用 Java 将数据写入文件
无论你是存储用户使用你的应用程序创建的数据,还是仅仅存储关于用户在应用程序中做了什么的元数据(例如,游戏保存或最近播放的歌曲),有很多很好的理由来存储数据供以后使用。在 Java 中,这是通过 `FileWriter` 类实现的,这次先打开一个文件,向其中写入数据,然后关闭该文件。
```
import java.io.FileWriter;
import java.io.IOException;
public class Exgest {
  public static void main([String][4][] args) {
    try {
        [FileWriter][8] myFileWriter = new [FileWriter][8]("example.txt", true);
        myFileWriter.write("Hello world\n");
        myFileWriter.close();
    } catch ([IOException][9] ex) {
        [System][6].out.println(ex);
    } // try
  } // main
}
```
这个类的逻辑和流程与读取文件类似。但它不是一个 `Scanner`,而是以一个文件的名字为参数创建的一个 `FileWriter` 对象。`FileWriter` 语句末尾的 `true` 标志告诉 `FileWriter` 将文本_追加_到文件的末尾。要覆盖一个文件的内容请移除 `true` 标志。
```
`FileWriter myFileWriter = new FileWriter("example.txt", true);`
```
因为我在向文件中写入纯文本所以我在写入文件的数据Hello world的结尾处手动添加了换行符\n
### 试试代码
将这段代码保存到 `Exgest.java` 文件,遵循 Java 的惯例,使文件名为与类名相匹配。
既然你已经掌握了用 Java 创建和读取数据的方法,你可以按相反的顺序尝试运行你的新应用程序。
```
$ java ./Exgest.java
$ java ./Ingest.java
Hello world
$
```
因为程序是把数据追加到文件末尾,所以你可以重复执行你的应用程序以多次写入数据,只要你想把更多的数据添加到你的文件中。
```
$ java ./Exgest.java
$ java ./Exgest.java
$ java ./Exgest.java
$ java ./Ingest.java
Hello world
Hello world
Hello world
$
```
### Java 和数据
你并不经常向文件中写入原始文本;实事上,你可能会使用一个其它的类库以写入特定的格式。例如,你可能使用 XML 类库来写复杂的数据,使用 INI 或 YAML 类库来写配置文件,或者使用任何数量的专门类库来写二进制格式,如图像或音频。
更完整的信息,请参阅 [OpenJDK 文档][10]。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/3/io-java
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[piaoshi](https://github.com/piaoshi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee)
[2]: https://adoptopenjdk.net
[3]: https://opensource.com/article/20/7/ide-java
[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file
[6]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filenotfoundexception
[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter
[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+ioexception
[10]: https://access.redhat.com/documentation/en-us/openjdk/11/

View File

@@ -1,118 +0,0 @@
[#]: subject: (Encrypt and decrypt files with a passphrase on Linux)
[#]: via: (https://opensource.com/article/21/7/linux-age)
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
在 Linux 上用密码加密和解密文件
======
age 是一个简单的、易于使用的工具,允许你用一个密码来加密和解密文件。
![Scissors cutting open access to files][1]
长期以来,保护文件和敏感文档的加密和安全一直是用户关心的问题。即使我们越来越多的数据被存放在网站和云服务上,并由带有越来越安全和具有挑战性的密码的用户账户来保护,但能够在我们自己的文件系统中存储敏感数据仍有很大的价值,特别是当我们能够快速和容易地加密这些数据时。
[age][2] 能让你这样做。它是一个小型的、易于使用的工具,允许你用一个密码加密一个文件,并根据需要解密。
### 安装 age
age 可以在大多数 Linux 软件库中[安装][3]。
要在 Fedora 上安装它:
```
`$ sudo dnf install age -y`
```
在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。在 Windows 上,使用 [Chocolatey][6]。
### 用 age 加密和解密文件
age 可以用公钥或用户设置的密码来加密和解密文件。
#### 在 age 中使用公钥
首先,生成一个公钥并写入 `key.txt` 文件:
```
$ age-keygen -o key.txt
Public key: age16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9
```
### 使用公钥加密
要用你的公钥加密一个文件:
```
`$ touch mypasswds.txt | age -r ageage16frc22wz6z206hslrjzuv2tnsuw32rk80pnrku07fh7hrmxhudawase896m9 > mypass.tar.gz.age`
```
在这个例子中,文件 `mypasswds.txt` 被我生成的公钥加密,放在一个叫做 `mypass.tar.gz.age` 的加密文件中。
### 用公钥解密
要解密你所保护的信息,使用 `age` 命令和 `--decrypt` 选项:
```
`$ age --decrypt -i key.txt -o mypass.tar.gz mypass.tar.gz.age`
```
在这个例子中age 使用存储在 `key.text` 中的密钥,并解密了我在上一步创建的文件。
### 使用密码加密
在没有公开密钥的情况下对文件进行加密被称为对称加密。它允许用户设置密码来加密和解密一个文件。要做到这一点:
```
$ age --passphrase --output mypasswd-encrypted.txt mypasswd.txt
Enter passphrase (leave empty to autogenerate a secure one):
Confirm passphrase:
```
在这个例子中age 提示你输入一个密码,它用这个密码对输入文件 `mypasswd.txt` 进行加密,并生成文件 `mypasswd-encrypted.txt`
### 使用密码解密
要解密一个用密码加密的文件,可以使用 `age` 命令和 `--decrypt` 选项:
```
`$ age --decrypt --output passwd-decrypt.txt mypasswd-encrypted.txt`
```
在这个例子中age 提示你输入密码,然后将 `mypasswd-encrypted.txt` 文件的内容解密为 `passwd-decrypt.txt`,只要你提供的密码与加密时设置的密码一致。
### 不要丢失你的密钥
无论你是使用密码加密还是公钥加密你都_不能_丢失加密数据的凭证。根据设计如果没有用于加密的密钥用 age 加密的文件是不能被解密的。所以,请备份你的公钥,并记住这些密码!
### 轻松实现加密
age 是一个真正强大的工具。我喜欢把我的敏感文件,特别是税务记录和其他档案数据,加密到 `.tz` 文件中以便以后访问。age 是用户友好的,使其非常容易随时加密。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/linux-age
作者:[Sumantro Mukherjee][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sumantro
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/document_free_access_cut_security.png?itok=ocvCv8G2 (Scissors cutting open access to files)
[2]: https://github.com/FiloSottile/age
[3]: https://github.com/FiloSottile/age#installation
[4]: https://opensource.com/article/20/11/macports
[5]: https://opensource.com/article/20/6/homebrew-mac
[6]: https://opensource.com/article/20/3/chocolatey

View File

@@ -3,18 +3,18 @@
[#]: author: "Julia Evans https://jvns.ca/"
[#]: collector: "lujun9972"
[#]: translator: "zepoch"
[#]: reviewer: " "
[#]: reviewer: "turbokernel"
[#]: publisher: " "
[#]: url: " "
从实际代码开始编写好的示例
======
我写关于编程的事情时,我花费了大量时间在生产好的示例上。我从未见过有人写过关于如何写出好的示例,所以我就写了一下如何写出一份好的示例。
编写程序时,我花费了大量时间在编写好的示例上。我从未见过有人写过关于如何写出好的示例,所以我就写了一下如何写出一份好的示例。
基础的就是你真的去写代码,然后删除不相关的细节,使其成为一个自成一体的例子,而不是无中生有地想出一些例子。
基础思路就是从你写的真实代码开始,然后删除不相关的细节,使其成为一个独立的例子,而不是无中生有地想出一些例子。
我将会谈论两种示例:实例和令人惊讶的例子
我将会谈论两种示例:基于真实案例的示例和奇怪的示例
### 好的示例是真实的
@@ -25,10 +25,10 @@ numbers = [1, 2, 3, 4]
squares = map(lambda x: x * x, numbers)
```
我觉得这个示例不真实的,有两方面的原因:
我觉得这个示例不真实的,有如下两方面的原因:
* 将一组数字作平方运算不是你想要在真的程序中完成的事,除非是项目 Euler 或某种东西(也有很多其它的更有可能的操作系统
* `map` 在 Python 中并不是很常用,即便是做这个我也更愿意写 `[x*x for x in numbers]`
* 将一组数字作平方运算不是在真的程序中完成的事,除非是项目 Euler 或某种东西(更多的可能是针对列表的操作)
* `map` 在 Python 中并不常用,即便是做这个我也更愿意写 `[x*x for x in numbers]`
一个更加真实的 Python lambdas 的示例是使用 `sort` 函数,就像这样:
@@ -37,11 +37,11 @@ children = [{"name": "ashwin", "age": 12}, {"name": "radhika", "age": 3}]
sorted_children = sorted(children, key=lambda x: x['age'])
```
但是这个示例是被精心设计的(为什么我们需要按照年龄对这些孩子进行排序呢?)。所以我们如何来做一个真实的示例呢?
但是这个示例是被精心设计的(为什么我们需要对这些孩子按照年龄进行排序呢?)。所以我们如何来做一个真实的示例呢?
### 如何让你的示例真实起来:看你写实际代码
### 如何让你的示例真实起来:看你写实际代码
我认为最简单的来生成一个例子的方法就是,不是凭空出现一个例子(就像我用那个`儿童`的例子),而只是从真正的代码开始!
我认为最简单的来生成一个例子的方法就是,不是凭空出现一个例子(就像我用那个`儿童`的例子),而只是从真正的代码开始!
举一个例子吧,如果我要用 `sort.+key` 来编写一串 Python 代码,我会发现很多我按某个标准对列表进行排序的真实例子,例如:
@@ -50,19 +50,18 @@ sorted_children = sorted(children, key=lambda x: x['age'])
* `sorted_keysizes = sorted(scores.keys(), key=scores.get)`
* `shows = sorted(dates[date], key=lambda x: x['time']['performanceTime'])`
在这里很容易看到一个规律——这些大都是按时间排序的!因此,您可以明白如何轻松地将按时间排序的某些对象(电子邮件、事件等)的简单实例放在一起。
在这里很容易看到一个规律——这些基本是按时间排序的!因此,您可以明白如何将按时间排序的某些对象(电子邮件、事件等)的简单实例轻松地放在一起。
### 现实的例子有助于"推销"你试图解释的概念
### 现实的例子有助于"布道"你试图解释的概念
当我试图去解释一个想法(就好比 Python Lambdas的时候我通常也会试图说服读者说这是值得学习的想法。Python lambdas 是如此的有用!当我去试图说服某个人 lambdas 是很好用的时候,让他想象一下 lambdas 如何帮助他们完成一项他们将要去做的任务或是以及一项他们以前做过的任务,对说服他会很有帮助。
### 从真实代码中提炼出示例可能需要很长时间
The example I just gave of explaining how to use `sort` with `lambda` is pretty simple and it didnt take me a long time to come up with, but turning real code into a standalone example can take a really long time!
我给出的解释如何使用 `lambda``sort` 函数的例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码为一个独立的示例则是会需要花费很长的时间
我给出如何使用 `lambda``sort` 函数的解释例子是十分简单的,它并不需要花费我很长时间来想出来,但是将真实的代码提炼出为一个独立的示例则是会需要花费很长的时间
举个例子,我想在这篇文章中融入一些奇怪的 CSS 行为的例子来说明创造一个怪异或令人惊讶的案例是十分有趣的。我花费了两个小时来解决我这周遇到的一个实际的问题,确保我理解 CSS 的实际情况,并将其变成一个迷你的示例。
举个例子,我想在这篇文章中融入一些奇怪的 CSS 行为的例子来说明创造一个怪的案例是十分有趣的。我花费了两个小时来解决我这周遇到的一个实际的问题,确保我理解 CSS 的实际情况,并将其变成一个示例。
最后,它“仅仅”用了[五行 HTML 和一点点的 CSS][1] 来说明了这个问题,看起来并不想是我花费了好多小时写出来的。但是最初它却是几百行的 JS/CSS/JavaScript它需要花费很长时间来将所有的代码化为核心的很少的代码。
@@ -70,10 +69,10 @@ The example I just gave of explaining how to use `sort` with `lambda` is pretty
### 就这么多了!
我觉得关于示例还有更多可以去讲的——我觉得还有几个不同类型的有用示例,例如
我觉得还有更多关于示例可以去讲的——几种不同类型的有用示例,例如
* 可以更多的改变人的思维而不是直接提供使用的代码的让读者感到惊喜的示例
* 易于复制粘贴以用作起点的示例
* 可以更多的改变人的思维而不是直接提供使用的惊喜读者的示例代码
* 易于复制粘贴以用作初始化的示例
@@ -86,7 +85,7 @@ via: https://jvns.ca/blog/2021/07/08/writing-great-examples/
作者:[Julia Evans][a]
选题:[lujun9972][b]
译者:[zepoch](https://github.com/zepoch)
校对:[校对者ID](https://github.com/校对者ID)
校对:[turbokernel](https://github.com/turbokernel)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,99 @@
[#]: subject: (Converseen for Batch Processing Images on Linux)
[#]: via: (https://itsfoss.com/converseen/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
在 Linux 上批量处理图像的 Converseen
======
Converseen 是一个免费的开源软件,用于批量图像转换。有了这个工具,你可以一次将多张图片转换成另一种格式,调整大小,改变它们的长宽比,旋转或翻转它们。
对于像我这样的人来说,这是一个很方便的工具,我必须处理多个不同大小的截图,但在上传到网站之前必须调整它们的大小。
批量转换工具在这种情况下有很大的帮助。这可以在 Linux 命令行中用不错的 [ImageMagick][1] 来完成,但在这里使用 GUI 工具要容易得多。实际上Converseen 在基于 Qt 的图形用户界面下使用 ImageMagick。
### 用 Converseen 批量处理图像
你可以用 [Converseen][2] 通过鼠标点击来转换、调整大小、旋转和翻转多个图像。
你有很多支持批量转换的选项。你可以在你的选择中添加更多的图片,或者删除其中的一些。你可以选择只转换你选择的几张图片。
在调整图像大小时,你可以选择保持长宽比。请记住,在宽度和高度中,你最后改变/输入的那个是控制长宽比的那个。所以,如果你想在保持长宽比的情况下调整大小,但要根据宽度来调整,不要修改高度栏。
![][3]
你也可以选择将转换后的图像以不同的名称保存在同一目录或其他位置。你也可以覆盖现有的图像。
你不能添加文件夹,但你可以一次选择并添加多个图像。
你可以将图像转换为多种格式,如 JPEG、JPG、TIFF、SVG 等。
在改变格式的同时,还有一个选项可以给透明背景以某种颜色。你还可以设置压缩级别的质量。
![][4]
Converseen 还可以导入 PDF 文件,并将整个 PDF 或其中的一部分转换为图像。然而,在 Ubuntu 21.04 中,每次我试图转换一个 PDF 文件时,它就会崩溃。
### 在 Linux 上安装 Converseen
Converseen 是一个流行的应用。它在大多数 Linux 发行版仓库中都有。
你可以在你的发行版的软件中心搜索到它:
![][5]
当然,你也可以使用你的发行版的包管理器通过命令行来安装它。
在基于 Debian 和 Ubuntu 的发行版上,使用:
```
sudo apt install converseen
```
在 Fedora 上,使用:
```
sudo dnf install converseen
```
在 Arch 和 Manjaro 上,使用:
```
sudo pacman -Sy converseen
```
Converseen 也可用于 Windows 和 FreeBSD。你可以在项目网站的下载页面获得相关说明。
[下载 Converseen][6]
它的源码可在 GitHub 仓库[获取][7]。
如果你正在寻找一个更简单的方法来调整一张图片的大小,你可以使用这个巧妙的技巧,[在 Nautilus 文件管理器中用右键菜单调整图片大小和旋转图片][8]。
总的来说Converseen 是一个有用的用于批量图像转换的 GUI 工具。它并不完美,但在大多数情况下是有用的。你曾经使用过 Converseen 或者你使用类似的工具吗?你对它的体验如何?
--------------------------------------------------------------------------------
via: https://itsfoss.com/converseen/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://imagemagick.org/index.php
[2]: https://converseen.fasterland.net/
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-interface.png?resize=800%2C400&ssl=1
[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/converseen-features-overview_copy.png?resize=800%2C497&ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/install-converseen-linux.jpeg?resize=800%2C527&ssl=1
[6]: https://converseen.fasterland.net/download/
[7]: https://github.com/Faster3ck/Converseen
[8]: https://itsfoss.com/resize-images-with-right-click/