Merge branch 'LCTT:master' into master

This commit is contained in:
赵孝楠 2021-07-23 16:26:27 +08:00 committed by GitHub
commit 64047f8beb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 2628 additions and 902 deletions

View File

@ -0,0 +1,77 @@
分支与发行版有什么不同?
======
> 开源软件的发行版和分支是不一样的。了解其中的区别和潜在的风险。
![](https://img.linux.net.cn/data/attachment/album/202107/22/205518spblrgcpxrlnbibe.jpg)
如果你们对开源软件有过一段时间的了解,一定曾在许多相关方面中听说过<ruby>分支<rt>fork</rt></ruby><ruby>发行版<rt>distribution</rt></ruby>两个词。许多人对这两个词的区别不太清楚,因此我将试着通过这篇文章为大家解答这一疑惑。
LCTT 译注fork 一词,按我们之前的倡议,在版本控制工作流中,为了避免和同一个仓库的 branch 一词混淆,我们建议翻译为“复刻”。但是在项目和发行版这个语境下,没有这个混淆,惯例上还是称之为“分支”。)
### 首先,一些定义
在解释分支与发行版两者的细微区别与相似之处之前,让我们先给一些相关的重要概念下定义。
**[开源软件][1]** 是指具有以下特点的软件:
* 在特定的 [许可证][2] 限制下,软件供所有人免费分发
* 在特定的许可证限制下,软件源代码可以供所有人查看与修改
开源软件可以按以下方式 **使用**
* 以二进制或者源代码的方式下载,通常是免费的。(例如,[Eclipse 开发者环境][3]
* 作为一个商业公司的产品,有时向用户提供一些服务并以此收费。(例如,[红帽产品][4]
* 嵌入在专有的软件解决方案中。(例如一些智能手机和浏览器用于显示字体的 [Freetype 软件][5]
<ruby>自由开源软件<rt>free and open source software</rt></ruby>FOSS不一定是“零成本”的“<ruby>免费<rt>free</rt></ruby>”。自由开源软件仅仅意味着这个软件在遵守软件许可证的前提下可以自由地分发、修改、研究和使用。软件分发者也可能为该软件定价。例如Linux 可以是 Fedora、Centos、Gentoo 等免费发行版,也可以是付费的发行版,如红帽企业版 LinuxRHEL、SUSE Linux 企业版SLES等。
<ruby>社区<rt>community</rt></ruby>指的是在一个开源项目上协作的团体或个人。任何人或者团体都可以在遵守协议的前提下,通过编写或审查代码/文档/测试套件、管理会议、更新网站等方式为开源项目作出贡献。例如,在 [Openhub.net][6] 网站上,我们可以看见政府、非营利性机构、商业公司和教育团队等组织都在 [为一些开源项目作出贡献][7]。
一个开源<ruby>项目<rt>project</rt></ruby>是集协作开发、文档和测试的结果。大多数项目都搭建了一个中央仓库用来存储代码、文档、测试文件和目前正在开发的文件。
<ruby>发行版<rt>distribution</rt></ruby>是指开源项目的一份的二进制或源代码的副本。例如CentOS、Fedora、红帽企业版 LinuxRHEL、SUSE Linux、Ubuntu 等都是 Linux 项目的发行版。Tectonic、谷歌的 Kubernetes 引擎GKE、亚马逊的容器服务和红帽的 OpenShift 都是 Kubernetes 项目的发行版。
开源项目的商业发行版经常被称作<ruby>产品<rt>products</rt></ruby>,因此,红帽 OpenStack 平台是红帽 OpenStack 的产品,它是 OpenStack 上游项目的一个发行版,并且是百分百开源的。
<ruby>主干<rt>trunk</rt></ruby>是开发开源项目的社区的主要工作流。
开源<runy>分支<rt>fork</rt></ruby>是开源项目主干的一个版本,它是分离自主干的独立工作流。
因此,**发行版并不等同于分支**。发行版是上游项目的一种包装,由厂商提供,经常作为产品进行销售。然而,发行版的核心代码和文档与上游项目的版本保持一致。分支,以及任何基于分支的的发行版,导致代码和文档的版本与上游项目不同。对上游项目进行了分支的用户必须自己来维护分支项目,这意味着他们失去了上游社区协同工作带来的好处。
为了进一步解释软件分支,让我来用动物迁徙作比喻。鲸鱼和海狮从北极迁徙到加利福尼亚和墨西哥;帝王斑蝶从阿拉斯加迁徙到墨西哥;并且北半球的燕子和许多其他鸟类飞翔南方去过冬。成功迁徙的关键因素在于,团队中的所有动物团结一致,紧跟领导者,找到食物和庇护所,并且不会迷路。
### 独立前行带来的风险
一只鸟、帝王蝶或者鲸鱼一旦掉队就失去了许多优势,例如团队带来的保护,以及知道哪儿有食物、庇护所和目的地。
相似地,从上游版本获取分支并且独立维护的用户和组织也存在以下风险:
1. **由于代码不同,分支用户不能够基于上游版本更新代码。** 这就是大家熟知的技术债,对分支的代码修改的越多,将这一分支重新归入上游项目需要花费的时间和金钱成本就越高。
2. **分支用户有可能运行不太安全的代码。** 由于代码不同的原因,当开源代码的漏洞被找到,并且被上游社区修复时,分支版本的代码可能无法从这次修复中受益。
3. **分支用户可能不会从新特性中获益。** 拥有众多组织和个人支持的上游版本,将会创建许多符合所有上游项目用户利益的新特性。如果一个组织从上游分支,由于代码不同,它们可能无法纳入新的功能。
4. **它们可能无法和其他软件包整合在一起。** 开源项目很少是作为单一实体开发的;相反地,它们经常被与其他项目打包在一起构成一套解决方案。分支代码可能无法与其他项目整合,因为分支代码的开发者没有与上游的其他参与者们合作。
5. **它们可能不会得到硬件平台认证。** 软件包通常被搭载在硬件平台上进行认证,如果有问题发生,硬件与软件工作人员可以合作找出并解决问题发生的根源。
总之,开源发行版只是一个来自上游的、多组织协同开发的、由供应商销售与支持的打包集合。分支是一个开源项目的独立开发工作流,有可能无法从上游社区协同工作的结果中受益。
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/forks-vs-distributions
作者:[Jonathan Gershater][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[Wlzzzz-del](https://github.com/Wlzzzz-del)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://opensource.com/users/jgershat
[1]:https://opensource.com/resources/what-open-source
[2]:https://opensource.com/tags/licensing
[3]:https://www.eclipse.org/che/getting-started/download/
[4]:https://access.redhat.com/downloads
[5]:https://www.freetype.org/
[6]:http://openhub.net
[7]:https://www.openhub.net/explore/orgs

View File

@ -1,18 +1,20 @@
[#]: collector: (lujun9972)
[#]: translator: (tanloong)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13602-1.html)
[#]: 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 分析的高级教程
进阶教程:用 Python 和 NLTK 进行 NLP 分析
======
进一步学习自然语言处理的基本概念
![Brain on a computer screen][1]
在[之前的文章][2]里,我介绍了<ruby>自然语言处理<rt>NLP</rt></ruby>和宾夕法尼亚大学研发的自然语言处理工具包 ([NLTK][3])。我演示了用 Python 解析文本和定义停用词的方法,并介绍了语料库的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。
> 进一步学习自然语言处理的基本概念
![](https://img.linux.net.cn/data/attachment/album/202107/21/115633k8l9nkqowqkowpwm.jpg)
在 [之前的文章][2] 里,我介绍了<ruby>自然语言处理<rt>natural language processing</rt></ruby>NLP和宾夕法尼亚大学研发的<ruby>自然语言处理工具包<rt>Natural Language Toolkit</rt></ruby> ([NLTK][3])。我演示了用 Python 解析文本和定义<ruby>停顿词<rt>stopword</rt></ruby>的方法,并介绍了<ruby>语料库<rt>corpus</rt></ruby>的概念。语料库是由文本构成的数据集,通过提供现成的文本数据来辅助文本处理。在这篇文章里,我将继续用各种语料库对文本进行对比和分析。
这篇文章主要包括以下部分:
@ -21,38 +23,35 @@
* <ruby><rt>Tree</rt></ruby><ruby>树库<rt>treebank</rt></ruby>
* <ruby>命名实体识别<rt>Named entity recognition</rt></ruby>
### 词网和同义词集
### WordNet 和<ruby>同义词集<rt>synsets</rt></ruby>
<ruby>[词网][4]<rt>WordNet</rt></ruby> 是 NLTK 里的一个大型词汇数据库语料库。词网包含各单词的诸多<ruby>认知同义词<rt>cognitive synonyms</rt></ruby>(认知同义词常被称作“<ruby>同义词集<rt>synset</rt></ruby>”)。在词网里,名词、动词、形容词和副词,各自被组织成一个同义词的网络。
[WordNet][4] 是 NLTK 里的一个大型词典数据库。WordNet 包含各单词的诸多<ruby>认知同义词<rt>cognitive synonyms</rt></ruby> (一个认知同义词常被称作 synset)。在 WordNet 里,名词、动词、形容词和副词,各自被组织成一个同义词的网络
词网是一个很有用的文本分析工具。它有面向多种语言的版本(汉语、英语、日语、俄语和西班牙语等),也使用多种许可证(从开源许可证到商业许可证都有)。初代版本的词网由普林斯顿大学研发,面向英语,使用<ruby>类 MIT 许可证<rt>MIT-like license</rt></ruby>
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>Name</rt></ruby>| 此同义词集的名称 | 单词 `code` 有 5 个同义词集,名称分别是 `code.n.01``code.n.02``code.n.03`、`code.v.01` 和 `code.v.02`|
|<ruby>词性<rt>POS</rt></ruby>| 此同义词集的词性 | 单词 `code` 有 3 个名词词性的同义词集和 2 个动词词性的同义词集|
|<ruby>定义<rt>Definition</rt></ruby>| 该词作对应词性时的定义 | 动词 `code` 的一个定义是:(计算机科学)数据或计算机程序指令的<ruby>象征性排列<rt>symbolic arrangement</rt></ruby>|
|<ruby>例子<rt>Example</rt></ruby>| 使用该词的例子 | `code` 一词的例子We should encode the message for security reasons|
|<ruby>词元<rt>Lemma</rt></ruby>| 与该词相关联的其他同义词集(包括那些不一定严格地是该词的同义词,但可以大体看作同义词的);词元直接与其他词元相关联,而不是直接与<ruby>单词<rt>word</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>Antonym</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|
|<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`,你可以找到它们。
同义词集还有一些其他属性,在 `<你的 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())
@ -75,7 +74,6 @@ for synset in synsets:
将会显示:
```
5 synsets:
Name code.n.01
@ -116,7 +114,7 @@ Part Holonyms: []
Part Meronyms: []
```
<ruby>同义词集<rt>synsets</rt></ruby><ruby>词元<rt>lemmas</rt></ruby> WordNet 里是按照树状结构组织起来的,下面的代码会给出直观的展现:
<ruby>同义词集<rt>synset</rt></ruby><ruby>词元<rt>lemma</rt></ruby>词网里是按照树状结构组织起来的,下面的代码会给出直观的展现:
```
def hypernyms(synset):
@ -127,9 +125,9 @@ 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'),
@ -155,24 +153,23 @@ code.v.02 tree:
   ...
```
WordNet 并没有涵盖所有的单词和其信息 (现今英语有约 17,0000 个单词,最新版的 WordNet 涵盖了约 15,5000 个),但它开了个好头。掌握了 WordNet 的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的<ruby>“词网”<rt>WordNet</rt></ruby>
词网并没有涵盖所有的单词和其信息(现今英语有约 17,0000 个单词,最新版的 词网 涵盖了约 15,5000 个),但它开了个好头。掌握了“词网”的各个概念后,如果你觉得它词汇少,不能满足你的需要,可以转而使用其他工具。或者,你也可以打造自己的“词网”!
#### 自主尝试
使用 Python 库,下载维基百科的 [open source][5] 页面,并列出该页面所有单词的<ruby>同义词集<rt>synsets</rt></ruby><ruby> 词元<rt>lemmas</rt></ruby>
使用 Python 库,下载维基百科的 [open source][5] 页面,并列出该页面所有单词的<ruby>同义词集<rt>synset</rt></ruby><ruby>词元<rt>lemma</rt></ruby>
### 相似度比较
相似度比较的目的是识别出两篇文本的相似度,在搜索引擎、聊天机器人等方面有很多应用。
比如,相似度比较可以识别 football 和 soccer 是否有相似性。
比如,相似度比较可以识别 `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 分别比较
# 一个单词可能有多个 同义词集,需要把 word1 的每个同义词集和 word2 的每个同义词集分别比较
for s1 in syn1:
    for s2 in syn2:
        print("Path similarity of: ")
@ -180,9 +177,9 @@ for s1 in syn1:
        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 ]
@ -194,9 +191,9 @@ Synset('soccer.n.01') ( n ) [ a football game in which two teams of 11 players t
   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>中的最短距离)
两个词各个同义词集之间<ruby>路径相似度<rt>path similarity</rt></ruby>最大的是 0.5,表明它们关联性很大[<ruby>路径相似度<rt>path similarity</rt></ruby>][6]指两个词的意义在<ruby>上下义关系的词汇分类结构<rt>hypernym/hypnoym taxonomy</rt></ruby>中的最短距离
那么 code 和 bug 呢?这两个计算机领域的词的相似度是:
那么 `code``bug` 呢?这两个计算机领域的词的相似度是:
```
Path similarity of:
@ -215,7 +212,7 @@ Synset('bug.n.02') ( n ) [ a fault or defect in a computer program, system, or m
   is 0.09090909090909091
```
这些是这两个词各 synset 之间<ruby>路径相似度<rt>path similarity</rt></ruby>的最大值,这些值表明两个词是有关联性的。
这些是这两个词各同义词集之间<ruby>路径相似度<rt>path similarity</rt></ruby>的最大值,这些值表明两个词是有关联性的。
NLTK 提供多种<ruby>相似度计分器<rt>similarity scorers</rt></ruby>,比如:
@ -232,7 +229,7 @@ NLTK 提供多种<ruby>相似度计分器<rt>similarity scorers</rt></ruby>
使用 Python 库,从维基百科的 [Category: Lists of computer terms][7] 生成一个术语列表,然后计算各术语之间的相似度。
### <ruby><rt>tree</rt></ruby><ruby>树库<rt>treebank</rt></ruby>
### 树和树库
使用 NLTK你可以把文本表示成树状结构以便进行分析。
@ -240,7 +237,6 @@ NLTK 提供多种<ruby>相似度计分器<rt>similarity scorers</rt></ruby>
这是一份简短的文本,对其做预处理和词性标注:
```
import nltk
@ -251,8 +247,7 @@ words = nltk.tokenize.word_tokenize(text)
words_tagged = nltk.pos_tag(words)
```
要把文本转换成树状结构,你必须定义一个<ruby>语法<rt>grammar</rt></ruby> 。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。
要把文本转换成树状结构,你必须定义一个<ruby>语法<rt>grammar</rt></ruby>。这个例子里用的是一个基于 [Penn Treebank tags][8] 的简单语法。
```
# A simple grammar to create tree
@ -261,7 +256,6 @@ grammar = "NP: {&lt;JJ&gt;&lt;NN&gt;}"
然后用这个<ruby>语法<rt>grammar</rt></ruby>创建一颗<ruby><rt>tree</rt></ruby>
```
# Create tree
parser = nltk.RegexpParser(grammar)
@ -271,7 +265,6 @@ pprint(tree)
运行上面的代码,将得到:
```
Tree('S', [('I', 'PRP'), ('love', 'VBP'), Tree('NP', [('open', 'JJ'), ('source', 'NN')])])
```
@ -284,10 +277,7 @@ tree.draw()
![NLTK Tree][9]
(Girish Managoli, [CC BY-SA 4.0][10])
这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的主语 ([subject][11])
这个树状结构有助于准确解读文本的意思。比如,用它可以找到文本的 [主语][11]
```
subject_tags = ["NN", "NNS", "NP", "NNP", "NNPS", "PRP", "PRP$"]
@ -300,22 +290,22 @@ def subject(sentence_tree):
print("Subject:", subject(tree))
```
结果显示主语是 I
结果显示主语是 `I`
```
Subject: I
```
这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票1 月 1 号伦敦飞纽约的,机器人可以用这种分析方法解读这个指令:
这是一个比较基础的文本分析步骤,可以用到更广泛的应用场景中。 比如,在聊天机器人方面,如果用户告诉机器人:“给我妈妈 Jane 预订一张机票1 月 1 号伦敦飞纽约的,机器人可以用这种分析方法解读这个指令:
**动作**: 预订
**动作的对象**: 机票
**乘客**: Jane
**出发地**: 伦敦
**目的地**: 纽约
**日期**: (明年) 1 月 1 号
**日期**: (明年)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>的方法:
<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()
@ -326,8 +316,9 @@ 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:
@ -339,9 +330,9 @@ print(tagged_sents)
```
sent0 = tagged_sents[0]
pprint(sent0)
```
[/code] [code]
```
[('Pierre', 'NNP'),
 ('Vinken', 'NNP'),
 (',', ','),
@ -354,20 +345,20 @@ pprint(sent0)
```
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;}
Subject: {<NNP><NNP>}
SubjectInfo: {<CD><NNS><JJ>}
Action: {<MD><VB>}
Object: {<DT><NN>}
Stopwords: {<IN><DT>}
ObjectInfo: {<JJ><NN>}
When: {<NNP><CD>}
'''
parser = nltk.RegexpParser(grammar)
tree = parser.parse(sent0)
print(tree)
```
[/code] [code]
```
(S
  (Subject Pierre/NNP Vinken/NNP)
  ,/,
@ -385,28 +376,24 @@ print(tree)
图形化地显示:
```
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] 页面,将得到的文本以图形化的树状结构展现出来。
使用 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'
```
@ -427,9 +414,9 @@ ne_tagged = nltk.ne_chunk(pos_tagged)
print("NE tagged text:")
print(ne_tagged)
print()
```
[/code] [code]
```
NE tagged text:
(S
  (PERSON Peterson/NNP)
@ -454,9 +441,9 @@ 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')]
@ -471,28 +458,24 @@ 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>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])。
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>做贡献的时间和地点。
使用 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],然后:
使用 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 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。
@ -508,7 +491,7 @@ 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)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -0,0 +1,197 @@
[#]: subject: (Configuring Vim as a Writing Tool)
[#]: via: (https://news.itsfoss.com/configuring-vim-writing/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13607-1.html)
将 Vim 配置成一个写作工具
======
> 我使用 Vim 来写小说。我是这样配置它的。
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/Setting-Up-Vim-for-Writing.jpg?w=1200&ssl=1)
在我的第一个专栏中,我谈到了我为什么把 [我的写作工作迁移到了 Vim 上][1] —— 远离了现代写作者们的标准工具如文字处理器MS Word 及它的开源替代方案)、文本编辑器(记事本,因为直到去年我一直是 Windows 用户)和云存储技术。如果你是一个写作者,在继续下面的内容前,我建议你先阅读一下 [那篇文章的第一部分][1] 。
基本上可以说,你使用的设备越多,你需要的写作工具就越多,最终你的工作流程就越复杂。这一点对我来说是很贴切的,因为我有四台设备,包括一部安卓手机,一台日常用的运行 Linux 的主力笔记本电脑,还有两台旧的笔记本电脑,其中一台是 Mac我去户外拍摄时会带着它。
Vim 对于我和我的工作方式来说是一个完美的解决方案;虽然我不会说我的新的工作流程是现代写作者工作的最佳方式,但我可以说的是,对于写作者来说,拥有一个能在我们所有设备上工作的工具非常重要的,并且这个工具要足够强大以满足我们写作者每天从事的不同类型的写作需求。
从这个角度来看Vim 的主要优势是它是跨平台的 —— 无论在什么设备上Vim 都能工作。在苹果生态系统中使用 Vim 的情况我就不细说了,但粗略地看一下 [这个应用程序][2] 的评论,我就会知道,总会有人在各种地方使用 Vim不管他们使用的是什么设备。
现在我们假设你是一个想开始使用 Vim 的写作者。当你安装了它,你该从哪里开始呢?
我在这一部分给你的并不算是教程,而是一系列的建议,包含对一个用于诗歌写作的 `.vimrc` 配置文件的解读。只要有可能,我就会链接到我学习相应内容时用到的 YouTube 上的教程。
对于 Linux 用户来说,系统已经预装了 Vim —— 通过你喜欢的终端模拟器就可以启动它。对于 Windows 和 Mac 用户,你可以从 [Vim 官方网站][3] 下载它。
### 建议
**安装/启用 Vim 后**
* 通过终端打开 Vim Tutor。Mac 用户可以用这种方式启动,而 Windows 用户也可以用这种方法启动。[LCTT 译注:原文这里本应该有链接,可能作者忘记添加了。无论如何,在终端中, Linux 中的命令是 `vimtutor`Windows 在安装目录下找到 `vimtutor.bat` 命令并运行Mac应该与 Linux 一样?我没 Mac 呀!])在这个阶段,你不会使用 Vim 进行任何写作 —— 相反,你要每天花 15 分钟做 Vim 教程。不要多花一分钟或少花一分钟;看看在规定的 15 分钟内,你能在教程中取得多大的进展。你会发现,每天你都会在教程中取得更大的进步。在一个月内,你应该能够利用这些 15 分钟完成整个教程。
* 成为一个更好的打字员对 Vim 的使用来说有极大的好处。这不是必须的,但我正在重新学习打字,它的副作用是使 Vim 变得更加有用了。我每次都以花 15 分钟练习打字开始,作为进入 Vim 教程前的热身。
在每一天的开始,我分配了 30 分钟的时间做这两项练习进行热身,而每天晚上睡觉前再分配 30 分钟进行练习以让我安定下来。这样的做法帮我快速从旧的工具包过渡到了 Vim但你的安排可能有所不同。
我再次强调,**除了 Vim Tutor 之外**,上述步骤都是可选的;这完全取决于你个人的动机水平。
现在我们来到了这篇文章的重点:如何配置 Vim ,使它对写作者友好?
### 如何配置用于写作的 .vimrc
在开始之前,我想在这里提醒各位读者,我不是一个技术人员 —— 我是一个小说家 —— 你在下面看到的任何错误都是我自己的;我希望有经验的 Vim 用户能提供反馈,告诉我如何进一步完善我的配置文件。
下面是我的 `.vimrc` 文件。你可以从我的 [GitHub][4] 上下载,并进一步完善它:
```
syntax on
set noerrorbells " 取消 Vim 的错误警告铃声,关闭它以免打扰到我们
set textwidth=100 " 确保每一行不超过 100 字符
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set linebreak
set number
set showmatch
set showbreak=+++
set smartcase
set noswapfile
set undodir=~/.vim/undodir
set undofile
set incsearch
set spell
set showmatch
set confirm
set ruler
set autochdir
set autowriteall
set undolevels=1000
set backspace=indent,eol,start
" 下面的设置确保按写作者而不是程序员喜欢的方式折行
set wrap
nnoremap <F5> :set linebreak<CR>
nnoremap <C-F5> :set nolinebreak<CR>
call plug#begin('~/.vim/plugged')
" 这是颜色风格插件
Plug 'colepeters/spacemacs-theme.vim'
Plug 'sainnhe/gruvbox-material'
Plug 'phanviet/vim-monokai-pro'
Plug 'flazz/vim-colorschemes'
Plug 'chriskempson/base16-vim'
Plug 'gruvbox-community/gruvbox'
" 这是为了更容易的诗歌写作选择的一些插件
Plug 'dpelle/vim-LanguageTool'
Plug 'ron89/thesaurus_query.vim'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'reedes/vim-pencil'
Plug 'reedes/vim-wordy'
" 这一部分是为了更容易地与机器集成,用了 vim-airline 这类插件
Plug 'vim-airline/vim-airline'
" 这一部分外理工作区和会话管理
Plug 'thaerkh/vim-workspace'
" 与上面插件相关, 下面的代码将你的所有的会话文件保存到一个你工作区之外的目录
let g:workspace_session_directory = $HOME . '/.vim/sessions/'
" 与上面插件相关,这是一个 Vim 活动的跟踪器
Plug 'wakatime/vim-wakatime'
" 一个干扰因素:我在这里使用了一些 Emacs 的功能,特别是 org-mode
Plug 'jceb/vim-orgmode'
" 这是文件格式相关插件
Plug 'plasticboy/vim-markdown'
call plug#end()
colorscheme pacific
set background=dark
if executable('rg')
let g:rg_derive_root='true'
endif
```
学习如何安装 Vim 插件时,这个[教程](https://www.youtube.com/watch?v=n9k9scbTuvQ)帮助了我。我使用 Vim Plugged 插件管理器是因为在我看来它是最简单、最优雅的。
![][5]
#### 对于写作者的 .vimrc 选项的整理
* `syntax on`:这可以确保 Vim 知道我在使用什么语法。做笔记、写这种文章时我主要使用 Markdown而在写小说的时候纯文本是我的首选格式。
* `set noerrorbells`:为了你的精神状态,我强烈建议打开这个选项。
* `set textwidth=100`:为了便于阅读,没有人愿意横向滚动一个文本文件。
* `set spell`:如果有拼写错误的话提醒你。
* `set wrap`:确保文本以写作者而不是程序员的方式进行折行。
你会注意到,我没有花更多时间讨论其他一些基本配置选项,因为我并不觉得那些对写作者来说有多重要。因为我做一些业余的编码工作,所以我的 `.vimrc` 配置反映了这一点。如果你只想在 Vim 上写作,那么上述配置就应该能让你顺利开始。
从这点上来说,你的 `.vimrc` 是一个活的文档,它能生动地反映你想用 Vim 做什么,以及你希望 Vim 如何为你做这些事情。
#### 关于插件的说明
第 43-98 行之间是我对插件的配置。如果你已经学习了关于如何安装 Vim 插件的教程,我强烈推荐你从以下专为写作开发的 Vim 插件开始:
* `vim-LanguageTool`
* `thesaurus_query.vim`
* `vim-pencil`
* `vim-wordy`
* `vim-goyo`
* `vim-markdown`
#### 总结
在这篇文章中,我们简单地[介绍](https://youtu.be/Pq3JMp3stxQ)了写作者可以怎样开始使用 Vim以及一个在写作工作中需要的 `.vimrc` 入门配置。除了我的 `.vimrc` 之外,我还将在这里链接到我在 GitHub 上发现的其他写作者的 `.vimrc`,它们是我自己配置时的灵感来源。
![][6]
请劳记,这只是一个写作者的 `.vimrc` 的入门配置。你会发现随着你的需求的发展Vim 也可以随之发展。因此,投入一些时间学习配置你的 `.vimrc` 是值得的。
在下一篇文章中,我将会检视我在写作时的工作流程的具体细节,这个工作流程中我使用了 Vim 和 Git 及 GitHub。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/configuring-vim-writing/
作者:[Theena][a]
选题:[lujun9972][b]
译者:[piaoshi](https://github.com/piaoshi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/theena/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/how-i-started-loving-vim/
[2]: https://apps.apple.com/us/app/ivim/id1266544660
[3]: https://www.vim.org/
[4]: https://github.com/MiragianCycle/dotfiles
[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1
[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1

View File

@ -3,36 +3,40 @@
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13604-1.html)
作为一个写作者如何使用Git版本控制
作为一个写作者如何使用 Git 版本控制
======
> 我使用 Vim 和 Git 来写小说。是的,你也可以用 Git 来完成非编码任务。
![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Using-Git-for-Writing.jpg?w=1200&ssl=1)
我相信当代的写作者们应该开始思考他们的工作流程了。
在一个注意力高度分散的世界里,作为写作者,我们必须对每天执行的任务链拥有控制权。传统上,作家们会把他们的写作放在分散注意力的事较少、注意力高度集中的时间段。不幸的是,海明威、阿特伍德们的这些建议不再真正适用于我们了。我们所生活的世界联系得更紧密了,因此对作家来说就有了更多的陷阱。这首先要求我们要有足够的自制力,不要让社交媒体或小狗和小猫的可爱视频在我们写作的时候分散我们的注意力。
但是,如果你的写作需要快速地检查事实、拼写不常见和技术性的词汇等,断开与互联网连接并不是一个现实的选项——这正是我写作时的场景。另一个问题是你用于写作的应用程序本身的干扰;作为一个长期使用 MS Word 的人,我发现它越来越漂亮,但速度越来越慢,也越来越让人分心。作为当初我[迁移到 Vim 的主要原因][1]之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。
但是,如果你的写作需要快速地检查事实、拼写不常见和技术性的词汇等,断开与互联网连接并不是一个现实的选项 —— 这正是我写作时的场景。另一个问题是你用于写作的应用程序本身的干扰;作为一个长期使用 MS Word 的人,我发现它越来越漂亮,但速度越来越慢,也越来越让人分心。作为当初我 [迁移到 Vim 的主要原因][1] 之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。
因为我已经详细介绍过了[我为什么转向 Vim][2]和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如gitGitHub
因为我已经详细介绍过了 [我为什么转向 Vim][2] 和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如 GitGitHub
### 什么是版本控制?再来一次?
![Source: https://git-scm.com/][3]
上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作——因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。
上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作 —— 因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。
上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具——包括 Gmail 或我们的电子邮件客户端——来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的——我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。
上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具(包括 Gmail 或我们的电子邮件客户端)来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。
读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎没有,或者说并不强大。
读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎不存在,或者说并不强大。
### 一个更好的工作流程
就像地球上的其它地方一样,大流行病的开始引发了一些焦虑和一些反思。我利用这段时间在 [The Odin Project][4](强烈推荐给那些想学习 html、CSS、JavaScript/Ruby 的人)上自学了网络开发。
在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _git_ 正是我作为一个写作者所要寻找的东西。
在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _Git_ 正是我作为一个写作者所要寻找的东西。
是的,更好的方法不是本地化的版本控制,而是 _分布式_ 的版本控制。“分布式”描述的是设备的分布,而我在这些设备上访问文件,以及之后进行编辑修改。下图是分布式版本控制的一个直观说明。
@ -44,7 +48,7 @@
* 使我的稿件库可以从任何地方、任何设备上访问
* 易于使用
* 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦——尽可能使用同一工具(即 Vim
* 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦 —— 尽可能使用同一工具(即 Vim
* 可扩展性
* 易于维护
@ -52,7 +56,7 @@
![][6]
如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述:
如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 Git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述:
![][8]
@ -68,9 +72,9 @@
你们中的写作者一定想知道这个系统存在什么缺点。以下是我在持续使用和完善这一工作流程时预计到的几个问题。
* 对草稿的评论:文字处理器的一个更有用的功能是具有评论的功能。当我希望以后再回到文本的某一部分时,我经常在这部分为自己留下一个评论。我仍然没有想出一个解决这个问题的办法。
* 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 markdown 写文案,并通过 Pandoc 将 markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。
* 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 Markdown 写文案,并通过 Pandoc 将 Markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。
我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的[用于写作的开源工具][10]和版本控制越来越熟悉和适应,我将进一步完善这个方法。
我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的 [用于写作的开源工具][10] 和版本控制越来越熟悉和适应,我将进一步完善这个方法。
我希望这篇文章能为那些想使用 Git 进行文档版本控制的写作者提供一个很好的介绍。这肯定不是一篇详尽的文章,但我将分享一些有用的链接,使你的旅程更容易。
@ -78,8 +82,6 @@
2. [开始使用 Git][12]
3. GitHub 的 Git 基础知识教程
作为彩蛋,这里有一段我在安卓设备上使用 Vim 处理一首诗,并将改动推送到 Git 的屏幕录像。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/version-control-writers/
@ -87,7 +89,7 @@ via: https://news.itsfoss.com/version-control-writers/
作者:[Theena][a]
选题:[lujun9972][b]
译者:[piaoshi](https://github.com/piaoshi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
@ -95,12 +97,12 @@ via: https://news.itsfoss.com/version-control-writers/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/how-i-started-loving-vim/
[2]: https://news.itsfoss.com/configuring-vim-writing/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/local.png?w=800&ssl=1
[4]: https://www.theodinproject.com/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgwMCIgd2lkdGg9IjY2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwNSIgd2lkdGg9IjYxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/distributed.png?w=668&ssl=1
[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Version_Control.png?w=617&ssl=1
[7]: https://itsfoss.com/recommends/pcloud/
[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc1MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/Version_Control_2.png?w=886&ssl=1
[9]: https://www.youtube.com/watch?v=NtH-HhaLw-Q
[10]: https://itsfoss.com/open-source-tools-writers/
[11]: https://www.theodinproject.com/paths/foundations/courses/foundations/lessons/introduction-to-git

View File

@ -0,0 +1,108 @@
[#]: 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: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13601-1.html)
FreeDOS 简史
======
> 经历了近 30 年的发展, FreeDOS 已经成为了世界先进的 DOS。
![](https://img.linux.net.cn/data/attachment/album/202107/21/104903zzxiyc4i4gkpxiph.jpg)
> 一个大师正在给他的一个弟子讲 [编程之道][2]。 “编程之道包含在所有的软件中 —— 不管它多么微不足道,” 大师说道。
>
> “编程之道在手持计算器里面吗?” 弟子问道。
>
> “是的,” 大师回答道。
>
> “编程之道在电子游戏里面吗?” 弟子继续问道。
>
> “即便是电子游戏中,” 大师说。
>
> “那编程之道在个人电脑的 DOS 里面吗?”
>
> 大师咳嗽了一下,稍稍改变了一下姿势,说道,“今天的课就到这里吧。”
>
> ——《编程之道》Geoffrey JamesInfoBooks1987
过去,计算仅限于昂贵的大型机和“大铁疙瘩”计算机系统,如 PDP 11。但是微处理器的出现在 20 世纪 70 年代带来了一场计算革命。你终于可以在家里有一台电脑了——“个人电脑”时代已经到了!
我记得看到的最早的个人电脑包括 Commodore、TRS-80 和 Apple。个人电脑成了一个热门话题所以 IBM 决定进入这个市场。在经历了一个快速开发周期之后IBM 于 1981 年 8 月发布了 IBM 5150 个人电脑最初的“IBM PC”
从零开始创建一台计算机并非易事,因此 IBM 以用“现成”的硬件来构建 PC 而闻名,并从外部开发商那里获得了其他组件的授权。其中之一是微软授权的操作系统。反过来,微软从西雅图计算机产品公司获得了 86-DOS ,进行了各种更新,并将新版本作为 IBM PC-DOS 与 IBM PC 一起首次亮相。
### 早期的 DOS
运行在最多只有 640 千字节内存中的 DOS除了管理硬件和允许用户启动应用程序之外真的做不了什么。因此PC-DOS 1.0 命令行非常贫乏只包含了一些设置日期和时间、管理文件、控制终端和格式化软盘的命令。DOS 还包括一个 BASIC 语言解释器,这是那个时代所有个人计算机的一个标准功能。
直到 PC-DOS 2.0DOS 才变得更加有趣,为命令行添加了新的命令,并包含了其他有用的工具。但对我来说,直到 1991 年的 MS-DOS 5.0 才有了“现代感”。微软在这个版本中对 DOS 进行了大修,更新了许多命令,并用一个新的全屏编辑器取代了老旧的 Edlin 编辑器使之更方便用户使用。DOS 5 还包括我喜欢的其他特性,比如基于微软 QuickBASIC 编译器的新 BASIC 解释器,简称 QBASIC. 如果你曾经在 DOS 上玩过 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并决定“如果 Windows 3.2 或 Windows 4.0 会像 Windows 3.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`、`sed` 和 `tr`
虽然 FreeDOS 的开发已经放缓,但它并没有停止。开发人员继续为 FreeDOS 编写新程序,并向 FreeDOS 添加新功能。我对 FreeDOS 1.3 RC4 的几个重要补充感到特别兴奋FreeDOS 1.3 RC4 是即将发布的 FreeDOS 1.3 的最新候选版本。最近的一些更新如下:
* Mateusz Viste 创建了一个新的电子书阅读器,名为 Ancient Machine BookAMB我们利用它作为 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 上运行XT、286、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)
校对:[wxy](https://github.com/wxy)
本文由 [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,91 @@
[#]: subject: (You Can Now Use KDE Connect in Windows as Well)
[#]: via: (https://news.itsfoss.com/kde-connect-windows/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
You Can Now Use KDE Connect in Windows as Well
======
KDE Connect is a popular open-source tool that lets you share a connection between a phone and your computer.
While it was always limited to the Linux platform, it looks like that it is coming to Windows after all.
And, cross-platform availability of software is always a good thing.
### What is KDE Connect?
In case you are coming across it for the first time—KDE connect lets you share files, links, sync notifications, gives you the ability to reply to messages, and more.
You can also choose to control your desktop and perform some custom commands remotely. And, you can also use your phone to control the volume/skip the music playing on your computer.
### KDE Connect Available as Beta in Microsoft Store
![][1]
As per a Reddit thread posted a few weeks back, a KDE contributor mentions that the beta version is available from the [Microsoft Store][2].
However, it is only accessible through the private link and cannot be found when you search for it in the Microsoft Store.
This also marks official support for Windows.
![][3]
### KDE Connect for Windows: Heres How it Looks
![][4]
You just need to make sure that both of your devices are connected to the same network.
Next, all you have to do is pair them and then start sharing files/links, browse your phone, and also get notifications.
You can choose to tweak some of the options that include storage paths for shared images or change the sound to play when you try to ring the device.
![][5]
As you can notice here, you have a variety of options to make use of.
I tried connecting my Android device for a while, and it worked just fine. You may want to explore more to learn what else you can do with it.
### Why is it Good News for Windows Users?
Undoubtedly Windows users already had plenty of options to achieve the same functions without KDE Connect. But with KDE connect onboard, it will finally provide the opportunity to use an open-source and privacy-friendly tool that they can pair their devices with.
After all, you would not want your notifications, and links/files that you share to be spied upon by a shoddy third-party application.
In that case, KDE Connect is your friend.
Even though it is in beta right now. You can try it out by visiting the link and installing it from the Microsoft store.
[KDE Connect on Microsoft Store][2]
**Via**: [Omg!Ubuntu!][6]
#### 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/kde-connect-windows/
作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIyOCIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://www.microsoft.com/en-gb/p/kde-connect/9n93mrmsxbf0?&activetab=pivot:overviewtab
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: https://www.omgubuntu.co.uk/2021/07/kde-connect-windows-app

View File

@ -0,0 +1,73 @@
[#]: subject: (Ubuntu 20.10 Reached End of Life, Time to Upgrade!)
[#]: via: (https://news.itsfoss.com/ubuntu-20-10-end-of-life/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Ubuntu 20.10 Reached End of Life, Time to Upgrade!
======
Ubuntu 20.10 (Groovy Gorilla) has reached its end of life today (July 22, 2021). It was a non-LTS release that [introduced some exciting features][1].
Usually, non-LTS releases are maintained for up to 9 months. So, with 20.10 reaching the end of life means there will be no security and maintenance updates for Ubuntu 20.10 users.
You will also miss out on updates to installed applications, and face issues installing new applications [using the apt command][2]. Using the Software Center is going to be a problem as well, without manually modifying sources.list (which is not recommended).
The end of life applies to all other Ubuntu flavors like Kubuntu, Lubuntu, MATE, etc.
While distributions like Linux Mint and elementary OS do not rely on non-LTS releases, you have nothing to worry about there.
It is also a good idea to [check your Ubuntu version][3] installed with this command in the terminal:
```
lsb_release -a
```
### Upgrade to Ubuntu 21.04 (Hirsute Hippo): Its Time!
It is a no-brainer that you need to upgrade to Ubuntu 21.04 to get the latest updates and security improvements.
[Ubuntu 21.10 release][4] is only a few months later—so you can try upgrading to it when that is available as well.
For now, you can follow our [Ubuntu upgrade][5] tutorial to get started.
I would recommend you to make a backup, in case things go bad with the upgrade process.
If you want to perform a fresh installation, you can do that as well.
### Still Using Ubuntu 20.10?
Technically, you can choose to keep using the unsupported version. However, if you do not want security issues to creep up, it is recommended to upgrade to the newest version available i.e Ubuntu 21.04.
Ubuntu 21.04 will be supported until January 2022. You might want to check out the [features in Ubuntu 21.04][6] before making the jump.
_How was your experience so far with Ubuntu 20.10? Have you upgraded yet? Let me know 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/ubuntu-20-10-end-of-life/
作者:[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://itsfoss.com/ubuntu-20-10-features/
[2]: https://itsfoss.com/apt-command-guide/
[3]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
[4]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/
[5]: https://itsfoss.com/upgrade-ubuntu-version/
[6]: https://news.itsfoss.com/ubuntu-21-04-features/

View File

@ -1,82 +0,0 @@
Wlzzzz-del is translating.
What's the difference between a fork and a distribution?
======
![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/spoons_forks_520x292_jh.png?itok=DzEzZBuG)
If you've been around open source software for any length of time, you'll hear the terms fork and distribution thrown around casually in conversation. For many people, the distinction between the two isn't clear, so here I'll try to clear up the confusion.
### First, some definitions
Before explaining the nuances of a fork vs. a distribution and the pitfalls thereof, let's define key concepts.
**[Open source software][1]** is software that:
* Is freely available to distribute under certain [license][2] restraints
* Permits its source code to be viewable and modified under certain license restraints
Open source software can be **consumed** in the following ways:
* Downloaded in binary or source code format, often at no charge (e.g., the [Eclipse developer environment][3])
* As a distribution (product) by a vendor, sometimes at a cost to the user (e.g., [Red Hat products][4])
* Embedded into proprietary software solutions (e.g., some smartphones and browsers display fonts using the open source [freetype software][5])
**Free and open source (FOSS)** is not necessarily "free" as in "zero cost." Free and open source simply means the software is free to distribute, modify, study, and use, subject to the software's licensing. The software distributor may attach a purchase price to it. For example, Linux is available at no cost as Fedora, CentOS, Gentoo, etc. or as a paid distribution as Red Hat Enterprise Linux, SUSE, etc.
**Community** refers to the organizations and individuals that collaboratively work on an open source project. Any individual or organization can contribute to the project by writing or reviewing code, documentation, test suites, managing meetings, updating websites, etc., provided they abide by the license. For example, at [Openhub.net][6], we see government, nonprofit, commercial, and education organizations [contributing to some open source projects][7].
**project** is the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed.
An open sourceis the result of this collaborative development, documentation, and testing. Most projects have a central repository where code, documentation, testing, and so forth are developed.
A **distribution** is a copy, in binary or source code format, of an open source project. For example, CentOS, Fedora, Red Hat Enterprise Linux, SUSE, Ubuntu, and others are distributions of the Linux project. Tectonic, Google Kubernetes Engine, Amazon Container Service, and Red Hat OpenShift are distributions of the Kubernetes project.
Vendor distributions of open source projects are often called **products** , thus Red Hat OpenStack Platform is the Red Hat OpenStack product that is a distribution of the OpenStack upstream project—and it is still 100% open source.
The **trunk** is the main workstream in the community where the open source project is developed.
An open source **fork** is a version of the open source project that is developed along a separate workstream from the main trunk.
Thus, **a distribution is not the same as a fork**. A distribution is a packaging of the upstream project that is made available by vendors, often as products. However, the core code and documentation in the distribution adhere to the version in the upstream project. A fork—and any distribution based on the fork—results in a version of the code and documentation that are different from the upstream project. Users who have forked upstream open source code have to maintain it on their own, meaning they lose the benefit of the collaboration that takes place in the upstream community.
To further explain a software fork, let's use the analogy of migrating animals. Whales and sea lions migrate from the Arctic to California and Mexico; Monarch butterflies migrate from Alaska to Mexico; and (in the Northern Hemisphere) swallows and many other birds fly south for the winter. The key to a successful migration is that all animals in the group stick together, follow the leaders, find food and shelter, and don't get lost.
### Risks of going it on your own
A bird, butterfly, or whale that strays from the group loses the benefit of remaining with the group and knowing where to find food, shelter, and the desired destination.
Similarly, users or organizations that fork and modify an upstream project and maintain it on their own run the following risks:
1. **They cannot update their code based on the upstream because their code differs.** This is known as technical debt; the more changes made to forked code, the more it costs in time and money to rebase the fork to the upstream project.
2. **They potentially run less secure code.** If a vulnerability is found in open source code and fixed by the community in the upstream, a forked version of the code may not benefit from this fix because it is different from the upstream.
3. **They might not benefit from new features.** The upstream community, using input from many organizations and individuals, creates new features for the benefit of all users of the upstream project. If an organization forks the upstream, they potentially cannot incorporate the new features because their code differs.
4. **They might not integrate with other software packages.** Open source projects are rarely developed as single entities; rather they often are packaged together with other projects to create a solution. Forked code may not be able to be integrated with other projects because the developers of the forked code are not collaborating in the upstream with other participants.
5. **They might not certify on hardware platforms.** Software packages are often certified to run on hardware platforms so, if problems arise, the hardware and software vendors can collaborate to find the root cause or problem.
In summary, an open source distribution is simply a packaging of an upstream, multi-organizational, collaborative open source project sold and supported by a vendor. A fork is a separate development workstream of an open source project and risks not being able to benefit from the collaborative efforts of the upstream community.
--------------------------------------------------------------------------------
via: https://opensource.com/article/18/7/forks-vs-distributions
作者:[Jonathan Gershater][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者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/jgershat
[1]:https://opensource.com/resources/what-open-source
[2]:https://opensource.com/tags/licensing
[3]:https://www.eclipse.org/che/getting-started/download/
[4]:https://access.redhat.com/downloads
[5]:https://www.freetype.org/
[6]:http://openhub.net
[7]:https://www.openhub.net/explore/orgs

View File

@ -2,7 +2,7 @@
[#]: via: (https://news.itsfoss.com/how-i-started-loving-vim/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (piaoshi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@ -1,38 +0,0 @@
[#]: subject: (My family's Linux story)
[#]: via: (https://opensource.com/article/21/5/my-linux-story)
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
[#]: collector: (lujun9972)
[#]: translator: (Shiboi77)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
My family's Linux story
======
Our first attempt at Linux was just an apt-get away.
![Terminal command prompt on orange background][1]
My first attempt at Linux was one of those "maybe I should give this a try" kinds of situations.
Back in the late 1990s, I found some kind of packaged Red Hat distro on quite a few floppies, bought a second hard drive for the family laptop, and set about installing it. It was an interesting experiment, but as I recall the family wasn't quite ready to share the computer to that extent. Fast forward to 2005, I finally broke down and bought a lovely Toshiba laptop that ran Window XP. At work, I had an aging Sun SPARCStation 5, and I didn't really like the direction the whole Solaris thing was going at that point (Motif-based desktop). I really wanted GIMP for some project or the other, but the convoluted journey to installing GNOME 1.x (was it 1.4? maybe) on Solaris was challenging. So, I was actually contemplating jumping ship to Windows XP. But after living with it on my home machine for a few months, I found myself liking that even less than trying to run GNOME on Solaris, so I installed Ubuntu Hoary Hedgehog 5.04 and then Breezy Badger 5.10 on my laptop. It was wonderful. That machine with its 3.2GHz Pentium, 2GB of memory, and 100GB hard drive ran rings around my SPARCStation 5.
All of a sudden, instead of fooling around with cobbled-together Solaris packages to try to get stuff running, things were just an apt-get away. The timing was good, too. My family and I lived in Grenoble, France from August 2006 to July 2007, while my wife was on sabbatical. Because of the Linux Toshiba, I was able to take my work with me. At the time I was doing a lot of GIS data processing on a couple of big projects; I found I could do the same thing in PostGIS / PostgreSQL much more rapidly than with the incredibly expensive commercial GIS software we used back home in Canada. Everyone was happy, especially me. 
The funny thing that happened along the way was that we took two other computers to France - my wife's similar Toshiba (running XP, which worked fine for her) and our kids' recently acquired new Toshiba laptop, also running XP. Just after Christmas, they had some friends over who inadvertently installed a nasty and impossible to remove virus on their computer. After several hours over a few days, one of my kids asked "Dad, can't we just install the same thing as on your computer"?  And poof, three new Linux users were created. My son, at 29 years old, is still a happy Linux user, and I'm guessing on his fourth or fifth Linux laptop, the last few all supplied by System76. One of my daughters was forced to convert to Windows when she started law school three years ago as her school had a mandatory testing framework that only would run on Windows and would allegedly detect things like VMs and whatnot (please don't get me started). And, my other daughter was seduced by a Macbook Air that her company bought for her.
Oh well, can't win them all!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/5/my-linux-story
作者:[Chris Hermansen][a]
选题:[lujun9972][b]
译者:[Shiboi77](https://github.com/Shiboi77)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clhermansen
[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)

View File

@ -1,206 +0,0 @@
[#]: subject: (Configuring Vim as a Writing Tool)
[#]: via: (https://news.itsfoss.com/configuring-vim-writing/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Configuring Vim as a Writing Tool
======
In my first column I spoke about why I moved [my writing to Vim][1] away from the standard tools of modern writers such as word processors (MS Word and their open source equivalents), text editors (Notepad since Ive been a Windows user until last year), and cloud based storage technology. If you are a writer, I urge you to [read that part 1][1] before continuing here.
Essentially, I argued that the more devices you use, the more writing tools youll need, the more complex the workflow eventually becomes. This is pertinent because I have four devices, including an Android phone, a main daily driver laptop running Linux, and a couple of older laptops, including a Mac, I take when I go outdoors for shoots.
Vim was the perfect solution for me, and how I work; while I wont argue that my new workflow is the best way for writers to work in the modern world, I will argue that it is important for writers to have a tool that works across all our devices, and is powerful enough to meet the needs for the different kinds of writing that we writers engage in everyday.
Vims main benefit from this perspective, therefore, is that it is cross-platform no matter what device you are on, Vim will work. I wont speak extensively about using Vim in the Apple ecosystem, but a cursory glance at the reviews for [this app][2] tells me that somewhere someone needs Vim no matter what device they are using.
Now lets say you are a writer who wants to start using Vim. Where do you start once youve installed it?
This part of the article isnt necessarily a tutorial but a series of recommendations, including an examination of a .vimrc configuration file for prose writing. Wherever possible I will link to the respective YouTube tutorial that I learnt from.
Linux users already have Vim pre-installed launch it via the terminal emulator of choice. For Windows and Mac users, you can download it from the [official site][3].
### Recommendations
**Post Vim Installation/Launch**
* Open Vim Tutor via terminal. (Mac users can launch it this way, while Windows users can launch it using this method. You will not be using Vim to do any writing during this phase instead you will spend 15 minutes everyday doing the Vim Tutorial. Dont spend a minute longer or shorter; see how much progress you can make inside the tutorial within the allotted 15 minutes. You will find that every day, you progress that much deeper into the tutorial. Inside a month, you should be able to complete the entire tutorial within those 15 minutes.
* Becoming a better typist has immense benefits for Vim usage. This is optional, but I am relearning to type from scratch and it is having the side effect of making Vim even more useful. I began spending 15 minutes everyday on this site as a warm up before I went into the Vim Tutorial.
I allocated 30 minutes at the start of every day for both these exercises to warm up, and 30 minutes every evening to cool down before I went to bed. This may have contributed to my quick transition from my old tool kit to Vim, but your mileage may vary.
Once again, let me stress that the above steps _**other than Vim Tutor**_ is optional; it all depends on your individual motivation levels.
We now come to the meat of this article: How do you configure Vim to be writer-friendly?
### How to configure .vimrc for writing
_Before I begin, Id like to remind readers here that I am not a tech person I am a novelist and that any errors you see in the below are my own; I would love for feedback from experienced Vim users on how to refine my configuration file even further._
Below is my .vimrc file. You can clone mine from my [GitHub][4] and refine it further.
```
syntax on
set noerrorbells "This removes vim's default error bell, turning it off so that it doesn't annoy us
set textwidth=100 "Ensures that each line is not longer than 100 columns
set tabstop=4 softtabstop=4
set shiftwidth=4
set expandtab
set smartindent
set linebreak
set number
set showmatch
set showbreak=+++
set smartcase
set noswapfile
set undodir=~/.vim/undodir
set undofile
set incsearch
set spell
set showmatch
set confirm
set ruler
set autochdir
set autowriteall
set undolevels=1000
set backspace=indent,eol,start
" The next two settings ensure that line breaks and wrap work how writers, not
" coders, prefer it
set wrap
nnoremap <F5> :set linebreak<CR>
nnoremap <C-F5> :set nolinebreak<CR>
call plug#begin('~/.vim/plugged')
" This is for color themes
Plug 'colepeters/spacemacs-theme.vim'
Plug 'sainnhe/gruvbox-material'
Plug 'phanviet/vim-monokai-pro'
Plug 'flazz/vim-colorschemes'
Plug 'chriskempson/base16-vim'
Plug 'gruvbox-community/gruvbox'
" This is a selection of plugins to make prose writing easier.
Plug 'dpelle/vim-LanguageTool'
Plug 'ron89/thesaurus_query.vim'
Plug 'junegunn/goyo.vim'
Plug 'junegunn/limelight.vim'
Plug 'reedes/vim-pencil'
Plug 'reedes/vim-wordy'
" This section are nice-to-haves for easier integration with machine, using vim-airline and such.
Plug 'vim-airline/vim-airline'
"This section deals with workspace and session management
Plug 'thaerkh/vim-workspace'
"Related to above, the following code saves all session files in a single directory outside your
"workspace
let g:workspace_session_directory = $HOME . '/.vim/sessions/'
"Related to above, this is a activity tracker for vim
Plug 'wakatime/vim-wakatime'
" A disturbance in the force: we are using some emacs functionality here, org-mode specifically
Plug 'jceb/vim-orgmode'
" This is for language-specific plugins
Plug 'plasticboy/vim-markdown'
call plug#end()
colorscheme pacific
set background=dark
if executable('rg')
let g:rg_derive_root='true'
endif
```
Learn how to install Vim Plugin. This tutorial helped me. I use Vim Plugged because it was the simplest and most elegant in my view.
![][5]
#### .vimrc housekeeping for writers
* `syntax on` : this ensures that vim acknowledges what syntax I am using. I primarily use markdown for most note-taking and writing articles such as this one; while plain-text is my preferred method when working on my fiction.
* `set noerrorbells` : for the sake of your sanity, I highly recommend turning this on
* `set textwidth=100` : For ease of reading because no one wants to be horizontal scrolling a text document
* `set spell“
* `set wrap` : ensures text wraps like how writers, not coders, would want it. You will notice that I havent spent much time discussing some of the other basic configuration, but I dont feel those are salient for writers. I do some hobbyist coding so my .vimrc is a reflection of that. If all you want to do is to write on Vim, then the above configuration ought to get you started.
From that point, your .vimrc is a living document of what you want to do with Vim, and how you want Vim to do that for you.
#### A note on plug-ins
Plug-ins are specified between lines 43-98. Assuming youve followed the tutorial on how to install vim plug-ins, I highly recommend the following vim writing-specific plug-ins to get started:
* `vim-LanguageTool`
* `thesaurus_query.vim`
* `vim-pencil`
* `vim-wordy`
* `vim-goyo`
* `vim-markdown`
#### Conclusion
In this article, we gently introduced how writers can get started on vim, including a basic primer on configuring .vimrc for writing. In addition to mine, I am going to link here to the .vimrc of other writers that I found on GitHub, and have used as inspiration for my own.
![][6]
Remember that this is just a starter kit of a .vimrc for writers. As your needs evolve, you will find that Vim can evolve with it. Therefore, learning to configure your .vimrc is worth investing some time in.
In the next article, I will be examining specifics of my writing workflow, using Vim and Git and GitHub.
#### 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/configuring-vim-writing/
作者:[Theena][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/theena/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/how-i-started-loving-vim/
[2]: https://apps.apple.com/us/app/ivim/id1266544660
[3]: https://www.vim.org/
[4]: https://github.com/MiragianCycle/dotfiles
[5]: https://i1.wp.com/i.ytimg.com/vi/n9k9scbTuvQ/hqdefault.jpg?w=780&ssl=1
[6]: https://i2.wp.com/i.ytimg.com/vi/Pq3JMp3stxQ/hqdefault.jpg?w=780&ssl=1

View File

@ -1,112 +0,0 @@
[#]: 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: (geekpi)
[#]: 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

@ -1,161 +0,0 @@
[#]: subject: (Run Python applications in virtual environments)
[#]: via: (https://opensource.com/article/21/7/python-pipx)
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Run Python applications in virtual environments
======
Avoid versioning conflicts and improve security by running Python
applications in isolation with pipx.
![Digital creative of a browser on the internet][1]
If you use Python, you probably install a lot of Python applications. Some are tools you just want to try out. Others are tried and true applications you use every day, so you install them on every computer you use. In either situation, it can be useful to run your Python applications in virtual environments to keep them and their dependencies separate from one another to avoid versioning conflicts and to keep them from the rest of your system to improve security.
This is where [pipx][2] comes into the picture.
Most Python apps can be installed using [pip][3], which just installs the Python package. Pipx, however, creates and manages a virtual environment for your Python applications and helps you run them.
### Installing pipx
Pipx is primarily an RPM package, and you can install it on any Fedora, RHEL, or CentOS machine with:
```
`$ sudo dnf install pipx`
```
### Using pipx
I'll demonstrate how to use pipx with the Cowsay package and the [Concentration][4] tool.
#### Installing packages
After pipx is installed, you can install Python packages with:
```
`$ pipx install <python_package>`
```
To install the Cowsay package:
```
$ pipx install cowsay                                                 ✔ │ 20:13:41  
  installed package cowsay 4.0, Python 3.9.5
  These apps are now globally available
        - cowsay
done! ✨ 🌟 ✨
```
Now you can run Cowsay anywhere in your system to talk to you through your terminal!
```
$  cowsay "I &lt;3 OSDC"                                                                                                                                      
  _________
| I &lt;3 OSDC |
  =========
        \
        \
                ^__^
                (oo)\\_______
                (__)\           )\/\
                ||----w |
                ||      ||
```
![Cowsay][5]
(Sumantro Mukherjee, [CC BY-SA 4.0][6])
#### Installing with special permissions
Not all applications are as simple as Cowsay. For instance, the Concentration application interacts with many other components on your system, so it requires special permissions. Install it with:
```
$ pipx install concentration                                                                           ✔ │ 10s  │  │ 20:26:12  
  installed package concentration 1.1.5, Python 3.9.5
  These apps are now globally available
        - concentration
done! ✨ 🌟 ✨
```
Concentration is designed to help you focus by blocking specific websites listed in a "distractors" file. To do that, it needs to run with sudo or root privileges. You can do this with [OpenDoas][7], a version of the `doas` command that runs any command with specific user privileges. To use `doas` to run Concentration with sudo privileges:
```
$ doas concentration improve                                                                  ✔ │  │ 20:26:54  
doas (sumantrom) password:  
Concentration is now improved :D!
```
As you can see, the isolated application was able to change something in the system.
#### Listing installed apps
The `pipx list` command displays all apps installed with pipx and their executable paths:
```
$ pipx list                                                                                                                                              
venvs are in /home/sumantrom/.local/pipx/venvs
apps are exposed on your $PATH at /home/sumantrom/.local/bin
   package concentration 1.1.5, Python 3.9.5
        - concentration
   package cowsay 4.0, Python 3.9.5
        - cowsay
```
#### Uninstalling apps
It's important to know how to uninstall things when you're finished with them. Pipx has a very simple uninstall command:
```
`$ pipx uninstall <package name>`
```
Or you can remove every package:
```
$ pipx uninstall-all
pipx uninstall-all                                                     2 ✘ │ 20:13:35  
uninstalled cowsay! ✨ 🌟 ✨
uninstalled concentration! ✨ 🌟 ✨
```
### Try pipx
Pipx is a package manager for popular Python applications. It has access to everything on [PyPi][8], but it can also install applications from a local directory containing a valid Python package, a Python wheel, or a network location.
If you install a lot of Python apps, try pipx.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/python-pipx
作者:[Sumantro Mukherjee][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/sumantro
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://pypi.org/project/pipx/
[3]: https://pypi.org/project/pip/
[4]: https://opensource.com/article/20/8/python-concentration
[5]: https://opensource.com/sites/default/files/uploads/cowsay.png (Cowsay)
[6]: https://creativecommons.org/licenses/by-sa/4.0/
[7]: https://github.com/Duncaen/OpenDoas
[8]: https://pypi.org/

View File

@ -0,0 +1,117 @@
[#]: subject: (Access cloud files on Windows with ownCloud)
[#]: via: (https://opensource.com/article/21/7/owncloud-windows-files)
[#]: author: (Martin Loschwitz https://opensource.com/users/martinloschwitzorg)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Access cloud files on Windows with ownCloud
======
ownCloud VFS leverages Microsoft's cloud files API to make opening,
modifying, and saving online files seamless.
![Scissors cutting open access to files][1]
Most computer users nowadays rely on online file storage. Thanks to the rise of cloud computing, the idea of storing files remotely and downloading them when needed has gained a lot of fresh air in recent years. Yet, the principle's technical roots are anything but new, with implementations reaching back decades. While the protocols used and features expected for accessing data on online storage have changed massively, the basic idea hasn't altered much since the days of FTP and similar protocols.
There's an easy explanation for why online (or "cloud") storage has so many fans. Cloud storage usually resides on highly redundant infrastructure, often distributed across physical sites. Ordinary people would have a tough time setting up anything similar with the tools generally available to them. Cloud storage also allows users to extend their storage space easily without having to fiddle with their device hardware. It also enables people to share files with relatives, friends, or colleagues in just a few simple steps.
Smartphones are an excellent example of cloud storage's advantages; clients including Dropbox, Google Drive, and iCloud are deeply integrated into mobile operating systems and can be used in apps just like local storage.
Classical desktop and laptop computers don't integrate online storage as well as smartphones do. Rather, accessing iCloud, ownCloud, or other storage solutions from a computer is a tedious task for several reasons.
### A matter of protocol
Many of the reasons boil down to the protocol. The methods and protocols for accessing online storage have changed often, and no single protocol has established itself as a de-facto standard. Online storage services such as Dropbox, S3, and iCloud use proprietary protocols (partially based on open protocols such as WebDAV), which cannot be implemented easily on desktop operating systems. As a result, desktop users often face tedious user interfaces (UIs), reduced comfort, and poor user experience (UX) with online file storage.
It helps to look a bit deeper to understand the problem and come up with possible solutions. To start, all modern operating systems—notably Windows, macOS, and Linux (along with its numerous derivatives)—assume they are exclusively in charge of a user's files. This comes from the old-fashioned assumption that a user's files will be hosted on a single device. If all a user's files are stored on the same device, it is easy to put them in a tree-like structure (as desktop operating systems have been doing for ages) and present a unique view to the user.
With cloud-based storage, things are not so easy. Because these files are not available locally, a computer's operating system cannot manage or display them the same way it displays local files. To edit an Excel sheet stored in the cloud, you must download the file from the cloud, store it locally, modify it, and upload it again. Not only does this break your UI and UX; it also creates chaos.
Some online storage providers try to work around the issue with clients that synchronize contents between the cloud and the local machine. This is an ugly workaround. For instance, you might not want the dozens of gigabytes of data stored in your cloud to also reside on your small local device. To mitigate this challenge, some tools allow you to select a subset of data to synchronize between the client and the online service; this shifts the problem to the side a bit but certainly does not solve it.
### How WebDAV failed the industry
Many IT professionals are likely shaking their heads fiercely, knowing there's a protocol for these types of tasks that could be used. And they are not completely wrong. [WebDAV][2] was specified as early as June 2007 by the IETF to extend the HTTP protocol for Web Distributed Authoring and Versioning (WebDAV for short). WebDAV's sole purpose was to provide an interface that allows files in a remote location, such as online cloud storage, to be accessed and edited the same way local files can be. WebDAV has gained traction since then: Private cloud solutions such as ownCloud and NextCloud support and can be accessed through it.
Yet to call WebDAV a ringing success would be unrealistic, as neither the server nor the client side has achieved widespread use. Matters are especially bad on the server side: many online storage services, including Dropbox, Google Drive, and Microsoft OneDrive, do not support the WebDAV extension to HTTP. Some put proxy services in place. Dropbox, for instance, can be used with DAVbox to achieve WebDAV access. Other services provide tools to mitigate the lack of a working WebDAV server. Generally speaking, though, WebDAV support is not widespread throughout the industry, and that will probably not change anytime soon.
### Poor operating system support for WebDAV
This leads right into the second aspect of WebDAV's disastrous history: the client side. At this time, only one operating system has somewhat complete client support throughout the relevant tools of its userland, and that is Linux. Standard desktop environments such as KDE, GNOME, and Xfce can connect to WebDAV drives from the desktop. They also integrate WebDAV drives as if they were normal local disks, effectively allowing users to move data back and forth between the remote site and the local machine. Last but not least, they can download files from WebDAV devices on demand instead of keeping files continuously in sync between a remote site and the local drive. In Linux, life with WebDAV is mostly good—mostly because WebDAV doesn't feature inherent caching.
Matters change a bit when looking at macOS. Apple equipped macOS with a WebDAV client a while ago, and it mostly works fine. However, it is tedious for less experienced users to set up. And macOS's WebDAV client tends to misbehave when the connection between the client and the server is brittle—like it would be for users in Germany behind LTE connectivity. In such setups, users have to clean up their WebDAV directories regularly to be able to use them.
The most widespread operating system, Windows, also offers the most dramatic failure in terms of WebDAV integration. To even set up a WebDAV-based storage drive, you would have to edit the Windows Registry—a task that easily exceeds the average computer user's knowledge. If that were not bad enough, even after modifying the Registry, the Windows client for the WebDAV protocol looks more like a stub than a usable feature. You will soon experience problems like those found with the macOS WebDAV implementation, and the experience of using the protocol will be terrible.
### ownCloud's VFS alternative
[ownCloud][3] is a private cloud solution that allows users to store, sync, and share data on their own terms, including on a Raspberry Pi, a private cloud, or in a hybrid setup. ownCloud offers a client for the world's most common operating system. But for many years, it relied upon workarounds, like requiring users to explicitly choose which files to synchronize.
ownCloud has come up with a solution to the problem—and it's a rather sophisticated one. Windows offers an interface to connect to cloud-based online storage, and ownCloud leverages that interface with its [virtual file system][4] (VFS). 
### How VFS works
ownCloud's VFS functionality for Windows heavily relies on a Microsoft feature named [cloud files API][5]. It was officially introduced in Windows 10, version 1809 in 2017. Microsoft designed it for file synchronization with OneDrive, but other services are free to use the API, which is now part of the Windows 10 core. The cloud files API is kind of a demarcation line for synchronizing data from the cloud to a local machine and vice versa. It's split into two parts:
* The **API** provides functions on the API level to perform tasks such as opening, saving, and uploading files to the remote host after the user commits changes. The cloud files API handles a lot of things invisible to the user; for instance, a client using the API will display all remote files as "present" in the local view without downloading them. The cloud files API will download a file only after the user explicitly requests to open it from the remote drive.
* The **Windows.Storage.Provider** namespace allows applications in the userland to configure a client to access a remote service through the cloud files API.
### What the user sees
The revolutionary way that cloud files API deals with files in remote storage under Windows becomes clear when you see ownCloud VFS in action.
First, set up a connection to your ownCloud drives from within the ownCloud Client for Windows. Make sure _virtual file support_ is enabled; this makes the directories in your ownCloud drive immediately visible and selectable in Windows tools, such as the Explorer. You won't be able to tell them apart from the files on your local storage devices, and when you open a file stored in ownCloud, it will appear like it is locally present. For files not synchronized to the local host, the cloud files API generates a placeholder that is replaced with the actual file when you open it. This allows a seamless user experience while preserving bandwidth on the client's and the server's internet links.
Setting up a VFS drive in Windows does not require administrator privileges, as editing the Windows Registry for WebDAV connectivity requires. This means ownCloud VFS might be usable on devices such as business laptops, where the administrator account is usually not available to the user. Compliance policies may still forbid using ownCloud if the instance is not run by the company under its compliance regime, however.
### Major differences from WebDAV
Not only does VFS work considerably better on Windows 10 operating systems, it also offers a few features not available in protocols like WebDAV. One of these is implicit caching. During normal operations, VFS will synchronize files when they are opened until a locally defined cache is full; if the user requests additional files, VFS will remove the oldest files from the cache.
Furthermore, VFS allows you to specify "favorite" files that will always be synchronized automatically from the remote drive whether or not you are trying to access them. This shortens the initial time to access frequently used files, especially if the files are large.
### Storage Sense makes sense
Another helpful feature in the Windows cloud files API is the "Storage Sense" feature added in Windows 1809. While primarily aimed at OneDrive users, Storage Sense can be used in the background with an ownCloud online storage drive due to its cloud files API support. Storage Sense regularly scans the Windows C: drive for files that have not been used for a long time. It synchronizes these files to the remote cloud storage and deletes them from the local device, freeing up space for data used more often.
The user can determine Storage Sense's intervals and when Windows will trigger scans. The latter factor is not very important anymore because searching an SSD or NVMe device is very fast compared to the old days of searching spinning disk drives. Storage Sense aims to increase available disk space on systems, and ownCloud drives can be targets for offloading unused files.
### VFS on other operating systems
By creating a virtual file system based on the cloud files API, ownCloud improves the experience of using ownCloud online storage as a web drive in Microsoft Windows 10. ownCloud is one of the few free, libre, and open source software projects using this API at all—even other vendors' commercial support for it is rather weak. Apple's iCloud client for Windows uses the cloud files API, but the list is short.
How does ownCloud use VFS on other operating systems? It's not as easy as porting the Windows functionality to other operating systems because the cloud files API is not present on non-Windows machines.
ownCloud still implements comparable functionality—sort of. The macOS and Linux ownCloud clients behave as though the cloud files API were available even on non-Windows systems. Certain Windows functions have been replaced in the background with stubs for the corresponding system. There are a few notable differences between the Windows client and the view in Linux or macOS. For instance, Windows shows the correct file size even for remote files represented locally by a placeholder. On Linux and macOS, all files are displayed with a size of 1 byte and a local extension of .owncloud. This makes it clear that the files do not exist locally—at least until the user asks to open them and ownCloud initiates the download.
It's true, though, that the VFS experience on macOS and Linux is not quite as smooth as it is on Windows 10.
### Summary
ownCloud's VFS dramatically improves the integration of ownCloud cloud storage drives into Windows 10. In contrast to WebDAV and related protocols, the cloud files API is a native API in Windows, integrated seamlessly with the operating system. This eliminates the ugly hacking required to enable WebDAV access in Windows 10, let alone the contortions needed to use it effectively. Older Windows clients do not benefit from the API, and its advantages might create an incentive to update old Windows versions in environments where ownCloud is heavily used.
macOS and Linux users do not benefit as much from ownCloud's VFS support. On Linux, hobby projects like [elokab-files-manager][6] provide better support for ownCloud VFS. But this is certainly not something you would want to bet on as your daily driver. The situation on macOS is even worse: While Apple has long promised to add similar API functionality to macOS, only Big Sur seems to have the required feature set. As of this writing, ownCloud's developers have not yet adapted the ownCloud client for macOS to the new features in Big Sur. Consequently, Linux and macOS users can use VFS on their platforms with minor limitations. Windows 10 users, however, get the biggest bang for their buck.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/owncloud-windows-files
作者:[Martin Loschwitz][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/martinloschwitzorg
[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://en.wikipedia.org/wiki/WebDAV
[3]: https://owncloud.com/
[4]: https://owncloud.com/features/virtual-files/
[5]: https://docs.microsoft.com/en-us/windows/win32/cfapi/build-a-cloud-file-sync-engine
[6]: https://github.com/dragotin/elokab-files-manager

View File

@ -0,0 +1,164 @@
[#]: subject: (How to Upgrade to Debian 11 from Debian 10)
[#]: via: (https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to Upgrade to Debian 11 from Debian 10
======
This guide explains the steps to upgrade debian 11 from debian 10.
[Debian][1] releases are rare. Because it is often a multi-year effort from the community. That is why Debian is truly universal operating system and rock solid stability wise.
[Debian 11][2], code named Bullseye, officially releases soon. On July 15, 2021, Debian 11 went to complete freeze, which means the release is imminent. Although the official date is not finalized, but you can install or upgrade to Debian 11 from Debian 10 right now.
This is how.
### Pre-Requisites
* The upgrade process is very straightforward. However, it is a good practice to take certain pre-cautions. Specially if you are upgrading a server.
* Take backup of your system, including all important data and files.
* Try to disable/remove any external repositories (PPA) you may have added over the time. You can enable them after upgrade one-by-one.
* Close all the running applications.
* Stop any running services that you may have enabled. You can start them via [systemctl][3] after upgrade is complete. This includes web server, SSH server, FTP server or any other servers.
* Make sure you have stable internet connection.
* And have sufficient downtime of your system. Because depending on your system configuration, a Debian version upgrade takes time ~ between 1.5 hours to 2 hours.
### Upgrade Debian 10 Buster to 11 Bullseye Linux
* Make sure your system is up-to-date, and your package list is up-to-date.
```
sudo apt update && sudo apt upgrade
```
* Install the gcc-8-base package using the below command. This is required because, historically it has been seen, that upgrade fails because of certain dependencies which included in the below package.
```
sudo apt install gcc-8-base
```
![upgrade debian system check][4]
* Open the /etc/apt/sources.list and update with bullseye repositories, by commenting the Debian 10 buster packages.
* Comment out all the buster repo by “#” at the beginning of the lines.
![Comment the Debian 10 lines][5]
* Add the following lines at the end of the file.
```
deb http://deb.debian.org/debian bullseye main contrib non-free
deb http://deb.debian.org/debian bullseye-updates main contrib non-free
deb http://security.debian.org/debian-security bullseye-security main
deb http://ftp.debian.org/debian bullseye-backports main contrib non-free
```
![Add Debian 11 lines][6]
* Press Ctrl + O to save the file and Ctrl + X to exit nano.
* Update the system repository list once to verify the addition of the repositories.
```
sudo apt update
```
* If the above command doesnt give any error, then you have successfully added the bullseye repo.
* Now, start the upgrade process by running the below command. The download size is around 1.2 GB for a base installation. That may be different based on your system config.
```
sudo apt full-upgrade
```
![Debian upgrade start][7]
* This command takes time. But do not leave the system unattended. Because upgrade process requires various inputs during the course of upgrade.
![lib6 config][8]
![sudoers file][9]
* Once it is completed, you can restart the system using
```
systemctl reboot
```
* After reboot, run the following commands to make sure your system is up-to-date, and you cleaned up all the unnecessary packages that is not required anymore.
```
sudo apt --purge autoremove
```
* If all goes well, you should be seeing the Debian 11 bullseye. You can verify the version using the below command:
```
cat /etc/os-release
```
![Debian 11 after upgrade][10]
### Closing Notes
I hope this guide helps you to upgrade your system to Debian 11 bullseye. If you face any issues, let me know using the comment box below.
[][11]
SEE ALSO:   Debian 11 bullseye - Default Theme Revealed
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/upgrade-debian-11-from-debian-10/
作者:[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.debian.org/
[2]: https://www.debugpoint.com/2021/05/debian-11-features/
[3]: https://www.debugpoint.com/2020/12/systemd-systemctl-service/
[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/upgrade-debian-system-check-1024x503.jpeg
[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Cpmment-the-Debian-10-lines-1024x636.jpeg
[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Add-Debian-11-lines-1024x635.jpeg
[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-upgrade-start-1024x226.jpeg
[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/lib6-config-1024x195.jpeg
[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/sudoers-file.jpeg
[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Debian-11-after-upgrade.jpeg
[11]: https://www.debugpoint.com/2020/11/debian-11-bullseye-theme/

View File

@ -0,0 +1,90 @@
[#]: subject: (Install Shutter in Fedora 34 and Above)
[#]: via: (https://www.debugpoint.com/2021/07/install-shutter-fedora/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Install Shutter in Fedora 34 and Above
======
This quick guide explains the steps required to install shutter in
Fedora 34 and above.
There are many alternatives and options for screenshot tool. But in my personal opinion, there is none that come close to the flexibility of Shutter. Unfortunately over the years, Linux distributions such as Ubuntu, Fedora faced problem packaging this application in official repo for various dependency problem and specially how it is designed.
The primary problem is it still based on GTK2 and Perl. While most of the application moved to GTK3, it remained in GTK2. This created a dependency problem as Debian/Ubuntu, Fedora they removed the dependent GTK2 version of certain packages.
Installing [Shutter][1] screenshot tool in Fedora 34 and above requires an alternative approach.
Right now, you can only install this tool via personal package archive only. Heres how to install it in Fedora 34 and above.
![Shutter in Fedora][2]
### Install Shutter in Fedora 34 and above
Open a terminal in your Fedora and enable the following [Copr repository for Shutter][3]. This package archive provides a separate build for Shutter for Fedora with all the unmet dependencies.
```
sudo dnf copr enable geraldosimiao/shutter
```
Once this is done, you can simply install shutter in Fedora 34 and above by dnf.
```
sudo dnf install shutter
```
Though the latest release is v0.97 at present. The repository sadly contains the old v0.94.x at the moment. I hope the repo owner soon include the latest version.
After installation, you can launch it via application menu.
#### Uninstall Shutter
If you want, you can easily remove this third-party repository via command:
```
sudo dnf copr remove geraldosimiao/shutter
```
And followed by below to remove Shutter completely including dependencies.
```
sudo dnf autoremove shutter
```
#### Install Shutter in Other Linux Distributions
If you want to install it in Debian, Ubuntu or related distribution [check out this guide][4].
[][5]
SEE ALSO:   How to fix disabled Edit Image Option in Shutter in Ubuntu 18.04 LTS
### Development of Shutter
Recently this project [moved to GitHub][6] for better collaboration and a GTK3 port is underway. And it is fairly active and recently had a release. We hope it gets ported to gtk3 soon and available in native repo of respective distributions.
Let me know using the comment box below if you face any error installing Shutter.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/07/install-shutter-fedora/
作者:[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/tag/shutter
[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Shutter-in-Fedora.jpeg
[3]: https://copr.fedorainfracloud.org/coprs/geraldosimiao/shutter/
[4]: https://www.debugpoint.com/2020/04/shutter-install-ubuntu/
[5]: https://www.debugpoint.com/2018/05/shutter-fix-disable-edit/
[6]: https://github.com/shutter-project/shutter

View File

@ -1,93 +0,0 @@
[#]: subject: (Meet Clapper: A Sleek Looking Linux Video Player for Minimalists)
[#]: via: (https://itsfoss.com/clapper-video-player/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Meet Clapper: A Sleek Looking Linux Video Player for Minimalists
======
Love minimalism? Youll love Clapper.
Clapper is a new [video player for Linux][1]. Actually, its more for GNOME than Linux.
Built on top of GNOMEs JavaScript library and GTK4 toolkit, it blends naturally in the GNOME desktop environment. It uses [GStreamer][2] for media backend and [OpenGL][3] for rendering.
I like application with minimalist approach. While VLC is the Swiss Knife of media players, I prefer [MPV player][4] for the sleek, minimal interface. And now I think I am going to stick with Clapper for sometime.
### Clapper video player
![A screenshot of Clapper video player][5]
[Clapper uses hardware acceleration][6] by default. It supports Intel and AMD GPUs and works on both Xorg and Wayland.
[Clapper][7] doesnt use the traditional upper window bar. There are auto-hiding preference menu, mode changer and window control buttons for you to access a few features. This gives it a sleek, minimalist look.
It has three modes:
* Windowed mode: the default mode shows the progress bar and window control
* Floating mode: the progress bar is hidden and the player is floating on top of other applications like the [always on top][8] feature or picture in picture mode
* Fullscreen mode: Player goes full screen, progress bar is bigger but they all auto-hide
![Interface of Clapper video player with preference control and window modes][9]
Clapper also has an adaptive UI which can also be used on Linux-based smartphones and tablets. So if you have got yourself a Pine Phone or Librem5, you can use Clapper on it.
There is support for subtitles with option to change the font. However, the subtitles didnt work in my testing. There is also no option to explicitly add subtitles to a playing video. This is something that must be improved.
Like VLC, Clapper also gives you the option to resume playback from the last point if you open the same video file again. One of the [handy features I love in VLC][10].
Clapper supports playing videos from the internet as well if you provide the URL.
Here, in the screenshot, I am playing a YouTube video in Clapper. It is a beautiful song sung by a beautiful singer and actress. Can you guess which song or movie it is?
![Clapper playing a video from YouTube][11]
### Install Clapper on Linux
Clapper is available in AUR for Arch and Manjaro users. That should not be a surprise for anyone. AUR has everything under the sun.
For other distributions, Clapper officially provides [Flatpak package][12]. So, please [enable Flatpak support for your distribution][13] and then use the following command to install it:
```
flatpak install flathub com.github.rafostar.Clapper
```
Once installed, simply search for it in the application menu or right click on a video file and choose to open it with Clapper.
Clapper is far from being the perfect video player. However, it has potential to become a popular Linux application.
If you use it, please do share your experience. If you find bugs, please [notify the developer][14].
--------------------------------------------------------------------------------
via: https://itsfoss.com/clapper-video-player/
作者:[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://itsfoss.com/video-players-linux/
[2]: https://gstreamer.freedesktop.org/
[3]: https://www.opengl.org/
[4]: https://itsfoss.com/mpv-video-player/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-screenshot.png?resize=800%2C498&ssl=1
[6]: https://github.com/Rafostar/clapper/wiki/Hardware-acceleration
[7]: https://github.com/Rafostar/clapper
[8]: https://itsfoss.com/always-on-top/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-video-player-interface.jpg?resize=800%2C480&ssl=1
[10]: https://itsfoss.com/simple-vlc-tips/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-youtube-video.jpg?resize=800%2C501&ssl=1
[12]: https://flathub.org/apps/details/com.github.rafostar.Clapper
[13]: https://itsfoss.com/flatpak-guide/
[14]: https://github.com/Rafostar/clapper/issues

View File

@ -0,0 +1,119 @@
[#]: subject: (Run a Linux virtual machine in Podman)
[#]: via: (https://opensource.com/article/21/7/linux-podman)
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Run a Linux virtual machine in Podman
======
Use Podman Machine to create a basic Fedora CoreOS VM to use with
containers and containerized workloads.
![woman on laptop sitting at the window][1]
Fedora CoreOS is an automatically updating, minimal [rpm-ostree][2]-based operating system for running containerized workloads securely and at scale.
[Podman][3] "is a tool for managing containers and images, volumes mounted into those containers, and pods made from groups of containers. Podman is based on libpod, a library for container lifecycle management."
Magical things happen when you use [Podman Machine][4], a feature that helps you create a basic Fedora CoreOS virtual machine (VM) to use with containers and containerized workloads.
### Getting started with Podman Machine
The first step is to install Podman. If you already have the latest version of Podman installed, you can skip the step. On my Fedora 34 machine, I installed Podman with:
```
`$ sudo dnf install podman`
```
I'm using podman-3.2.2-1.fc34.x86_64.
### Initializing a Fedora CoreOS
Once Podman is installed, initialize it with:
```
podman machine init vm2
Downloading VM image: fedora-coreos-34.20210626.1.0-qemu.x86_64.qcow2.xz: done  
Extracting compressed file
```
This command creates `vm2` and downloads Fedora CoreOS's qcow2 file in .xz format and extracts it.
### Listing your VMs
It's always important to know your VMs and their status, and the `list` command helps with that. The following example shows the names of all my VMs, the date they were created, and the last time they were up:
```
podman machine list  
NAME                    VM TYPE         CREATED         LAST UP
podman-machine-default*  qemu           6 days ago      Currently running
vm2                     qemu            11 minutes ago  11 minutes ago
```
### Starting a VM
To start a VM, run:
```
podman machine start
Waiting for VM …
```
### SSHing into the VM
You can use secure shell (SSH) to access your VM and use it to run workloads without any setup hassles:
```
podman machine ssh  
Connecting to vm podman-machine-default. To close connection, use `~.` or `exit`
Fedora CoreOS 34.20210611.1.0
Tracker: <https://github.com/coreos/fedora-coreos-tracker>
Discuss: <https://discussion.fedoraproject.org/c/server/coreos/>
 
Last login: Wed Jun 23 13:23:36 2021 from 10.0.2.2
[core@localhost ~]$ uname -a
Linux localhost 5.12.9-300.fc34.x86_64 #1 SMP Thu Jun 3 13:51:40 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
[core@localhost ~]$
```
Currently, Podman only supports running one VM at a time.
### Stopping your VM
To stop a running VM, use the `stop` command:
```
podman machine stop
[core@localhost ~]$ Connection to localhost closed by remote host.
Connection to localhost closed.
Error: exit status 255
```
I hope this helps you get started with Podman Machine. Give it a try, and let us know what you think in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/linux-podman
作者:[Sumantro Mukherjee][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/sumantro
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop)
[2]: http://coreos.github.io/rpm-ostree/
[3]: https://github.com/containers/podman
[4]: http://docs.podman.io/en/latest/markdown/podman-machine.1.html

View File

@ -0,0 +1,167 @@
[#]: subject: (Accessibility in open source for people with ADHD, dyslexia, and Autism Spectrum Disorder)
[#]: via: (https://opensource.com/article/21/7/open-source-neurodiversity)
[#]: author: (Rikard Grossman-Nielsen https://opensource.com/users/rikardgn)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Accessibility in open source for people with ADHD, dyslexia, and Autism Spectrum Disorder
======
Open source accommodations help people with neurodiversity use their
talents to their highest ability.
![a magnifying glass looking at a brain illustration][1]
For a long time, attention deficit hyperactivity disorder (ADHD), autism, Asperger syndrome, dyslexia, and other neurodiverse conditions were considered things that hold people back. But now, many researchers and employers recognize that [neurodiversity is a competitive advantage][2], especially in technology, and especially when certain accommodations are provided.
This is certainly true for me. I'm a 39-year-old teacher in Sweden diagnosed with ADHD and Asperger's (also referred to as Autism Level 1). I'm also an intermediate Linux user and use it daily for Java programming, productivity, and gaming. I've been using Linux since the late 1990s, and I've learned ways open source programs can be made more accessible for people with these conditions. For example, I use accessibility software, including speech synthesis to find spelling errors and calendar software accommodations to help with my Asperger's and ADHD.
### Asperger's, ADHD, and dyslexia
Before I get into open source software accommodations, I'll share some information about these conditions.
#### Asperger syndrome
[Asperger's][3] is a form of autism without intellectual disability. People with Asperger's often have:
* Difficulties in social contact with other people
* Special interest areas that may consume a large part of their attention and time
* Difficulties understanding and using language in communicating with other people
* Deficits in motor skills
* A tendency to easily get caught in up certain routines or actions
* Unusual perception of and sensitivity to stimuli such as sound, light, etc.
#### ADHD
The three core symptoms of [ADHD][4] are:
* **Attention:** Difficulties in concentration and forgetfulness; distractability; easily bored and fail to complete things that don't interest them
* **Impulsivity:** Strong emotional reactions to different things; difficulty listening to others; problems handling unstructured situations that require reflection and thinking things through; sometimes impulsivity may lead to difficulties in motor control
* **Hyperactivity:** Difficulty regulating activity to an appropriate level for the situation; trouble sitting still and winding down, possibly mixed with periods of exhaustion
Hyperactivity in children is often physical; in adults, it's more of an internal restlessness that might cause sleeping problems (among other things). Some people with ADHD have one of the three core symptoms, and others have two or all of them.
#### Dyslexia
Some people with neurodiverse conditions also have problems with reading and writing. This might be related to difficulties in attention, hyperactivity, and impulsivity. However, they might also be caused by [dyslexia][5].
* People with dyslexia have difficulty recognizing and understanding words. They might place letters in the incorrect order, making reading comprehension more difficult.
* Dyslexia isn't correlated with intelligence.
* Dyslexia can't be cured, but accommodations can help a great deal in school and work.
* Reading a lot and listening to audiobooks can improve the ability of people with dyslexia to read and write.
### Asperger's and ADHD at work
While the symptoms associated with Asperger's and ADHD can make some parts of work challenging, other aspects give neurodiverse people advantages in the workplace.
#### Asperger's
Some of the skills people with [autism spectrum disorders bring to the workplace][6]:
* High concentration power and precision in work
* Attention to minute details
* Patience for repetitive tasks
* Higher memory power (can remember tiny details)
* Hard-working
* Loyal
#### ADHD
Some of the skills people with [ADHD bring to the workforce][7]:
* Able to find unique solutions to difficult problems
* Can talk about many different topics at one time
* Good in a crisis; some of the most stressful jobs are staffed by those with ADHD
* Empathetic and intuitive
* Entrepreneurial
### Making software more accessible
The descriptions above are highly generalized and may not apply to all adults with Asperger's, ADHD, and dyslexia. One problem with current accessibility standards is that they confuse different neurodiversities. For example, they may not differentiate between autism with and without intellectual disability, the latter of which is called Asperger's or Autism Level 1, or they may assume dyslexia is an intellectual disability.
In his article [_User interface for people with autism spectrum disorders_][8], Nikolay Pavlov provides some suggestions to improve UI design:
* Use simple graphics
* Strive for simple, clear navigation
* Do not use complex menus
People with Asperger's have different needs, abilities, and preferences, so these accommodations won't be beneficial to everyone. These UI features could also help people who have autism with intellectual disability, ADHD, dyslexia without intellectual disability, and other conditions. Therefore, when considering making accommodations in software, think carefully about your target group. And know that if you ask people for input, you will probably get many different answers.
People with ADHD especially might benefit from one of Pavlov's other recommendations:
* Use visual indicators for time-consuming actions
This is valuable when people perceive that an app or web page is not loading quickly enough. I appreciate when systems give continuous feedback on their progress because it tells me that everything is in working order.
### Examples of accessibility
The GNOME calendar offers a good example of making software more accessible.
Compare the standard date view:
![Standard GNOME calendar][9]
(Rikard Grossman-Nielsen, [CC BY-SA 4.0][10])
To this modified view:
![Modified GNOME calendar][11]
(Rikard Grossman-Nielsen, [CC BY-SA 4.0][10])
It's a lot easier to find the marked date with the yellow circle around the number 29.
In contrast, [Vi and Vim][12] are among the least accessible text editors I've ever used, but note they aren't designed with accessibility in mind. My biggest problem is that that they don't offer any cues to their different commands. When I use a terminal editor, I prefer [Nano][13] because it provides cues to what keyboard commands to use. Most often, I use a graphical user interface (GUI) editor like [Gedit][14] or Nedit because it's easier for me to create text in a GUI editor.
### How GNOME embraces diversity
I've found that [GNOME][15] is the best of the large Linux desktop environments for offering accessibility features, but it can definitely still improve. Because I'm interested in Linux on the desktop and making it even more accessible, I joined the team planning [GUADEC][16], the GNOME Users And Developers European Conference.
GUADEC embraces a climate of diversity, both in theory and practice. The conference provides accommodations, such as captioning for online lectures and quiet rooms at physical events. The 2021 conference, to be held online July 2125, will have a few lectures on UI design, and I will offer a workshop on [making open source applications more accessible][17]. If you'd like to learn more, visit the GUADEC website and [register][18].
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/open-source-neurodiversity
作者:[Rikard Grossman-Nielsen][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/rikardgn
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/LAW_EvidencedBasedIP_520x292_CS.png?itok=mmhCWuZR (a magnifying glass looking at a brain illustration)
[2]: https://hbr.org/2017/05/neurodiversity-as-a-competitive-advantage
[3]: https://en.wikipedia.org/wiki/Asperger_syndrome
[4]: https://en.wikipedia.org/wiki/Attention_deficit_hyperactivity_disorder
[5]: https://en.wikipedia.org/wiki/Dyslexia
[6]: https://www.thehrdigest.com/autistic-workers-strength-not-weakness/
[7]: https://adhdatwork.add.org/potential-benefits-of-having-an-adhd-employee/
[8]: https://www.researchgate.net/publication/276495184_User_Interface_for_People_with_Autism_Spectrum_Disorders
[9]: https://opensource.com/sites/default/files/uploads/gnome-calendar-standard.png (Standard GNOME calendar)
[10]: https://creativecommons.org/licenses/by-sa/4.0/
[11]: https://opensource.com/sites/default/files/uploads/gnome-calendar-modified.png (Modified GNOME calendar)
[12]: https://opensource.com/resources/what-vim
[13]: https://opensource.com/article/20/12/gnu-nano
[14]: https://opensource.com/article/20/12/gedit
[15]: https://opensource.com/downloads/cheat-sheet-gnome-3
[16]: https://events.gnome.org/event/9/
[17]: https://events.gnome.org/event/9/contributions/240/
[18]: https://events.gnome.org/event/9/registrations/34/

View File

@ -0,0 +1,219 @@
[#]: subject: (Run GitHub Actions on Fedora CoreOS)
[#]: via: (https://fedoramagazine.org/run-github-actions-on-fedora-coreos/)
[#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Run GitHub Actions on Fedora CoreOS
======
![][1]
[United Artists][2], Public domain, via Wikimedia Commons
[GitHub Actions][3] is a service provided to quickly setup continuous integration and delivery (CI/CD) workflows . These workflows run on hosts called _runners_. GitHub provides [hosted runners][4] with a limited set of operating system choice (Windows Server, Ubuntu, MacOS).
Another option is to use [self-hosted][5] runners which gives the repository administrator more control on the runners. Self-hosted runners are dedicated to a repository or organization. The following article goes through the steps of configuring self-hosted runners using Fedora CoreOS.
### Getting Started
Fedora CoreOS is a minimalist operating system designed to be easy to deploy and maintain at scale. The operating system will automaticaly update and provide, by default, the tools needed to run containers. For all of these reasons, Fedora CoreOS is a great choice to consider for running CI/CD workflows.
The first step to configure and provision a Fedora CoreOS machine is to generate an [Ignition][6] file. [Butane][7] allows you to generate Ignitions file using a friendlier format (YAML).
#### Configure a Fedora CoreOS runner
To execute GitHub actions on Fedora CoreOS, the host needs the binaries and scripts used to register and run the runner. Download the binaries and scripts from the [actions runner project][8] and deploy under _/usr/local/sbin/actions-runner_.
```
version: "1.3.0"
variant: fcos
storage:
directories:
- path: /usr/local/sbin/actions-runner
mode: 0755
user:
name: core
group:
name: core
files:
- path: /usr/local/sbin/actions-runner/actions-runner-linux.tar.gz
overwrite: true
contents:
source: https://github.com/actions/runner/releases/download/v2.278.0/actions-runner-linux-x64-2.278.0.tar.gz
mode: 0755
user:
name: core
group:
name: core
```
#### Registration and Removal token
Configuring runners for a project requires a “token”. This prevents registering or removing self-hosted runners from projects without the correct permissions. Tokens provided by Github have a one hour expiration time. If the runner restarts after this time it will require a new registration token.
The token can be problematic, in particular with Fedora CoreOS automatic updates. The update process expects that the host will restart at least once every couple weeks after receiving new data.
Luckily, it is possible to use GitHub REST API to obtain these tokens and automatically configure the runner every time the host restarts. The following _manage-runner.sh_ script uses the APIs to retrieve a token, remove any runner already configured and register the runner with a new token.
```
#!/bin/bash
# Handles the Github Action runner configuration.
# Remove and Registration token expires after 1 hour, if we want our runner
# to work after a reboot (auto update) we need to refresh the tokens.
# First remove the runner with a fresh remove token
REMOVE_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/remove-token | jq -r '.token')
/usr/local/sbin/actions-runner/config.sh remove --token ${REMOVE_TOKEN}
# Then register the runner with a fresh registration token
REGISTRATION_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${GITHUB_USER}/${GITHUB_REPO}/actions/runners/registration-token | jq -r '.token')
/usr/local/sbin/actions-runner/config.sh --url https://github.com/cverna/fcos-actions-runner --token ${REGISTRATION_TOKEN} --labels fcos --unattended
```
The script above uses a few environment variables that contain a GitHub username and a [Personal Access Token][9] used to authenticate the REST API requests. The Personal Access Token requires the repo permissions in order to successfully retrieve the runner registration and removal tokens. The token is security sensitive so it is better to store it in a different file with stricter permissions. In this example that file is _actions-runner_.
```
GITHUB_USER=<user>
GITHUB_REPO=<repo>
GITHUB_TOKEN=<personal_access_token>
```
Following is the Butane snippet that creates these two files _manage-runner.sh_ and _actions-runner_.
```
- path: /usr/local/sbin/actions-runner/manage-runner.sh
contents:
local: manage-runner.sh
mode: 0755
user:
name: core
group:
name: core
- path: /etc/actions-runner
contents:
local: actions-runner
mode: 0700
user:
name: core
group:
name: core
```
### Running Actions on Fedora CoreOS
Finally, create the systemd services that will configure and start the runner. Define the services in the Butane configuration file.
```
systemd:
units:
- name: github-runner-configure.service
enabled: true
contents: |
[Unit]
Description=Configure the github action runner for a repository
After=network-online.target boot-complete.target
Requires=boot-complete.target
[Service]
EnvironmentFile=/etc/actions-runner
Type=oneshot
RemainAfterExit=yes
User=core
WorkingDirectory=/usr/local/sbin/actions-runner
ExecStartPre=tar xvf actions-runner-linux.tar.gz --no-same-owner
ExecStart=/usr/local/sbin/actions-runner/manage-runner.sh
[Install]
WantedBy=multi-user.target
- name: github-runner.service
enabled: true
contents: |
[Unit]
Description=Run the github action runner
After=github-runner-configure.service
[Service]
WorkingDirectory=/usr/local/sbin/actions-runner
User=core
ExecStart=/usr/local/sbin/actions-runner/run.sh
[Install]
WantedBy=multi-user.target
```
This creates two services, _github-runner-configure.service_ (running once when the host has finished booting) and _github-runner.service_ (running the Actions runner binaries and waiting for new CI/CD jobs).
Now that the Butane configuration is complete, generate an Ignition file out of it and provision a Fedora CoreOS Actions runner.
```
$ podman run -i --rm -v $PWD:/code:z --workdir /code quay.io/coreos/butane:release --pretty --strict --files-dir /code config.yaml -o config.ignition
```
Once the Ignition file is generated, it can be used to provision a runner on the platforms where Fedora CoreOS is [available][10].
> [Getting started with Fedora CoreOS][11]
### Configure an Action to use a self-hosted runner
The following test Action workflow will test the FCOS self-hosted worker. Create the following file in your git repository _.github/workflows/main.yml_
```
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main ]
pull_request:
branches: [ main ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: fcos
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Runs a single command using the runners shell
- name: Run a one-line script
run: podman run --rm fedora-minimal:34 echo Hello World !
```
Note that the _runs-on_ configuration is set up to use a runner with the label _fcos_.
The code presented in this article is available [here][12].
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/run-github-actions-on-fedora-coreos/
作者:[Clément Verna][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/cverna/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/modern-times-816x345.jpg
[2]: https://commons.wikimedia.org/wiki/File:Chaplin_-_Modern_Times.jpg
[3]: https://docs.github.com/en/actions
[4]: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
[5]: https://docs.github.com/en/actions/hosting-your-own-runners
[6]: https://github.com/coreos/ignition
[7]: https://github.com/coreos/butane
[8]: https://github.com/actions/runner
[9]: https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token
[10]: https://docs.fedoraproject.org/en-US/fedora-coreos/bare-metal/
[11]: https://fedoramagazine.org/getting-started-with-fedora-coreos/
[12]: https://github.com/cverna/fcos-actions-runner

View File

@ -0,0 +1,191 @@
[#]: subject: (Write your first web component)
[#]: via: (https://opensource.com/article/21/7/web-components)
[#]: author: (Ramakrishna Pattnaik https://opensource.com/users/rkpattnaik780)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Write your first web component
======
Don't repeat yourself; create elements you can reuse when writing web
apps for any browser.
![Digital creative of a browser on the internet][1]
Web components are a collection of open source technologies such as JavaScript and HTML that allow you to create custom elements that you can use and reuse in web apps. The components you create are independent of the rest of your code, so they're easy to reuse across many projects.
Best of all, it's a platform standard supported by all major modern browsers.
### What's in a web component?
* **Custom elements:** This JavaScript API allows you to define new types of HTML elements.
* **Shadow DOM:** This JavaScript API provides a way to attach a hidden separate [Document Object Model][2] (DOM) to an element. This encapsulates your web component by keeping the styling, markup structure, and behavior isolated from other code on the page. It ensures that styles are not overridden by external styles or, conversely, that a style from your web component doesn't "leak" into the rest of the page**.**
* **HTML templates:** The element allows you to define reusable DOM elements. The element and its contents are not rendered in the DOM but can still be referenced using JavaScript.
### Write your first web component
You can write a simple web component with your favorite text editor and JavaScript. This how-to uses bootstrap to generate simple stylings then creates a simple card web component to display the temperature of a location passed to it as an attribute. The component uses the [Open Weather API][3], which requires you to generate an APPID/APIKey by signing in.
The syntax of calling this web component requires the location's longitude and latitude:
```
`<weather-card longitude='85.8245' latitude='20.296' />`
```
Create a file named **weather-card.js** that will contain all the code for your web component. Start by defining your component. This can be done by creating a template element and adding some simple HTML elements into it:
```
const template = document.createElement('template');
template.innerHTML = `
  &lt;div class="card"&gt;
    &lt;div class="card-body"&gt;&lt;/div&gt;
  &lt;/div&gt;
`
```
Start defining the WebComponent class and its constructor:
```
class WeatherCard extends HTMLElement {
  constructor() {
    super();
    this._shadowRoot = this.attachShadow({ 'mode': 'open' });
    this._shadowRoot.appendChild(template.content.cloneNode(true));
  }
  ….
}
```
The constructor attaches the shadowRoot and sets it to open mode. Then the template is cloned to shadowRoot.
Next, access the attributes. These are the longitude and latitude, and you need them to make a GET request to the Open Weather API. This needs to be done in the `connectedCallback` function. You can use the `getAttribute` method to access the attributes or define getters to bind them to this object:
```
get longitude() {
  return this.getAttribute('longitude');
}
get latitude() {
  return this.getAttribute('latitude');
}
```
Now define the `connectedCallBack` method that fetches weather data whenever it is mounted:
```
connectedCallback() {
  var xmlHttp = new XMLHttpRequest();
  const url = `[http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}\&amp;lon=${this.longitude}\&amp;appid=API\\_KEY\\`][4]
  xmlHttp.open("GET", url, false);
  xmlHttp.send(null);
  this.$card = this._shadowRoot.querySelector('.card-body');
  let responseObj = JSON.parse(xmlHttp.responseText);
  let $townName = document.createElement('p');
  $townName.innerHTML = `Town: ${responseObj.name}`;
  this._shadowRoot.appendChild($townName);
  let $temperature = document.createElement('p');
  $temperature.innerHTML = `${parseInt(responseObj.main.temp - 273)} &amp;deg;C`
  this._shadowRoot.appendChild($temperature);
}
```
Once the weather data is retrieved, additional HTML elements are added to the template. Now, your class is defined.
Finally, define and register a new custom element by using the method `window.customElements.define`:
```
`window.customElements.define('weather-card', WeatherCard);`
```
The first argument is the name of the custom element, and the second argument is the defined class. Here's a [link to the entire component][5].
You've written your first web component! Now it's time to bring it to the DOM. To do that, you must load the JavaScript file with your web component definition in your HTML file (name it **index.html**):
```
&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
&lt;/head&gt;
&lt;body&gt;
  &lt;weather-card longitude='85.8245' latitude='20.296'&gt;&lt;/weather-card&gt;
  &lt;script src='./weather-card.js'&gt;&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
```
Here's your web component in a browser:
![Web component displayed in a browser][6]
(Ramakrishna Pattnaik, [CC BY-SA 4.0][7])
Because web components need only HTML, CSS, and JavaScript, they are natively supported by browsers and can be used seamlessly with frontend frameworks, including React and Vue. The following simple code snippet shows how to use web components with a simple React App bootstrapped with [Create React App][8]. For this, you need to import the **weather-card.js** file you defined earlier and use it as a component:
```
import './App.css';
import './weather-card';
function App() {
  return (
  &lt;weather-card longitude='85.8245' latitude='20.296'&gt;&lt;/weather-card&gt;
  );
}
export default App;
```
### Lifecycle of a web component
All components follow a lifecycle from initialization to removal from the DOM (i.e., unmount). Methods are associated with each lifecycle event so that you can control the components better. The various lifecycle events of a web component include:
* **Constructor:** The constructor for a web component is called before it is mounted, meaning it's created before the element is attached to the document. It's used for initializing local state, binding event handlers, and creating the shadow DOM. The constructor must make a call to `super()` to call the class the Web Component class extends.
* **ConnectedCallBack:** This is called when an element is mounted (that is, inserted into the DOM tree). It deals with initializations creating DOM nodes and is used mostly for operations like instantiating network requests. React developers can relate it to `componentDidMount`.
* **attributeChangedCallback:** This method accepts three arguments: `name`, `oldValue`, and `newValue`. It is called whenever one of the component's observed attributes gets changed. Attributes are declared observed attributes using a static `observedAttributes` getter: [code] static get observedAttributes() {
  return ['name', '_id'];
} [/code] `attributeChangedCallback` will be called whenever the attribute name or `_id` is changed.
* **DisconnectedCallBack:** This is called when an element is removed from the DOM tree (i.e., unmounted). It is equivalent to React's `componentWillUnmount`. It is used to free resources that won't be garbage-collected automatically, like unsubscribing from DOM events, stopping interval timers, or unregistering all registered callbacks.
* **AdoptedCallback:** It is called each time the custom element is moved to a new document. It only occurs when dealing with IFrames.
### Modular open source
Web components can be a powerful way to develop web apps. Whether you're comfortable with JavaScript or just getting started with it, it's easy to create reusable code with this great open standard, no matter what browser your target audience uses.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/web-components
作者:[Ramakrishna Pattnaik][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/rkpattnaik780
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://en.wikipedia.org/wiki/Document_Object_Model
[3]: https://openweathermap.org/api
[4]: http://api.openweathermap.org/data/2.5/weather?lat=${this.latitude}\&lon=${this.longitude}\&appid=API\_KEY\`
[5]: https://gist.github.com/rkpattnaik780/acc683d3796102c26c1abb03369e31f8
[6]: https://opensource.com/sites/default/files/uploads/webcomponent.png (Web component displayed in a browser)
[7]: https://creativecommons.org/licenses/by-sa/4.0/
[8]: https://create-react-app.dev/docs/getting-started/

View File

@ -0,0 +1,99 @@
[#]: subject: (How to manage feedback on your open project)
[#]: via: (https://opensource.com/open-organization/21/7/manage-feedback-open-project)
[#]: author: (Laura Hilliger https://opensource.com/users/laurahilliger)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to manage feedback on your open project
======
Open projects generate feedback—lots of it. How can leaders manage it
all? This process might help.
![red pen editing mistakes][1]
People who let open principles guide their leadership practices in open organizations inevitably find themselves fielding feedback. Lots of feedback.
That's by design. Open leaders [invite comment and critique][2] on just about anything they can.
But it also poses a regular challenge: How to sift through, manage, evaluate, and address that feedback in authentic and useful ways?
Members of the Open Organization project got a taste of this process recently. Working on the Open Leadership Definition—a robust, [collaborative description][3] of the specific mindsets and behaviors associated with open styles of leadership—collaborators solicited community-wide feedback on a multi-hundred-word draft document. The results were impressive—even if a bit intimidating.
As we continue diligently working through the feedback we received, we thought we'd offer some insight into our own process for managing a significant amount of feedback—in case it's useful to others trying to do the same.
### The challenge
First, we [invited anyone to read and comment][4] directly on our draft documents. Results were humbling. We're so pleased to have received so many thoughtful comments and ideas for improvement. But we received _a lot_ of comments.
We needed some way to organize, analyze, review, address, and respond to all those comments. After all, in open organizations, feedback is only valuable and effective to the extent that people respond to and act on it. 
So we turned to a well-known technological advancement that has changed the lives of many: the spreadsheet. We collected all the comments we received in a single place—and made sure everyone could see what we were doing along the way.
The result: a [collaborative and transparent worksheet][5] anyone can follow as they watch us edit and revise in line with the community's stellar feedback.
### The process
But collecting feedback is only part of the work (and the easiest part, at that). Next, we knew we needed to create (and publish) a step-by-step process anyone could follow when collaborating on edits to the Open Leadership Definition.
But collecting feedback is only part of the work (and the easiest part, at that).
Here's what we can up with:
1. Review feedback left in section documents.
2. Record/transcribe feedback, comments, and suggestions into our spreadsheet.
3. Assign editorial leads for each document section.
4. (Editorial leads) Systematically review comments in biweekly community calls with other contributors.
5. (Editorial leads) Address reviewer comments, make necessary editorial changes to documents.
6. (Editorial leads) Record their decisions, changes, and/or correspondence in the spreadsheet.
Without a doubt, it's more work than simply jumping into the document and making the changes we thought were most appropriate. Because all our work—all the feedback we received, and all the ways we were _responding_ to that feedback—was open and transparent, we'll need to _reflect on_ and _justify_ every editorial decision we made. It takes time. But it's the least we can do to reciprocate the kindness our community showed us in leaving their feedback (after all, that took time, too!).
### The results (so far)
As we've worked, we've categorized feedback into seven different "types." Some, like typos and grammar issues, are no-brainers; we'll integrate this feedback and clean up our mistakes. Others, like those that suggest additional ideas or ask us to rethink assumptions, might _also_ be no-brainers—but not all of them can be integrated so easily. So, we're using our biweekly calls to work through and discuss this feedback.
That's the most fun part—the part where we get to connect for live chatter and debate about how we are—or aren't—going to address what the community has raised.
Here's a summary of what we've seen and debated so far.
#### Working on the preamble
The first section we reviewed was the document's "preamble," which received a lot of insightful and important comments that underscored the importance of nuance. This piece of the definition summarizes the rest, and so we need to get it right. Here's what we discussed.
**The types of organizations where open leaders thrive.** We've discussed the ways open leaders can enhance organizations operating with all kinds of cultures—but argued that they're _especially_ important in _open_ organizations (because of the way command-and-control thinking can stymie openness). We acknowledge that all kinds of organizations can be open organizations—not just those wrestling with ambiguity or focusing on innovation.
**Organizations as actors.** One interesting debate centered on writing that seemed to treat _organizations themselves_ as individual actors—rather than, say, _groups_ of individual actors. Some of us argued that organizations are more than the sum of their components and that sentences like "open leaders make organizations more self-aware" made perfect sense. Others countered that this made organizations seem like sentient beings, when in fact they're _collections_ of sentient beings. We were personifying organizations, in other words. Ultimately, we were able to find a way to both defend the sentiment that an organization can be reflective (concerned with its own context, boundaries, and limitations) and yet do so in a way that doesn't completely anthropomorphize the organization. The line is blurry at best. So we discussed how open leaders support a culture of self awareness and edited our language in the preamble to try and better balance this philosophical point.
That's the most fun part—the part where we get to connect for live chatter and debate about how we are—or aren't—going to address what the community has raised.
**Mindsets and behaviors.** Here again we arrived at the question that motivated this project in the first place: _What is open leadership?_ We debated the status of "open leadership" as a "mindset" versus a "skill" versus a "practice" (each of these designations has implications for how we define open leadership and how we help others adopt it), and doing this meant negotiating the complexities of character, ego, mindfulness, and more. For instance, a skill can generally be taught, but there's more nuance to what we all believe can be "taught" versus "experienced." And as our document shows, open leadership isn't just a set of things people _do_; it's a _way of thinking_, too. So we settled on open leadership as being a specific set of "mindsets and behaviors," an organic decision [inspired by Red Hat's definition][6] of the "open leadership" concept.
**Open leaders and character.** Other excellent reviewer comments led us to discuss distributed leadership, planned obsolescence as a positive attribute and how "authority" to lead only lasts as long as people grant that authority. We discussed a nebulous quality open leaders have, character traits and experience that people value and therefore are willing to go to when support is needed. Some of our revisions will certainly reflect this discussion.
### Slow and steady wins the race
We've only just begun processing feedback on the Open Leadership Definition draft. We'll continue revising (and discussing!) in our biweekly calls, and we're planning new pieces about this work. We're eager to learn from our community and hear how this work can be more useful, so while the current draft is closed to comments, we always invite feedback. [Why not follow along][5]? And keep an eye out for future opportunities to get involved.
--------------------------------------------------------------------------------
via: https://opensource.com/open-organization/21/7/manage-feedback-open-project
作者:[Laura Hilliger][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/laurahilliger
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_mistakes.png?itok=dN0OoIl5 (red pen editing mistakes)
[2]: https://opensource.com/open-organization/17/8/what-to-do-when-nobody-participates
[3]: https://github.com/open-organization/editorial/issues/94
[4]: https://opensource.com/open-organization/21/6/celebrate-sixth-anniversary
[5]: https://docs.google.com/spreadsheets/d/1ETyMtoNK9MpkTOm2wUvqBBtcnf1S6wGWOUPvOYFyrx8/edit#gid=0
[6]: https://github.com/red-hat-people-team/red-hat-multiplier

View File

@ -0,0 +1,135 @@
[#]: subject: (Top Android Emulators to Run and Test Android Apps on Linux)
[#]: via: (https://itsfoss.com/android-emulators-linux/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Top Android Emulators to Run and Test Android Apps on Linux
======
Android is built on top of a heavily customized Linux kernel. So, running mobile apps on Linux makes sense using an Android emulator.
While this is not something new that you can do on your Linux machine, it is a feature more in demand after Windows introduced the ability to run Android apps in 2021.
Not just limited to using apps, some of the Android emulators can also come in handy for development and testing.
Hence, I have compiled a list of the best emulators that you can use to test or run Android applications/games on Linux.
### 1\. Anbox
Anbox is a pretty popular emulator that lets Linux users run Android apps. Probably this is what Deepin Linux utilizes to make help run Android apps out of the box.
It isolates the Android operating system from the host using a container, which also lets them make the latest Android version available to use.
Android apps running will not have direct access to your hardware—which is a good security decision.
Unlike some of the other options here, Anbox does not technically need an emulation layer to make Android work. In other words, it is as close to a native Android experience on your Linux system.
For this reason, it may not be the easiest option available. You cannot just use the Google Play Store to install applications, you need to utilize Android Debug Bridge (ADB). All you need is the APK file of an app to install and use it.
[Anbox][1]
### 2\. Genymotion
![][2]
Genymotion is an impressive solution tailored for testing and development.
It is not a free and open-source option. They provide virtual Android experiences as a service through the cloud or a desktop client that is independent of Android Studio.
You can simulate a variety of hardware configurations and Android versions to create a virtual device for testing. It also gives you the ability to scale up and has multiple Android virtual devices running for extensive tests.
It can help you test how file uploading works in your app, impacts battery, performance, memory, and so on.
While it is a premium solution mostly for professionals, it does support the latest Linux distributions that include Ubuntu 20.04 LTS.
[Genymotion][3]
### 3\. Android-x86
![][4]
Android x86 is an open-source project to make Android run on a PC with 32-bit support.
You can choose to install it using a virtual machine manager on your Linux system or directly try it on your PC.
Official [installation instructions][5] are available if you need to go ahead.
Unlike some other options, it is a simple emulator that tries to work on a PC with no fancy features.
[Android x86][6]
### 4\. Android Studio (Virtual Devices)
![][7]
Android Studio is a full-fledged tool for development and testing. Fortunately, with the support for Linux, you can use it to emulate the Android experience for experiments if you need to.
You just need to create an Android Virtual Device (AVD) that you can configure and then simulate as an emulator.
There are good chances to find support for some of the latest smartphones, TVs, and smartwatches as well.
It needs a certain learning curve to be able to pull it off, but it is free and completely open-source.
[Android Studio][8]
### 5\. ARChon
![][9]
An interesting solution is an Android emulator that you can use in Linux and any other platform.
It helps run Android apps on Chrome OS or with Chrome browser on any operating system. Unlike some others, you may not get a complete Android experience but only the ability to run Android apps.
You just have to unpack the runtime and load it into Chrome extensions. Next, add the app you want to use by downloading the APK file onto it.
[ARChon][10]
### 6\. Bliss OS
![][11]
Bliss OS is yet another open-source project, similar to Android x86 that aims to make Android run on PC.
Unlike Android x86, it gives more compatibility options by supporting both 32-bit and 64-bit architectures. Also, you can download the compatible file as per your processor.
It is actively maintained and supports the latest Android versions available in the market.
[Bliss OS][12]
### Wrapping Up
While you will find several Android emulators available for Linux, they may not replace a full-fledged smartphone experience.
Every emulator comes with a set of features along with a specific purpose. Choose the one that you need!
Have you tried Android emulators yet? Whats your favorite emulator that you have used in Linux? Feel free to let me know in the comments down below.
--------------------------------------------------------------------------------
via: https://itsfoss.com/android-emulators-linux/
作者:[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://anbox.io
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/genymotion-android-emulator.png?resize=800%2C508&ssl=1
[3]: https://www.genymotion.com
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-x86-emulator.jpg?resize=1920%2C1080&ssl=1
[5]: https://www.android-x86.org/installhowto.html
[6]: https://www.android-x86.org
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/android-virtual-devices-studio.png?resize=800%2C296&ssl=1
[8]: https://developer.android.com/studio
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/arcrhon.jpg?resize=800%2C426&ssl=1
[10]: https://archon-runtime.github.io
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/bliss-os-android.png?resize=800%2C576&ssl=1
[12]: https://blissos.org

View File

@ -0,0 +1,204 @@
[#]: subject: (Write your first JavaScript code)
[#]: via: (https://opensource.com/article/21/7/javascript-cheat-sheet)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Write your first JavaScript code
======
JavaScript was created for the web, but it can do so much more. Learn
the basics, then download our cheat sheet so you always have the details
at hand.
![Code with javascript on white background][1]
JavaScript is a programming language full of pleasant surprises. Many people first encounter JavaScript as a language for the web. There's a JavaScript engine in all the major browsers, there are popular frameworks such as JQuery, Cash, and Bootstrap to help make web design easier, and there are even programming environments written in JavaScript. It seems to be everywhere on the internet, but it turns out that it's also a useful language for projects like [Electron][2], an open source toolkit for building cross-platform desktop apps with JavaScript.
JavaScript is a surprisingly multipurpose language with a wide assortment of libraries for much more than just making websites. Learning the basics of the language is easy, and it's a gateway to building whatever you imagine.
### Install JavaScript
As you progress with JavaScript, you may find yourself wanting advanced JavaScript libraries and runtimes. When you're just starting, though, you don't have to install JavaScript at all. All major web browsers include a JavaScript engine to run the code. You can write JavaScript using your favorite text editor, load it into your web browser, and see what your code does.
### Get started with JavaScript
To write your first JavaScript code, open your favorite text editor, such as [Notepad++][3], [Atom][4], or [VSCode][5]. Because it was developed for the web, JavaScript works well with HTML, so first, just try some basic HTML:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;JS&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[p][10] id="example"&gt;Nothing here.&lt;/[p][10]&gt;
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Save the file, and then open it in a web browser.
![HTML displayed in browser][11]
(Seth Kenlon, [CC BY-SA 4.0][12])
To add JavaScript to this simple HTML page, you can either create a JavaScript file and refer to it in the page's `head` or just embed your JavaScript code in the HTML using the `<script>` tag. In this example, I embed the code:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;JS&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[p][10] id="example"&gt;Nothing here.&lt;/[p][10]&gt;
    &lt;[script][13]&gt;
      let myvariable = "Hello world!";
      document.getElementById("example").innerHTML = myvariable;
    &lt;/[script][13]&gt;
   
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Reload the page in your browser.
![HTML with JavaScript displayed in browser][14]
(Seth Kenlon, [CC BY-SA 4.0][12])
As you can see, the `<p>` tag as written still contains the string "Nothing here," but when it's rendered, JavaScript alters it so that it contains "Hello world" instead. Yes, JavaScript has the power to rebuild (or just help build) a webpage.
The JavaScript in this simple script does two things. First, it creates a variable called `myvariable` and places the string "Hello world!" into it. Finally, it searches the current document (the web page as the browser is rendering it) for any HTML element with the ID `example`. When it locates `example`, it uses the `innerHTML` function to replace the contents of the HTML element with the contents of `myvariable`.
Of course, using a custom variable isn't necessary. It's just as easy to populate the HTML element with something being dynamically created. For instance, you could populate it with a timestamp:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;JS&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[p][10] id="example"&gt;Date and time appears here.&lt;/[p][10]&gt;
    &lt;[script][13]&gt;
      document.getElementById("example").innerHTML = Date();
    &lt;/[script][13]&gt;
   
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Reload the page to see a timestamp generated at the moment the page is rendered. Reload a few times to watch the seconds increment.
### JavaScript syntax
In programming, **syntax** refers to the rules of how sentences (or "lines") are written. In JavaScript, each line of code must end in a semicolon (`;`) so that the JavaScript engine running your code understands when to stop reading.
Words (or "strings") must be enclosed in quotation marks (`"`), while numbers (or "integers") go without.
Almost everything else is a convention of the JavaScript language, such as variables, arrays, conditional statements, objects, functions, and so on.
### Creating variables in JavaScript
Variables are containers for data. You can think of a variable as a box where you can put data to share with your program. Creating a variable in JavaScript is done with two keywords you choose based on how you intend to use the variable: `let` and `var`. The `var` keyword denotes a variable intended for your entire program to use, while `let` creates variables for specific purposes, usually inside functions or loops.
JavaScript's built-in `typeof` function can help you identify what kind of data a variable contains. Using the first example, you can find out what kind of data `myvariable` contains by modifying the displayed text to:
```
&lt;string&gt;
let myvariable = "Hello world!";
document.getElementById("example").innerHTML = typeof(myvariable);
&lt;/string&gt;
```
This renders "string" in your web browser because the variable contains "Hello world!" Storing different kinds of data (such as an integer) in `myvariable` would cause a different data type to be printed to your sample web page. Try changing the contents of `myvariable` to your favorite number and then reloading the page.
### Creating functions in JavaScript
Functions in programming are self-contained data processors. They're what makes programming _modular_. It's because functions exist that programmers can write generic libraries that, for instance, resize images or keep track of the passage of time for other programmers (like you) to use in their own code.
You create a function by providing a custom name for your function followed by any amount of code enclosed within braces.
Here's a simple web page featuring a resized image and a button that analyzes the image and returns the true image dimensions. In this example code, the `<button>` HTML element uses the built-in JavaScript function `onclick` to detect user interaction, which triggers a custom function called `get_size`:
```
&lt;[html][6]&gt;
  &lt;[head][7]&gt;
    &lt;[title][8]&gt;Imager&lt;/[title][8]&gt;
  &lt;/[head][7]&gt;
  &lt;[body][9]&gt;
    &lt;[div][15]&gt;
      &lt;[button][16] onclick="get_size(document.getElementById('myimg'))"&gt;
        Get image size
    &lt;/[button][16]&gt;
    &lt;/[div][15]&gt;
   
    &lt;[div][15]&gt;
      &lt;[img][17] style="width: 15%" id="myimg" src="penguin.png" /&gt;
    &lt;/[div][15]&gt;
   
    &lt;[script][13]&gt;
      function get_size(i) {
        let w = i.naturalWidth;
        let h = i.naturalHeight;
        alert(w + " by " + h);
      }
    &lt;/[script][13]&gt;
   
  &lt;/[body][9]&gt;
&lt;/[html][6]&gt;
```
Save the file and load it into your web browser to try the code.
![Custom get_size function returns image dimensions][18]
(Seth Kenlon, [CC BY-SA 4.0][12])
### Cross-platform apps with JavaScript
You can see from the code sample how JavaScript and HTML work closely together to create a cohesive user experience. This is one of the great strengths of JavaScript. When you write code in JavaScript, you inherit one of the most common user interfaces of modern computing regardless of platform: the web browser. Your code is cross-platform by nature, so your application, whether it's just a humble image size analyzer or a complex image editor, video game, or whatever else you dream up, can be used by everyone with a web browser (or a desktop, if you deliver an Electron app).
Learning JavaScript is easy and fun. There are lots of websites with tutorials available. There are also over a million JavaScript libraries to help you interface with devices, peripherals, the Internet of Things, servers, file systems, and lots more. And as you're learning, keep our [**JavaScript cheat sheet**][19] close by so you remember the fine details of syntax and structure.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/javascript-cheat-sheet
作者:[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/code2.png?itok=JCJTJszs (Code with javascript on white background)
[2]: https://www.electronjs.org/
[3]: https://opensource.com/article/16/12/notepad-text-editor
[4]: https://opensource.com/article/20/12/atom
[5]: https://opensource.com/article/20/6/open-source-alternatives-vs-code
[6]: http://december.com/html/4/element/html.html
[7]: http://december.com/html/4/element/head.html
[8]: http://december.com/html/4/element/title.html
[9]: http://december.com/html/4/element/body.html
[10]: http://december.com/html/4/element/p.html
[11]: https://opensource.com/sites/default/files/pictures/plain-html.jpg (HTML displayed in browser)
[12]: https://creativecommons.org/licenses/by-sa/4.0/
[13]: http://december.com/html/4/element/script.html
[14]: https://opensource.com/sites/default/files/uploads/html-javascript.jpg (HTML with JavaScript displayed in browser)
[15]: http://december.com/html/4/element/div.html
[16]: http://december.com/html/4/element/button.html
[17]: http://december.com/html/4/element/img.html
[18]: https://opensource.com/sites/default/files/uploads/get-size.jpg (Custom get_size function returns image dimensions)
[19]: https://opensource.com/downloads/javascript-cheat-sheet

View File

@ -0,0 +1,84 @@
[#]: subject: (Fixing Flatpak Error: No remote refs found similar to flathub)
[#]: via: (https://itsfoss.com/no-remote-ref-found-flatpak/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Fixing Flatpak Error: No remote refs found similar to flathub
======
So, I just installed Fedora. Installing my favorite applications was among the list of things to do after installing Fedora.
I tried installing VLC in Flatpak form, but it gave me an error:
**error: No remote refs found similar to flathub**
![No remote refs found error displayed with Flatpak][1]
### Fixing “no remote refs found similar to flathub” error
The fix is rather simple. Add the Flathub repository in the following way:
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
It will ask for your password, or you could use the above command with sudo.
Now, if you try to install a Fltapak package from Fltahub, it should work as expected.
![Adding the Flathub repoistory fixes the issue][2]
### Reason why you see this error and how it was fixed
Now that have fixed the error, it would be a good idea to also learn why you saw this error in the first place and how it was fixed.
Like most other package managers in Linux, Flatpak also works on the concept of repositories. In simpler words, you can imagine package repositories as a warehouse where packages are stored.
But in order to retrieve a package from this warehouse, you need to know the address of the warehouse first.
Thats what happens here. You are trying to download (and install) a package from a certain repository (Flathub in this case). But your system doesnt know about this “flathub”.
In order to solve this issue, you added the Flathub repository. When you do that, your Linux system can look for the package you are trying to install in this repository.
You may see all the remote Flatpak repository added to your system.
![List Flatpak repositories added to your system][3]
Lets have a deeper look at the command which was used for adding the repository:
```
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
```
* flatpak: this is the flatpak CLI tool.
* remote-add: this option indicates that you are adding a new remote repository.
* if-not-exists: this ensures that the remote repository is only added if it is not added already.
* flathub: this is short reference for the complete URL of the actual repository. You may name it something else but the convention is to use the one provided by the developer.
* <https://flathub.org/repo/flathub.flatpakrepo>: The actual repository address.
_**So, the bottom line is that when you see Flatpak complaining about no remote refs found similar to xyz, verify that the said repository is not added and if thats the case, figure out its URL and add it to the system.**_
I hope this quick tip help you with this Flatpak issue.
--------------------------------------------------------------------------------
via: https://itsfoss.com/no-remote-ref-found-flatpak/
作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-remote-ref-not-found-error-800x265.png?resize=800%2C265&ssl=1
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-no-remote-ref-problem-fixed.png?resize=800%2C317&ssl=1
[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/flatpak-list-repositories.png?resize=800%2C317&ssl=1

View File

@ -0,0 +1,38 @@
[#]: subject: (My family's Linux story)
[#]: via: (https://opensource.com/article/21/5/my-linux-story)
[#]: author: (Chris Hermansen https://opensource.com/users/clhermansen)
[#]: collector: (lujun9972)
[#]: translator: (shiboi77 )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
我的家庭 Linux 故事
======
我们在Linux的第一次尝试只是一个简单的方法。
![在橙色背景的终端命令提示][1]
我在linux的第一次尝试是“或许我应该试一试”的这种情况。
回到1990年我在相当多的软盘上找到了一些打包的红帽发行版我为家庭笔记本买了第二个硬盘然后设置安装了它。 这是一件有趣的实验但是我记起家中并没有准备在这程度上分享电脑。快进到2005年我最终崩溃了买了一台运行windows xp的可爱的东芝笔记本电脑。在工作中我有一个老化的SUN SPARCStation 5并且我不太喜欢整个solaris的发展方向基于Motif的桌面。我真的想要用GIMP来完成一些项目或其他项目但是安装GNOME1.x的是复杂的也许它是1.4在Solaris是具有挑战性的。所以我实际上是在考虑跳槽到Windows xp。 但是在我的家用机器上用了几个月之后我发现自己喜欢它的程度甚至低于在Solaris上运行GNOME所以我安装了Ubuntu Hoary Hedgehog 5.04然后在我的笔记本电脑上安装了Breezy Badger 5.10。这太棒了。那台拥有3.2GHz奔腾处理器2GB内存和100GB的硬盘的机器在我的SPARCStation 5周围运行。
突然之间不再是用拼凑起来的Solaris安装包试图去让东西运行这些事情仅仅是一个轻松地方式。并且时机也很好。我家庭和我从2006年8月到2007年7月居住在法国格勒诺布尔而我的妻子在休假。因为有了linux东芝我才能随身带着我的工作。那个时候我在几大项目上做了大量的GIS数据处理我发现我可以在PostGIS / PostgreSQL上做同样的事情比我们在加拿大使用的昂贵得多的商业GIS软件要快得多。大家都很开心尤其是我。
一路上发生的有趣的事情是我们把另外两台电脑逮到了法国——我妻子的类似的东芝电脑运行xp对她来说很好用和我们孩子最近新买的东芝牌笔记本电脑也运行xp。仅仅就在圣诞节过后他们有一些朋友在无意中安装了一个讨厌的并且无法清除的病毒在他们的电脑上。经过几个小时甚至几天后我的一个孩子问我“爸爸我们就不能安装和你电脑上一样的东西吗”然后创建了三个新的Linux用户。我的儿子在29岁依然是一个快乐的Linux用户我猜他第四或第五台Linux笔记本电脑的系统全部由最近的系统76支持。我的一个女儿三年前开始读法学院因为他所在的学校有一个强制性的测试框架只能在Windows上运行而且据称会检测VM之类的东西请不要让我开始。而且我的另一个女儿被她的公司为她买的Macbook Air诱惑了。
哦,好吧,不能赢得他们所有!
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/5/my-linux-story
作者:[Chris Hermansen][a]
选题:[lujun9972][b]
译者:[shiboi77](https://github.com/shiboi77)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clhermansen
[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)

View File

@ -1,106 +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: (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,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: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
满足日常需求的应用第一部分:网络浏览器
======
![][1]
照片由 [Brooke Cagle][2] 发布在 [Unsplash][3]。
满足日常需求的重要应用之一是网络浏览器。这是因为上网是大多数人在电脑前进行的一项活动。本文将介绍一些你可以在 Fedora Linux 上使用的开源网络浏览器。你需要安装上述软件。本文提到的所有浏览器都已经在官方的 Fedora 软件库中提供。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。
### Firefox
火狐是一个快速且注重隐私的浏览器,可以在许多设备上使用。它是由 [Mozilla][5] 创建的,是一个具有完整功能的浏览器,提供许多扩展。你可以为你的火狐浏览器添加许多强大的功能和有用的特性。它只使用适量的内存来创造一个流畅的体验,使你的电脑保持对其他任务的响应。你可以创建一个账户,让你在多个设备上共享配置,所以你不需要在每个设备上设置火狐浏览器。
![][6]
火狐浏览器提供以下功能:
* 隐私浏览模式
* 阻止广告跟踪器
* 密码管理器
* 设备之间的同步
* 画中画
关于火狐浏览器的更多信息可在此链接中找到:[https://www.mozilla.org/en-US/firefox][7]
### GNOME Web
GNOME Web 是 GNOME 桌面的一个浏览器,它是 Fedora 工作站的默认桌面环境。如果你使用 GNOME 作为默认桌面环境的 Fedora Workstation它可能非常适合作为你的主浏览器。这个浏览器有一个简单、干净、漂亮的外观。GNOME Web 的功能比 Firefox 少,但对于普通用途来说已经足够了。
![][8]
GNOME Web 提供了以下功能:
* 隐身模式
* GNOME 桌面集成
* 内置广告拦截器
* 智能跟踪预防
关于 GNOME Web 的更多信息可以在这个链接中找到:<https://wiki.gnome.org/Apps/Web>
### Chromium
Chromium 是一个来自 Chromium 项目的开源网络浏览器,它有一个极简的用户界面。它的外观与 Chrome 相似,因为它实际上是作为 Chrome 和其他几个浏览器的基础。许多人使用 Chromium 是因为他们已经习惯了 Chrome。
![][9]
Chromium 提供以下功能:
* 隐身模式
* 扩展程序
* 密码的自动填写
关于 Chromium 浏览器的更多信息可在此链接中找到:<https://www.chromium.org/Home>
### qutebrowser
这个浏览与上面提到的稍有不同qutebrowser 是一个以键盘为中心的浏览器,具有最小的 GUI。因此你不会发现通常在其他浏览器中的按钮如返回、主页、重新加载等。相反你可以用键盘输入命令来运行 qutebrowser 中的功能。它使用 Vim 风格的键绑定,所以它适合 Vim 用户。如果你有兴趣在上网时获得不同的体验,你应该试试这个浏览器。
![][10]
qutebrowser 提供以下功能:
* 广告屏蔽
* 隐私浏览模式
* 快速书签
关于 qutebrowser 浏览器的更多信息可在此链接中找到:<https://qutebrowser.org/>
### 总结
每个人在使用互联网时都有不同的需求,特别是在浏览方面。本文中提到的每个浏览器都有不同的功能。因此,请选择适合你日常需求和喜好的浏览器。如果你使用的是本文中提到的浏览器,请在评论中分享你的故事。如果你使用的是其他的浏览器,请说一下。希望这篇文章能帮助你选择在 Fedora 上满足你日常需求的浏览器。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/apps-for-daily-needs-part-1-web-browsers/
作者:[Arman Arisman][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://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,160 @@
[#]: subject: (Run Python applications in virtual environments)
[#]: via: (https://opensource.com/article/21/7/python-pipx)
[#]: author: (Sumantro Mukherjee https://opensource.com/users/sumantro)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
在虚拟环境中运行 Python 应用
======
通过使用 pipx 隔离运行 Python 应用来避免版本冲突并提高安全性。
![Digital creative of a browser on the internet][1]
如果你使用 Python你可能会安装很多 Python 应用。有些是你只想尝试的工具。还有一些是你每天都在使用的久经考验的应用,所以你把它们安装在你使用的每一台计算机上。这两种情况下,在虚拟环境中运行你的 Python 应用是非常有用的,这可以使它们以及它们的依赖关系相互分离,以避免版本冲突,并使它们与你系统的其它部分隔离,以提高安全性。
这就是 [pipx][2] 出场的地方。
大多数 Python 应用可以使用 [pip][3] 进行安装,它只安装 Python 包。然而Pipx 为你的 Python 应用创建并管理一个虚拟环境,并帮助你运行它们。
### 安装 pipx
Pipx 主要是一个 RPM 包,你可以在任何 Fedora、RHEL 或 CentOS 机器上安装它:
```
`$ sudo dnf install pipx`
```
### 使用 pipx
我将通过 Cowsay 以及 [Concentration][4] 工具演示如何使用 pipx。
#### 安装软件包
安装完 pipx 后,你可以用以下方法安装 Python 包:
```
`$ pipx install <python_package>`
```
要安装 Cowsay 包:
```
$ pipx install cowsay ✔ │ 20:13:41
installed package cowsay 4.0, Python 3.9.5
These apps are now globally available
- cowsay
done! ✨ 🌟 ✨
```
现在你可以在系统的任何地方运行 Cowsay通过终端与你对话
```
$ cowsay "I &lt;3 OSDC"
_________
| I &lt;3 OSDC |
=========
\
\
^__^
(oo)\\_______
(__)\ )\/\
||----w |
|| ||
```
![Cowsay][5]
Sumantro Mukherjee, [CC BY-SA 4.0][6]
#### 以特殊权限进行安装
不是所有的应用都像 Cowsay 一样简单。例如Concentration 会与你系统中的许多其他组件交互,所以它需要特殊的权限。用以下方式安装它:
```
$ pipx install concentration ✔ │ 10s │ │ 20:26:12
installed package concentration 1.1.5, Python 3.9.5
These apps are now globally available
- concentration
done! ✨ 🌟 ✨
```
Concentration 通过阻止 “distractors” 文件中列出的特定网站来帮助你集中注意力。要做到这点,它需要以 sudo 或 root 权限运行。你可以用 [OpenDoas][7] 来做到这点,这是 `doas` 命令的一个版本,可以用特定的用户权限运行任何命令。要使用 `doas` 以 sudo 权限来运行 Concentration
```
$ doas concentration improve ✔ │ │ 20:26:54
doas (sumantrom) password:
Concentration is now improved :D!
```
如你所见,这个独立的应用能够改变系统中的一些东西。
#### 列出已安装的应用
`pipx list` 命令显示所有用 pipx 安装的应用和它们的可执行路径:
```
$ pipx list
venvs are in /home/sumantrom/.local/pipx/venvs
apps are exposed on your $PATH at /home/sumantrom/.local/bin
package concentration 1.1.5, Python 3.9.5
- concentration
package cowsay 4.0, Python 3.9.5
- cowsay
```
#### 卸载应用
当你使用完毕后知道如何卸载它们是很重要的。Pipx 有一个非常简单的卸载命令:
```
`$ pipx uninstall <package name>`
```
或者你可以删除每个软件包:
```
$ pipx uninstall-all
pipx uninstall-all 2 ✘ │ 20:13:35
uninstalled cowsay! ✨ 🌟 ✨
uninstalled concentration! ✨ 🌟 ✨
```
### 尝试 pipx
Pipx 是一个流行的 Python 应用的包管理器。它可以访问 [PyPi][8] 上的所有东西,但它也可以从包含有效 Python 包的本地目录、Python wheel 或网络位置安装应用。
如果你安装了大量的 Python 应用,可以试试 pipx。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/python-pipx
作者:[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/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet)
[2]: https://pypi.org/project/pipx/
[3]: https://pypi.org/project/pip/
[4]: https://opensource.com/article/20/8/python-concentration
[5]: https://opensource.com/sites/default/files/uploads/cowsay.png (Cowsay)
[6]: https://creativecommons.org/licenses/by-sa/4.0/
[7]: https://github.com/Duncaen/OpenDoas
[8]: https://pypi.org/

View File

@ -0,0 +1,94 @@
[#]: subject: (Meet Clapper: A Sleek Looking Linux Video Player for Minimalists)
[#]: via: (https://itsfoss.com/clapper-video-player/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
认识 Clapper一款外观时尚的 Linux 视频播放器,适合极简主义者使用
======
喜欢极简主义吗?你会喜欢 Clapper 的。
Clapper 是一个新的 [Linux 视频播放器][1]。实际上,它更多的是为 GNOME 而不是为 Linux。
它构建在 GNOME 的 JavaScript 库和 GTK4 工具包之上,自然地融合在 GNOME 的桌面环境中。它使用 [GStreamer][2] 作为媒体后端,使用 [OpenGL][3] 进行渲染。
我喜欢极简主义的应用。虽然 VLC 是媒体播放器中的瑞士刀,但我更喜欢 [MPV 播放器][4],因为它的界面时尚、简约。现在我想要坚持使用 Clapper 一段时间了。
### Clapper 视频播放器
![A screenshot of Clapper video player][5]
[Clapper 默认使用硬件加速][6]。它支持英特尔和 AMD 的 GPU在 Xorg 和 Wayland 上都能工作。
[Clapper][7] 不使用传统的上部窗口栏。有自动隐藏的偏好菜单、模式切换器和窗口控制按钮供你访问一些功能。这给了它一个时尚、简约的外观。
它有三种模式:
* 窗口模式:默认模式显示进度条和窗口控制。
* 浮动模式:进度条被隐藏,播放器漂浮在其他应用程序的顶部,就像“[总是在顶部][8]”或“画中画”模式。
* 全屏模式:播放器进入全屏,进度条变大,但它们都会自动隐藏起来
![Interface of Clapper video player with preference control and window modes][9]
Clapper 也有一个自适应的用户界面,也可以在基于 Linux 的智能手机和平板电脑上使用。因此,如果你有自己的 Pine Phone 或 Librem5你可以在它上面使用 Clapper。
它支持字幕,并可选择改变字体。然而,在我的测试中,字幕并不可用。也没有选项可以明确地在播放的视频中添加字幕。这一点必须改进。
和 VLC 一样如果你再次打开同一个视频文件Clapper 也可以让你选择从最后一个点恢复播放。这是我喜欢的 VLC 中的一个[方便的功能][10]。
如果你提供 URLClapper 也支持从互联网上播放视频。
这里的截图中,我正在 Clapper 中播放一个 YouTube 视频。这是一首由一位美丽的歌手和演员唱的优美歌曲。你能猜到这是哪首歌或哪部电影吗?
![Clapper playing a video from YouTube][11]
### 在 Linux 上安装 Clapper
对 Arch 和 Manjaro 用户而言Clapper 可在 AUR 中找到。这不是对所有人的惊喜。AUR 有这世上的一切。
对于其他发行版Clapper 官方提供了 [Flatpak 包][12]。所以,请[为你的发行版启用 Flatpak 支持][13],然后使用下面的命令来安装它:
```
flatpak install flathub com.github.rafostar.Clapper
```
安装后,只需在应用菜单中搜索它,或右击视频文件,选择用 Clapper 打开它。
Clapper 远不是一个完美的视频播放器。然而,它有可能成为一个流行的 Linux 应用。
如果你使用它,请分享你的经验。如果你发现问题,请[通知开发者][14]。
--------------------------------------------------------------------------------
via: https://itsfoss.com/clapper-video-player/
作者:[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://itsfoss.com/video-players-linux/
[2]: https://gstreamer.freedesktop.org/
[3]: https://www.opengl.org/
[4]: https://itsfoss.com/mpv-video-player/
[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-screenshot.png?resize=800%2C498&ssl=1
[6]: https://github.com/Rafostar/clapper/wiki/Hardware-acceleration
[7]: https://github.com/Rafostar/clapper
[8]: https://itsfoss.com/always-on-top/
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-video-player-interface.jpg?resize=800%2C480&ssl=1
[10]: https://itsfoss.com/simple-vlc-tips/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/clapper-youtube-video.jpg?resize=800%2C501&ssl=1
[12]: https://flathub.org/apps/details/com.github.rafostar.Clapper
[13]: https://itsfoss.com/flatpak-guide/
[14]: https://github.com/Rafostar/clapper/issues