Merge pull request #2 from LCTT/master

update 20210723
This commit is contained in:
SamMa 2021-07-23 10:44:22 +08:00 committed by GitHub
commit 8083368a8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 5475 additions and 3069 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

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

View File

@ -1,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> (一个<ruby>认知同义词<rt>cognitive synonyms</rt></ruby>常被称作 synset)
词网是一个很有用的文本分析工具。它有面向多种语言的版本(汉语、英语、日语、俄语和西班牙语等),也使用多种许可证(从开源许可证到商业许可证都有)。初代版本的词网由普林斯顿大学研发,面向英语,使用<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>computer science</rt></ruby>)数据或计算机程序指令的<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>lemma</rt></ruby>直接与其他<ruby>词元<rt>lemma</rt></ruby>关联,而不是直接与<ruby>单词<rt>words/rt></ruby>相关联| `code.v.02`<ruby>词元<rt>lemma</rt></ruby>是`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>| 意思相反的词 | <ruby>词元<rt>lemma</rt></ruby>`encode.v.01.encode` 的<ruby>反义词<rt>antonym</rt></ruby>`decode.v.01.decode`|
|<ruby>上义词<rt>Hypernym</rt></ruby>|该词所属的一个范畴更大的词 | `code.v.01` 的一个<ruby>上义词<rt>hypernym</rt></ruby>`tag.v.01`|
|<ruby>分项词<rt>Meronym</rt></ruby>| 属于该词组成部分的词 | <ruby>计算机<rt>computer</rt></ruby>的一个<ruby>分项词<rt>meronym</rt></ruby><ruby>芯片<rt>chip</rt></ruby>|
|<ruby>总项词<rt>Holonym</rt></ruby>| 该词作为组成部分所属的词 | <ruby><rt>window</rt></ruby>的一个<ruby>总项词<rt>holonym</rt></ruby><ruby>电脑屏幕<rt>computer screen</rt></ruby>|
|<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`|
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>lemma</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>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>,比如:
@ -226,13 +223,13 @@ NLTK 提供多种<ruby>相似度计分器<rt>similarity scorers</rt></ruby>
* jcn_similarity
* lin_similarity
要进一步了解这<ruby>相似度计分器<rt>similarity scorers</rt></ruby>,请查看 [WordNet Interface][6] 的 Similarity 部分。
要进一步了解这<ruby>相似度计分器<rt>similarity scorers</rt></ruby>,请查看 [WordNet Interface][6] 的 Similarity 部分。
#### 自主尝试
使用 Python 库,从维基百科的 [Category: Lists of computer terms][7] 生成一个术语列表,然后计算各术语之间的相似度。
### <ruby><rt>tree</rt></ruby><ruby>树库<rt>treebank</rt></ruby>
### 树和树库
使用 NLTK你可以把文本表示成树状结构以便进行分析。
@ -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,30 +376,26 @@ 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'`
sentence = 'Peterson first suggested the name "open source" at Palo Alto, California'
```
验证这个句子里的<ruby>人名<rt>name</rt></ruby><ruby>地名<rt>place</rt></ruby>有没有被识别出来。照例先预处理:
@ -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,35 +458,31 @@ 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>keywords</rt></ruby>列表或者<ruby>技术<rt>techonologies</rt></ruby>列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。
* 找出其中频率最高的<ruby>单词<rt>unigrams</rt></ruby><ruby>、二元搭配<rt>bigrams</rt></ruby><ruby>三元搭配<rt>trigrams</rt></ruby>,将它们作为一个关键词列表或者技术列表。相关领域的学生或者工程师需要了解这样一份列表里的内容。
* 图形化地显示这个领域里重要的人名、技术、日期和地点。这会是一份很棒的信息图。
* 构建一个<ruby>搜索引擎<rt>search engine</rt></ruby>。你的<ruby>搜索引擎<rt>search engine</rt></ruby>性能能够超过维基百科吗?
* 构建一个搜索引擎。你的搜索引擎性能能够超过维基百科吗?
### 下一步?
### 接下来可以做什么?
<ruby>自然语言处理<rt>NLP</rt></ruby><ruby>应用构建<rt>application building</rt></ruby>的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。
自然语言处理是<ruby>应用构建<rt>application building</rt></ruby>的典型支柱。NLTK 是经典、丰富且强大的工具集,提供了为现实世界构建有吸引力、目标明确的应用的工作坊。
在这个系列的文章里,我用 NLTK 作为例子,展示了自然语言处理可以做什么。自然语言处理和 NLTK 还有太多东西值得探索,这个系列的文章只是帮助你探索它们的切入点。
如果你的需求慢慢增长到 NLTK 已经满足不了了,你可以训练新的模型或者向 NLTK 添加新的功能。基于 NLTK 构建的新的<ruby>自然语言处理库<rt>NLP libraries</rt></ruby>正在不断涌现,机器学习也正被深度用于自然语言处理。
如果你的需求增长到 NLTK 已经满足不了了,你可以训练新的模型或者向 NLTK 添加新的功能。基于 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,55 @@
[#]: collector: "lujun9972"
[#]: translator: "mcfd"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13589-1.html"
[#]: subject: "My top 7 keywords in Rust"
[#]: via: "https://opensource.com/article/20/10/keywords-rust"
[#]: author: "Mike Bursell https://opensource.com/users/mikecamel"
我的 7 大 Rust 关键字
======
> 从 Rust 标准库学习一些有用的关键字。
![Rustacean t-shirt][1]
我使用 [Rust][2] 已经有几个月了,写的东西比我预期的要多——尽管随着我的学习,我改进了所写的代码,并完成了一些超出我最初意图的更复杂的任务,相当多的东西已经被扔掉了。
我仍然喜欢它,并认为谈论一些在 Rust 中反复出现的重要关键字可能会有好处。我会提供我个人对它们的作用的总结:为什么你需要考虑如何使用它们,以及任何其他有用的东西,特别是对于刚接触 Rust 的新手或来自另一种语言的人(如 Java请阅读我的文章 [为什么作为一个 Java 程序员的我喜欢学习 Rust][3])。
事不宜迟,让我们开始吧。获取更多信息的好地方总是 Rust 官方文档 —— 你可能想从 [std 标准库][4]开始。
1. `const` – 你可以用 `const` 来声明常量,而且你应该这样做。虽然这不是造火箭,但请一定要用 `const` ,如果你要在不同的模块中使用常量,那请创建一个 `lib.rs` 文件Rust 默认的),你可以把所有的常量放在一个命名良好的模块中。我曾经在不同模块的不同文件中发生过 `const` 变量名(和值)的冲突,仅仅是因为我太懒了,除了在不同文件中剪切和粘贴之外,我本可以通过创建一个共享模块来节省大量的工作。
2. `let` – 你并不 _总是_ 需要用 `let` 语句声明一个变量但当你这样做时你的代码会更加清晰。此外如果可以请一定要添加变量类型。Rust 会尽最大努力猜测它应该是什么类型的变量,但它不一定总能在运行时做到这一点(在这种情况下,编译器 [Cargo][5] 会提示你),它甚至可能做不到你期望的那样。在后一种情况下,对于 Cargo 来说,抱怨你所赋值的函数(例如)与声明不一致,总比 Rust 试图帮助你做错事,而你却不得不在其他地方花费大量时间来进行调试要简单。
3. `match`  `match` 对我来说是新鲜事物,我喜欢使用它。它与其他编程语言中的 `switch` 没有什么不同,但在 Rust 中被广泛使用。它使代码更清晰易读如果你做了一些愚蠢的事情例如错过一些可能的情况Cargo 会很好地提示你。我一般的经验法则是,在管理不同的选项或进行分支时,如果可以使用 `match`,那就请一定要使用它。
4. `mut`  在声明一个变量时如果它的值在声明后会发生变化那么你需要声明它是可变的LCTT 译注Rust 中变量默认是不可变的)。常见的错误是在某个变量 _没有_ 变化的情况下声明它是可变的,这时编译器会警告你。如果你收到了 Cargo 的警告,说一个可变的变量没有被改变,而你认为它被 _改变_ 了,那么你可能要检查该变量的范围,并确保你使用的是正确的那个。
5. `return` – 实际上我很少使用 `return`,它用于从函数中返回一个值,但是如果你只是在函数的最后一行提供值(或提供返回值的函数),通常会变得更简单,能更清晰地阅读。警告:在很多情况下,你 _会_ 忘记省略这一行末尾的分号(`;`),如果你这样做,编译器会不高兴的。
6. `unsafe` – 如其意:如果你想做一些不能保证 Rust 内存安全的事情,那么你就需要使用这个关键字。我绝对无意在现在或将来的任何时候宣布我的任何 Rust 代码不安全Rust 如此友好的原因之一是它阻止了这种黑客行为。如果你真的需要这样做,再想想,再想想,然后重新设计代码。除非你是一个非常低级的系统程序员,否则要 _避免_ 使用 `unsafe`
7. `use` – 当你想使用另一个 crate 中的东西时,例如结构体、变量、函数等,那么你需要在你要使用它的代码的代码块的开头声明它。另一个常见的错误是,你这样做了,但没有在 `Cargo.toml` 文件中添加该 crate (最好有一个最小版本号)。
我知道,这不是我写过的最复杂的文章,但这是我在开始学习 Rust 时会欣赏的那种文章。我计划在关键函数和其他 Rust 必知知识方面编写类似的文章:如果你有任何要求,请告诉我!
* * *
_本文最初发表于 [Alice, Eve, and Bob][6] 经作者许可转载。_
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/10/keywords-rust
作者:[Mike Bursell][a]
选题:[lujun9972][b]
译者:[mcfd](https://github.com/mcfd)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/mikecamel
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rustacean-tshirt.jpg?itok=u7LBmyaj "Rustacean t-shirt"
[2]: https://www.rust-lang.org/
[3]: https://opensource.com/article/20/5/rust-java
[4]: https://doc.rust-lang.org/std/
[5]: https://doc.rust-lang.org/cargo/
[6]: https://aliceevebob.com/2020/09/01/rust-my-top-7-keywords/

View File

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

View File

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

View File

@ -0,0 +1,109 @@
[#]: subject: (Using Git Version Control as a Writer)
[#]: via: (https://news.itsfoss.com/version-control-writers/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: (piaoshi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-13604-1.html)
作为一个写作者如何使用 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] 之一,我曾详细地谈到了这一点,所以我不打算再在这个问题上大谈特谈。重点是,在现代世界中,在现代设备上进行写作,可能远非理想状态。
因为我已经详细介绍过了 [我为什么转向 Vim][2] 和开源版本控制,在这篇文章中,我更想谈谈该 **怎么做**,特别是如何使用开源的版本控制技术,比如 Git和 GitHub
### 什么是版本控制?再来一次?
![Source: https://git-scm.com/][3]
上图是我们如何进行传统版本控制的一个说明。这个图中假设你有一台设备,而且你只在那台设备上写作。但对我而言,我在许多机器上写作,包括我的安卓手机和一些不同年代的笔记本电脑,我会在特定的任务、特定的位置使用到它们。我在所有这些设备上进行的一个共同任务就是写作 —— 因此,我的设备必须以合理的方式捕捉变化并控制文件的版本。不要再让我将 `file1V1_device1_date.doc` 作为文件名了。
上图也没有考虑到我们用来写作的工具。像 LibreOffice Write 这样的文字处理器可以在 Linux、Mac 和 Windows 系统上使用,但在手机上使用文字处理器将会是一段不愉快的经历。我们中的一些写作者还使用其他文本工具(包括 Gmail 或我们的电子邮件客户端)来为我们的写作打草稿。但按逻辑顺序跟踪所有这些文件和电子邮件是相当折磨人的,我就用这样的流程写过一本书,相信我:我花在弄清文件名、版本变化、评论、给自己的注释以及带有附加注释的电子邮件上的时间,足以让我精神错乱。
读到这里,你们中的一些人可能会正确地指出,有云备份技术呀。虽然云存储的好处是巨大的,而且我也在继续使用它们,但其版本控制几乎不存在,或者说并不强大。
### 一个更好的工作流程
就像地球上的其它地方一样,大流行病的开始引发了一些焦虑和一些反思。我利用这段时间在 [The Odin Project][4](强烈推荐给那些想学习 html、CSS、JavaScript/Ruby 的人)上自学了网络开发。
在课程的第一个模块中,有一个关于 Git 的介绍:什么是版本控制,以及它试图解决什么问题。读了这一章后,我豁然开朗。我立即意识到,这个 _Git_ 正是我作为一个写作者所要寻找的东西。
是的,更好的方法不是本地化的版本控制,而是 _分布式_ 的版本控制。“分布式”描述的是设备的分布,而我在这些设备上访问文件,以及之后进行编辑修改。下图是分布式版本控制的一个直观说明。
![Source: https://git-scm.com/][5]
### 我的方法
我为写作建立一个版本控制系统的目标如下:
* 使我的稿件库可以从任何地方、任何设备上访问
* 易于使用
* 减少或消除因在写作、学习和编码各工作流程之间的场景切换而产生的摩擦 —— 尽可能使用同一工具(即 Vim
* 可扩展性
* 易于维护
基于以上需求,下图是我进行写作的分布式版本控制系统。
![][6]
如你所见,我的版本控制系统是分布式版本控制的一个简单的适配。在我的例子中,通过将 Git 版本控制应用到云存储([pCloud][7])的一个文件夹上,我可以同时利用这两种技术的优点。因此,我的工作流程可以用下图描述:
![][8]
#### 优势
1. 我用一个写作(和编码)工具
2. 我可以对我的手稿进行版本控制,无论我是从什么设备上访问文件的
3. [超级简单,几乎没有任何不便之处][9]
4. 易于维护
#### 缺点
你们中的写作者一定想知道这个系统存在什么缺点。以下是我在持续使用和完善这一工作流程时预计到的几个问题。
* 对草稿的评论:文字处理器的一个更有用的功能是具有评论的功能。当我希望以后再回到文本的某一部分时,我经常在这部分为自己留下一个评论。我仍然没有想出一个解决这个问题的办法。
* 协作:文字处理程序允许写作者之间进行协作。在我以前做广告相关工作的时候,我会用 Google Docs 来写文案,然后分享链接给我的设计师,从而他可以为广告和网站对文案进行摘录。现在,我的解决方法是用 Markdown 写文案,并通过 Pandoc 将 Markdown 文件导出为 .doc 文件。更关键的是,当我的手稿完成后,我仍然需要将文件以 .doc 格式发送给我的编辑。一旦我的编辑做了一些修改并把它发回来,我再尝试用 Vim 打开它就没有意义了。在这一点上,该系统的局限性变得更加明显。
我并不是说这是最好的方法,但在我职业生涯的这个阶段,这是对我来说最好的方法。我想,随着我对我的新的 [用于写作的开源工具][10] 和版本控制越来越熟悉和适应,我将进一步完善这个方法。
我希望这篇文章能为那些想使用 Git 进行文档版本控制的写作者提供一个很好的介绍。这肯定不是一篇详尽的文章,但我将分享一些有用的链接,使你的旅程更容易。
1. [The Odin Project 介绍的 Git 基础知识][11]
2. [开始使用 Git][12]
3. GitHub 的 Git 基础知识教程
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/version-control-writers/
作者:[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://news.itsfoss.com/configuring-vim-writing/
[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]: 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]: 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
[12]: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control

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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,269 @@
[#]: subject: "How different programming languages read and write data"
[#]: via: "https://opensource.com/article/21/7/programming-read-write"
[#]: author: "Alan Smithee https://opensource.com/users/alansmithee"
[#]: collector: "lujun9972"
[#]: translator: "MjSeven"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-13599-1.html"
不同的编程语言是如何读写数据的
======
> 每种编程语言都有其独特的完成任务的方式,这也说明了为什么有这么多语言可供选择。
![](https://img.linux.net.cn/data/attachment/album/202107/20/065355dfr3f1zmf7fpzmw7.jpg)
在 Jim Hall 的《[不同的编程语言如何完成相同的事情][2]》文章中,他演示了 13 种不同的语言如何使用不同的语法来完成同一个任务。经验是,编程语言往往有很多相似之处。一旦你了解了一种编程语言,你就可以通过理解它的语法和结构来学习另一种。
本着同样的精神Jim 的文章比较了不同编程语言如何读写数据。无论数据来自配置文件还是用户创建的文件,在存储设备上处理数据都是程序员的常见任务。以这种方式涵盖所有编程语言是不切实际的,但最近的 Opensource.com 系列文章提供了对这些编程语言采用的不同方法的深入了解:
* [C][3]
* [C++][4]
* [Java][5]
* [Groovy][6]
* [Lua][7]
* [Bash][8]
* [Python][9]
### 读写数据
用计算机读写数据的过程和你在现实生活中读写数据的过程类似。要访问书中的数据,你首先要打开它,然后阅读单词或将生词写入书中,然后合上书。
当程序需要从文件中读取数据时,你向程序传入一个文件位置,然后计算机将该数据读入内存中并解析它。同样,当程序需要将数据写入文件时,计算机会将新数据放入系统的内存写入缓冲区,然后将其同步到存储设备上的文件中。
下面是这些操作的一些伪代码:
1. 在内存中加载文件。
2. 读取文件内容,或将数据写入文件。
3. 关闭文件。
### 从文件中读取数据
从 Opensource.com 系列文章的语言中,你可以看到读取文件的三种趋势。
#### C
在 C 语言中,打开文件可能涉及检索单个字符(直到 `EOF` 指示符,表示文件结束)或一个数据块,具体取决于你的需求和方法。根据你的目标,它可能感觉像一个主要是手工的过程,但这正是其他语言所模仿的。
```
FILE *infile;
int ch;
infile = fopen(argv[1], "r");
do {
ch = fgetc(infile);
if (ch != EOF) {
printf("%c", ch);
}
} while (ch != EOF);
fclose(infile);
```
你还可以选择将文件的某些部分加载到系统缓冲区中,然后在缓冲区外工作。
```
FILE *infile;
char buffer[300];
infile = fopen(argv[1], "r");
while (!feof(infile)) {
size_t buffer_length;
buffer_length = fread(buffer, sizeof(char), 300, infile);
}
printf("%s", buffer);
fclose(infile);
```
#### C++
C++ 简化了一些步骤,允许你将数据解析为字符串。
```
std::string sFilename = "example.txt";
std::ifstream fileSource(sFilename);
std::string buffer;
while (fileSource >> buffer) {
std::cout << buffer << std::endl;
}
```
#### Java
Java 和 Groovy 类似于 C++。它们使用名为 `Scanner` 的类来设置数据流或对象,这样就会包含你选择的文件内容。你可以通过标记(字节、行、整数等)扫描文件。
```
File myFile = new File("example.txt");
Scanner myScanner = new Scanner(myFile);
while (myScanner.hasNextLine()) {
String line = myScanner.nextLine();
System.out.println(line);
}
myScanner.close();
```
#### Groovy
```
def myFile = new File('example.txt')
def myScanner = new Scanner(myFile)
while (myScanner.hasNextLine()) {
def line = myScanner.nextLine()
println(line)
}
myScanner.close()
```
#### Lua
Lua 和 Python 进一步抽象了整个过程。你不必有意识地创建数据流,你只需给一个变量赋值为 `open` 函数的返回值,然后解析该变量的内容。这种方式快速,最简且容易。
```
myFile = io.open('example.txt', 'r')
lines = myFile:read("*all")
print(lines)
myFile:close()
```
#### Python
```
f = open('example.tmp', 'r')
for line in f:
print(line)
f.close()
```
### 向文件中写入数据
就写代码来说,写入是读取的逆过程。因此,将数据写入文件的过程与从文件中读取数据基本相同,只是使用了不同的函数。
#### C
在 C 语言中,你可以使用 `fputc` 函数将字符写入文件:
```
fputc(ch, outfile);
```
或者,你可以使用 `fwrite` 将数据写入缓冲区。
```c
fwrite(buffer, sizeof(char), buffer_length, outfile);
```
#### C++
因为 C++ 使用 `ifstream` 库为数据打开缓冲区,所以你可以像 C 语言那样将数据写入缓冲区C++ 库除外)。
```
std::cout << buffer << std::endl;
```
#### Java
在 Java 中,你可以使用 `FileWriter` 类来创建一个可以写入数据的对象。它的工作方式与 `Scanner` 类非常相似,只是方向相反。
```
FileWriter myFileWriter = new FileWriter("example.txt", true);
myFileWriter.write("Hello world\n");
myFileWriter.close();
```
#### Groovy
类似地Groovy 使用 `FileWriter`,但使用了稍微 “groovy” 的语法。
```
new FileWriter("example.txt", true).with {
write("Hello world\n")
flush()
}
```
#### Lua
Lua 和 Python 很相似,都使用名为 `open` 的函数来加载文件,`writer` 函数来写入数据,`close` 函数用于关闭文件。
```
myFile = io.open('example.txt', 'a')
io.output(myFile)
io.write("hello world\n")
io.close(myFile)
```
#### Python
```
myFile = open('example.txt', 'w')
myFile.write('hello world')
myFile.close()
```
### File 模式
许多语言在打开文件时会指定一个“模式”。模式有很多,但这是常见的定义:
* **w** 表示写入
* **r** 表示读取
* **r+** 表示可读可写
* **a** 表示追加
某些语言,例如 Java 和 Groovy允许你根据用于加载文件的类来确定模式。
无论编程语言以何种方式来确定文件模式,你都需要确保你是在 _追加_ 数据,除非你打算用新数据覆盖文件。编程语言不像文件选择器那样,没有内置的提示来警告你防止数据丢失。
### 新语言和旧把戏
每种编程语言都有其独特完成任务的方式,这就是为什么有这么多语言可供选择。你可以而且应该选择最合适你的语言。但是,你一旦了解了编程的基本结构,你可以随意尝试其他语言,而不必担心不知道如何完成基本任务。通常情况下,实现目标的途径是相似的,所以只要你牢记基本概念,它们就很容易学习。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/programming-read-write
作者:[Alan Smithee][a]
选题:[lujun9972][b]
译者:[MjSeven](https://github.com/MjSeven)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/alansmithee
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 "Code going into a computer."
[2]: https://opensource.com/article/21/4/compare-programming-languages
[3]: https://opensource.com/article/21/3/file-io-c
[4]: https://opensource.com/article/21/3/ccc-input-output
[5]: https://opensource.com/article/21/3/io-java
[6]: https://opensource.com/article/21/4/groovy-io
[7]: https://opensource.com/article/21/3/lua-files
[8]: https://opensource.com/article/21/3/input-output-bash
[9]: https://opensource.com/article/21/6/reading-and-writing-files-python
[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html
[11]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html
[12]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html
[13]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html
[14]: http://www.opengroup.org/onlinepubs/009695399/functions/feof.html
[15]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html
[16]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+file
[17]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string
[18]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system
[19]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+filewriter

View File

@ -1,115 +0,0 @@
[#]: subject: (Vivaldi 4.0 Looks Like an All-in-One Browser for Linux)
[#]: via: (https://news.itsfoss.com/vivaldi-4-0-release/)
[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Vivaldi 4.0 Looks Like an All-in-One Browser for Linux
======
Vivaldi 4.0 is the latest version that introduces new functionalities for multitaskers and users who rely on web browsers for everything.
It is worth noting that only the UI layer of Vivaldi is closed-source, more than 93% of its source code is open-source. Even though it is not completely FOSS, many users use it because of its anti-tracking policy, appealing interface, and active Linux support.
In case you did not know, recently [Vivaldi made significant performance improvements][1] taking Linux (Ubuntu) into account for testing. So, it looks like they keep Linux users in mind, which is a good thing.
If you thought [Firefox 89][2] release was exciting, Vivaldi is particularly interesting for its new additions.
### Vivaldi 4.0: Whats New?
The latest major release focuses to prove itself as a better alternative to popular web browsers like Google Chrome, and Microsoft Edge.
#### Vivaldi Translate
![][3]
Powered by [Lingvanex][4], Vivaldi Translate delivers a concise translation for your text, removing the need to install a plugin or using a separate translator tool and providing a secure translation too.
Have you ever had to access a website in a language you do not understand? If yes, then you know how painful it is to copy-paste the text into a translator to understand what the page is saying.
But now that you have an integrated tool with Vivaldi that facilitates your browsing experience without compromising your privacy. You can access the translation feature using the icon in the address bar whenever you load a website with a different language.
#### Vivaldi Mail (Beta)
![][5]
Using a browser is a good way of exchanging information, including emails. When you have multiple emails for different purposes, it can get quickly overwhelming managing them.
Mail makes it easier by assembling your diverse emails into a single place in the web browser. Due to its support for IMAP and POP3, you can integrate most email providers.
So, you do not have to install a 3rd party webmail client to keep things convenient to access.
#### Vivaldi Feed Reader (Beta)
![][6]
RSS is the go-to online reading for many users.
While we have [RSS readers for Linux][7] already. You can access Vivaldi Feed Reader right from Mail; thus, allowing you to filter feeds and apply certain properties on them.
You can add articles, YouTube videos, podcasts, and more to the feed. When you load up a site for anything, a feed icon comes up in the right-side of the address bar. All you have to do is click on it to add things to your feed, it is that easy.
#### Vivaldi Calendar (Beta)
Vivaldi Calendar does all that you expect from a full-fledged calendar app without the trade-off of your privacy. And this is an extremely useful addition to Vivaldi.
Accessing what you plan without launching a separate service or app and having the ability to quickly access it in your browser should save a lot of time.
#### Other Changes
While Vivaldi offers a lot of features, it also makes it easy to choose the experience you want right after you launch the browser
There are three layouts you can select:
![][3]
* **Essentials**: Only Ad blocker and translations available.
* **Classic**: Everything in essentials, plus side panels and status bar.
* **Fully Loaded:** All the features offered ready for access in your layout including the Calendar, Mail, and Feed Reader.
For more information on how it all works and details of the latest release, you may want to go through the [announcement post][8].
### Summing Up
Vivaldi is a cross-platform web browser that does not neglect Linux users. With the latest Vivaldi 4.0 release, the browser offers an exciting experience with an arsenal of features that major web browsers do not offer.
You can download the latest update from the official website (DEB/RPM files available). You can also choose to manually add the repositories for your distribution using the [official instructions][9].
[Download Vivaldi 4.0][10]
_What do you think about using Vivaldi on Linux after this major upgrade?_
#### 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/vivaldi-4-0-release/
作者:[Omar Maarof][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/omar/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/vivaldi-browser-3-7-release/
[2]: https://news.itsfoss.com/firefox-89-release/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://lingvanex.com
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUwNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjEzMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://itsfoss.com/feed-reader-apps-linux/
[8]: https://vivaldi.com/blog/vivaldi-4-0/
[9]: https://help.vivaldi.com/desktop/install-update/manual-setup-vivaldi-linux-repositories/
[10]: https://vivaldi.com/download/

View File

@ -1,95 +0,0 @@
[#]: subject: (helloSystem FreeBSD Based OS Brings another Promising Release 0.5.0)
[#]: via: (https://www.debugpoint.com/2021/06/hellosystem-0-5-0-release/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
helloSystem FreeBSD Based OS Brings another Promising Release 0.5.0
======
The helloSystem team brings another promising release with its latest
version 0.5.0. And gives hope to users as a free alternative to macOS.
![helloSystem 0.5.0][1]
The helloSystem is a FreeBSD-based lightweight operating system designed from the ground up. The operating system with FreeBSD at its core provides a real “open” alternative to the macOS and its users.
The ideas and principles mainly give FreeBSD users an alternative to the no-lock-down environment, unlike macOS. That means you get any application software you want in helloSystem, that too includes all Linux applications. Because FreeBSD already has a built-in layer to run Linux applications. And it is worth mentioning that you can keep using your older hardware with this operating system without fear of non-upgradable status.
An impressive operating system, indeed. However, the operating system is fairly new, hence things are still being worked on.
Lets take a look at whats new in the new helloSystem 0.5.0 release.
### helloSystem 0.5.0 Whats New
This release is based on the stable FreeBSD 12.2 version. This release provides updates to wireless networking and much new specific hardware support. The primary window manager is Openbox 3.4 which is a bit older version right now.
The main top panel Global system menu is now updated automatically when the system is modified with applications or directories.
From the changelog, it is evident that the file manager Filer sees most of the updates in this release of updates in this point release. Here are the updates in Filer 0.10.0:
* Initial spatial mode option for Filer (each folder opens in its own window)
* “Go to…” menu in Filer, Command+Shift+G
* Go up to the parent folder in Filer using Command+Up
* Get Info in Filer using Command+I
* Filer brings already-open windows to the front rather than opening multiple windows for the same folder
* Context menu in Filer for opening text files and folders as root
* Filer now shows volumes on the desktop
* Filer now shows the correct names for volumes (“volume labels”)
* Adjusted icon grid size in Filer
* Filer now shows volumes first in the sidebar
* Menus are now available if only the desktop is showing and no Filer windows are open Filer now shows alternating row colors in detail view
Other updates include:
* New app QHexEdit and Android File Transfer Utility is introduced.
* Updated initgfx, more GPUs such as the AMD Radeon HD 6630M/6650M/6750M/7670M/7690M (Whistler/Turks) family GPUs found in 2011 Macs might now be supported
* Double click on the title bar of any application to hide the main window and shows only the title bar.
* It is now possible to save (persist across reboots) custom keyboard preferences
Placeholder .app bundles (and thereby menu entries) are automatically created for applications installed with pkg
* Audio Volume can now be set from the global menu bar
![Utilities][2]
Most of the important application shortcut is added, but they are not installed by default with the .iso file. So you need to download and install what you need. This is good in the way that, the .iso size is reduced without all those apps. You just install later what you need. Most of the important ones are available in the menu as shortcuts such as LibreOffice, GIMP, etc.
### Download
The project is hosted on GitHub at the moment. You can download the 64-bit .iso file from the below link.
[helloSystem 0.5.0][3]
Once downloaded, you can either install it in a physical system or try it on a [virtual machine][4].
If you are planning to try it out in a physical system as a multi-boot, I would recommend you to be a little extra careful, there might be issues with UEFI.
### Closing Notes
This is one of the interesting FreeBSD OS that I am following very closely. A promising project indeed with a stable alternative to Linux and macOS. Request you to contribute to the project in any capacity in GitHub.
Cheers.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/06/hellosystem-0-5-0-release/
作者:[Arindam][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/helloSystem-0.5.0-1024x578.jpg
[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Utilities.jpg
[3]: https://github.com/helloSystem/ISO/releases/download/r0.5.0/hello-0.5.0_0E223-FreeBSD-12.2-amd64.iso
[4]: https://www.debugpoint.com/2020/05/install-use-gnome-boxes/

View File

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

View File

@ -1,95 +0,0 @@
[#]: subject: (elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box)
[#]: via: (https://news.itsfoss.com/elementary-os-6-beta-2-release/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
elementary OS 6 Beta 2 is the First Step to Have Flatpak Apps Out-of-the-box
======
elementary OS 6 “Odin” [beta release][1] gave us a sneak peek on a variety of interesting things that are in motion for the final release.
Now, the second beta release, i.e. **elementary OS 6 Beta 2** is starting to make sense of the ambitious plans that the development team has for the stable release soon.
This release is meant for testing and development, do not install it on your production system.
### Whats New in elementary OS 6 Beta 2?
elementary OS 6 beta 2 brings in three major key upgrades along with under-the-hood improvements.
First, the improvements to the installer.
There are a few UI tweaks to the installer for a cleaner and consistent look. You will also find a subtle animation with the installation progress instead of a static icon.
![Credits: elementary OS Blog][2]
If you have been using the first beta, you will need to re-install for proper testing. The installer window did not resize, which was a problem for me to test using a virtual machine setup.
The next major highlight is the **addition of first party Flatpak applications**. While they already made it clear that they want to transition to Flatpak packages for any pre-installed apps, now they are finally making progress.
![][3]
As mentioned in the beta 2 [release announcement][4]:
> elementary OS 6 now comes with Calculator, Camera, Document Viewer, Screenshot, Tasks, and Web from the AppCenter Flatpak repository.
So, you should expect more first-party applications to embrace Flatpak packaging. It will also make its way to third-party applications available in the App Center (which the developers can follow to make their applications available as a Flatpak package).
Of course, this may also encourage other distributions to adopt Flatpak applications to provide a secure sandbox experience out of the box.
The last important addition with this release is the **ability to add online accounts from the System settings**.
You can add both mail and calendar accounts, note that both IMAP and CalDav standards are supported.
Once you add the accounts, it will show up in apps like Calendar, Tasks, and Mail making the experience seamless.
#### Other Improvements
![][5]
Along with several under-the-hood improvements, other significant changes include:
* Improved notification system that supports icon badges and action buttons
* Updating the documentation before the final release
* Web supports dark style theme
For more information on the latest beta release, you can explore the [release announcement][4].
### Download elementary OS 6 Beta 2
You can download the beta 2 for public testing from its [official builds][6] page. It is worth noting that only GitHub sponsors can access early/daily builds.
[elementary OS 6 Beta 2][6]
_Im excited about elementary OS 6, what about you? Drop your thoughts in the comments section 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/elementary-os-6-beta-2-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/elementary-os-6-beta/
[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU1MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMiIgd2lkdGg9IjcxOSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://blog.elementary.io/elementary-os-6-odin-beta-2/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4MCIgd2lkdGg9IjcyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: https://builds.elementary.io

View File

@ -1,90 +0,0 @@
[#]: subject: (Security-Focused Tutanota Mails Linux Desktop Application is Now Available)
[#]: via: (https://news.itsfoss.com/tutanota-desktop/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Security-Focused Tutanota Mails Linux Desktop Application is Now Available
======
Tutanota is an open-source privacy-oriented email service. It is an impressive [secure email service][1] as an alternative to Gmail.
In fact, our ethical web portal [LinuxHandbook][2] hosts emails on Tutanota.
While it is already a full-fledged service with constant improvements added regularly, the desktop client was something in beta since 2018.
Now, they have finally [announced][3] the availability of their desktop client for Linux, Windows, and macOS for every Tutanota user.
### Access Tutanota Using the Desktop Client
The desktop client features all the goodies that you get with the web version. The announcement mentions that they have had rigorous tests and review to ensure that you get the best security while using the desktop version.
![][4]
You can also go through the [security review on GitHub][5].
To walk you through, let me highlight some of the key features that the desktop version offers:
* Encrypted mailbox
* Encrypted calendar
* Secure Contact and Address book
* Ability to search encrypted data locally
* Supports email and calendar notifications
* Two-factor authentication
* Supports opening different windows
In addition to these, you can also set out-of-the-office notifications, spellcheck your emails before sending, use filters, and do great deal of things that you normally find in the web version.
If needed, you can set it up to run on startup, disable its background activity, choose the storage path for downloads, and several other options.
The desktop client should give you a great level of control for a good experience.
I also noticed that it offers a desktop integration option when you first launch the desktop app. This should integrate the client with the system tray.
To enhance security, the desktop client uses caching of the web client. This will make sure that you dont have to re-login and load up the correct version needed for access.
![][6]
### Download Tutanota Desktop
It is available as an AppImage file for Linux. You may want to refer to our [AppImage guide][7] to get started.
You can download it from the official website. Tutanota also gives you the [option to verify the signature][8] to check if you did not download a tampered file.
[Download Tutanota][9]
_A desktop client is something many users prefer over the web version, what about you? What do you think about Tutanotas desktop version?_
#### 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/tutanota-desktop/
作者:[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/secure-private-email-services/
[2]: https://linuxhandbook.com/about/
[3]: https://tutanota.com/blog/posts/desktop-clients-end-beta/
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://github.com/tutao/tutanota/issues/2787
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://itsfoss.com/use-appimage-linux/
[8]: https://tutanota.com/faq/#verify-desktop
[9]: https://tutanota.com/#download

View File

@ -1,126 +0,0 @@
[#]: subject: (Using Git Version Control as a Writer)
[#]: via: (https://news.itsfoss.com/version-control-writers/)
[#]: author: (Theena https://news.itsfoss.com/author/theena/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Using Git Version Control as a Writer
======
I believe modern writers should begin thinking about their processes, or workflows.
In a highly distracted world, it is imperative to take ownership over the chain of tasks we perform every day as writers. Traditionally, writers would put their writing to the hours where the distraction is less, and the focus high. Unfortunately advice from Hemingway, Atwood, et al., isnt really applicable to us any more. The world we live in is far more connected, and thus have far more pitfalls for writers. Part of that is being disciplined enough to not let social media or cute videos of puppies and kittens distract us at the times we are writing.
But disconnecting from the internet isnt really an option if part of your writing requires quick fact-checks, spellings of uncommon and technical words, etc., this is very true for me when I am writing. The other issue is the distractions that are within the writing app itself; as a life long MS Word user, I found it getting prettier, but slower and more distracting. I spoke about this at length as being among the [primary reasons for transitioning into Vim][1] in the first place, so I am not going to speak extensively on this. The point being that writing in the modern world, on modern devices can be far from ideal.
Since Ive already gone into detail on the [why I switched to Vim][2] and open source version control, I would like to use this article to talk about the **how**, specifically how to use open source version control technology such as git (and GitHub).
### What is Version Control, again?
![Source: https://git-scm.com/][3]
The diagram above is a illustration of how we perform traditional version control. This
diagram assumes that you have one device and that you write only in that device. In my case, I write on a number of machines, including my Android phone and a selection of laptops of varying ages that I use for specific and in specific places. The one common task that I carry out between all these devices is writing it is imperative, therefore, that my devices capture changes and version controls my files in sane manner. No more `file1V1_device1_date.doc` as I would name my files.
The diagram above also doesnt take into account the tools that we use to write.A word processor such as LibreOffice Write works across Linux, Mac, and Windows machines, but using a word processor on the phone is an unpleasant experience. Some of us writers also use other text tools, including Gmail or our email clients, to write little sketches for our writing. Keeping track of all of these files and emails in a logical order is exhausting I wrote a book using such a process, and trust me: the time I spent figuring out file names, version changes, comments, notes to self, and emails with additional notes, was enough to drive me to distraction.
Some of you reading this might rightly point out that cloud-based backup technology
exists. While the benefits of cloud-based storage are immense, and I continue using them, version control barely exists, or isnt powerful.
### A better workflow
Like the rest of the planet, the start of the pandemic led to some anxiety and some soul
searching. I spent the time teaching myself web development on [The Odin Project][4] (highly recommended for those who are thinking of learning html, CSS, JavaScript/Ruby).
Among the first modules was an introduction to Git: what version control was, and what problems it sought to address. Reading this chapter was a revelation. I knew immediately that this _git_ was exactly what I was looking for as a writer.
The better way, then, isnt localized version control but _distributed_ version control. Distributed describes the distribution of the _devices_ that I will be accessing a file from, and editing/changing thereafter. The diagram below is a visual illustration of distributed version control.
![Source: https://git-scm.com/][5]
### My way
My goals in building a version control system for writing were as follows:
* Make my manuscript repository accessible from anywhere, from any device
* Ease of use
* Reduce or remove the friction that comes about from shifting context between writing, study and coding workflows as much as possible, we will use the same tool (i.e. Vim)
* Scalable
* Easy to maintain
Based on the above needs, the diagram below is my distributed version control system for my writing.
![][6]
As you can see, my version control system is a simplistic adaptation of distributed version control. By adding git version control to a folder on cloud storage ([pCloud][7]) in my case, I can now draw the benefits of both technologies. Thus my workflow can be visualized as follows:
![][8]
#### Advantages
1. I have one writing (and coding) tool
2. I have version control of my manuscripts, no matter what device I access the file from
3. Its [super easy, barely an inconvenience][9]
4. Easy to maintain.
#### Drawbacks
The writers among you must wonder what drawbacks exist in the system. Here are a few that I anticipate as I continue using and refining this workflow.
* Comments on drafts: one of the more useful features of word processors is the ability to comment. I often leave comments for myself when I want to come back to a certain portion of the text. I still havent figured out a workaround for this.
* Collaboration: Word processors allow for collaboration between writers. During my advertising days, I would use Google Docs to write copy and share the link with my designers to extract the copy for ads and websites. Right now, my workaround for this writing the copy in markdown, and exporting the markdown file to a .doc file via Pandoc. More critically, when my manuscripts are completed, Id need to still send the files in .doc format for my editors. Once my editor makes
those changes and sends it back, it makes little sense for me to try opening it again in Vim. At this point, the systems limitations will become more obvious.
In no way am I saying this is the best method, but this is the best method for _me_ at this
point in my career. I imagine I will be refining this further as I get more familiar and comfortable with my new [open source tools for writing][10] and version control.
I hope this serves as a good introduction to writers wanting to use Git for their document version control. This is by no means an extensive article, but I will share some useful links to make the journey easier for you.
1. [Git Basics from The Odin Project:][11]
2. [Getting started with Git][12]
3. GitHubs Basics of Git Tutorial
As a bonus, heres a screen recording of me using Vim on my Android device to work on a poem, pushing the changes to Git.
#### 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/version-control-writers/
作者:[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://news.itsfoss.com/configuring-vim-writing/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://www.theodinproject.com/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgwMCIgd2lkdGg9IjY2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwNSIgd2lkdGg9IjYxNyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://itsfoss.com/recommends/pcloud/
[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc1MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[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
[12]: https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control

View File

@ -1,86 +0,0 @@
[#]: subject: (Dark and Light Only! Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme)
[#]: via: (https://news.itsfoss.com/ubuntu-21-10-theme-change/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Dark and Light Only! Ubuntu 21.10 Looks to Ditch the Standard Mixed Color Theme
======
Ubuntus default “Yaru” community theme is an excellent choice. However, Ubuntus team has been tweaking it for a while since Ubutu 19.10 to match their branding and offer a good-looking experience.
I liked the default themes available with Ubuntu 20.04. Up until now, you got standard, light, and dark theme options to choose from.
![][1]
But starting with [Ubuntu 21.10][2], you will no longer find the “**Standard**” (or mixed) theme available to pick. It all comes down to two choices that include light and dark theme only.
Now, why is this happening? What exactly is the Standard theme offering now?
Heres what you need to know …
### Ubuntus Standard Theme is Problematic
![][1]
If you have used Ubuntu, you probably know that Ubuntus Standard theme refers to a mixed theme. It features a dark window bar (or the titlebar of applications) and the rest follows a light theme pattern.
With **Ubuntu and GNOMEs default theme color conflicts** and **lack of theming API** for GTK (and Gnome shell), it is already [problematic][3] to customize and work on Ubuntus desktop theme.
Moreover, GTK 3 and GTK 4 do not support having a separate background color for the headerbar from the rest of the window. Hence, it is tough to keep bug-free implementations for every GTK application.
And that is the reason the Yaru community design team recently [proposed][4] to remove the mixed theme.
Ubuntus team has agreed to this decision and the change has been merged. You should no longer find the mixed theme in Ubuntu 21.10 but only the dark and light themes as your option.
In other words, “Yaru” will be the light theme, and “Yaru dark” will be the dark theme when using [GNOME Tweaks][5]. There will be no “Yaru-light” anymore.
### Will They Bring Back the Mixed Theme?
Unless there are changes in the upstream — GNOME providing a theming API and GTK 3/4 supporting more customizability for headerbar, the mixed theme is gone for good.
So, with Ubuntu 21.10 and any future releases, you get fully light and fully dark themes, which should offer a seamless user experience across any GTK application.
### A Potential Rebranding in Ubuntu 21.10
While the Brand and Visual team at Canonical agreed to the default Yaru theme changes, they also want to work closely with the Yaru community design team for the upcoming rebranding, as mentioned by a designer in this [GitHub thread][4]:
![][6]
So, what exactly do we know about the upcoming rebranding for Ubuntu 21.10? Nothing yet.
But considering that Ubuntu 20.04 shaped up with attractive branding and visuals, Im excited about this one. Most probably, the default color scheme will change but what what will it change to?
Lets wait for that! Feel free to share your thoughts on this development on Ubuntus future design in the comments below.
First noticed at: [OMG! Ubuntu][7]
#### 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-21-10-theme-change/
作者:[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,PHN2ZyBoZWlnaHQ9IjUzNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[2]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/
[3]: https://github.com/ubuntu/yaru/discussions/2677
[4]: https://github.com/ubuntu/yaru/issues/2913
[5]: https://itsfoss.com/gnome-tweak-tool/
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://www.omgubuntu.co.uk/2021/06/ubuntu-21-10-yarn-theme-change

View File

@ -1,88 +0,0 @@
[#]: subject: (Nextcloud Alternative Twake Adds New Features and Privacy Improvements)
[#]: via: (https://news.itsfoss.com/twake-2021-q2-release/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Nextcloud Alternative Twake Adds New Features and Privacy Improvements
======
If you did not know about Twake, you might want to check out our quick review on [Twake app][1] on our main portal.
To give you a quick introduction, I would say that Twake aims to be a modern, open-source Nextcloud alternative with Slack-like features in the mix. In other words, it could be an all-in-one solution for your requirements.
Now, after several updates to the platform, theres a big release that addresses some improvements and adds a couple of new features.
Here, let me give you some highlights of the latest release.
### New and Improved Channels
If you are using Twake to collaborate and communicate as an [open-source alternative to Slack][2], there are some significant improvements to the way everyone interacts with channels.
It is now super easy to leave and join channels, which needed attention in its early implementation.
![][3]
The channel access rights have been tweaked to let the team members create a channel as per their requirements. If you have a lot of channels and want to add some of them for quick access, you can now add them to favorites to do just that.
Also, if you are in dire need of multiple channels, you will have to ability to create groups of channels to better organize them.
![][4]
If you create a public channel, you can invite all your workspace members to it in one go. Also, if a new user joins, they will be added to all the public channels by default.
### Colleagues and Guest Management
![][5]
You get a new add colleague button to add collaborators using their email addresses. While it makes things convenient, it is also great to see that you can invite anyone not in your workplace as a guest to a direct channel when needed.
### Privacy and Other Improvements
![][6]
Originally, they used Amazon Web Services (AWS) to host everything. Now, they have switched to a France-based server (OVH Cloud) as someone with a better privacy policy in place.
Under-the-hood, they have also transitioned from using PHP to NodeJS in the back end to make things faster.
They have made several technical improvements to ensure security of users data and also improved the notifications.
To learn more about whats coming next and about this specific release, you can check out their [official announcement][7] or the [GitHub page][8].
[Twake.app][9]
If you havent tried Twake yet, it is an interesting choice to go for. While there are some room for improvements like the addition of two-factor authentication for free and standard users, it is an impressive experience.
_What do you think about Twake? Feel free to share your thoughts in the comments down below._
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/twake-2021-q2-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/twake-app/
[2]: https://itsfoss.com/open-source-slack-alternative/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxNCIgd2lkdGg9IjU1MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzMiIgd2lkdGg9Ijc1MSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://www.linagora.com/en/post/2021/06/22/twake-q2-505-product-update-en
[8]: https://github.com/linagora/Twake
[9]: https://twake.app/en/

View File

@ -1,86 +0,0 @@
[#]: subject: (Childrens Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options)
[#]: via: (https://news.itsfoss.com/tux-paint-0-9-26/)
[#]: author: (Abhishek https://news.itsfoss.com/author/root/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Childrens Drawing App Tux Paint Now Has Gradient Fill and Pixel Art Options
======
Tux Paint is an [open source drawing application][1] and an alternative to Microsoft Paint on Linux. It is a cross-platform application and you can also use it on Windows and macOS.
[Tux Paint][2] primarily intends to be used by children between the age of 3 and 12. It is actually used in schools worldwide. It features easy to use interface, sound effect and a Tux mascot that works as guide in an entertaining way.
Of course, this doesnt mean that you cannot use Tux Paint if you are 13 or older.
The developers of Tux Paint have just released the version 0.9.26. Lets see what new features you get in the latest release.
### Whats new in Tux Paint 0.9.26?
Here are the main new features in improvement added in the version 0.9.26.
#### Fill tool now has gradient option
![][3]
Gradient colors have gained quite some popularity lately. Keeping that in mind, Tux Paints Fill tool now can fill the selected area with gradient colors.
There are two kinds of gradients filling available. The “Radial” fill creates a circular gradient centered around the mouse click, while the “Linear” fill allows the interactive creation of gradients at different angles and sizes.
#### Magic tools now has pixel and checkerboard options
The Magic tool now has “pixel” options that makes it easier to create retro-gaming style pixel art. It doesnt give the capability of full-fledged pixel tool like [Pixelorama][4] but at pixelating is available as an option.
There is also a Checkerboard option that fills the entire canvas with a check pattern and the “Clone” option allows duplicating parts of the picture via brush strokes.
#### Accessibility improvements
![][5]
The new version has two accessibility options added. The entire user interface of Tux Paint can now be enlarged. This is going to benefit users with impaired vision. This will also make the program more suitable to very HiDPI displays.
Another option is to re-organize the color palette. It can also be helpful to users of coarse input devices, such as eye-gaze tracking systems.
#### What else?
Tux Paints user documentation has been overhauled and this makes localization easier. So if you are interested, please contact the Tux Paint team and help with localization efforts.
#### Getting Tux Paint 0.9.26
On Linux, you can get the latest Tux Paint in [Flatpak package format][6]. If you have Flatpak support enabled, you can use the following command to install it:
```
flatpak install flathub org.tuxpaint.Tuxpaint
```
For Windows and macOS, you can [download it from its website][7].
#### 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/tux-paint-0-9-26/
作者:[Abhishek][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/root/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/open-source-paint-apps/
[2]: http://www.tuxpaint.org/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://itsfoss.com/pixelorama/
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYyNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: https://flathub.org/apps/details/org.tuxpaint.Tuxpaint
[7]: http://www.tuxpaint.org/download/

View File

@ -1,90 +0,0 @@
[#]: subject: (KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More)
[#]: via: (https://news.itsfoss.com/kaos-2021-06-release/)
[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
KaOS 2021.06 Brings in Plasma 5.22, JPEG XL Support, and More
======
[KaOS][1] is an independent Linux/GNU distribution built from scratch. It is uses Qt and [KDE][2], comes baked in with [pacman][3] as its package manager.
The latest version comes with useful upgrades. Lets discover what this version has to offer.
### Whats New?
![][4]
KaOS 2021.06 comes with [Plasma 5.22][5], which is the latest and the most stable release currently. Not just limited to stability, it also provides better flexibility and usability. To know more about the desktop environment, you can refer to our article on [Plasma 5.22][6].
To give you a quick overview, the most remarkable new feature Plasma 5.22 presents is **Adaptive Transparency. **It means the panel and panel widgets will be pleasantly translucent. However, if there are any maximized windows, they will become entirely opaque.
Also, **Plasma Wayland** session now supports **Activities. **Thus, you can keep your work separate from other tasks. In other words, you will get the most out of your activity by staying focused on it.
Along with the desktop environment upgrade, some of the key changes include:
* Plasma System Monitor now replaces KSysguard.
* No need to adjust a mirror list to install/update KaOS anymore. KaOS will be using Fosshost as the default mirror, which utilizes Fastly CDN to deliver the content from a nearby location without you needing to select a mirror explicitly.
* KWin Wayland now includes the Present Windows effect.
* New applications added include [Maliit][7] virtual keyboard packages.
* Support for [JPEG XL][8], a modern option for the JPEG format.
![][9]
### Other Improvements
* The Calamares installer has two new QML modules to provide consistent layout and the interactive map that you notice in the installer should work fine without an active internet connection.
* All of the latest Plasma Desktop packages are built on **Qt 5.15.2+**. These include Frameworks 5.83.0, Plasma 5.22.2, and KDE applications 21.04.2.
* LibreOffice has replaced Calligra as the default office suite.
* Installing on RAID is currently unavailable.
![][10]
For more details you can refer to the [official announcement][11].
### Summing Up
KaOS is making progress towards providing a complete and focused open-source operating system. They are working on presenting constant enhancements within the scope of KDE.
[Download KaOS 2021.06][12]
_What do you think about KaOS with Plasma 5.22? Would you be willing to try it out?_
#### 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/kaos-2021-06-release/
作者:[Omar Maarof][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/omar/
[b]: https://github.com/lujun9972
[1]: https://kaosx.us/
[2]: https://kde.org/
[3]: https://itsfoss.com/pacman-command/
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: https://kde.org/announcements/plasma/5/5.22.0/
[6]: https://news.itsfoss.com/kde-plasma-5-22-release/
[7]: https://maliit.github.io/
[8]: https://jpeg.org/jpegxl/
[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[11]: https://kaosx.us/news/2021/kaos06/
[12]: https://kaosx.us/pages/download/

View File

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

View File

@ -0,0 +1,88 @@
[#]: subject: (Edward Snowden Thinks GIMP Needs a Major UI Overhaul)
[#]: via: (https://news.itsfoss.com/gimp-ui-edward-snowden/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Edward Snowden Thinks GIMP Needs a Major UI Overhaul
======
Edward Snowdens recent tweet praised what free and open-source software can achieve.
In the tweet, he highlights that every time he uses Blender (an open-source 3D software suite), it reminds him of the advantages of FOSS and the growth of the ecosystem.
He did not just limit to that, in a follow-up reply to the same thread, he also tagged **GIMP** and added, “**Im really hoping for a major UI overhaul. You guys could be eating Adobes lunch.**“
> P.S. [@GIMP_Official][1], I'm really hoping for a major UI overhaul. You guys could be eating Adobe's lunch.
>
> — Edward Snowden (@Snowden) [July 18, 2021][2]
### Does GIMP Require a Major UI Overhaul?
![][3]
[GIMP][4] is one of the most effective free and open-source image manipulation tools available.
It is actively used by professionals and all kinds of individuals to get a variety of things done.
You can even [make a GIF in GIMP][5]. Hence, it is tailored for simple and advanced tasks.
While it offers a learning curve to get used to its UI, it is good enough functionality-wise.
Does it require a UI overhaul?
Yes, as per the trends, all kinds of designing/editing tools are working to improve the user-friendliness factor, GIMP may have missed out on this front.
Of course, a sudden UI change may affect the workflow for a lot of veteran users. But, it does require a UI overhaul to beat its competitors like Adobes tools.
Also, with an easy-to-use interface, it will attract more users, potentially helping it grow and monetize the project even further.
And, it is also clear that Snowden thinks the same way, which is why he is hoping for a major UI overhaul while expecting GIMP to challenge Adobe tools in a big way.
### Why is GIMP Not Working on a Major User Experience Overhaul Yet?
Unfortunately, GIMP does not have regular UX contributors or developers to work on a major overhaul.
They mentioned it as a reply to one of the tweets in Snowdens tweet thread:
> “We worked with a UX architect between 2005 and 2012. Good things came out of it. We make small UX improvements in almost every update now that point releases (e.g. 2.10.24) are allowed to have new stuff. But we dont have a regular UX contributor or devs for a huge overhaul”
Well, this is definitely a sad thing for such a popular project that gets immense love from thousands of users.
And, I hope, after Snowdens tweet, the GIMP project gets more traction and we see regular contributors to help evolve GIMP with the love it deserves.
If you want to help, you can explore [GIMPs contribution page][6] to learn more about helping the project.
_Feel free to let me know your thoughts on GIMP and if you find it useful. Do you think that it needs a major UI overhaul, comments section is all yours!_
**Image Credits (Snowdens image)**: [TheGuardian][7]
#### 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/gimp-ui-edward-snowden/
作者:[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://twitter.com/GIMP_Official?ref_src=twsrc%5Etfw
[2]: https://twitter.com/Snowden/status/1416778909358731266?ref_src=twsrc%5Etfw
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://www.gimp.org
[5]: https://itsfoss.com/make-gif-in-gimp/
[6]: https://www.gimp.org/develop/
[7]: https://www.theguardian.com/books/2019/aug/01/edward-snowden-memoir-to-reveal-whistleblowers-secrets-permanent-record

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

View File

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

View File

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

View File

@ -0,0 +1,117 @@
[#]: subject: (17 open source technologists share their work-from-home uniforms)
[#]: via: (https://opensource.com/article/21/7/work-home-uniforms)
[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
17 open source technologists share their work-from-home uniforms
======
Nerdwear of the technically employed. What's your style?
![Taking a walk outside][1]
As the world turns and some folks begin returning to the office, I feel it's a good time to ask our community of open source techies: _What's your work-from-home (WFH) uniform?_
Do you dress like you would if you were going into the office? Or are you more comfortable in workout clothes or even your PJs? Do you have a template you stick to most days?
I have a format that helps me feel both productive and comfortable, and if I need to run an errand in public, I don't have to change first: A clean, nice-fitting shirt (T-shirts are OK) on top of comfortable pants (yoga is OK but not pajama). I've leaned into my stash of T-shirts from fun conferences I've attended with people I miss seeing and locales in my home state that make me proud.
Some Opensource.com friends and contributors weigh in on their work-from-home uniforms below. What's yours?
* * *
Over the last eight years, I've learned that if I try to work in my PJs, I will get nothing done. In warm weather, I'm in shorts (cargo, of course) and a T-shirt. In cooler weather, it's jeans and a T-shirt with a sweater or hoodie. Never shoes, but I'll wear socks once my feet start getting cold. —[Ben Cotton][2]
Last winter, I un-ironically told two friends: "I miss my clothes." Most of my wardrobe went untouched for a year, not because I had outgrown or no longer liked my outfits, but because I had nowhere to wear them. Working from home means I'm exercising at least once before, during, or after work. Between walking a (very brisk-paced) dog and taking a class at the gym on my lunch break, I often work in sneakers complete with bike shorts and a tank top. But when the situation calls, I can pop a cardigan on to look more professional. —[Lauren Maffeo][3]
Before the pandemic, I tried dressing like I was going to do something that day. WFH was a privilege, and I really appreciated it, as it afforded me the ability to take care of my needs and work at the same time. Once the pandemic hit though, it became tiring to put on a front that I was going somewhere because, well, no one was. Most of the time, I'm wearing a Red Hat or Kubernetes/Cloud Native T-shirt and workout shorts. I live in Michigan, though, so those shorts get swapped out for joggers when it's cold. But that's pretty rare given my office is pretty warm thanks to all the computers. Oh, and slippers, like right now because my feet are cold for some reason. —[Chris Short][4]
My WFW (work from work) uniform was always conference T's, jeans/cargo pants, and sandals or sneakers. So, my wardrobe hasn't changed... Well, that's not exactly true: Having not replenished my supply of conference T's, some of them have become a bit ratty, but I'm not on camera. And my hair is a bit messier. Sidenote: The New York Times had a recent [article][5] on a slide in hygiene and grooming during COVID, and, according to the article, many are saying they're going to remain a bit sloppier post-COVID. —[Kevin Cole][6]
I used to wear suits and professional woman's wear for the office. Now I get to go back to the tech WFH uniform: nerd shirt, pants/skirt. Often I add a scarf to jazz it up for video. I wear shoes because my feet get cold. My colleagues mock me, but I do my hair and makeup every day. How I missed all my nerdware and hoodies due to "serious non-tech office jobs." —[Heather Leson][7]
I try to stay dressed at home like there could be a strong reason to go out at short notice with my shoes and go-bag near the door. Too many years living in earthquake country, I guess. —[Stefano Maffulli][8]
I wear pajamas most of the time, but I keep a "video shirt" ready in case I need to go on video for some reason. For a template, my day is driven by the calls and meetings on my calendar. During my breaks there, I'll run up and down the stairs a few times just to stretch my legs. —[Peter Gervase][9]
No video meetings for me, but shorts and T-shirts are the regular. Jeans when it's colder. —[Bob Murphy][10]
I love playing around with color, so I wear five different colored tops (mostly not ironed) for five days, paired with comfortable cotton pants. I love my earrings, so I match my tops and earrings. Every now and then, I do wear my jeans and other formal outfits to make sure that I fit into them. —[Nimisha Mukherjee][11]
I start my day in gym clothes because I squeeze in a morning workout before I hit the keyboard. My current WFH uniform is a T-shirt or polo and shorts. I try to wear shorts as much as I can when I WFH. In fall and winter, I stick to chamois shirts, fleeces, and jeans. I end my day back in gym clothes because I hit the gym four out of five nights during the week. —[Will Kelly][12]
My WFH outfit is the same as my office outfit: knit shirts and jeans. Unlike some of my colleagues, I have not grown a beard and let my hair get long and shaggy. A bike racer I knew once said, "You dress like a bum, you ride like a bum," and I feel the same is true for me: "You dress like a bum, you work like a bum." —[Gary Smith][13]
I learned long ago when I started full-time remote work, that I needed to do the whole "get up, get ready, get dressed like you were going into the office" thing, providing some structure to my day and to get my head in "the right place" for work. Jeans, T-shirt, socks, boots (or shoes, but mostly boots1), and my ever-present head wrap. I don't know about everyone else, but I have a space that is dedicated for work, and I have my EDC2 bag that I take to and from my home office with my personal belongings, the same as I would any other job. When it is time to stop working, I pick up my bag and take it with me as a signal to myself that I'm done for the day. —[Kevin Sonney][14]
1 You keep livestock, you wear boots. I'm sure you can guess why.
2 "Every-day carry"
I get up every morning at about the same time, around 7:30am, and get dressed in comfortable, casual clothes. I've been doing this for the last eight years since I retired. I have a light breakfast, and in the summer, I walk between four and five miles. Then I return home and begin my morning routine of juice or tea and toast, then checking email, attending meetings (more on Zoom or other virtual platforms this year). Keeping a routine is important to me, and dressing comfortably is, too. —[Don Watkins][15]
At one point in my life, I was a chef. So, I have a bunch of chef pants, which are really comfortable but not stylish. I've been wearing them over the winter combined with some of my "ugliest" conference T-shirts. A couple of years ago, a coworker visited Russia and was staying with a family that had a grandmother who loved knitting wool socks. So, he brought wool socks back for everyone. So, ugly chef pants, ugly conference T-shirt, and wool socks hand-knitted by a Russian grandma. —[Craig Sebenik][16]
My WFH uniform is not much different from my regular outfit. I like to be comfortable, no matter if I'm at home or talking in front of a thousand people at a conference. That means that I'm in T-shirts all around the year, no matter if it's WFH or a large IT event. It's one of the perks of being an engineer, not in sales or management. The only difference is that I wear jeans in public and something more comfortable, like sports pants, at home. —[Peter Czanik][17]
It has been at least 30 years since I wore suits, then (for a while) "business casual." Most days now, I start early in my jammies. Wednesdays, I start with my yoga pants and top because my online yoga class starts at 9:30. Other days I change into jeans or cargo shorts and a solid black, conference, or other geeky T-shirt after breakfast. I always shave because that is one thing that makes me feel civilized. I am "retired," so I don't feel any need at all to have a different video presence other than my "normal" mode of dress. Besides, the only video meetings I attend are the Opensource.com and Enable Sysadmin weekly writer calls. —[David Both][18]
The only rule is there are no rules! I wear whatever I want, mostly a Red Hat T-shirt and shorts or jogging pants. If I have an important meeting, I try to be more presentable. —[Kedar Vijay Kulkarni][19]
Before walking the dogs, I am in sleepwear and a dressing gown while eating toast and having that first coffee. After the dog walk, I'm in shorts/polo/T-shirt if it's warm enough, or jeans/cargo pants if it's colder. I tend towards classic Shadowman shirts if I'm not on customer calls or major internal briefings, and the newer Red Hat logo-based shirts if I need official branding. Sadly, we're heading into winter here in New Zealand, so hoodies and jeans are starting to become a bit more normal. For my 3am calls with the United States, I've got a snug dressing gown and a warm drink. —[Steven Ellis][20]
Thanks to the Opensource.com Correspondent program, here's my Spring, Summer, Fall, and Winter uniform. —[Chris Hermansen][21]
![Opensource.com swag, a spring outfit][22]
 
![Opensource.com swag, a winter outfit][23]
 
![Opensource.com swag, a summer outfit][24]
Summer
* * *
What's your WFH uniform? Are you in a T-shirt and pajama pants, or do you dress as if you're going into the office? Please share your remote work attire in the comments below.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/work-home-uniforms
作者:[Jen Wike Huger][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/jen-wike
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/walking_selfcare_wfh_outside_520.png?itok=64WmWspJ (Taking a walk outside)
[2]: https://opensource.com/users/bcotton
[3]: https://opensource.com/users/lmaffeo
[4]: https://opensource.com/users/chrisshort
[5]: https://www.nytimes.com/2021/05/06/health/shower-bathing-pandemic.html
[6]: https://opensource.com/users/kjcole
[7]: https://opensource.com/users/hleson
[8]: https://opensource.com/users/reed
[9]: https://opensource.com/users/pgervase
[10]: https://opensource.com/users/murph
[11]: https://opensource.com/users/nimisha
[12]: https://opensource.com/users/willkelly
[13]: https://opensource.com/users/greptile
[14]: https://opensource.com/users/ksonney
[15]: https://opensource.com/users/don-watkins
[16]: https://opensource.com/users/craig5
[17]: https://opensource.com/users/czanik
[18]: https://opensource.com/users/dboth
[19]: https://opensource.com/users/kkulkarn
[20]: https://opensource.com/users/steven-ellis
[21]: https://opensource.com/users/clhermansen
[22]: https://opensource.com/sites/default/files/uploads/spring_2.jpg (Opensource.com swag, a spring outfit)
[23]: https://opensource.com/sites/default/files/uploads/winter.jpg (Opensource.com swag, a winter outfit)
[24]: https://opensource.com/sites/default/files/uploads/summer.jpg (Opensource.com swag, a summer outfit)

View File

@ -0,0 +1,163 @@
[#]: subject: (Is Open-Source Software Secure?)
[#]: via: (https://news.itsfoss.com/open-source-software-security/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Is Open-Source Software Secure?
======
Being someone who prefers [Linux for desktop][1] and encourages using open-source software, you may expect the answer to the question raised in the headline with a big “**Yes**“.
But I am not going to limit discussing the benefits of open-source software. Let us explore more!
Here, I plan to share my thoughts on if open-source software is secure and what are the things involved in it that make secure or insecure.
### Why Should You Care if Open-Source Software is Secure?
No matter whether you use [Linux][2] or any other operating system, you will be surrounded with open-source software in some way (directly/indirectly).
To give you an example, most of the proprietary software tools depend on some form of open-source libraries to make things work.
Furthermore, there is a reason why companies of various scale (including Google, Microsoft, and Facebook) rely on open-source software or contribute their resources to the open-source community in one way or the other.
Hence, the security of open-source software is something essential to know about.
### Myths About Open-Source Software Security
![][3]
While there are several arguments to pitch the cons of open-source software in terms of security, some of them just do not make any sense.
#### Anyone Can See &amp; Exploit the Code
The code is accessible to everyone, yes. But just because you can see the code—does that mean anyone can exploit it?
**Not really.**
Even though anyone can create a fork (or copy) of the software, the original software cannot be manipulated easily.
Usually, the project maintainer (or a group of them) manage the code repository and accept the commits from contributors. The code is reviewed before approval. And no one can hijack the code just like that.
**It takes effort for an attacker to exploit a vulnerability or add malicious code in a software, no matter if it is open-source or closed source.**
#### Without Dedicated Resources, Security Breaks down
Many believe that without dedicated employees or a team for an open-source software, it is difficult to maintain security.
In contrast, with several types of contributors joining and leaving, the software gets more attention from a wide range of developers.
And they may be able to spot security issues better than a few employees assigned for a proprietary software.
Some projects from the likes of Mozilla have a dedicated team to effectively iron out security issues. Similarly, most of the successful open source projects have plenty of resources to dedicate for security.
Hence, the open-source software ecosystem is a mixed bag for security. Even without dedicated resources, the projects get help from various contributors, and some are profitable to a great extent which helps them dedicate more resources.
### Open Source Software is Secure: Heres How
![][3]
Now that we have tackled the myths, let me highlight how open-source software deals with security issues.
In other words, the benefits in security with open-source software.
Not to forget, the perks of open-source software translate to some of the reasons why [Linux is better than Windows][4].
#### More Eyes Looking at the Code
Unlike a proprietary software, access to code is not limited to a few developers.
Some projects may even have thousands of developers watching the code, reviewing them, and flagging or fixing security issues.
And this gives an edge over closed-source software by having **the ability to identify issues quickly and addressing them as soon as possible.**
Not just limited to more developers, often enterprises get involved with open-source projects that they utilize. And when they do, they will also go through the code and review it.
This gives another source of external audit that may help improve the security of the software.
In contrast, with a closed-source software, a limited number of developers may not be able to find all kinds of security issues. And it may take them longer to fix all the issues one by one.
#### Community Decision Making to Prioritize Security Issues
The developers of a closed-source software may have certain restrictions and priorities as what to work on and when to resolve an issue.
However, in case of an open-source project, the community of contributors can prioritize and assign themselves what they want to work on and when to fix an issue. You do not need to depend on a vendor or follow their instructions to address a security issue.
The decision making that goes into addressing and fixing the security issues is more transparent and flexible in case of an open-source software. Hence, it can prove to be more effective leaving you with three specific benefits:
* **Transparency**
* **No dependency on the vendor**
* **Faster security updates**
### Open Source Software is not Bulletproof: Heres Why
![][3]
While there are cases where open-source software may get an edge for security, there could be instances or factors that affects it.
It is important to acknowledge that these problems exist, accordingly, an enterprise or an individual can make better decision about the state of security for an open-source software.
#### Not enough Eyes to Review Code and Uncertainty
Even if the code is accessible the world of developers, there are chances that a **project does not have enough contributors/developers to thoroughly review the code**.
In that case, we cannot have great confidence of an open-source software being peer-reviewed, because it lacks exactly that.
The open-source software may “claim” to have the best security just because its open-source, which is misleading when there are not enough developers working on it.
Also, we do not know how many developers are looking/reviewing the code and how exactly the code walkthrough is going on.
For instance, the Heartbleed bug was spotted after 2 years of its introduction in a project that was already popular i.e **OpenSSL**.
#### Software Responsibility or Accountability
This may not be important for individuals, but an **open-source software often comes with no warranties**.
So, if a business uses it, they must take the responsibility of any losses or damages caused by the use of that software.
This is something that tells you that nothing can be 100% secure and bug-free. No matter how many eyes you have on a code, or how skilled the contributors are, there will be risks in some form, be it security or data loss.
And this brings us to the fact that open-source software is not bulletproof.
### Open Source May Have its Edge for Better Security But…
Nothing is superior when it comes to security. No matter if it is closed-source or open-source, the same set of principles apply when it comes to security.
There are various external factors that can affect the security of a software, and **many of those are not source dependent**.
The code must be monitored in the same way to keep things secure.
Yes, the **open-source approach introduces benefits that closed-source software will never have**, but that does not mean that it is bulletproof.
_What do you think about the state of security when it comes to open-source software?_ _Do you think it is superior to proprietary solutions?_
I would appreciate your valuable thoughts in the comments down below.
#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You!
If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software.
I'm not interested
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/open-source-software-security/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/linux-foundation-linux-desktop/
[2]: https://itsfoss.com/what-is-linux-distribution/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: https://itsfoss.com/linux-better-than-windows/

View File

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

View File

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

View File

@ -1,11 +1,11 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (6 evening rituals for working in tech)
[#]: via: (https://opensource.com/article/20/11/evening-rituals-working-tech)
[#]: author: (Jen Wike Huger https://opensource.com/users/jen-wike)
[#]: collector: "lujun9972"
[#]: translator: "Arzelan"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: subject: "6 evening rituals for working in tech"
[#]: via: "https://opensource.com/article/20/11/evening-rituals-working-tech"
[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike"
6 evening rituals for working in tech
======
@ -44,6 +44,6 @@ via: https://opensource.com/article/20/11/evening-rituals-working-tech
[a]: https://opensource.com/users/jen-wike
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_jadud_farm-road.png?itok=of8IuSM5 (A farm road)
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDUCATION_jadud_farm-road.png?itok=of8IuSM5 "A farm road"
[2]: https://opensource.com/article/20/2/linux-ebook-readers
[3]: https://opensource.com/article/20/10/tech-morning-rituals

View File

@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (tanloong)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

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

View File

@ -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,134 +0,0 @@
[#]: subject: (How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo)
[#]: via: (https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo
======
The KDE team enabled the backports PPA which you can use to install and
upgrade to KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo._This guide
outlines the following topics_ppa:kubuntu-ppa/backports
![Kubnutu 21.04 running with KDE Plasma 5.22][1]
KDE team released the KDE Plasma 5.22 recently with a fair amount of enhancements, bug fixes along with updated KDE Framework and applications versions. This release brings several improvements such as Adaptive transparency in panels, user-friendly notification on file operation popups, package type display in Discover, various Wayland changes, and more. Check out more details about features [here][2].
If you are running Kubuntu 21.04 Hirsute Hippo Or, have a custom KDE Plasma installed in [Ubuntu 21.04 Hisrsute Hippo][3], you can upgrade to the latest version using the following steps. The current Hirsute Hippo series provides the prior versions of KDE Plasma 5.21.04 with KDE Framework 5.80.
:
1. [How to install KDE Plasma 5.22 in Kubuntu 21.04][4]
2. [How to install KDE Plasma 5.22 in Ubuntu 21.04 alongside GNOME][5]
3. [Can I install KDE Plasma 5.22 in Ubuntu 20.04 LTS?][6]
4. [How to Uninstall][7]
### Install KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo Steps
Follow the below steps.
If you want to use the graphical method, then add to the software sources in Discover and hit Update.
Or, use the following terminal method for faster installation.
* **Step 1**: Open a terminal and add below KDE Backports PPA.
```
sudo add-apt-repository ppa:kubuntu-ppa/backports
```
* **Step 2**: Then run the following to initiate a system upgrade. This will install the latest KDE Plasma 5.22 in your Hirsute Hippo system.
```
sudo apt update
sudo apt full-upgrade
```
![Upgrade to Plasma 5.22][8]
* **Step 3**: Reboot after the update and you should be greeted with an updated KDE Plasma 5.22 desktop.
The installation may take some time considering a complete version upgrade of the entire desktop environment.
### Installing KDE Plasma 5.22 in Ubuntu 21.04
If you are running GNOME based default Ubuntu 21.04 Hirsute Hippo desktop, you can use this PPA to install the latest KDE Plasma. Heres how.
[][9]
SEE ALSO:   Lubuntu 21.04 Hirsute Hippo - Artwork Contest is Here
Open a terminal and add the PPA (like above steps).
```
sudo add-apt-repository ppa:kubuntu-ppa/backports
```
Then, refresh the packages.
```
sudo apt update
```
Then run the below to install the Kubuntu desktop.
```
sudo apt install kubuntu-desktop
```
This will install the KDE Plasma desktop alongside with GNOME in Ubuntu 21.04.
### KDE Plasma 5.22 in Ubuntu 20.04 LTS
Ubuntu 20.04 LTS edition has the earlier KDE Plasma 5.18, KDE Framework 5.68, KDE Applications 19.12.3. So, during its entire lifecycle, it would not receive the latest KDE Update. So, technically you can add the above PPA and install the KDE Plasma 5.22. But I would not recommend it due to incompatible packages, frameworks that may lead to an unstable system.
So, it is recommended that you use either Kubuntu 21.04 with the above backports PPA Or, use KDE neon to experience the latest Plasma desktop.
### Uninstallation of KDE Plasma 5.22
If you change your mind and want to go back to the stock version of the KDE Plasma, then install the ppa-purge and purge the PPA. This will downgrade packages and make the stock version available.
```
sudo apt install ppa-purge
sudo ppa-purge ppa:kubuntu-ppa/backports
sudo apt update
```
### Closing Notes
I hope this quick guide helped you to install the latest KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo. This allows you experience the latest KDE technology coupled with KDE Framework and applications. However, you should be aware that not all the features should be made available in the backports PPA only the selected features and bug fixes that pass regression and safe to use. That said, you can always install KDE Neon as a fresh system to enjoy the latest tech from KDE.
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/
作者:[Arindam][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Kubutu-21.04-running-with-KDE-Plasma-5.22-1024x531.jpg
[2]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/
[3]: https://www.debugpoint.com/2021/04/ubuntu-21-04-hirsute-hippo-release/
[4]: tmp.wazjcS11If#plasma-kubuntu-2104
[5]: tmp.wazjcS11If#plasma-ubuntu-2104
[6]: tmp.wazjcS11If#plasma-ubuntu-2004
[7]: tmp.wazjcS11If#uninstall-stock-version
[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Upgrade-to-Plasma-5.22.jpg
[9]: https://www.debugpoint.com/2020/12/lubuntu-21-04-artwork/

View File

@ -1,135 +0,0 @@
[#]: subject: (Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager)
[#]: via: (https://itsfoss.com/hash-linux-review/)
[#]: author: (Sarvottam Kumar https://itsfoss.com/author/sarvottam/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager
======
With some effort, [you can install Arch Linux][1]. You may also install a desktop environment or windows manager of your choice on your Arch system.
That takes some time and effort but it is surely achievable. However, there exists projects that try to ease the pain by providing you a system preconfigured with a desktop environment or window manager of your choice. [ArcoLinux][2] is one such example.
Recently, I came across another project that has its sole focus on providing choice of window managers on top of the wonderful Arch distribution.
[Hash Project][3] offers four preconfigured Arch variants with tiling window managers: Awesome, [Xmonad][4], i3, and Bspwm.
If youre a beginner window manager hopper, the Hash project is what you should definitely try at once. Without investing time to configure it first, you can explore the potential of window managers and get used to keyboard-driven systems.
In this article, Ill discuss my part of the experience with the **Hash Linux Xmonad edition** featuring Linux kernel 5.12.
### Installation Of Hash Linux
The ISO image of all four editions of Hash Linux is available to [download][5] for x86_64 system architecture.
To avoid any unexpected error while installing it on a bare system, I created a virtual machine of Hash Linux Xmonad version in GNOME Boxes.
As I booted into Hash Linux, I noticed two things. First, a panel providing important shortcuts for managing windows and commands. Ill discuss it later after installation. Second, a beautiful and easy-to-use GUI installer.
![Hash Linux GUI Installer][6]
As usual, the graphical installer made the installation process very smooth by providing buttons to click on. Within a few steps of configuration, Hash Linux was installed and ready to reboot.
![Installer Welcome Page][7]
### First Impression
![Hash Linux][8]
If youve ever installed Xmonad window manager on your Linux system, what is the first thing you saw after reboot? Blank screen right.
And if youre a beginner or you dont know the default key binding, you get stuck on the same screen. Hence, you must have to read keyboard shortcuts first before using any window manager.
What if you get all the important shortcuts right on your window? A cheat sheet can save you a lot of time.
Therefore, for the sake of simplicity and beginner-friendly, Hash Linux has pinned important keys on the desktop window.
So, lets try some of it first. Starting with one of the most important `[Super]+Enter`, it opens the default termite terminal emulator with Z shell (ZSH).
If you click it multiple times, you notice that by default Xmonad follows a dwindle layout where it first fixes one window on the right side and then arranges the rest of all on the left side in the same manner.
![Xmonad default layout][9]
Using `[Super]+[Space]`, you can also change the current layout to a tabbed one. Even you can use `[Super]+[left+click]` to move a window into a float mode.
![Moved to float][10]
To quit the currently focussed window, you can press `[Super]+Q`.
### Applications In Hash Linux
By default, Hash Linux contains several useful command-line tools such as NeoFetch, Htop, Vim, Pacman, Git, and Speedtest-cli.
![Htop][11]
It also has a good amount of graphical applications such as Firefox 89, Gparted, Nitrogen, Conky, Flameshot, Geany, and CPU-X.
`[Super]+D` is the default key in Hash Linux to open application search menu.
![Application search menu][12]
### Theming
Hash Cyan is the default theme in Hash Linux. Besides it, Hash Linux provides four more themes: Light Orange, Sweet Purple, Night Red, and Arch Dark.
Hash Theme Selector is a home-baked Hash Linux application that you can use to configure the theme for a window manager.
![Hash Theme Selector][13]
### Upgrading Hash Linux
Being a rolling release distribution, you dont need to download a new ISO of Hash Linux to update the existing system. The only thing you need to upgrade your system is to run `upgrade` command in a terminal.
![upgrading hash linux][14]
### Closing Thought
If you want to use a window manager instead of the desktop environment but do not want to spend a lot of time configuring it, Hash project saves the day.
First, it will save you a lot of time and effort for configuration, and second, it will easily make you comfortable in using a keyboard-driven system. Later, you can definitely learn to configure according to your own needs.
As Hash Linux already provides four ISO with the different window managers, you can start using any version and find your favorite one. Overall, it is a [good Arch-based Linux distribution][15].
At last, I would also like to mention that the current official [site][3] of Hash Linux does not contain much information about it.
![][16]
An earlier [site][17] (not accessible to me now) that also mentioned in the release info, contained information about it including configuration details when I checked last time.
Dont want to go the Arch way just for tiling window manager? Try [Regolith Linux][18]. It is Ubuntu preconfigured with i3wm. Awesome, right?
--------------------------------------------------------------------------------
via: https://itsfoss.com/hash-linux-review/
作者:[Sarvottam Kumar][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/sarvottam/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/install-arch-linux/
[2]: https://arcolinux.com/
[3]: https://hashproject.ga/
[4]: https://xmonad.org/
[5]: https://hashproject.ga/index.html#downloads
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-GUI-Installer.jpg?resize=800%2C451&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Installer-Welcome-Page.png?resize=800%2C452&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux.jpg?resize=800%2C451&ssl=1
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Xmonad-default-layout.png?resize=800%2C452&ssl=1
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Moved-to-float.png?resize=800%2C452&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Htop.jpg?resize=800%2C451&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Application-search-menu.jpg?resize=800%2C451&ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Theme-Selector.png?resize=800%2C452&ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Upgrading-hash-linux.png?resize=800%2C452&ssl=1
[15]: https://itsfoss.com/arch-based-linux-distros/
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-Site-URL.png?resize=575%2C193&ssl=1
[17]: https://hashproject.org/
[18]: https://itsfoss.com/regolith-linux-desktop/

View File

@ -1,239 +0,0 @@
[#]: subject: (Use XMLStarlet to parse XML in your the Linux terminal)
[#]: via: (https://opensource.com/article/21/7/parse-xml-linux)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Use XMLStarlet to parse XML in your the Linux terminal
======
Become an XML star with XMLStarlet, an XML toolkit for your terminal.
![Penguin with green background][1]
Learning to parse XML is often considered a complex venture, but it doesn't have to be. [XML is highly and strictly structured][2], so it's relatively predictable. There are also lots of tools out there to help make the job manageable.
One of my favorite XML utilities is [XMLStarlet][3], an XML toolkit for your terminal. With XMLStarlet, you can validate, parse, edit, format, and transform XML data. XMLStarlet is a relatively minimal command, but navigating XML is full of potential, so this article demonstrates how to use it to query XML data.
### Install
XMLStarlet is installed by default on CentOS, Fedora, and many other modern Linux distributions, so just open a terminal and type `xmlstarlet` to access it. If XMLStarlet isn't already installed, your operating system offers to install it for you.
Alternately, you can install the `xmlstarlet` command from your package manager:
```
`$ sudo dnf install xmlstarlet`
```
On macOS, use [MacPorts][4] or [Homebrew][5]. On Windows, use [Chocolatey][6].
Should all else fail, you can install it manually from the [source code on Sourceforge][7].
### Parsing XML with XMLStarlet
There are many tools designed to help parse and transform XML data, including software libraries that let you [write your own parser][8] and complex commands like `fop` and `xsltproc`. Sometimes you don't need to process XML data, though; you just need a convenient way to extract important data from, update, or just validate it. For spontaneous XML interactions, I use `xmlstarlet`, a classic "Swiss Army knife"-style application that does the most common XML tasks. You can see what it has to offer by running the command along with the `--help` option:
```
$ xmlstarlet --help
Usage: xmlstarlet [&lt;options&gt;] &lt;command&gt; [&lt;cmd-options&gt;]
where &lt;command&gt; is one of:
  ed    (or edit)      - Edit/Update XML document(s)
  sel   (or select)    - Select data or query XML document(s) (XPATH, etc)
  tr    (or transform) - Transform XML document(s) using XSLT
  val   (or validate)  - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG)
  fo    (or format)    - Format XML document(s)
  el    (or elements)  - Display element structure of XML document
  c14n  (or canonic)   - XML canonicalization
  ls    (or list)      - List directory as XML
[...]
```
You can get further help by appending `--help` to the end of any of these subcommands:
```
$ xmlstarlet sel --help
  -Q or --quiet             - do not write anything to standard output.
  -C or --comp              - display generated XSLT
  -R or --root              - print root element &lt;xsl-select&gt;
  -T or --text              - output is text (default is XML)
  -I or --indent            - indent output
[...]
```
#### Selecting data with sel
You can view the data in XML with the `xmlstarlet select` (`sel` for short) command. Here's a simple XML document:
```
&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;xml&gt;
  &lt;os&gt;
   &lt;linux&gt;
    &lt;distribution&gt;
      &lt;name&gt;Fedora&lt;/name&gt;
      &lt;release&gt;7&lt;/release&gt;
      &lt;codename&gt;Moonshine&lt;/codename&gt;
      &lt;spins&gt;
        &lt;name&gt;Live&lt;/name&gt;
        &lt;name&gt;Fedora&lt;/name&gt;
        &lt;name&gt;Everything&lt;/name&gt;
      &lt;/spins&gt;
    &lt;/distribution&gt;
    &lt;distribution&gt;
      &lt;name&gt;Fedora Core&lt;/name&gt;
      &lt;release&gt;6&lt;/release&gt;
      &lt;codename&gt;Zod&lt;/codename&gt;
      &lt;spins&gt;&lt;/spins&gt;
    &lt;/distribution&gt;
   &lt;/linux&gt;
  &lt;/os&gt;    
&lt;/xml&gt;
```
When looking for data in an XML file, your first task is to focus on the node you want to explore. If you know the path to the node, specify the full path with the `--value-of` option. The earlier in the [Document Object Model][9] (DOM) tree you start to explore, the more information you see:
```
$ xmlstarlet select --template \
\--value-of /xml/os/linux/distribution \
\--nl myfile.xml
      Fedora
      7
      Moonshine
     
        Live
        Fedora
        Everything     
     
      Fedora Core
      6
      Zod
```
The `--nl` stands for "new line," and it inserts copious amounts of whitespace to ensure your terminal prompt gets a new line after your results are in. I've removed some of the excess space in the sample output.
Narrow your focus by descending further into the DOM tree:
```
$ xmlstarlet select --template \
\--value-of /xml/os/linux/distribution/name \
\--nl myfile.xml
Fedora
Fedora Core
```
#### Conditional selects
One of the most powerful tools for navigating and parsing XML is called XPath. It governs the syntax used in XML searches and invokes functions from XML libraries. XMLStarlet understands XPath expressions, so you can make your selection conditional with an XPath function. XPath features a wealth of functions, and it's [documented in detail by W3C][10], but I find [Mozilla's XPath documentation][11] more concise.
You can use square brackets as a test function, comparing the contents of an element to some value. Here's a test for the value of the `<name>` element, which returns the release number associated only with a specific match.
Imagine for a moment that the sample XML file contains all Fedora releases beginning with 1. To view all release numbers associated with the old name "Fedora Core" (the project dropped "Core" from the name from release 7 onward):
```
$ xmlstarlet sel --template \
\--value-of '/xml/os/linux/distribution[name = "Fedora Core"]/release' \
\--nl myfile.xml
6
5
4
3
2
1
```
You could view all codenames for those releases, too, by changing the `--value-of` path to `/xml/os/linux/distribution[name = "Fedora Core"]/codename`.
### Matching paths and getting values
An advantage of viewing XML tags as nodes is that once you find the node, you can think of it as your current "directory" of data. It's not really a directory, at least not in the filesystem sense, but it is a collection of data that you can query. To help you keep your destination and the data "inside" it separate, XMLStarlet differentiates between what you're trying to match with the `--match` option and the value of the data you want with a `--value-of` option.
Suppose you know that the `<spin>` node contains several elements. That makes it your destination. Once you're there, you can use `--value-of` to specify which element you want a value for. To look at all elements, use a dot (`.`) to represent your current location:
```
$ xmlstarlet sel --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '.' --nl myfile.xml \
Live
Fedora
Everything
```
As with navigating the DOM, you can use XPath expressions to limit the scope of what data is returned. In this example, I use the `last()` function to retrieve just the last element in the `spin` node:
```
$ xmlstarlet select --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '*[last()]' --nl myfile.xml
Everything
```
In this example, I use the `position()` function to select a specific element in the `spin` node:
```
$ xmlstarlet select --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '*[position() = 2]' --nl myfile.xml
Fedora
```
The `--match` and `--value-of` options can overlap, so it's up to you how you want to use them together. These two expressions, in the case of the sample XML, do the same thing:
```
$ xmlstarlet select  --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '.' \
\--nl myfile.xml
Live
Fedora
Everything     
$ xmlstarlet select --template \
\--match '/xml/os/linux/distribution' \
\--value-of 'spin' \
\--nl myfile.xml
Live
Fedora
Everything
```
### Getting comfortable with XML
XML can seem over-verbose and unwieldy at times, but the tools built to interact with it consistently surprise me. If you're looking to take advantage of XML, then XMLStarlet could be a good entry point. The next time you're about to open an XML file to look at structured data, try using XMLStarlet and see if you can query that data instead. The more comfortable you get with XML, the better it can serve you as a robust and flexible data format.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/parse-xml-linux
作者:[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/linux_penguin_green.png?itok=ENdVzW22 (Penguin with green background)
[2]: https://opensource.com/article/21/6/what-xml
[3]: https://en.wikipedia.org/wiki/XMLStarlet
[4]: https://opensource.com/article/20/11/macports
[5]: https://opensource.com/article/20/6/homebrew-mac
[6]: https://opensource.com/article/20/3/chocolatey
[7]: http://xmlstar.sourceforge.net
[8]: https://opensource.com/article/21/6/parsing-config-files-java
[9]: https://opensource.com/article/21/6/what-xml#dom
[10]: https://www.w3.org/TR/1999/REC-xpath-19991116
[11]: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,124 @@
[#]: subject: (Apps for daily needs part 2: office suites)
[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/)
[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Apps for daily needs part 2: office suites
======
![][1]
Photo by [Brooke Cagle][2] on [Unsplash][3]
Today, almost every family has a desktop computer or laptop. Thats because the computer has become a very important requirement. Moreover, many people have to create documents and presentations in digital format for work or study. Therefore, the office suites are must-have application on almost all computers. This article will introduce some of the open source office suites that you can use on Fedora Linux. You may need to install the software mentioned. 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]. Here is the list of apps for daily needs in the office suites category.
### LibreOffice
LibreOffice is the most popular office suite among GNU/Linux users. It has a user interface and user experience similar to Microsoft Office. This makes LibreOffice easy to learn for those who have just migrated from Microsoft Office. LibreOffice has complete features to meet your needs working on documents and presentations. It consists of six applications: Writer, Calc, Impress, Draw, Math, and Base.
The first application is Writer that is used to create various kinds of documents, such as letters, faxes, agendas, minutes, etc. It is a full-featured word processing and desktop publishing tool. The second application is Calc which is a spreadsheet program that is perfect for presenting data and documenting it in tabular format. Calc can create simple tables or do professional data analysis. The third application is Impress which is an easy-to-use presentation application. You can easily choose what you features want in your presentation slides, such as text, images, tables, diagrams, etc.
![LibreOffice Writer][5]
![LibreOffice Calc][6]
![LibreOffice Impress][7]
The three LibreOffice applications mentioned earlier are the most commonly used applications in creating documents and presentations. However, LibreOffice provides three other applications that are also very useful. The first is Draw which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Math which can help us make perfectly formatted mathematical and scientific formulas. The last is Base which is an application for processing databases.
![LibreOffice Draw][8]
![LibreOffice Math][9]
![LibreOffice Base][10]
More information is available at this link: <https://www.libreoffice.org/>
* * *
### ONLYOFFICE
ONLYOFFICE is an office suite application that is highly compatible with Microsoft Office. Therefore we do not have to worry about collaborating with colleagues who use Microsoft Office because it can read various file formats such as docx, xlsx, and pptx.
ONLYOFFICE provides three applications with a clean and modern look. We can easily find the features and tools that we need. Although the features are not as complete as LibreOffice, they are very sufficient to help us create good documents and presentations.
The first application is Documents Editor which has the same function as Writer from LibreOffice. It has all the basic features needed in a word processor, such as managing fonts and styles, formatting text, adjusting line and paragraph spacing, inserting headers and footers, customizing page layout, and setting margins. The second application is Spreadsheet Editor which is an application for processing data and creating it as a document in tabular format. It is an application with the same functionality as Calc. The last one is Presentations Editor which is a presentation application with functions similar to Impress.
Unfortunately ONLYOFFICE is not available in the official Fedora Linux repositories. But you can still install it on Fedora Linux using Flatpak or Appimages.
![ONLYOFFICE Documents Editor][11]
![ONLYOFFICE Spreadsheets Editor][12]
![ONLYOFFICE Presentations Editor][13]
More information is available at this link: <https://www.onlyoffice.com/desktop.aspx>
* * *
### Calligra
Calligra is an office suite created by KDE. Therefore, this application is actually more suitable for users of the KDE Plasma desktop environment. But it can still run well on other desktop environments, such as Fedora Workstation using GNOME.
Calligra provides several applications with a slightly different look from LibreOffice or ONLYOFFICE. It may take some adjustment for those who are used to mainstream office suite applications. However, Calligra is still a reliable office suite to support our daily needs.
The first application is Words which is an intuitive word processor with desktop publishing features. It has a full range of features to help us in document creation. The second application is Sheets which has the same functionality as Calc and Spreadsheet Editors as a fully-featured spreadsheet application. The third application is Stage which can help us in making presentation slides.
![Calligra Words][14]
![Calligra Sheets][15]
![Calligra Stage][16]
The three Calligra applications are the most commonly used applications for creating documents and presentations. There are three other applications that are also very useful. The first is Karbon which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Plan which is project management application that can help in managing moderately large projects with multiple resources. The last is KEXI which is a visual database application creator.
![Calligra Karbon][17]
![Calligra Plan][18]
![Calligra Kexi][19]
More information is available at this link: <https://calligra.org/>
* * *
### Conclusion
This article presented 3 office suites for your daily needs that you can use on Fedora Linux. If you want a complete set of features in your office suite, then LibreOffice may be the right choice. For good compatibility with Microsoft Office, then you may choose ONLYOFFICE. However, if you want a different user interface and experience in creating documents and presentations, you can try Calligra. Hopefully this article can help you to choose the right office suite. If you have experience in using these applications, please share your experience in the comments.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/
作者:[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-2-Office-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://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-writer-1-1024x575.png
[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-calc-1-1024x575.png
[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-impress-1-1024x575.png
[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-draw-1-1024x575.png
[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-math-1-1024x575.png
[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-base-1-1024x575.png
[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-doc-1024x575.png
[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-sheet-1024x575.png
[13]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-presentation-1024x575.png
[14]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-words-1024x575.png
[15]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-sheets-1024x575.png
[16]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-stage-1024x575.png
[17]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-karbon-1-1024x575.png
[18]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-plan-1024x575.png
[19]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-kexi-1024x575.png

View File

@ -0,0 +1,232 @@
[#]: subject: (Linux package managers: dnf vs apt)
[#]: via: (https://opensource.com/article/21/7/dnf-vs-apt)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
Linux package managers: dnf vs apt
======
Package managers do the same general things—installing, managing, and
uninstalling applications—but they don't do everything the same.
![Gift box opens with colors coming out][1]
There are many ways to [get applications onto a Linux system][2]. Some, like Flatpak and containers, are new. Others, like DEB and RPM, are classic formats that have withstood the test of time.
There isn't a universal installer for any operating system. Today, all major OSes use a mix of app stores (both first and third party), drag-and-drop installation, and installation wizards because there are innumerable developers delivering software. Different developers have different requirements for the code they deliver, and this informs the installation method they each choose.
Linux pioneered the concept of a _package manager_, a command to install, manage, and uninstall applications. Two common package manager commands are `apt` and `dnf`. The `apt` command manages DEB packages, while `dnf` manages RPM packages. The two are not strictly exclusive of one another in theory, although in practice, a Linux distribution generally uses one or the other. It's theoretically possible to run both on one system, but package installations would overlap, versioning would be difficult, and the commands would be redundant to one another. However, if you work in a mixed Linux environment, interacting with workstations running one distribution and servers running another, you may need to know both.
### Searching for applications
Before you can install an application with a package manager, you need to know the package's name. Usually, the application name and the package name are the same. The process to verify the name of the package you want to install is exactly the same on `dnf` and `apt`:
```
$ sudo dnf search zsh
====== Name Exactly Matched: zsh ======
zsh.x86_64 : Powerful interactive shell
[...]
```
With `apt`:
```
$ sudo apt search zsh
Sorting... Done
Full Text Search... Done
csh/stable 20110502-4+deb10u1 amd64
  Shell with C-like syntax
ddgr/stable 1.6-1 all
  DuckDuckGo from the terminal
direnv/stable 2.18.2-2 amd64
  Utility to set directory specific environment variables
draai/stable 20180521-1 all
  Command-line music player for MPD
[...]
```
To get relevant results from `apt` earlier in the search, you can use [regex][3]:
```
apt search ^zsh
Sorting... Done
Full Text Search... Done
zsh/stable 5.7.1-1 amd64
  shell with lots of features
[...]
```
### Finding an application's package
Some commands come bundled with other commands, all in one package. When that happens, you can use your package manager to learn which package provides what you need. The `dnf` and `apt` commands diverge on how they search for this kind of metadata.
On `dnf`:
```
$ sudo dnf provides pgrep
procps-ng-3.3.15-6.el8.x86_64 : System and process monitoring utilities
Repo        : baseos
Matched from:
Filename    : /usr/bin/pgrep
```
The `apt` command uses a subcommand, `apt-file`. To use `apt-file`, you must first install it and then prompt it to update its cache:
```
$ sudo apt install apt-file
Reading package lists... Done
Building dependency tree      
Reading state information... Done
The following additional packages will be installed:
  libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl
The following NEW packages will be installed:
  apt-file libapt-pkg-perl libexporter-tiny-perl liblist-moreutils-perl libregexp-assemble-perl
0 upgraded, 5 newly installed, 0 to remove and 14 not upgraded.
Need to get 297 kB of archives.
After this operation, 825 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
$ sudo apt-file update
[...]
```
You can use `apt-file` to search for a command. You can cast a very wide net by just searching for the command, but if you happen to know the command's expected path, it's more accurate:
```
$ sudo apt-file search /usr/bin/pgrep
pgreplay: /usr/bin/pgreplay              
procps: /usr/bin/pgrep
```
### Installing applications
Installing applications is essentially identical with `apt` and `dnf`:
```
`$ sudo apt install zsh`
```
With `dnf`, you can install a single package using the same option:
```
`$ sudo dnf install zsh`
```
Many RPM-based distributions feature _installation groups_, which collect sometimes superficially related applications into one easily installable target. For instance, the [Design Suite][4] group in Fedora contains popular creative applications. Many artists who want one creative application are likely to want similar applications, and installing the whole group is an easy and quick way to get a sensible start on building a digital studio. You can view available groups with `group list` (use `-v` to see the group names without spaces):
```
$ sudo dnf group list -v
[...]
Available Groups:
   Container Management (container-management)
   RPM Development Tools (rpm-development-tools)
   Design Suite (design-suite)
   Development Tools (development)
[...]
```
Install an RPM group using the `group install` subcommands:
```
`$ sudo dnf group install design-suite`
```
You can use the `@` notation to reduce typing:
```
`$ sudo dnf install @design-suite`
```
### Upgrading applications
One advantage of using a package manager is that it is aware of _all_ the applications it has ever installed. That means you don't have to go hunting for updated versions of applications. Instead, you can tell your package manager to scan for updates.
The subcommands used by `dnf` and `apt` are slightly different. Because `apt` keeps a cache of information that requires regular updating, it uses the `upgrade` subcommand for application updates:
```
`$ sudo apt upgrade`
```
By contrast, `dnf` updates metadata every time you use the command, so the `update` and `upgrade` subcommands are interchangeable:
```
`$ sudo dnf upgrade`
```
This is the same as:
```
`$ sudo dnf update`
```
### Removing applications
If you've ever tried to remove an application manually on any platform, then you know there are inevitably leftover files, such as preference files or assets or icons, scattered all around your hard drive after you remove the application. Yet another advantage to using a package manager is that your package manager knows _every single file_ installed with a package:
```
`$ sudo dnf remove zsh`
```
The `remove` subcommand is also used for `apt`:
```
`$ sudo apt remove zsh`
```
Removing a package with `apt` doesn't remove modified user configuration files, in case you removed the package by accident. If you want `apt` to remove an application _and_ its configuration files, use `purge` on an application you've previously removed:
```
`$ sudo apt purge zsh`
```
Both `apt` and `dnf` (even with `purge`) don't remove data or configuration files in your home directory. To remove data from your home directory, you must do it manually (it's usually found in `~/.config` and `~/.local`).
### Learning package management
Whether your Linux distribution of choice favors `apt` or `dnf`, the commands' purposes are broadly identical. They help you install, update, and remove packages. These two, being the most common package managers, largely mirror one another's most important syntactical elements, so switching between them is pretty easy.
Each has some advanced features, such as repository management, that diverge substantially, but those tend not to be run as frequently as the classic sequence of `search` and `install`.
Regardless of which package manager you use more often, you can download our [apt cheat sheet][5] and [dnf cheat sheet][6] so that you have the most important syntax close at hand when you need it the most.
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/dnf-vs-apt
作者:[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/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out)
[2]: https://opensource.com/article/18/1/how-install-apps-linux
[3]: https://opensource.com/article/18/5/getting-started-regular-expressions
[4]: https://labs.fedoraproject.org/en/design-suite/
[5]: https://opensource.com/downloads/apt-cheat-sheet
[6]: https://opensource.com/downloads/dnf-cheat-sheet

25
sources/tech/20210720 .md Normal file
View File

@ -0,0 +1,25 @@
[#]: subject: ()
[#]: via: (https://www.2daygeek.com/save-command-output-to-a-file-linux/)
[#]: author: ( )
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
======
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/save-command-output-to-a-file-linux/
作者:[][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:
[b]: https://github.com/lujun9972

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

@ -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

@ -1,91 +0,0 @@
[#]: subject: (Linux Mint 20.2 is Now Available With New Features and Tools)
[#]: via: (https://news.itsfoss.com/linux-mint-20-2-release/)
[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/)
[#]: collector: (lujun9972)
[#]: translator: (lcf33)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
包含新功能和工具的Linux Mint 20.2 已经发布。
======
几周前Linux Mint 20.2 beta版[发布][1]了。现在Linux Mint 20.2 最终稳定版也发布了。
这个版本是基于Ubuntu 20.04 的LTS长期支持版本支持2025年截止。
来看下这个版本有什么新特性,以及如何获取它。
### Linux Mint 20.2: 有什么新特性?
这个版本主要两点是增加了更新通知。该功能鼓励用户更新系统,以确保安全性。
该功能不像[Windows系统那样强制更新][2],但它会留意你多久没有更新系统,检查系统运行时间,然后提醒你更新。
![][3]
更棒的是,你可以配置更新通知。
其他主要升级还有:桌面环境**Cinnamon 5**,新的**批量改名工具**Bulky**用Sticky Notes取代GNote**作为默认笔记应用。
![][4]
批量文件改名工具可以在所有桌面版本但不包括Xfce。因为Xfce默认文件管理器Thunar已经有该功能批量文件改名
Cinnamon 5不是很让人激动不过有一些内在性能改进并增加了限制内存使用的选项。
![][5]
Sticky Notes 是用GTK 3开发的支持HiDPI并提供了更多的功能。同时与系统托盘整合得更好。
![][6]
### 其他改进
在网络上共享文件的[Warpinator应用程序][7]得到了一些升级,变得更有用。
其他桌面环境的升级包括Xfce 4.16和MATE 1.24。除此之外你还会发现一些细微的UI改进和错误修复。
特别是解决了NVIDIA显卡**对混合图形的支持**的问题,这对笔记本电脑用户来说是个好消息。
要了解更多变更详情,你可以参考任一桌面版本的[官方公告][8]。
### 下载或升级至Linux Mint 20.2
你可以直接在官方网站[下载页面][9]找到稳定版本。
[Download Linux Mint 20.2][9]
如果已经安装了Linux Mint 20 或者 20.1。你可以先检查所有可用更新,然后更新管理器会收到更新。
接下来确保你做了备份如果你想的话可以使用timeshift工具然后从**编辑**菜单种静茹更新管理器的系统升级选项,如下所示。
![][10]
当你单击后,屏幕上会出现升级的提示。你也可以通过[官方升级说明][11]获得进一步帮助。
_你完成升级了吗你对最新版本有什么看法欢迎在下面的平路种分享你的想法。_
#### 大型科技网站It's FOSS需要你获得数百万收入
如果你喜欢我们It's FOSS网站请考虑捐款支持我们的独立出版物。您的支持将帮助我们继续出版专注于桌面Linux和开源软件的内容。
我不感兴趣。
--------------------------------------------------------------------------------
via: https://news.itsfoss.com/linux-mint-20-2-release/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/lcf33)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://news.itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://news.itsfoss.com/linux-mint-20-2-beta-release/
[2]: https://news.itsfoss.com/linux-mint-updates-notice/
[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2MCIgd2lkdGg9IjQ5NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9IjU3MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[7]: https://news.itsfoss.com/warpinator-android-app/
[8]: https://blog.linuxmint.com/?p=4102
[9]: https://linuxmint.com/download.php
[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MCIgd2lkdGg9IjUzMyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4=
[11]: https://blog.linuxmint.com/?p=4111

View File

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

View File

@ -0,0 +1,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

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

View File

@ -0,0 +1,193 @@
[#]: 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: ( )
[#]: publisher: ( )
[#]: url: ( )
将 Vim 配置成一个写作工具
======
在我的第一个专栏中,我谈到了我为什么把 [我的写作工作迁移到了 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 用户也可以用这种方法启动。[译者注:原文这里本应该有链接,可能作者忘记添加了。无论如何,在终端中, Linux 中的命令是 vimtutorWindows 在安装目录下找到 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 插件时,这个教程帮助了我。我使用 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`
#### 总结
在这篇文章中,我们简单地介绍了写作者可以怎样开始使用 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)
校对:[校对者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

@ -0,0 +1,127 @@
[#]: subject: (How to get KDE Plasma 5.22 in Kubuntu 21.04 Hirsute Hippo)
[#]: via: (https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/)
[#]: author: (Arindam https://www.debugpoint.com/author/admin1/)
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
如何在 Kubuntu 21.04 Hirsute Hippo 中获得 KDE Plasma 5.22
======
KDE 团队启用了向后移植 PPA你可以使用它在 Kubuntu 21.04 Hirsute Hippo 中安装和升级到 KDE Plasma 5.22。
![Kubnutu 21.04 running with KDE Plasma 5.22][1]
KDE 团队最近发布了 KDE Plasma 5.22,其中有相当多的增强功能、错误修复以及更新的 KDE 框架和应用版本。这个版本带来了一些改进,如面板的自适应透明度,文件操作弹出时的用户友好通知,“发现”中的软件包类型显示,各种 Wayland 的变化等。在[这里][2]查看更多关于功能细节。
如果你正在运行 Kubuntu 21.04 Hirsute Hippo 或者,在 [Ubuntu 21.04 Hisrsute Hippo][3] 中安装了自定义的 KDE Plasma你可以通过以下步骤升级到最新版本。目前的 Hirsute Hippo 系列提供了 KDE Plasma 5.21.04 与 KDE Framework 5.80 的先前版本。
本指南包含下列主题:
1. [如何在 Kubuntu 21.04 中安装 KDE Plasma 5.22][4]
2. [如何在 Ubuntu 21.04 中与 GNOME 一起安装 KDE Plasma 5.22][5]
3. [我可以在 Ubuntu 20.04 LTS 中安装 KDE Plasma 5.22 么][6]
4. [如何卸载][7]
### 在 Kubuntu 21.04 Hirsute Hippo 中安装 KDE Plasma 5.22 的步骤
按照下面的步骤进行。
如果你想使用图形方法,那么在“发现”中添加到软件源,然后点击更新。
或者,使用下面的终端方法,以加快安装速度。
* **步骤 1**:打开一个终端,添加下面的 KDE Backports PPA。
```
sudo add-apt-repository ppa:kubuntu-ppa/backports
```
* **步骤 2**:然后运行以下程序来启动系统升级。这将在你的 Hirsute Hippo 系统中安装最新的 KDE Plasma 5.22。
```
sudo apt update
sudo apt full-upgrade
```
![Upgrade to Plasma 5.22][8]
* **步骤 3**:更新后重新启动,你应该会看到一个更新的 KDE Plasma 5.22 桌面。
考虑到整个桌面环境的完整版本升级,安装可能需要一些时间。
### 在 Ubuntu 21.04 中安装 KDE Plasma 5.22
如果你正在运行基于 GNOME 的默认 Ubuntu 21.04 Hirsute Hippo 桌面,你可以使用这个 PPA 来安装最新的 KDE Plasma。下面是方法。
打开终端,添加 PPA像上面的步骤那样
```
sudo add-apt-repository ppa:kubuntu-ppa/backports
```
然后,刷新软件包。
```
sudo apt update
```
然后运行下面的程序来安装 Kubuntu 桌面。
```
sudo apt install kubuntu-desktop
```
这将在 Ubuntu 21.04 中与 GNOME 一起安装 KDE Plasma 桌面。
### Ubuntu 20.04 LTS 中的 KDE Plasma 5.22
Ubuntu 20.04 LTS 版拥有早期的 KDE Plasma 5.18、KDE Framework 5.68、KDE Applications 19.12.3。所以,在它的整个生命周期中,它不会收到最新的 KDE 更新。所以,从技术上讲,你可以添加上述 PPA 并安装 KDE Plasma 5.22。但我不建议这样做,因为不兼容的软件包、框架可能会导致系统不稳定。
所以,建议你使用 Kubuntu 21.04 和上面的向后移植 PPA 或者使用 KDE neon 来体验最新的 Plasma 桌面。
### 卸载 KDE Plasma 5.22
如果你改变主意,想回到 KDE Plasma 的原始版本,那么安装 ppa-purge 并清除 PPA。这将使软件包降级并启用仓库版本。
```
sudo apt install ppa-purge
sudo ppa-purge ppa:kubuntu-ppa/backports
sudo apt update
```
### 结束语
我希望这个快速指南能帮助你在 Kubuntu 21.04 Hirsute Hippo 中安装最新的 KDE Plasma 5.22。这可以让你体验到最新的 KDE 技术以及 KDE 框架和应用。然而,你应该知道,并不是所有的功能都应该在向后移植 PPA 中提供,它只有选定的功能和错误修复,这才能通过回归测试并安全使用。也就是说,你总是可以把 KDE Neon 安装成一个全新的系统来享受 KDE 的最新技术。
* * *
--------------------------------------------------------------------------------
via: https://www.debugpoint.com/2021/06/plasma-5-22-kubuntu-21-04/
作者:[Arindam][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://www.debugpoint.com/author/admin1/
[b]: https://github.com/lujun9972
[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Kubutu-21.04-running-with-KDE-Plasma-5.22-1024x531.jpg
[2]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/
[3]: https://www.debugpoint.com/2021/04/ubuntu-21-04-hirsute-hippo-release/
[4]: tmp.wazjcS11If#plasma-kubuntu-2104
[5]: tmp.wazjcS11If#plasma-ubuntu-2104
[6]: tmp.wazjcS11If#plasma-ubuntu-2004
[7]: tmp.wazjcS11If#uninstall-stock-version
[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Upgrade-to-Plasma-5.22.jpg

View File

@ -0,0 +1,135 @@
[#]: subject: "Hash Linux: Arch Linux Preconfigured With Xmonad, Awesome, i3, and Bspwm Window Manager"
[#]: via: "https://itsfoss.com/hash-linux-review/"
[#]: author: "Sarvottam Kumar https://itsfoss.com/author/sarvottam/"
[#]: collector: "lujun9972"
[#]: translator: "mcfd"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
Hash Linux: 预配置 Xmonad、Awesome、i3 和 Bspwm 窗口管理器的 Arch Linux 衍生版
======
通过一些努力,[你可以安装 Arch Linux][1]。也可以在你的 Arch 系统上安装一个你选择的桌面环境或窗口管理器。
这需要一些时间和精力,但肯定是可以实现的。但是,有一些项目可以减轻你的痛苦,为你提供一个预先配置好的桌面环境或窗口管理器的系统。[ArcoLinux][2] 就是这样一个例子。
最近,我发现了另一个项目,它只专注于在出色的 Arch 发行版上提供完善的窗口管理器的选择。
[Hash Project][3] 提供了四种预配置平铺式窗口管理器的 Arch 变体Awesome、 [Xmonad][4]、 i3、和 Bspwm。
如果你是一个初学窗口管理器的人Hash Project 绝对是你应该马上尝试的。不用先投入时间去配置它,你就可以探索窗口管理器的潜力,并习惯由键盘驱动的系统。
在本文中,我将讨论我在使用 **Hash Linux Xmonad 版本** 时的部分体验,该版本采用 Linux 5.12的内核。
### 安装 Hash Linux
Hash Linux 四个版本的 ISO 镜像均可 [下载][5] ,适用于 x86_64 系统架构。
为了避免在实体机上安装时出现的各种意外错误,我在 GNOME Boxes 中创建了一个 Hash Linux Xmonad 版本的虚拟机。
当我启动到 Hash Linux 时,我注意到两件事。 首先是一个面板,提供用于管理窗口和命令的快捷方式。 我将在安装后讨论它。 其次,是一个漂亮且易于使用的 GUI 安装程序。
![Hash Linux GUI Installer][6]
像其他衍生版一样图形化的安装程序使安装过程非常顺畅。在几个步骤的配置中Hash Linux 已安装完毕,并准备重新启动。
![Installer Welcome Page][7]
### 第一印象
![Hash Linux][8]
如果你曾经在你的 Linux 系统上安装过 Xmonad 窗口管理器,那么你重启后首先看到的是什么? 空白的屏幕吧。
如果你是一个初学者,或者你不知道默认的按键绑定,你会被卡在一个屏幕上。因此,在使用任何窗口管理器之前,你必须先阅读其键盘快捷键。
如果你想把所有重要的快捷键提示都放在窗口上呢?一个备忘单可以为你节省很多时间。
因此为了简化和方便初学者Hash Linux 将重要的快捷键都钉在了桌面上。
所以,让我们先尝试其中的一些。从最重要的一个开始 `[Super]+Enter`,它可以打开默认的 termite 终端模拟器与 Z shell (ZSH)。
如果你多次点击它,你会发现默认情况下 Xmonad 遵循一个缩小布局,它首先将一个窗口固定在右边,然后以同样的方式将其余的全部安排在左边。
![Xmonad default layout][9]
按下 `[Super]+[Space]`,你也可以将当前的布局改为标签式布局。甚至你可以按下 `[Super]+[left+click]` 将窗口拖动。
![Moved to float][10]
要退出当前的窗口,你可以按下 `[Super]+Q`
### Hash Linux 中的应用
默认情况下Hash Linux 包含几个有用的命令行工具NeoFetch、Htop、Vim、Pacman、Git 和 Speedtest-cli。
![Htop][11]
它还拥有大量的图形应用程序Firefox 89、Gparted、Nitrogen、Conky、Flameshot、Geany 和 CPU-X。
`[Super]+D` 是 Hash Linux 中打开应用程序搜索菜单的默认快捷键。
![Application search menu][12]
### 主题美化
Hash Cyan 是 Hash Linux 的默认主题。除了它之外Hash Linux 还提供了另外四个主题Light Orange、Sweet Purple、Night Red 和 Arch Dark。
Hash Theme Selector 是一个自制的 Hash Linux 应用程序,你可以用它来配置窗口管理器的主题。
![Hash Theme Selector][13]
### 升级 Hash Linux
作为一个滚动发行版,你不需要下载一个新的 Hash Linux 的 ISO 来更新现有系统。你唯一需要的是在终端运行 ` upgrade` 命令来升级你的系统。
![upgrading hash linux][14]
### 结束语
如果你想使用一个窗口管理器来代替桌面环境但又不想花很多时间来配置它Hash Project 可以节省你的时间。
首先,它可以节省你大量的配置时间和精力,其次,它可以很轻松地让你适应使用键盘控制的系统。以后,你肯定可以学会根据自己的需要进行配置。
由于 Hash Linux 已经提供了4个带有不同的窗口管理器的 ISO你可以开始使用任何一个版本并找到你最喜欢的一个版本。总的来说它是一个[很好的 Arch Linux 衍生版][15]。
最后我还要提一下,目前 Hash Linux 的官方[网站][3]并没有包含很多关于它的信息。
![][16]
早期的[网站][17](我现在无法访问)也在发布信息中提到,在我上次访问时,其中包含了许多关于它的信息,包括配置细节等。
不想入 Arch 的教,只想用平铺式窗口管理器?可以试试 [Regolith Linux][18] 。它是预先配置了 i3wm 的 Ubuntu。棒极了对吧
--------------------------------------------------------------------------------
via: https://itsfoss.com/hash-linux-review/
作者:[Sarvottam Kumar][a]
选题:[lujun9972][b]
译者:[mcfd](https://github.com/mcfd)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/sarvottam/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/install-arch-linux/
[2]: https://arcolinux.com/
[3]: https://hashproject.ga/
[4]: https://xmonad.org/
[5]: https://hashproject.ga/index.html#downloads
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-GUI-Installer.jpg?resize=800%2C451&ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Installer-Welcome-Page.png?resize=800%2C452&ssl=1
[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux.jpg?resize=800%2C451&ssl=1
[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Xmonad-default-layout.png?resize=800%2C452&ssl=1
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Moved-to-float.png?resize=800%2C452&ssl=1
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Htop.jpg?resize=800%2C451&ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Application-search-menu.jpg?resize=800%2C451&ssl=1
[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Theme-Selector.png?resize=800%2C452&ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/06/Upgrading-hash-linux.png?resize=800%2C452&ssl=1
[15]: https://itsfoss.com/arch-based-linux-distros/
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/Hash-Linux-Site-URL.png?resize=575%2C193&ssl=1
[17]: https://hashproject.org/
[18]: https://itsfoss.com/regolith-linux-desktop/

View File

@ -0,0 +1,243 @@
[#]: subject: "Use XMLStarlet to parse XML in your the Linux terminal"
[#]: via: "https://opensource.com/article/21/7/parse-xml-linux"
[#]: author: "Seth Kenlon https://opensource.com/users/seth"
[#]: collector: "lujun9972"
[#]: translator: "zepoch"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
在你的 Linux 终端中使用 XMLStarlet 来解析 XML
======
借助 XMLStarlet一个终端上的 XML 工具包,你就是 XML 之星。
![Penguin with green background][1]
学习解析 XML 通常被认为是一件复杂的事情,但其实大可不必。[XML 是高度严格结构化的][2],所以也是相对来说可预测的。也有许多其他工具可以帮助你管理工作。
我最喜欢的 XML 实用程序之一是 [XMLStarlet][3] 用于终端的 XML 工具包,借助 XML 工具包,你可以验证、解析、编辑、格式化和转换 XML 数据。XMLStarLet 是个相对最小的命令,但指导 XML 却充满潜力,因此本文演示了如何使用它来查询 XML 数据。
### 安装
XMLStarLet 默认安装在 CentOSFedora和许多其他现代 Linux 发行版上,所以你可以打开终端,输入 `xmlstarlet` 来访问它。如果 XMLStarLet 还没有被安装,你的操作系统则会为你安装它。
或者,你可以用包管理器安装 `xmlstarlet`
```
`$ sudo dnf install xmlstarlet`
```
在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。在 Windows 上,使用 [Chocolatey][6]。
如果都失败了,您可以从 [Sourceforge 上的源代码][7]手动安装它。
### 用 XMLStarlet 解析 XML
有许多工具可以帮助解析和转换XML数据包括允许您[编写自己的解析器][8]和复杂命令的软件库,如 `fop``xsltproc`。尽管有时您不需要处理XML数据您可以很方便的从 XML 数据中来提取、更新或验证重要数据。对于自发的XML交互我使用 `xmlstarlet`,这是常见的处理 XML任务的一个典型的“瑞士军刀”式应用。通过运行 `--help` 命令,您可以看到它提供哪些选项:
```
$ xmlstarlet --help
Usage: xmlstarlet [&lt;options&gt;] &lt;command&gt; [&lt;cmd-options&gt;]
where &lt;command&gt; is one of:
ed (or edit) - Edit/Update XML document(s)
sel (or select) - Select data or query XML document(s) (XPATH, etc)
tr (or transform) - Transform XML document(s) using XSLT
val (or validate) - Validate XML document(s) (well-formed/DTD/XSD/RelaxNG)
fo (or format) - Format XML document(s)
el (or elements) - Display element structure of XML document
c14n (or canonic) - XML canonicalization
ls (or list) - List directory as XML
[...]
```
您可以通过在这些子命令的末尾附加 `-help` 来获得进一步的帮助:
```
$ xmlstarlet sel --help
-Q or --quiet - do not write anything to standard output.
-C or --comp - display generated XSLT
-R or --root - print root element &lt;xsl-select&gt;
-T or --text - output is text (default is XML)
-I or --indent - indent output
[...]
```
#### 用 sel 命令选择数据
可以使用 `xmlstarlet select`(简称 `sel`命令查看XML格式的数据。下面是一个简单的XML文档
```
&lt;?xml version="1.0" encoding="UTF-8" standalone="no"?&gt;
&lt;xml&gt;
&lt;os&gt;
&lt;linux&gt;
&lt;distribution&gt;
&lt;name&gt;Fedora&lt;/name&gt;
&lt;release&gt;7&lt;/release&gt;
&lt;codename&gt;Moonshine&lt;/codename&gt;
&lt;spins&gt;
&lt;name&gt;Live&lt;/name&gt;
&lt;name&gt;Fedora&lt;/name&gt;
&lt;name&gt;Everything&lt;/name&gt;
&lt;/spins&gt;
&lt;/distribution&gt;
&lt;distribution&gt;
&lt;name&gt;Fedora Core&lt;/name&gt;
&lt;release&gt;6&lt;/release&gt;
&lt;codename&gt;Zod&lt;/codename&gt;
&lt;spins&gt;&lt;/spins&gt;
&lt;/distribution&gt;
&lt;/linux&gt;
&lt;/os&gt;
&lt;/xml&gt;
```
在 XML 文件中查找数据时,您的第一个任务是关注要探索的节点。如果知道节点的路径,请使用 `-value of` 选项指定完整路径。您越早浏览 [Document Object Model][9]DOM就可以看到更多信息
```
$ xmlstarlet select --template \
\--value-of /xml/os/linux/distribution \
\--nl myfile.xml
Fedora
7
Moonshine
Live
Fedora
Everything
Fedora Core
6
Zod
```
`--nl` 代表“新的一行”,它插入大量的空白,以确保在输入结果后,终端在新的一行显示。我已经删除了样本输出中的一些多余空间。
通过进一步深入 DOM 树来凝聚焦点:
```
$ xmlstarlet select --template \
\--value-of /xml/os/linux/distribution/name \
\--nl myfile.xml
Fedora
Fedora Core
```
#### 条件选择
用于导航和解析 XML 的最强大工具之一被称为 XPath。它控制 XML 搜索中使用的语法,并从 XML 库调用函数。XMLStarlet 能够解析 XPath 表达式,因此可以使用 XPath 函数来有条件的进行选择。XPath 具有丰富的函数,[由 W3C 详细记录][10],但我觉得 [Mozilla 的 XPath 文档][11]更简洁。
可以使用方括号作为测试函数,将元素的内容与某个值进行比较。下面是对 `<name>` 元素的值的测试,它仅返回与特定匹配相关联的版本号。
想象一下,示例 XML 文件包含以 1 开头的所有 Fedora 版本。要查看与旧名称 “Fedora Core” 关联的所有版本号(项目从版本 7 开始名称中的 “Core” 被删除掉了),请执行以下操作:
```
$ xmlstarlet sel --template \
\--value-of '/xml/os/linux/distribution[name = "Fedora Core"]/release' \
\--nl myfile.xml
6
5
4
3
2
1
```
通过将 `--path 的值`更改为 `/xml/os/linux/distribution[name=“Fedora Core”]/codename`,您便可以查看这些版本的所有代号。
### 匹配路径和获取目标值
将 XML 标记视为节点的一个优点是一旦找到节点就可以将其视为当前的数据“目录”。它不是一个真正的目录至少不是文件系统意义上的目录但它是一个可以查询的数据集合。为了帮助您将目标和“其他”的数据分开XMLStarlet 把您试图用 `--match` 选项匹配的内容和用 `--value` 选项匹配的数据值进行了区分。
假设你知道 `<spin>` 节点包含几个元素。这就是你的目的节点了。一旦到了这一步,就可以使用 `-value of` 指定要为哪个元素赋值。要查看所有元素,可以使用点(`.`)展示当前位置的所有元素:
```
$ xmlstarlet sel --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '.' --nl myfile.xml \
Live
Fedora
Everything
```
与导航 DOM 一样,可以使用 XPath 表达式来限制返回数据的范围。在本例中,我使用 `last` 函数来检索 `spin` 节点中的最后一个元素:
```
$ xmlstarlet select --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '*[last()]' --nl myfile.xml
Everything
```
在本例中,我使用 `position` 函数选择 `spin` 节点中的特定元素:
```
$ xmlstarlet select --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '*[position() = 2]' --nl myfile.xml
Fedora
```
The `--match` and `--value-of` options can overlap, so it's up to you how you want to use them together. These two expressions, in the case of the sample XML, do the same thing:
`--match``--value` 选项可以重叠,因此如何将它们一起使用取决于您自己。对于示例 XML这两个表达式执行的是相同的操作
```
$ xmlstarlet select --template \
\--match '/xml/os/linux/distribution/spin' \
\--value-of '.' \
\--nl myfile.xml
Live
Fedora
Everything
$ xmlstarlet select --template \
\--match '/xml/os/linux/distribution' \
\--value-of 'spin' \
\--nl myfile.xml
Live
Fedora
Everything
```
### 熟悉XML
XML 有时看起来过于冗长和笨拙,但为与之交互和构建的工具却总是让我吃惊。如果您想要好好使用 XML那么XMLStarlet 可能是一个很好的切入点。下次要打开 XML 文件查看结构化数据时,请尝试使用 XMLStarlet看看是否可以改为查询该数据。当 XML 越适合你时,它就越能作为一种健壮灵活的数据格式而存在。
--------------------------------------------------------------------------------
via: https://opensource.com/article/21/7/parse-xml-linux
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[zepoch](https://github.com/zepoch)
校对:[校对者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/linux_penguin_green.png?itok=ENdVzW22 "Penguin with green background"
[2]: https://opensource.com/article/21/6/what-xml
[3]: https://en.wikipedia.org/wiki/XMLStarlet
[4]: https://opensource.com/article/20/11/macports
[5]: https://opensource.com/article/20/6/homebrew-mac
[6]: https://opensource.com/article/20/3/chocolatey
[7]: http://xmlstar.sourceforge.net
[8]: https://opensource.com/article/21/6/parsing-config-files-java
[9]: https://opensource.com/article/21/6/what-xml#dom
[10]: https://www.w3.org/TR/1999/REC-xpath-19991116
[11]: https://developer.mozilla.org/en-US/docs/Web/XPath/Functions

View File

@ -7,35 +7,35 @@
[#]: publisher: ( )
[#]: url: ( )
Getting Started with Podman on Fedora
在 Fedora 上开始使用 Podman
======
![][1]
Podman logo from the Podman project <https://github.com/containers/podman/tree/main/logo>
来自 Podman 项目的 Podman 标志 <https://github.com/containers/podman/tree/main/logo>
[Podman][2] is a daemonless container engine for developing, managing, and running OCI Containers on your Linux System. In this article, we will introduce podman and how to use it with a small application build using nodejs. The app will be very simple and clean.
[Podman][2] 是一个无守护程序的容器引擎,用于在你的 Linux 系统上开发、管理和运行 OCI 容器。在这篇文章中,我们将介绍 podman 以及如何用 nodejs 构建一个小型应用来使用它。该应用将是非常简单和干净的。
### Install Podman
### 安装 Podman
Podman command is the same as [docker][3] just type in your terminal **alias docker=podman** if you have docker already installed
如果你已经安装了 docker只需在终端输入 **alias docker=podman**,那么 Podman 的命令就与 [docker][3] 相同。
Podman is installed by default in Fedora. But if you dont have it for any reason, you can install it using the following command:
在 Fedora 中Podman 是默认安装的。但是如果你因为任何原因没有安装,你可以用下面的命令安装它:
```
sudo dnf install podman
```
For fedora [silverblue][4] users, podman is already installed in your OS.
对于 Fedora [silverblue][4] 用户podman 已经安装在你的操作系统中了。
After installation, run the hello world image to ensure everything is working:
安装后,运行 hello world 镜像,以确保一切正常:
```
podman pull hello-world
podman run hello-world
```
If everything is working well you will see the following output in your terminal:
如果一切运行良好,你将在终端看到以下输出:
```
Hello from Docker!
@ -53,15 +53,15 @@ This message shows that your installation appears to be working correctly.
https://docs.docker.com/get-started/
```
### Simple Nodejs App
### 简单的 Nodejs 应用
First, we will create a folder **webapp** , type the following command in your terminal
首先,我们将创建一个文件夹 **webapp**,在终端输入以下命令
```
mkdir webapp && cd webapp
```
Now create the file ****_package.json_ This file includes all the dependencies that the project needs to work well. Copy the following code inside the file _package.json ._
现在创建文件 **_package.json_**,该文件包括项目运行所需的所有依赖项。在文件 _package.json_ 中复制以下代码:
```
{
@ -74,7 +74,7 @@ Now create the file ****_package.json_ This file includes all the dependencies t
}
```
Create the file _index.js_ and add the following code there:
创建文件 _index.js_,并在其中添加以下代码:
```
const express = require('express')
@ -89,11 +89,11 @@ app.listen(8081, () => {
});
```
You can download source code from [here][5].
你可以从[这里][5]下载源代码。
### Create Dockerfile
### 创建 Dockerfile
First of all, create a file called _Dockerfile_ and make sure the first character is a capital, NOT lower case, then add the following code there:
首先,创建一个名为 _Dockerfile_ 的文件,并确保第一个字符是大写,而不是小写,然后在那里添加以下代码:
```
FROM node:alpine
@ -103,42 +103,42 @@ RUN npm install
CMD ["npm", "start"]
```
Be sure you are inside the folder _webapp_ then show the image and then type the following command:
确保你在 _webapp_ 文件夹内,然后显示镜像,然后输入以下命令:
```
podman build .
```
Make sure to add the **dot**. The image is created on your machine and you can show it using the following command:
确保加了**点**。镜像在你的机器上被创建,你可以用以下命令显示它:
```
podman images
```
The last step is to run the image inside a container by typing the following command:
最后一步是输入以下命令在容器中运行该镜像:
```
podman run -p 8080:8080 <image-name>
```
Now open your browser in _localhost:8080_ and you will see that your app works.
现在在你的浏览器中打开 _localhost:8080_,你会看到你的应用已经工作。
### Stopping and Remove Container
### 停止和删除容器
To exit from the container use _CTRL-C._ You can remove the container by using the container id. Get the id and stop the container using these commands:
使用 _CTRL-C_ 退出容器,你可以使用容器 ID 来删除容器。获取 ID 并使用这些命令停止容器:
```
podman ps -a
podman stop <container_id>
```
You can delete the images from your machine by using the following command:
你可以使用以下命令从你的机器上删除镜像:
```
podman rmi <image_id>
```
Read more about podman and how it works on the [official website][2]
在[官方网站][2]上阅读更多关于 podman 和它如何工作的信息。
--------------------------------------------------------------------------------
@ -146,7 +146,7 @@ via: https://fedoramagazine.org/getting-started-with-podman-in-fedora/
作者:[Yazan Monshed][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

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