From 5e91314ff78ea596911f56572f0dba9a49f55790 Mon Sep 17 00:00:00 2001 From: nacyro Date: Fri, 3 Jan 2020 15:59:02 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ... and guides to enhance your tech skills.md | 89 ------------------- ... and guides to enhance your tech skills.md | 88 ++++++++++++++++++ 2 files changed, 88 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md create mode 100644 translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md diff --git a/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md b/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md deleted file mode 100644 index 7e9e984b63..0000000000 --- a/sources/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (nacyro) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (9 cheat sheets and guides to enhance your tech skills) -[#]: via: (https://opensource.com/article/20/1/cheat-sheets-guides) -[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) - -9 cheat sheets and guides to enhance your tech skills -====== -Kick off the new year with our latest programming cheat sheets and -guides for people of all skill levels. Take our poll to let us know what -you'd like to see next! -![a checklist for a team][1] - -Cheat sheets are perfect for the new coder just starting out on the command line. However, even the most experienced programmers need to lean on references every once in a while. If that pesky keyboard shortcut is just at the tip of your finger, a cheat sheet is perfect to have nearby. Here’s a roundup of our downloadable guides that will set you up for success in 2020. - -### Cheat sheets - -#### [Markdown][2] - -Markdown is not just for coders. Anyone can use it to help bring syntax and structure to a plain text document. This cheat sheet provides Markdown foundations using the CommonMark specification. It also includes syntax for GitHub and GitLab.  - -#### [Linux permissions and users][3] - -Keep commands for managing users close at hand with this Linux cheat sheet. Quickly learn how to add users, delete users, show history, and set permissions. - -#### [Bash][4] - -Once you know Bash, the possibilities at the command line are endless. Our Bash cheat sheet helps you become more efficient with keyboard shortcuts. Before you know it, you'll be running scripts in your sleep (literally).   - -#### [Linux common commands][5] - -It's no wonder that our cheat sheet for common Linux commands is so popular. This cheat sheet is packed with the essentials to get started with installing software and navigating file systems. Print this one out for yourself and your colleagues. - -#### [Microservices][6] - -It seems like everyone is talking about microservices and for good reason. Microservices make applications modular so that they are easier to build and maintain. It's no longer just a buzzword with this cheat sheet. Get to know important terms and learn more about the fundamentals of microservices in [A guide to open source for microservices][7]. - -#### [Java][8] - -This cheat sheet is ideal for beginner and intermediate Java programmers. It includes important context along with code for handling imports, variables, classes, and more. - -#### [pip][9] - -Programmers love using pip commands to help install, manage, and use Python software packages. However, pip can do much more than that. This cheat sheet will teach you how to build wheels and record packages. - -### Guides - -#### [7 essential PyPI libraries][10] - -This collection of Python tutorials will help you learn how to write extensions faster, format your code, automate tests, ensure code consistency, and more using PyPI libraries.  - -#### [Getting started with Kubernetes][11] - -In this approachable guide, author [Scott McCarty][12] uses an unexpected analogy to explain the value of Kubernetes and the steps to get started.  - -* * * - -We'd like to hear from you: Do you have an idea for a new cheat sheet or guide? Take our poll and choose from one of the options, or let us know in the comments. Check out all of our downloads [here][13]. Get alerts about new cheat sheets by [signing up][14] for our email newsletter. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/cheat-sheets-guides - -作者:[Lauren Pritchett][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/lauren-pritchett -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) -[2]: https://opensource.com/downloads/cheat-sheet-markdown -[3]: https://opensource.com/downloads/linux-permissions-cheat-sheet -[4]: https://opensource.com/downloads/bash-cheat-sheet -[5]: https://opensource.com/downloads/linux-common-commands-cheat-sheet -[6]: https://opensource.com/downloads/microservices-cheat-sheet -[7]: https://opensource.com/article/19/11/microservices-cheat-sheet -[8]: https://opensource.com/downloads/java-cheat-sheet -[9]: https://opensource.com/downloads/pip-cheat-sheet -[10]: https://opensource.com/downloads/7-essential-pypi-libraries -[11]: https://opensource.com/downloads/getting-started-kubernetes-ebook -[12]: https://opensource.com/users/fatherlinux -[13]: https://opensource.com/downloads/cheat-sheets -[14]: https://opensource.com/email-newsletter diff --git a/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md b/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md new file mode 100644 index 0000000000..15c10736ed --- /dev/null +++ b/translated/tech/20200101 9 cheat sheets and guides to enhance your tech skills.md @@ -0,0 +1,88 @@ +[#]: collector: (lujun9972) +[#]: translator: (nacyro) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (9 cheat sheets and guides to enhance your tech skills) +[#]: via: (https://opensource.com/article/20/1/cheat-sheets-guides) +[#]: author: (Lauren Pritchett https://opensource.com/users/lauren-pritchett) + +九个提升你技术技能的备忘单和指南 +====== +用我们最新的编程备忘单和指南来为新年开局,它适合所有技能水平的人。来参加我们的投票,让我们知道你接下来想看什么! + +![a checklist for a team][1] + +对刚接触命令行的新程序员来说备忘单是完美的。然而,即便是最有经验的程序员也需要时不时地依靠参考资料。假如你刚好敲不出那个讨厌的快捷键,那么手边有个备忘单就很赞了。这是一份我们可供下载指南的综述,它将助你在 2020 年取得成功。 + +### 备忘单 + +#### [Markdown][2] + +Markdown 不仅针对程序员,任何人都可以借助它为纯文本文档增添语法和结构。此备忘单提供了使用 CommonMark 规范的 Markdown 要点。它还包括 GitHub 和 GitLab 的语法。 + +#### [Linux 权限和用户][3] + +用这个 Linux 备忘单把用户管理命令放在手边。快速学习如何增删用户、查看历史以及设置权限。 + +#### [Bash][4] + +一旦您了解了 Bash,在命令行中就蕴含了无限可能。我们的 Bash 备忘单可以帮助您更有效地使用键盘快捷键。不知不觉间,您就能易如反掌地运行脚本。 + +#### [Linux 常用命令][5] + +毫不奇怪,我们的 Linux 常用命令备忘单是如此受欢迎。这个备忘单包含了开始安装软件和导览文件系统的要点。为自己和你的同事打印出来吧。 + +#### [微服务][6] + +似乎每个人都在谈论微服务,而且理由很充分。微服务使应用程序模块化,因此更容易构建和维护。它不再只是这个备忘单上的流行语。在 [微服务开源指南][7] 中了解重要的术语并学习更多关于微服务的基础知识。 + +#### [Java][8] + +此备忘单非常适合初级和中级 Java 程序员。它包括重要的上下文以及处理导入、变量、类等的代码。 + +#### [pip][9] + +程序员爱用 pip 命令来帮助安装、管理和使用 Python 软件包。然而,pip 可以做的远不止这些。这个备忘单将教你如何构建 wheels 和 record 包。 + +### 指南 + +#### [七个不可或缺的 PyPI 库][10] + +这组 Python 教程将帮助您学习如何更快地编写扩展、格式化代码、自动化测试、确保代码一致性,以及更多使用 PyPI 库的方法。 + +#### [开始学习 Kubernetes][11] + +在这份平易近人的指南中,作者 [Scott McCarty][12] 用了一个出人意料的类比来解释 Kubernetes 的价值和上手步骤。 + +* * * + +我们想听听你的意见:你对新的备忘单或指南有什么高见?参加我们的投票,从选项中选择一个,或者在评论中告诉我们。点击 [这里][13] 查看我们所有的下载。通过 [注册][14] 我们的电子邮件通讯获得关于新备忘单的提醒。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/cheat-sheets-guides + +作者:[Lauren Pritchett][a] +选题:[lujun9972][b] +译者:[nacyro](https://github.com/nacyro) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_hands_team_collaboration.png?itok=u82QepPk (a checklist for a team) +[2]: https://opensource.com/downloads/cheat-sheet-markdown +[3]: https://opensource.com/downloads/linux-permissions-cheat-sheet +[4]: https://opensource.com/downloads/bash-cheat-sheet +[5]: https://opensource.com/downloads/linux-common-commands-cheat-sheet +[6]: https://opensource.com/downloads/microservices-cheat-sheet +[7]: https://opensource.com/article/19/11/microservices-cheat-sheet +[8]: https://opensource.com/downloads/java-cheat-sheet +[9]: https://opensource.com/downloads/pip-cheat-sheet +[10]: https://opensource.com/downloads/7-essential-pypi-libraries +[11]: https://opensource.com/downloads/getting-started-kubernetes-ebook +[12]: https://opensource.com/users/fatherlinux +[13]: https://opensource.com/downloads/cheat-sheets +[14]: https://opensource.com/email-newsletter From 8eeac9210007c607f9b6f694d7195421fd93d1b1 Mon Sep 17 00:00:00 2001 From: nacyro Date: Fri, 3 Jan 2020 16:50:55 +0800 Subject: [PATCH 02/17] =?UTF-8?q?=E7=94=B3=E9=A2=86=E5=8E=9F=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20191031 Advance your awk skills with two easy tutorials.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md index f84e4ebe3a..76f7a54e5f 100644 --- a/sources/tech/20191031 Advance your awk skills with two easy tutorials.md +++ b/sources/tech/20191031 Advance your awk skills with two easy tutorials.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (nacyro) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ecf018d5142d2ccf3daf2dee7d58360c6059fef6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 17:44:07 +0800 Subject: [PATCH 03/17] PRF @geekpi --- ...h the Linux Equinox Desktop Environment.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md index cfa8489c40..84c9ed2b1e 100644 --- a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md +++ b/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Chill out with the Linux Equinox Desktop Environment) @@ -9,20 +9,20 @@ 轻松使用 Linux Equinox 桌面环境 ====== -本文是 24 天 Linux 桌面特别系列的一部分。EDE 不是最迷人、最小或效率最高的桌面。但它的柔和、静音让人平静,它让人感到熟悉舒缓,它的图标主题有趣。 -![Linux penguin at the north pole beside an igloo][1] -我还没有认真用过 Fast Light Toolkit([FLTK] [2]),但我是 C++ GUI 工具箱的粉丝,它非常易于学习,并且即使跨更新时也很可靠。当我发现有一个用 FLTK 构建的桌面环境时,我很想尝试一下,并且我很快为我的决定感到高兴。[Equinox 桌面环境(EDE)][3] 是用 C++ 和 FLTK 为 Unix 桌面编写的快速、简单的桌面。它使用通用的桌面约定,因此外观和感觉都非常熟悉,并且在使用几天后,我发现它的简单性提供了我所喜欢的最低限度的优雅。 +> 本文是 24 天 Linux 桌面特别系列的一部分。EDE 不是最迷人、最小或效率最高的桌面。但它的柔和、安宁让人平静,它让人感到熟悉舒缓,它的图标主题也很有趣。 + +我还没有认真用过 Fast Light Toolkit([FLTK] [2]),但我是 C++ GUI 工具箱的粉丝,它非常易于学习,并且即使进行更新也很可靠。当我发现有一个用 FLTK 构建的桌面环境时,我很想尝试一下,并且我很快为我的决定感到高兴。[Equinox 桌面环境(EDE)][3] 是用 C++ 和 FLTK 为 Unix 桌面编写的快速、简单的桌面环境。它使用通用的桌面约定,因此外观和感觉都非常熟悉,并且在使用几天后,我发现它的简单性提供了我所喜欢的最低限度的优雅。 ![EDE desktop][4] ### 安装 EDE -你可能会发现 EDE 包含在发行版的软件仓库中,但你也可以在它的 [SourceForge 仓库][5]中找到它。如果你已经在运行其他桌面,你可以安全地在同一系统上安装 EDE,因为它仅带来了一些额外的应用,这些应用程序特定于 EDE,因此它们不会妨碍你的其他桌面。 +你可能会发现 EDE 包含在发行版的软件仓库中,但你也可以在它的 [SourceForge 仓库][5]中找到它。如果你已经在运行其他桌面环境,你可以安全地在同一系统上安装 EDE,因为它仅带来了一些额外的应用,这些应用程序特定于 EDE,因此它们不会妨碍你的其他桌面。 -EDE 只是桌面,它使用 [Pekwm][6] 窗口管理器来处理布局。 +EDE 只是桌面环境,它使用 [Pekwm][6] 窗口管理器来处理布局。 -安装 EDE 之后,注销当前的桌面会话,以便你可以登录到新的会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面,因此你必须在登录之前覆盖该桌面。 +安装 EDE 之后,注销当前的桌面会话,以便你可以登录到新的会话。默认情况下,会话管理器(KDM、GDM、LightDM 或 XDM,取决于你的设置)将继续登录到以前的桌面环境,因此你必须在登录之前覆盖该桌面环境。 在 GDM 中: @@ -48,14 +48,12 @@ EDE 的布局恰恰是大多数人在桌面上所期望的布局:左侧的应 EDE 有一个小的配置应用,可用于设置一些简单的选项: - * 背景和图标设置 -  * 屏幕保护程序设置 -  * 时间和时钟 -  * 系统铃声 -  * 键盘 -  * 偏好应用 - - +* 背景和图标设置 +* 屏幕保护程序设置 +* 时间和时钟 +* 系统铃声 +* 键盘 +* 偏好应用 ![EDE Configuration Place][10] @@ -63,7 +61,7 @@ EDE 的功能不多。没有文件管理器、文本编辑器、绘画程序或 ### EDE 总结 -我发现 EDE 至少作为一种”假日“桌面而言,它的简单性令人舒适。它值得一看。它不是最迷人的桌面,也不是最小的、也不是最高效的。但它的柔和、静音让人平静,它让人感到熟悉舒缓,并且它的图标主题充满乐趣和生气。EDE 是一个以其缓慢而稳定的步调而自豪的桌面。 +我发现 EDE 至少作为一种“假日”桌面而言,它的简单性令人舒适。它值得一看。它不是最迷人的桌面,也不是最精简的、也不是最高效的。但它的柔和、安宁让人平静,它让人感到熟悉舒缓,并且它的图标主题充满乐趣和生气。EDE 是一个以其缓慢而稳定的步调而自豪的桌面。 如果你想放松心情使用一个干净和令人愉悦的界面,请试试 EDE。 @@ -74,7 +72,7 @@ via: https://opensource.com/article/19/12/ede-linux-desktop 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ebdcc4000c43d02a6b15df7922461277b0433027 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 17:44:37 +0800 Subject: [PATCH 04/17] PUB @geekpi https://linux.cn/article-11745-1.html --- ...24 Chill out with the Linux Equinox Desktop Environment.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20191224 Chill out with the Linux Equinox Desktop Environment.md (98%) diff --git a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md b/published/20191224 Chill out with the Linux Equinox Desktop Environment.md similarity index 98% rename from translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md rename to published/20191224 Chill out with the Linux Equinox Desktop Environment.md index 84c9ed2b1e..c6a96672d7 100644 --- a/translated/tech/20191224 Chill out with the Linux Equinox Desktop Environment.md +++ b/published/20191224 Chill out with the Linux Equinox Desktop Environment.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11745-1.html) [#]: subject: (Chill out with the Linux Equinox Desktop Environment) [#]: via: (https://opensource.com/article/19/12/ede-linux-desktop) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 965419e2bece4108bb02ca647ec930b4da6bc229 Mon Sep 17 00:00:00 2001 From: Brooke Lau Date: Fri, 3 Jan 2020 22:08:52 +0800 Subject: [PATCH 05/17] translating by lxbwolf --- sources/tech/20200101 5 predictions for Kubernetes in 2020.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200101 5 predictions for Kubernetes in 2020.md b/sources/tech/20200101 5 predictions for Kubernetes in 2020.md index 2032983b78..99723632b8 100644 --- a/sources/tech/20200101 5 predictions for Kubernetes in 2020.md +++ b/sources/tech/20200101 5 predictions for Kubernetes in 2020.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (lxbwolf) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 09736cf9fdd2ade647f8c89c1399dfa439912f4c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Jan 2020 23:30:13 +0800 Subject: [PATCH 06/17] PUB --- .../20191227 10 resources to boost your Git skills.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20191227 10 resources to boost your Git skills.md (100%) diff --git a/translated/tech/20191227 10 resources to boost your Git skills.md b/published/20191227 10 resources to boost your Git skills.md similarity index 100% rename from translated/tech/20191227 10 resources to boost your Git skills.md rename to published/20191227 10 resources to boost your Git skills.md From d99886fd6152b9885d359aaa2322db2e15faf2f8 Mon Sep 17 00:00:00 2001 From: MjSeven Date: Fri, 3 Jan 2020 23:31:14 +0800 Subject: [PATCH 07/17] Translating by MjSeven --- .../tech/20191129 How to write a Python web API with Django.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20191129 How to write a Python web API with Django.md b/sources/tech/20191129 How to write a Python web API with Django.md index ed16fc40f8..38acb243cd 100644 --- a/sources/tech/20191129 How to write a Python web API with Django.md +++ b/sources/tech/20191129 How to write a Python web API with Django.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 461886a295a1e4ba1f9d14777053ca22e48d0a0e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:55:34 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20Tracking?= =?UTF-8?q?=20Translations=20with=20Transtats?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 Tracking Translations with Transtats.md --- ...03 Tracking Translations with Transtats.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20200103 Tracking Translations with Transtats.md diff --git a/sources/tech/20200103 Tracking Translations with Transtats.md b/sources/tech/20200103 Tracking Translations with Transtats.md new file mode 100644 index 0000000000..b11a56be66 --- /dev/null +++ b/sources/tech/20200103 Tracking Translations with Transtats.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Tracking Translations with Transtats) +[#]: via: (https://fedoramagazine.org/tracking-translations-with-transtats/) +[#]: author: (Sundeep Anand https://fedoramagazine.org/author/suanand/) + +Tracking Translations with Transtats +====== + +![][1] + +Translation is an important step in software localization which helps make software more popular globally, and impacts international user experience. In recent years, localization processes have been evolving worldwide to become more continuous, faster, efficient with automation. In Fedora, the development of the [Zanata][2] platform and its plugins, then [Transtats][3], and now the migration to the [Weblate][4] platform are part of this common ongoing goal. The localization of a desktop OS like Fedora is highly complex because it depends on many factors of the individual upstream projects which are packaged in Fedora. For example, different translation timelines, resources, and tooling. + +### What is Transtats? + +Transtats is a web application which tries to tie up upstream repositories, translation platforms, build system, and product release schedule together to solve problems of mismatch, out-of-sync conditions and to assist the timely packaging of quality translations. Actually, it collects translation data, analyzes them, and creates meaningful representations. + +Fedora Transtats is hosted at + +![][5] + +### How to see the translation status of my package? + +Just select **Packages** tab from left hand side navigation bar. This takes us to the packages list view. Then, search for the package and click on its name. + +![][6] + +For example _anaconda_. On package details page, locate following: + +![][7] + +Here, we have translation statistics from translation platform: [Zanata][8] and [Koji][9] build system. Syncs with the platform and build system are scheduled, which update differences periodically. Languages in red color indicate that there are translated strings remaining in the Translation Platform to be pulled and packaged, whereas, blue denote translated messages could not make 100% in the built package. + +### String breakage (or changes?) + +In translation of software packages, one of the challenges is to prevent string breakage. Package maintainers should strive to abide by the scheduled Fedora release String Freeze. However, in some circumstances it could be necessary to break the string freeze and to inform the translation team on the mailing list. As well as, to update latest translation template (POT) file in the translation platform. Just in case these actions seem missing – translators may get new strings to translate very late or the application may have some strings untranslated. In the worst case, an outdated translation string mismatch may result in a crash. Sync and automation pipelines are there to prevent this, nevertheless it depends on the push or pull methods followed by package developers or maintainers. + +To deal with the same context, we can use a job template in Transtats to detect this string change – particularly useful after string freeze in Fedora release schedule. This would be really helpful for the folks who look for packaging translations without string breakage, keeping translation template (POT) file in sync with translation platform, and testing localized form of the application for translation completeness to back trace. + +### How to detect string changes? + +One of the options in **Jobs** tab is ‘YML based Jobs’. Where we can see available job templates. + +![][10] + +The jobs framework executes all the tasks mentioned in the YAML, create appropriate logs and store results. Track String Change job basically: + + 1. Clones the source repository of respective package. + 2. Tries to generate translation template (POT) file. + 3. Downloads POT file from respective translation platform. + 4. And, finds differences between both the POT files. + + + +_Actually, Transtats maintains mapping of upstream repository, Translation Platform project and respective build tag for every package._ + +![][11] + +Let’s take a closer look into this YAML. We can provide value for %PACKAGE_NAME% and %RELEASE_SLUG% in the next step – **Set Values**! For example: _anaconda_ and _fedora-32_. Furthermore, a couple of things seek attention are: + + * In case the upstream software repository maintains separate git branch for fedora release, please edit ‘branch: master’ to ‘branch: <fedora-release-branch>’ + * In ‘generate’ block, mention the command to generate POT file. Default one should work for ‘intltool-update’ only, however, many packages do have their own. + * A few packages may have gettext domain name different than that of package name. If this is the case, mention the gettext domain too. + + + +As soon as the job is triggered, logs should be populated. If this is not a _scratch_ run, a unique URL shall also be created at the end. + +![][12] + +Left hand side is the input YAML and right hand side is respective log for each task. Here we can find the differences and figure out string mismatch. + +![][13] + +In [Transtats][14], we can create solutions to different problems in the form of job templates. And, scheduling of these jobs could be a step towards automation. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/tracking-translations-with-transtats/ + +作者:[Sundeep Anand][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/suanand/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2019/12/transtats-816x345.png +[2]: http://zanata.org/ +[3]: http://transtats.org/ +[4]: https://weblate.org/en/ +[5]: https://fedoramagazine.org/wp-content/uploads/2019/12/transtats-landing-1-1024x450.png +[6]: https://fedoramagazine.org/wp-content/uploads/2019/12/anaconda-pkg.png +[7]: https://fedoramagazine.org/wp-content/uploads/2019/12/anaconda-details.png +[8]: https://fedora.zanata.org/project/view/anaconda +[9]: https://koji.fedoraproject.org/koji +[10]: https://fedoramagazine.org/wp-content/uploads/2019/12/job-templates-1024x361.png +[11]: https://fedoramagazine.org/wp-content/uploads/2019/12/strchgjob.png +[12]: https://fedoramagazine.org/wp-content/uploads/2019/12/string-change-job-log-1024x478.png +[13]: https://fedoramagazine.org/wp-content/uploads/2019/12/string-change-1024x614.png +[14]: https://github.com/transtats/transtats From 647cd510fe8700b5219e8bfb6e3382026cf6f6b8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:57:40 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200104=20Shocking?= =?UTF-8?q?!=20EA=20is=20Permanently=20Banning=20Linux=20Gamers=20on=20Bat?= =?UTF-8?q?tlefield=20V?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md --- ...y Banning Linux Gamers on Battlefield V.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md diff --git a/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md b/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md new file mode 100644 index 0000000000..b0d8bb3874 --- /dev/null +++ b/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md @@ -0,0 +1,86 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Shocking! EA is Permanently Banning Linux Gamers on Battlefield V) +[#]: via: (https://itsfoss.com/ea-banning-linux-gamers/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Shocking! EA is Permanently Banning Linux Gamers on Battlefield V +====== + +Only when I thought that [EA][1] as a game company might be getting better after [its decision to make its games available on Steam][2] – but it looks like that isn’t the case. + +In a [Reddit thread][3], a lot of Linux players seem to complain about getting banned by FairFight (which is the server-side anti-cheat engine used for BF V) just because they chose to play Battlefield V (BF V) on [Linux using Wine][4]. + +![][5] + +### Is this a widespread issue? + +Unfortunately, it seems to be the case with a number of Linux players using Wine to play Battlefield V on Linux. + +You can also find users on [Lutris Gaming forums][6] and [Battlefield forums][7] talking about it. + +Of course, the userbase on Linux playing Battlefield V isn’t huge – but it still matters, right? + +### What’s exactly the issue here? + +It looks like EA’s anti-cheat tech considers [DXVK][8] (Vulkan-based implementation of DirectX which tries to solve compatibility issues) as cheating. + +So, basically, the compatibility layer that is being utilized to make it possible to run Battlefield V is being detected as a modified file through which you’re “**potentially**” cheating. + +![Battlefield V on Lutris][9] + +Even though this could be an innocent problem for the anti-cheat engine but EA does not seem to acknowledge that at all. + +Here’s what they respond with when one of the players wrote an email to EA in order to lift the ban: + +> After thoroughly investigating your account and concern, we found that your account was actioned correctly and will not remove this sanction from your account. + +Also, with all this going on, [Lutris Gaming][10] seems to be quite furious on EA’s behavior with the permanent bans: + +> It has come to our attention that several Battlefield 5 players have recently been banned for playing on Linux, and that EA has chosen not to revert these wrongful punishments. Due to this, we advise to refrain from playing any multiplayer games published by [@EA][11] in the future. +> +> — Lutris Gaming (@LutrisGaming) [January 2, 2020][12] + +### Not just Battlefield V, it’s the same with Destiny 2 + +As pointed by a Redditor in the same thread, Bungie also happens to consider Wine as an emulator (which is against their policy) and has banned players on Linux a while back. + +### EA needs to address the issue + +_We have reached out to EA for a comment on the issue_. _And, we’re still waiting for a response._ + +I shall update the article if we have an official response from EA. However, considering Blizzard as an example, they should actually work on fixing the issue and [reverse the bans on players using Linux][13]. + +I know that BF V does not offer native Linux support – but supporting the compatibility layer and not considering it as cheating would allow Linux users to experience the game which they rightfully own (or considering to purchase). + +What are your thoughts on this? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ea-banning-linux-gamers/ + +作者:[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://www.ea.com/ +[2]: https://thenextweb.com/gaming/2019/10/29/ea-games-are-coming-back-to-steam-but-you-still-need-origin/ +[3]: https://www.reddit.com/r/linux/comments/ej3q2p/ea_is_permanently_banning_linux_players_on/ +[4]: https://itsfoss.com/install-latest-wine/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/reddit-thread-ea.jpg?ssl=1 +[6]: https://forums.lutris.net/t/ea-banning-dxvk-on-battlefield-v/7810 +[7]: https://forums.battlefield.com/en-us/discussion/197938/ea-banning-dxvk-on-battlefield-v-play-linux +[8]: https://github.com/doitsujin/dxvk +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/battlefield-v-lutris-gaming.png?ssl=1 +[10]: https://lutris.net/ +[11]: https://twitter.com/EA?ref_src=twsrc%5Etfw +[12]: https://twitter.com/LutrisGaming/status/1212827248430059520?ref_src=twsrc%5Etfw +[13]: https://www.altchar.com/game-news/blizzard-unbans-overwatch-players-who-used-linux-os-agF9y0G2gWjn From fd094955beb7b002093e38de46058c3b6730236e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:58:13 +0800 Subject: [PATCH 10/17] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20What=20y?= =?UTF-8?q?ou=20need=20to=20know=20about=20Rust=20in=202020?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 What you need to know about Rust in 2020.md --- ...hat you need to know about Rust in 2020.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20200103 What you need to know about Rust in 2020.md diff --git a/sources/tech/20200103 What you need to know about Rust in 2020.md b/sources/tech/20200103 What you need to know about Rust in 2020.md new file mode 100644 index 0000000000..ddb91f42ea --- /dev/null +++ b/sources/tech/20200103 What you need to know about Rust in 2020.md @@ -0,0 +1,73 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (What you need to know about Rust in 2020) +[#]: via: (https://opensource.com/article/20/1/rust-resources) +[#]: author: (Ryan Levick https://opensource.com/users/ryanlevick) + +What you need to know about Rust in 2020 +====== +While many programmers have long used Rust for hobby projects, in 2019, +the language attracted support from major technology companies, as the +top Rust articles on Opensource.com explain. +![Person using a laptop][1] + +[Rust][2] has drawn plenty of attention from programmers on sites like Hacker News for a while. While many have long [loved using the language][3] for hobby projects, it didn't start catching on in industry until 2019, when this really started to change. + +Over the last year, many large companies, including [Microsoft][4], [Facebook][5], and [Intel][6], came out in support of Rust, and many [smaller ones][7] took notice. As the first emcee at [RustFest][8], the largest Rust conference in Europe, in 2016, I didn't meet a single person professionally using Rust who didn't work at Mozilla. Three years later, it seemed like every other person I talked to at RustFest 2019 was using Rust in their day job for another company, whether as a game developer, a backend engineer at a bank, a creator of developer tools, or something else. + +In 2019, Opensource.com also played a role by reporting on the growing interest in Rust. In case you missed them, here are the top articles about Rust on Opensource.com over the last year. + +### Building the virtualization stack of the future with rust-vmm + +Amazon's [Firecracker][9] is the virtualization technology that powers AWS Lambda and Fargate, and it is written completely in Rust. One of the technology's authors, Andreea Florescu, offers insight into Firecracker and its related technologies in [_**Building the virtualization stack of the future with rust-vmm**_][10]. + +Firecracker started life as a fork of Google's [CrosVM][11] but quickly diverged due to the differing needs of the two projects. Despite this, there are many common pieces that are best shared across the project and in any other virtual machine manager (VMM) written in Rust. With that in mind, the [rust-vmm][12] project started as a way for Amazon and Google, as well as Intel and Red Hat, to share common Rust "crates" (i.e., packages) with each other and the rest of the open source community. These include interfaces to KVM (Linux virtualization APIs), Virtio device support, and a kernel loader. + +It's truly amazing to see some of the titans of the software industry working together around a common technology stack written in Rust. Given this and other partnerships around [technology stacks written in Rust][13], I wouldn't be surprised to see more of this in 2020. + +### Why to choose Rust as your next programming language + +Adopting a new language, especially at a large company with a long-established technology stack, is no easy task. I had the pleasure of writing [_**Why to choose Rust as your next programming language**_][14] about how Microsoft is looking into adopting Rust when so many other interesting programming languages have not been considered. + +Choosing a programming language involves many different criteria—from technical to organizational to even emotional. Some of these criteria are easier to measure than others. For instance, it's easier to understand the costs of technical changes, like adapting build systems and building new tooling, than it is to understand organizational or emotional issues like how productive or happy developers will be using this new language. What's more, the easy-to-measure criteria are often cost-related, while the hard-to-measure criteria are often benefits-oriented. This often leads to costs getting more weight in the decision-making process, even though it's not necessarily true that the costs outweigh the benefits—it's just that they're easier to measure. This makes it unlikely for a company to adopt a new language. + +However, one of Rust's largest benefits is how easy it is to measure its ability to write secure yet performant systems software. Given that 70% of severe vulnerabilities at Microsoft are due to memory-safety issues that Rust is designed to prevent, and that these issues cost the company billions of dollars per year, it's easy to measure and understand the benefits of adopting the language. + +Whether full-scale adoption of Rust at Microsoft will happen remains to be seen, but Rust's future is bright if only for the fact that is has a clear and measurable benefit over existing technologies. + +### Rust in 2020 + +Rust is really starting to gain traction in industry. Although it still has a long way to go to reach the popularity of languages like C++. I expect more companies to start adopting Rust in 2020. The Rust community must now set its sights on welcoming people and companies into the community while ensuring that the things that have driven the language to this point remain in place. + +Rust is more than just a compiler and a set of libraries. It's a group of people who care about making systems programming easy, safe, and fun. The coming year will be critical in Rust's journey from a hobbyist language to one of the main languages used in the software industry. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/rust-resources + +作者:[Ryan Levick][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/ryanlevick +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: http://rust-lang.org/ +[3]: https://insights.stackoverflow.com/survey/2019#technology-_-most-loved-dreaded-and-wanted-languages +[4]: https://youtu.be/o01QmYVluSw +[5]: https://youtu.be/kylqq8pEgRs +[6]: https://youtu.be/l9hM0h6IQDo +[7]: https://oxide.computer/blog/introducing-the-oxide-computer-company/ +[8]: https://rustfest.eu +[9]: https://firecracker-microvm.github.io/ +[10]: https://opensource.com/article/19/3/rust-virtual-machine +[11]: https://chromium.googlesource.com/chromiumos/platform/crosvm/ +[12]: https://github.com/rust-vmm +[13]: https://bytecodealliance.org/ +[14]: https://opensource.com/article/19/10/choose-rust-programming-language From 92e78b5fd087fa09872902c82ca0c0e62dd6defa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:58:39 +0800 Subject: [PATCH 11/17] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20My=20Ras?= =?UTF-8?q?pberry=20Pi=20retrospective:=206=20projects=20and=20more?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md --- ...y Pi retrospective- 6 projects and more.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md diff --git a/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md b/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md new file mode 100644 index 0000000000..b68e15a924 --- /dev/null +++ b/sources/tech/20200103 My Raspberry Pi retrospective- 6 projects and more.md @@ -0,0 +1,67 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (My Raspberry Pi retrospective: 6 projects and more) +[#]: via: (https://opensource.com/article/20/1/raspberry-pi-best) +[#]: author: (Anderson Silva https://opensource.com/users/ansilva) + +My Raspberry Pi retrospective: 6 projects and more +====== +See what I've done with the fun, educational, and useful Raspberry Pi. +![Raspberry Pi 4 board, posterized filter][1] + +Historically and theoretically speaking, a decade, a century, or a millennium starts when the clock turns midnight on January 1 of the year one of its decimal order. For example, the 20th century started on January 1, 1901, not on January 1, 1900. The reason for this is simple: there is no year 0 in our modern calendar, so these periods of time start on year 1 (using the Gregorian calendar). But that's not how we refer to time periods colloquially and culturally; for example, when we mention '80s music or movies, we're talking about the period from 1980 to 1989. + +The recently passed 2010s, I could argue, was the decade of the cloud, social media, mobile technology, and the Internet of Things (IoT), which includes the [Raspberry Pi][2]. Recently, _Time_ magazine called the Raspberry Pi one of the [10 best gadgets of the past decade][3]. And I very much agree. + +The original Raspberry Pi launched in 2012, and it took me a couple of years to jump on the bandwagon and ride on the Pi-train. But since then, I have built many fun educational projects at home and even documented a few of them for Opensource.com. + +### The Christmas light trilogy + +I wrote three articles over three years that explored controlling Christmas lights with the Raspberry Pi and the open source project LightShowPi. The first article, [_Create your own musical light show with Raspberry Pi_][4], was a mix between a very basic introduction to electronics development and building a Christmas light show. The second article, [_SSH into your Christmas tree with Raspberry Pi_][5], went a little deeper into controlling the lights with things such as remote management and electronic buttons. The last chapter of the trilogy, [_Set the holiday mood with your Raspberry Pi_][6], reviewed changes introduced in the LightShowPi project in the prior year. + +### DIY projects + +Over the years, I've turned my Raspberry Pi into several useful devices. One time, I turned the Pi into a [music-playing device with the Pi MusicBox][7], which allows you to plug your favorite music streaming services into a common web interface and play your favorite tunes around the house. + +Making the Raspberry Pi into a [mobile video recording device][8] was another DIY project I put together. It required a few extra pieces of hardware, like a touchscreen, a Pi Camera, and a battery pack, but it worked. One of the biggest drawbacks of this setup was the small amount of memory available on the Pi at the time. I think the capabilities of this little portable camera could be a lot better if I re-did it on a Raspberry Pi 4 with 4GB of RAM. This may be a project to revisit in 2020. + +Another small project I built, a [digital clock for my living room][9], used the small Adafruit PiTFT screen. As simple as this project was, it probably was the one that I used the longest. That clock stood by my TV set for over a year, running 24 hours a day… until the day the screen burned out. + +### The Pi Day series + +Last but not least, in 2019, I contributed [14 articles in 14 days][10] leading up to Pi Day (March 14). This was by far the most challenging writing project I've ever done, but it allowed me to cover many different topics and hopefully expose readers to even more ideas about the versatility of the Raspberry Pi. + +### To infinity and beyond + +I don't know anyone in the Raspberry Pi Foundation, so I don't have any special access to its roadmaps and future plans. I could (but I won't) speculate on what the future holds for the brand and its devices that have allowed so many people of different social statuses around the world to expand their knowledge about computer science, electronics, and open source development. All I hope is for the foundation's management to stay true to its vision and mission and continue making affordable technology for people everywhere. + +The 2010s are over, and what a sweet decade it was. To me, it smelled like pie, raspberry pie. + +Having recently co-authored a book about building things with the Raspberry Pi ( Raspberry Pi Hacks... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/raspberry-pi-best + +作者:[Anderson Silva][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/ansilva +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/raspberrypi4_board_hardware.jpg?itok=KnFU7NvR (Raspberry Pi 4 board, posterized filter) +[2]: https://www.raspberrypi.org/ +[3]: https://time.com/5745302/best-gadgets-of-the-2010s-decade/?utm_source=reddit.com +[4]: https://opensource.com/life/15/2/music-light-show-with-raspberry-pi +[5]: https://opensource.com/life/15/12/ssh-your-christmas-tree-raspberry-pi +[6]: https://opensource.com/article/18/12/lightshowpi-raspberry-pi +[7]: https://opensource.com/life/15/3/pi-musicbox-guide +[8]: https://opensource.com/life/15/9/turning-raspberry-pi-portable-streaming-camera +[9]: https://opensource.com/article/17/7/raspberry-pi-clock +[10]: https://opensource.com/article/19/3/happy-pi-day From 1a8473c1a5c9b7fb65bf661589f5845ca0d8bce6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:59:05 +0800 Subject: [PATCH 12/17] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20Introduc?= =?UTF-8?q?ing=20the=20guide=20to=20inter-process=20communication=20in=20L?= =?UTF-8?q?inux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md --- ...to inter-process communication in Linux.md | 176 ++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md diff --git a/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md b/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md new file mode 100644 index 0000000000..c0b7eee940 --- /dev/null +++ b/sources/tech/20200103 Introducing the guide to inter-process communication in Linux.md @@ -0,0 +1,176 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Introducing the guide to inter-process communication in Linux) +[#]: via: (https://opensource.com/article/20/1/inter-process-communication-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Introducing the guide to inter-process communication in Linux +====== +This free eBook gives seasoned and occasional coders insight into the +core concepts and mechanisms of inter-process communication (IPC) in +Linux. +![Inter-process Communication in Linux][1] + +Getting one software process to talk to another software process is a delicate balancing act. It can be a vital function for an application, though, so it's a problem any programmer embarking on a complex project has to solve. Whether your application needs to kick off a job being handled by someone else's software; to monitor an action being performed by a peripheral or over a network; or to detect a signal from some other source, when your software relies on something outside of its own code to know what to do next or when to do it, you need to think about inter-process communication (IPC). + +The Unix operating system accounted for this long ago, possibly because of an early expectation that software would originate from diverse sources. In the same tradition, Linux provides many of the same interfaces for IPC and some new ones. The Linux kernel features several IPC methods, and the [util-linux package][2] contains the **ipcmk**, **ipcrm**, **ipcs**, and **lsipc** commands for monitoring and managing IPC messages. + +### Show IPC information + +Before experimenting with IPC, you should know what IPC facilities are already on your system. The **lsipc** command provides that information. + + +``` +RESOURCE DESCRIPTION               LIMIT  USED  USE% +MSGMNI   Number of message queues  32000     0 0.00% +MSGMAX   Max size of message (byt.. 8192     -     - +MSGMNB   Default max size of queue 16384     -     - +SHMMNI   Shared memory segments     4096    79 1.93% +SHMALL   Shared memory pages       184[...] 25452 0.00% +SHMMAX   Max size of shared memory 18446744073692774399 +SHMMIN   Min size of shared memory     1     -     - +SEMMNI   Number of semaphore ident 32000     0 0.00% +SEMMNS   Total number of semaphore 1024000.. 0 0.00% +SEMMSL   Max semaphores per semap  32000     -     - +SEMOPM   Max number of operations p  500     -     - +SEMVMX   Semaphore max value       32767     -     - +``` + +You may notice that this sample listing includes three different types of IPC mechanisms, each available in the Linux kernel: messages (MSG), shared memory (SHM), and semaphores (SEM). You can view current activity in each of those subsystems with the **ipcs** command: + + +``` +$ ipcs + +\------ Message Queues Creators/Owners --- +msqid     perms     cuid      cgid  [...] + +\------ Shared Memory Segment Creators/Owners +shmid     perms    cuid    cgid  [...] +557056    700      seth    users [...] +3571713   700      seth    users [...] +2654210   600      seth    users [...] +2457603   700      seth    users [...] + +\------ Semaphore Arrays Creators/Owners --- +semid     perms     cuid      cgid  [...] +``` + +This shows that there currently are no messages or semaphore arrays, but a number of shared memory segments are in use. + +There's a simple example you can perform on your system so you can see one of these systems at work. It involves some C code, so you must have build tools on your system. The names of the packages you must install to be able to build from source code vary depending on your distro, so refer to your documentation for specifics. For example, on Debian-based distributions, you can learn about build requirements on the [BuildingTutorial][3] section of the wiki, and on Fedora-based distributions, refer to the [Installing software from source][4] section of the docs. + +### Create a message queue + +Your system has a default message queue already, but you can create your own using the **ipcmk** command: + + +``` +$ ipcmk --queue +Message queue id: 32764 +``` + +Write a simple IPC message sender, hard-coding in the queue ID for simplicity: + + +``` +#include <sys/ipc.h> +#include <sys/msg.h> +#include <stdio.h> +#include <string.h> + +struct msgbuffer { +  char text[24]; +} message; + +int main() { +    int msqid = 32764; +    strcpy(message.text,"opensource.com"); +    msgsnd(msqid, &message, sizeof(message), 0); +    printf("Message: %s\n",message.text); +    printf("Queue: %d\n",msqid); +    return 0; +        } +``` + +Compile the application and run it: + + +``` +$ gcc msgsend.c -o msg.bin +$ ./msg.bin +Message: opensource.com +Queue: 32769 +``` + +You just sent a message to your message queue. You can verify that with the **ipcs** command, using the **\--queue** option to limit output to the message queue: + + +``` +$ ipcs -q + +\------ Message Queues -------- +key        msqid   owner  perms  used-bytes  messages +0x7b341ab9 0       seth   666    0          0 +0x72bd8410 32764   seth   644    24         1 +``` + +You can also retrieve those messages with: + + +``` +#include <sys/ipc.h> +#include <sys/msg.h> +#include <stdio.h> + +struct msgbuffer { +    char text[24]; +} message; + +int main() { +    int msqid = 32764; +    msgrcv(msqid, &message, sizeof(message),0,0); +    printf("\nQueue: %d\n",msqid); +    printf("Got this message: %s\n", message.text); +    msgctl(msqid,IPC_RMID,NULL); +    return 0; +``` + +Compile and run with: + + +``` +$ gcc get.c -o get.bin +$ ./get.bin + +Queue: 32764 +Got this message: opensource.com +``` + +### Download [the eBook][5] + +This is just one example of the lessons available in Marty Kalin's [A guide to inter-process communication in Linux][5], the latest free (and Creative Commons) downloadable eBook from Opensource.com. In just a few short lessons, you will learn about POSIX methods of IPC from message queues, shared memory and semaphores, sockets, signals, and much more. Sit down with Marty's book, and you'll emerge a better-informed programmer. But it isn't just for seasoned coders—if all you ever write are shell scripts, there's plenty of practical knowledge about pipes (named and unnamed) and shared files, as well as important concepts you need to know when you use a shared file or an external message queue. + +If you're interested in making great software that's written to be dynamic and system-aware, you need to know about IPC. Let [this book][5] be your guide. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/inter-process-communication-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/coverimage_inter-process_communication_linux_520x292.png?itok=hPoen7oI (Inter-process Communication in Linux) +[2]: https://mirrors.edge.kernel.org/pub/linux/utils/util-linux/ +[3]: https://wiki.debian.org/BuildingTutorial +[4]: https://docs.pagure.org/docs-fedora/installing-software-from-source.html +[5]: https://opensource.com/downloads/guide-inter-process-communication-linux From 24abcbc7833e4a91ce122e8f552d5dd7d19314ec Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Jan 2020 00:59:46 +0800 Subject: [PATCH 13/17] =?UTF-8?q?=E9=80=89=E9=A2=98:=2020200103=20Add=20sc?= =?UTF-8?q?orekeeping=20to=20your=20Python=20game?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20200103 Add scorekeeping to your Python game.md --- ...03 Add scorekeeping to your Python game.md | 640 ++++++++++++++++++ 1 file changed, 640 insertions(+) create mode 100644 sources/tech/20200103 Add scorekeeping to your Python game.md diff --git a/sources/tech/20200103 Add scorekeeping to your Python game.md b/sources/tech/20200103 Add scorekeeping to your Python game.md new file mode 100644 index 0000000000..d2055cc067 --- /dev/null +++ b/sources/tech/20200103 Add scorekeeping to your Python game.md @@ -0,0 +1,640 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Add scorekeeping to your Python game) +[#]: via: (https://opensource.com/article/20/1/add-scorekeeping-your-python-game) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Add scorekeeping to your Python game +====== +In the tenth article in this series on programming with Python's Pygame +module, display your game player's score when they collect loot or take +damage. +![connecting yellow dots in a maze][1] + +This is part 10 in an ongoing series about creating video games in [Python 3][2] using the [Pygame][3] module. Previous articles are: + + * [Learn how to program in Python by building a simple dice game][4] + * [Build a game framework with Python using the Pygame module][5] + * [How to add a player to your Python game][6] + * [Using Pygame to move your game character around][7] + * [What's a hero without a villain? How to add one to your Python game][8] + * [Simulate gravity in your Python game][9] + * [Add jumping to your Python platformer game][10] + * [Enable your Python game player to run forward and backward][11] + * [Using Python to set up loot in Pygame][12] + + + +If you've followed along with this series, you've learned all the essential syntax and patterns you need to create a video game with Python. However, it still lacks one vital component. This component isn't important just for programming games in Python; it's something you must master no matter what branch of computing you explore: Learning new tricks as a programmer by reading a language's or library's documentation. + +Luckily, the fact that you're reading this article is a sign that you're comfortable with documentation. For the practical purpose of making your platform game more polished, in this article, you will add a score and health display to your game screen. But the not-so-secret agenda of this lesson is to teach you how to find out what a library offers and how you can use new features. + +### Displaying the score in Pygame + +Now that you have loot that your player can collect, there's every reason to keep score so that your player sees just how much loot they've collected. You can also track the player's health so that when they hit one of the enemies, it has a consequence. + +You already have variables that track score and health, but it all happens in the background. This article teaches you to display these statistics in a font of your choice on the game screen during gameplay. + +### Read the docs + +Most Python modules have documentation, and even those that do not can be minimally documented by Python's Help function. [Pygame's main page][13] links to its documentation. However, Pygame is a big module with a lot of documentation, and its docs aren't exactly written in the same approachable (and friendly and elucidating and helpful) narrative style as articles on Opensource.com. They're technical documents, and they list each class and function available in the module, what kind of inputs each expects, and so on. If you're not comfortable referring to descriptions of code components, this can be overwhelming. + +The first thing to do, before bothering with a library's documentation, is to think about what you are trying to achieve. In this case, you want to display the player's score and health on the screen. + +Once you've determined your desired outcome, think about what components are required for it. You can think of this in terms of variables and functions or, if that doesn't come naturally to you yet, you can think generically. You probably recognize that displaying a score requires some text, which you want Pygame to draw on the screen. If you think it through, you might realize that it's not very different from rendering a player or loot or a platform on screen. + +Technically, you _could_ use graphics of numbers and have Pygame display those. It's not the easiest way to achieve your goal, but if it's the only way you know, then it's a valid way. However, if you refer to Pygame's docs, you see that one of the modules listed is **font**, which is Pygame's method for making printing text on the screen as easy as typing. + +### Deciphering technical documentation + +The **font** documentation page starts with **pygame.font.init()**, which it lists as the function that is used to initialize the font module. It's called automatically by **pygame.init()**, which you already call in your code. Once again, you've reached a point that that's technically _good enough_. While you don't know _how_ yet, you know that you _can_ use the **pygame.font** functions to print text on the screen. + +If you read further, however, you find that there's yet an even better way to print fonts. The **pygame.freetype** module is described in the docs this way: + +> The pygame.freetype module is a replacement for pygame.fontpygame module for loading and rendering fonts. It has all of the functionality of the original, plus many new features. + +Further down the **pygame.freetype** documentation page, there's some sample code: + + +``` +import pygame +import pygame.freetype +``` + +Your code already imports Pygame, but modify your **import** statements to include the Freetype module: + + +``` +import pygame +import sys +import os +import pygame.freetype +``` + +### Using a font in Pygame + +From the description of the font modules, it's clear that Pygame uses a font, whether it's one you provide or a default font built into Pygame, to render text on the screen. Scroll through the **pygame.freetype** documentation to find the **pygame.freetype.Font** function: + + +``` +pygame.freetype.Font +Create a new Font instance from a supported font file. + +Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font + +pygame.freetype.Font.name +  Proper font name. + +pygame.freetype.Font.path +  Font file path + +pygame.freetype.Font.size +  The default point size used in rendering +``` + +This describes how to construct a font "object" in Pygame. It may not feel natural to you to think of a simple object onscreen as the combination of several code attributes, but it's very similar to how you built your hero and enemy sprites. Instead of an image file, you need a font file. Once you have a font file, you can create a font object in your code with the **pygame.freetype.Font** function and then use that object to render text on the screen. + +Because not everyone in the world has the exact same fonts on their computers, it's important to bundle your chosen font with your game. To bundle a font, first create a new directory in your game folder, right along with the directory you created for your images. Call it **fonts**. + +Even though several fonts come with your computer, it's not legal to give those fonts away. It seems strange, but that's how the law works. If you want to ship a font with your game, you must find an open source or Creative Commons font that permits you to give the font away along with your game. + +Sites that specialize in free and legal fonts include: + + * [Font Library][14] + * [Font Squirrel][15] + * [League of Moveable Type][16] + + + +When you find a font that you like, download it. Extract the ZIP or [TAR][17] file and move the **.ttf** or **.otf** file into the **fonts** folder in your game project directory. + +You aren't installing the font on your computer. You're just placing it in your game's **fonts** folder so that Pygame can use it. You _can_ install the font on your computer if you want, but it's not necessary. The important thing is to have it in your game directory, so Pygame can "trace" it onto the screen. + +If the font file has a complicated name with spaces or special characters, just rename it. The filename is completely arbitrary, and the simpler it is, the easier it is for you to type into your code. + +Now tell Pygame about your font. From the documentation, you know that you'll get a font object in return when you provide at least the path to a font file to **pygame.freetype.Font** (the docs state explicitly that all remaining attributes are optional): + + +``` +`Font(file, size=0, font_index=0, resolution=0, ucs4=False) -> Font` +``` + +Create a new variable called **myfont** to serve as your font in the game, and place the results of the **Font** function into that variable. This example uses the **amazdoom.ttf** font, but you can use whatever font you want. Place this code in your Setup section: + + +``` +font_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"fonts","amazdoom.ttf") +font_size = tx +myfont = pygame.freetype.Font(font_path, font_size) +``` + +### Displaying text in Pygame + +Now that you've created a font object, you need a function to draw the text you want onto the screen. This is the same principle you used to draw the background and platforms in your game. + +First, create a function, and use the **myfont** object to create some text, setting the color to some RGB value. This must be a global function; it does not belong to any specific class: + + +``` +def stats(score,health): +    myfont.render_to(world, (4, 4), "Score:"+str(score), WHITE, None, size=64) +    myfont.render_to(world, (4, 72), "Health:"+str(health), WHITE, None, size=64) +``` + +Of course, you know by now that nothing happens in your game if it's not in the Main loop, so add a call to your **stats** function near the bottom of the file: + + +``` +    for e in enemy_list: +        e.move() +    stats(player.score,player.health) # draw text +    pygame.display.flip() +``` + +Try your game. + +When the player collects loot, the score goes up. When the player gets hit by an enemy, health goes down. Success! + +![Keeping score in Pygame][18] + +There is one problem, though. When a player gets hit by an enemy, health goes _way_ down, and that's not fair. You have just discovered a non-fatal bug. Non-fatal bugs are those little problems in applications that don't keep the application from starting up or even from working (mostly), but they either don't make sense, or they annoy the user. Here's how to fix this one. + +### Fixing the health counter + +The problem with the current health point system is that health is subtracted for every tick of the Pygame clock that the enemy is touching the player. That means that a slow-moving enemy can take a player down to –200 health in just one encounter, and that's not fair. You could, of course, just give your player a starting health score of 10,000 and not worry about it; that would work, and possibly no one would mind. But there is a better way. + +Currently, your code detects when a player and an enemy collide. The fix for the health-point problem is to detect _two_ separate events: when the player and enemy collide and, once they have collided, when they _stop_ colliding. + +First, in your Player class, create a variable to represent when a player and enemy have collided: + + +``` +        self.frame = 0 +        self.health = 10 +        self.damage = 0 +``` + +In the update function of your Player class, _remove_ this block of code: + + +``` +        for enemy in enemy_hit_list: +            self.health -= 1 +            #print(self.health) +``` + +And in its place, check for collision as long as the player is not currently being hit: + + +``` +        if self.damage == 0: +            for enemy in enemy_hit_list: +                if not self.rect.contains(enemy): +                    self.damage = self.rect.colliderect(enemy) +``` + +You might see similarities between the block you deleted and the one you just added. They're both doing the same job, but the new code is more complex. Most importantly, the new code runs only if the player is not _currently_ being hit. That means that this code runs once when a player and enemy collide and not constantly for as long as the collision happens, the way it used to. + +The new code uses two new Pygame functions. The **self.rect.contains** function checks to see if an enemy is currently within the player's bounding box, and **self.rect.colliderect** sets your new **self.damage** variable to one when it is true, no matter how many times it is true. + +Now even three seconds of getting hit by an enemy still looks like one hit to Pygame. + +I discovered these functions by reading through Pygame's documentation. You don't have to read all the docs at once, and you don't have to read every word of each function. However, it's important to spend time with the documentation of a new library or module that you're using; otherwise, you run a high risk of reinventing the wheel. Don't spend an afternoon trying to hack together a solution to something that's already been solved by the framework you're using. Read the docs, find the functions, and benefit from the work of others! + +Finally, add another block of code to detect when the player and the enemy are no longer touching. Then and only then, subtract one point of health from the player. + + +``` +        if self.damage == 1: +            idx = self.rect.collidelist(enemy_hit_list) +            if idx == -1: +                self.damage = 0   # set damage back to 0 +                self.health -= 1  # subtract 1 hp +``` + +Notice that this new code gets triggered _only_ if the player has been hit. That means this code doesn't run while your player is running around your game world exploring or collecting loot. It only runs when the **self.damage** variable gets activated. + +When the code runs, it uses **self.rect.collidelist** to see whether or not the player is _still_ touching an enemy in your enemy list (**collidelist** returns negative one when it detects no collision). Once it is not touching an enemy, it's time to pay the **self.damage** debt: deactivate the **self.damage** variable by setting it back to zero and subtract one point of health. + +Try your game now. + +### Score reaction + +Now that you have a way for your player to know their score and health, you can make certain events occur when your player reaches certain milestones. For instance, maybe there's a special loot item that restores some health points. And maybe a player who reaches zero health points has to start back at the beginning of a level. + +You can check for these events in your code and manipulate your game world accordingly. You already know how, so go skim the documentation for new tricks and try them out on your own. + +Here's all the code so far: + + +``` +#!/usr/bin/env python3 +# draw a world +# add a player and player control +# add player movement +# add enemy and basic collision +# add platform +# add gravity +# add jumping +# add scrolling +# add loot +# add score + +# GNU All-Permissive License +# Copying and distribution of this file, with or without modification, +# are permitted in any medium without royalty provided the copyright +# notice and this notice are preserved.  This file is offered as-is, +# without any warranty. + +import pygame +import sys +import os +import pygame.freetype + +''' +Objects +''' +        +class Platform(pygame.sprite.Sprite): +    # x location, y location, img width, img height, img file     +    def __init__(self,xloc,yloc,imgw,imgh,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)).convert() +        self.image.convert_alpha() +        self.rect = self.image.get_rect() +        self.rect.y = yloc +        self.rect.x = xloc + +class Player(pygame.sprite.Sprite): +    ''' +    Spawn a player +    ''' +    def __init__(self): +        pygame.sprite.Sprite.__init__(self) +        self.movex = 0 +        self.movey = 0 +        self.frame = 0 +        self.health = 10 +        self.damage = 0 +        self.collide_delta = 0 +        self.jump_delta = 6 +        self.score = 1 +        self.images = [] +        for i in range(1,9): +            img = pygame.image.load(os.path.join('images','hero' + str(i) + '.png')).convert() +            img.convert_alpha() +            img.set_colorkey(ALPHA) +            self.images.append(img) +            self.image = self.images[0] +            self.rect  = self.image.get_rect() + +    def jump(self,platform_list): +        self.jump_delta = 0 + +    def gravity(self): +        self.movey += 3.2 # how fast player falls +        +        if self.rect.y > worldy and self.movey >= 0: +            self.movey = 0 +            self.rect.y = worldy-ty +        +    def control(self,x,y): +        ''' +        control player movement +        ''' +        self.movex += x +        self.movey += y +        +    def update(self): +        ''' +        Update sprite position +        ''' +        +        self.rect.x = self.rect.x + self.movex +        self.rect.y = self.rect.y + self.movey + +        # moving left +        if self.movex < 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[self.frame//ani] + +        # moving right +        if self.movex > 0: +            self.frame += 1 +            if self.frame > ani*3: +                self.frame = 0 +            self.image = self.images[(self.frame//ani)+4] + +        # collisions +        enemy_hit_list = pygame.sprite.spritecollide(self, enemy_list, False) +        if self.damage == 0: +            for enemy in enemy_hit_list: +                if not self.rect.contains(enemy): +                    self.damage = self.rect.colliderect(enemy) + +        if self.damage == 1: +            idx = self.rect.collidelist(enemy_hit_list) +            if idx == -1: +                self.damage = 0   # set damage back to 0 +                self.health -= 1  # subtract 1 hp + +        loot_hit_list = pygame.sprite.spritecollide(self, loot_list, False) +        for loot in loot_hit_list: +            loot_list.remove(loot) +            self.score += 1 +            print(self.score) + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.collide_delta = 0 # stop jumping +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty +            +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.movey = 0 +            self.rect.y = worldy-ty-ty +            self.collide_delta = 0 # stop jumping +            if self.rect.y > g.rect.y: +                self.health -=1 +                print(self.health) +                +        if self.collide_delta < 6 and self.jump_delta < 6: +            self.jump_delta = 6*2 +            self.movey -= 33  # how high to jump +            self.collide_delta += 6 +            self.jump_delta    += 6 +            +class Enemy(pygame.sprite.Sprite): +    ''' +    Spawn an enemy +    ''' +    def __init__(self,x,y,img): +        pygame.sprite.Sprite.__init__(self) +        self.image = pygame.image.load(os.path.join('images',img)) +        self.movey = 0 +        #self.image.convert_alpha() +        #self.image.set_colorkey(ALPHA) +        self.rect = self.image.get_rect() +        self.rect.x = x +        self.rect.y = y +        self.counter = 0 + +                +    def move(self): +        ''' +        enemy movement +        ''' +        distance = 80 +        speed = 8 + +        self.movey += 3.2 +        +        if self.counter >= 0 and self.counter <= distance: +            self.rect.x += speed +        elif self.counter >= distance and self.counter <= distance*2: +            self.rect.x -= speed +        else: +            self.counter = 0 +        +        self.counter += 1 + +        if not self.rect.y >= worldy-ty-ty: +            self.rect.y += self.movey + +        plat_hit_list = pygame.sprite.spritecollide(self, plat_list, False) +        for p in plat_hit_list: +            self.movey = 0 +            if self.rect.y > p.rect.y: +                self.rect.y = p.rect.y+ty +            else: +                self.rect.y = p.rect.y-ty + +        ground_hit_list = pygame.sprite.spritecollide(self, ground_list, False) +        for g in ground_hit_list: +            self.rect.y = worldy-ty-ty + +        +class Level(): +    def bad(lvl,eloc): +        if lvl == 1: +            enemy = Enemy(eloc[0],eloc[1],'yeti.png') # spawn enemy +            enemy_list = pygame.sprite.Group() # create enemy group +            enemy_list.add(enemy)              # add enemy to group +            +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return enemy_list + +    def loot(lvl,tx,ty): +        if lvl == 1: +            loot_list = pygame.sprite.Group() +            loot = Platform(200,ty*7,tx,ty, 'loot_1.png') +            loot_list.add(loot) + +        if lvl == 2: +            print(lvl) + +        return loot_list + +    def ground(lvl,gloc,tx,ty): +        ground_list = pygame.sprite.Group() +        i=0 +        if lvl == 1: +            while i < len(gloc): +                ground = Platform(gloc[i],worldy-ty,tx,ty,'ground.png') +                ground_list.add(ground) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return ground_list + +    def platform(lvl,tx,ty): +        plat_list = pygame.sprite.Group() +        ploc = [] +        i=0 +        if lvl == 1: +            ploc.append((20,worldy-ty-128,3)) +            ploc.append((300,worldy-ty-256,3)) +            ploc.append((500,worldy-ty-128,4)) + +            while i < len(ploc): +                j=0 +                while j <= ploc[i][2]: +                    plat = Platform((ploc[i][0]+(j*tx)),ploc[i][1],tx,ty,'ground.png') +                    plat_list.add(plat) +                    j=j+1 +                print('run' + str(i) + str(ploc[i])) +                i=i+1 + +        if lvl == 2: +            print("Level " + str(lvl) ) + +        return plat_list + +def stats(score,health): +    myfont.render_to(world, (4, 4), "Score:"+str(score), SNOWGRAY, None, size=64) +    myfont.render_to(world, (4, 72), "Health:"+str(health), SNOWGRAY, None, size=64) + +''' +Setup +''' +worldx = 960 +worldy = 720 + +fps = 40 # frame rate +ani = 4  # animation cycles +clock = pygame.time.Clock() +pygame.init() +main = True + +BLUE  = (25,25,200) +BLACK = (23,23,23 ) +WHITE = (254,254,254) +SNOWGRAY = (137,164,166) +ALPHA = (0,255,0) +    +world = pygame.display.set_mode([worldx,worldy]) +backdrop = pygame.image.load(os.path.join('images','stage.png')).convert() +backdropbox = world.get_rect() +player = Player() # spawn player +player.rect.x = 0 +player.rect.y = 0 +player_list = pygame.sprite.Group() +player_list.add(player) +steps = 10 +forwardx = 600 +backwardx = 230 + +eloc = [] +eloc = [200,20] +gloc = [] +tx = 64 #tile size +ty = 64 #tile size + +font_path = os.path.join(os.path.dirname(os.path.realpath(__file__)),"fonts","amazdoom.ttf") +font_size = tx +myfont = pygame.freetype.Font(font_path, font_size) +    +i=0 +while i <= (worldx/tx)+tx: +    gloc.append(i*tx) +    i=i+1 + +enemy_list = Level.bad( 1, eloc ) +ground_list = Level.ground( 1,gloc,tx,ty ) +plat_list = Level.platform( 1,tx,ty ) +loot_list = Level.loot(1,tx,ty) + +''' +Main loop +''' +while main == True: +    for event in pygame.event.get(): +        if event.type == pygame.QUIT: +            pygame.quit(); sys.exit() +            main = False + +        if event.type == pygame.KEYDOWN: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                print("LEFT") +                player.control(-steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                print("RIGHT") +                player.control(steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                print('jump') + +        if event.type == pygame.KEYUP: +            if event.key == pygame.K_LEFT or event.key == ord('a'): +                player.control(steps,0) +            if event.key == pygame.K_RIGHT or event.key == ord('d'): +                player.control(-steps,0) +            if event.key == pygame.K_UP or event.key == ord('w'): +                player.jump(plat_list) + +            if event.key == ord('q'): +                pygame.quit() +                sys.exit() +                main = False + +    # scroll the world forward +    if player.rect.x >= forwardx: +        scroll = player.rect.x - forwardx +        player.rect.x = forwardx +        for p in plat_list: +            p.rect.x -= scroll +        for e in enemy_list: +            e.rect.x -= scroll +        for l in loot_list: + +            l.rect.x -= scroll +                +    # scroll the world backward +    if player.rect.x <= backwardx: +        scroll = backwardx - player.rect.x +        player.rect.x = backwardx +        for p in plat_list: +            p.rect.x += scroll +        for e in enemy_list: +            e.rect.x += scroll +        for l in loot_list: +            l.rect.x += scroll + +    world.blit(backdrop, backdropbox) +    player.gravity() # check gravity +    player.update() +    player_list.draw(world) #refresh player position +    enemy_list.draw(world)  # refresh enemies +    ground_list.draw(world)  # refresh enemies +    plat_list.draw(world)   # refresh platforms +    loot_list.draw(world)   # refresh loot +    for e in enemy_list: +        e.move() +    stats(player.score,player.health) # draw text +    pygame.display.flip() +    clock.tick(fps) +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/add-scorekeeping-your-python-game + +作者:[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/LAW_maze.png?itok=mZ5LP4-X (connecting yellow dots in a maze) +[2]: https://www.python.org/ +[3]: https://www.pygame.org/news +[4]: https://opensource.com/article/17/10/python-101 +[5]: https://opensource.com/article/17/12/game-framework-python +[6]: https://opensource.com/article/17/12/game-python-add-a-player +[7]: https://opensource.com/article/17/12/game-python-moving-player +[8]: https://opensource.com/article/18/5/pygame-enemy +[9]: https://opensource.com/article/19/11/simulate-gravity-python +[10]: https://opensource.com/article/19/12/jumping-python-platformer-game +[11]: https://opensource.com/article/19/12/python-platformer-game-run +[12]: https://opensource.com/article/19/12/loot-python-platformer-game +[13]: http://pygame.org/news +[14]: https://fontlibrary.org/ +[15]: https://www.fontsquirrel.com/ +[16]: https://www.theleagueofmoveabletype.com/ +[17]: https://opensource.com/article/17/7/how-unzip-targz-file +[18]: https://opensource.com/sites/default/files/uploads/pygame-score.jpg (Keeping score in Pygame) From b3182a7127a88ff8399d719ea871aa3a8eec5c7c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Jan 2020 06:40:45 +0800 Subject: [PATCH 14/17] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @chen-ni 翻译的很棒! --- ...ow to make an old computer useful again.md | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/translated/tech/20190724 How to make an old computer useful again.md b/translated/tech/20190724 How to make an old computer useful again.md index 1df6d5fabd..60497a12b2 100644 --- a/translated/tech/20190724 How to make an old computer useful again.md +++ b/translated/tech/20190724 How to make an old computer useful again.md @@ -1,18 +1,20 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to make an old computer useful again) [#]: via: (https://opensource.com/article/19/7/how-make-old-computer-useful-again) -[#]: author: (Howard Fosdick https://opensource.com/users/howtechhttps://opensource.com/users/don-watkinshttps://opensource.com/users/suehlehttps://opensource.com/users/aseem-sharmahttps://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/dragonbitehttps://opensource.com/users/don-watkinshttps://opensource.com/users/jamesfhttps://opensource.com/users/seth) +[#]: author: (Howard Fosdick https://opensource.com/users/howtech) 如何把你的老爷机重新利用起来 ====== -按照下面各个步骤,让你的老爷机焕然一新 -![Person typing on a 1980's computer][1] -你的地下室里有一台用来落灰的旧电脑?为什么不把它利用起来呢?如果你常用的电脑坏了,又想用一个比手机更大的屏幕上网,这时候一台备用电脑可能就派上用场了。或者,它也可以充当一台全家人共用的廉价辅助电脑,甚至还可以改造为一台复古游戏机。 +> 按照下面各个步骤,让你的老爷机焕然一新。 + +![](https://img.linux.net.cn/data/attachment/album/202001/04/064017ztl28cn6jjhnjnaj.jpg) + +你的地下室里是不是有一台用来落灰的旧电脑?为什么不把它利用起来呢?如果你常用的电脑坏了,又想用一个比手机更大的屏幕上网,这时候一台备用电脑可能就派上用场了。或者,它也可以充当一台全家人共用的廉价备用电脑,甚至还可以改造为一台复古游戏机。 哪怕是一台有十余年历史的老爷机,只要选对了软件,也可以胜任很多新电脑能够完成的任务。其中的关键在于,要使用开源软件。 @@ -22,7 +24,7 @@ 第一步是检查硬件是否运转正常。如果在这个环节忽略了一个问题,后面可能会让你非常头疼。 -灰尘是电子器件的天敌,所以第一件事应该是打开机箱,清除灰尘。[压缩空气设备][2]这时候可能会派上用场。请注意,进行任何接触电脑的操作时,都应该确保你是[触地][3]的。此外,_避免_ 清洁布与任何物体发生摩擦。即使是一次小到你无法察觉的静电放电,也可能会导致电路损毁。 +灰尘是电子器件的天敌,所以第一件事应该是打开机箱,清除灰尘。[压缩空气设备][2]这时候可能会派上用场。请注意,进行任何接触电脑的操作时,都应该确保[接地][3]。此外,**不要**用清洁布擦拭任何东西。即使是一次小到你无法察觉的静电放电,也可能会导致电路损毁。 清洁工作完成之后,关闭机箱,检查是否所有硬件都可以正常工作。需要测试的项目包括: @@ -31,23 +33,23 @@ * 主板 * 外围设备(DVD 驱动器、USB 接口、声卡,等等) -首先,将计算机启动面板([UEFI][4] 或者是 [BIOS][5]面板)上的诊断测试依次运行一遍。如果不知道按哪个程序功能按键进入你电脑的启动面板,可以参考 [这份列表][6]。 +首先,将计算机启动界面([UEFI][4] 或者是 [BIOS][5] 界面)上的诊断测试依次运行一遍。如果不知道按哪个功能键进入你电脑的启动界面,可以参考 [这份列表][6]。 -此外,也可以使用诸如 [Hirens BootCD][7] 和 [Ultimate Boot CD][8] 之类的免费资源工具包,进行启动面板覆盖不到的测试。这些资源工具包涵盖了数百个测试程序,并且都是免费的,尽管不都开源。运行这些工具包无需安装任何软件,因为它们都是从 U 盘或者 DVD 驱动器启动的。 +此外,也可以使用诸如 [Hirens BootCD][7] 和 [Ultimate Boot CD][8] 之类的免费资源工具包,进行启动界面覆盖不到的测试。这些资源工具包涵盖了数百个测试程序,并且都是免费的,尽管不都开源。运行这些工具包无需安装任何软件,因为它们都是从 U 盘或者 DVD 驱动器启动的。 测试一定要彻底!对于内存和硬盘来说,基础测试还不够,应该运行深度测试,哪怕是运行一整夜也无妨。只有这样,才能够查出那些不易发现的瞬时故障。 -如果发现了问题,可以参考我的[硬件故障排除快速指南][9],帮你解决最常见的硬件问题。 +如果发现了问题,可以参考我的[硬件故障排除快速指南][9],可以帮你解决最常见的硬件问题。 ### 选择软件 电脑翻新的关键在于,根据手头的硬件资源,恰如其分地安装软件。最核心的三种硬件资源分别是: -1. 处理器(核数、速度) +1. 处理器(内核数、速度) 2. 内存 3. 显存 -可以在启动时的 UEFI/BIOS 面板上,弄清楚你电脑的硬件资源。记得抄下数据,以免遗忘。接下来,可以在 [CPU Benchmark][10] 网站上查看你的处理器,该网站除了提供 CPU 的背景资料,还提供一个 CPU 的性能分数。 +可以在启动时的 UEFI/BIOS 界面上,弄清楚你电脑的硬件资源。记得抄下数据,以免遗忘。接下来,可以在 [CPU Benchmark][10] 网站上查看你的处理器,该网站除了提供 CPU 的背景资料,还提供一个 CPU 的性能分数。 了解了硬件性能之后,就可以选择能够在硬件上高效运行的软件了。软件的选择涉及四个重要的层面: @@ -56,19 +58,19 @@ 3. 浏览器 4. 应用 -一个优秀的 Linux 发行版可以满足全部四个层面。不要试图使用已经停止维护的 Windows 版本,例如 Windows 8、Vista 或者 XP,哪怕已经安装在电脑上了。恶意软件的 [风险][11] 你是承受不起的。明智的做法是,使用一个更抗病毒的最新版本操作系统。 +一个优秀的 Linux 发行版可以满足上述全部四个层面。不要试图使用已经停止维护的 Windows 版本,例如 Windows 8、Vista 或者 XP,哪怕已经安装在电脑上了。恶意软件的[风险][11]你是承受不起的。明智的做法是,使用一个更抗病毒的最新版本操作系统。 -那 Windows 7 呢?[维护宽限期][12] 至 2020 年 1 月 14 日结束,也就是说,在此日期之前你还可以获得安全补丁,之后就想都别想了。现在正是迁出 Windows 7 的绝佳时机。 +那 Windows 7 呢?[维护宽限期][12]至 2020 年 1 月 14 日结束,也就是说,在此日期之前你还可以获得安全补丁,之后就想都别想了。现在正是迁出 Windows 7 的绝佳时机。 Linux 的巨大优势在于,有许多专门为过时硬件设计的[发行版][13]。此外,[桌面环境][14]和操作系统在 Linux 的设计中是分开的,你可以自行选择搭配。这一点非常重要,因为桌面环境对低端系统的性能有很大影响。(对于 Windows 和 MacOS 来说,你选择的操作系统版本决定了桌面环境,没得可选。) -Linux 的另一个好处是,拥有数以千计免费且开源的应用,不需要担心激活或者许可的问题。此外,Linux 是可移植的,可以在不同的分区、硬盘、设备或计算机之间,对操作系统和应用进行复制、移动或克隆。(Windows 则不然,使用注册表将系统捆绑在了所安装的计算机上。) +Linux 的另一个好处是,拥有数以千计自由且开源的应用,不需要担心激活或者许可的问题。此外,Linux 是可移植的,可以在不同的分区、硬盘、设备或计算机之间,对操作系统和应用进行复制、移动或克隆。(Windows 则不然,使用注册表将系统捆绑在了所安装的计算机上。) ### 翻新后的电脑能够做什么? 这里讨论的是大约在 2006 年到 2013 年之间生产的双核计算机,尤其是装载了 [Intel 酷睿 2][15] CPU 或 [AMD 速龙 64 X2][16] 系列处理器的计算机。它们的 [CPU 分数][10] 大多在 1000 到 4000 分之间。这种电脑卖不了几个钱,但用在运行轻量级 Linux 软件上,性能还是足够的。 -有一点需要注意:你的电脑应该至少拥有 2 GB 内存,如果不够就进行升级。就我翻新过的电脑来说,使用者用到的内存(不包括数据缓存)一般在 0.5 到 2 GB 之间,很少超过 2 GB。如果将内存升级到 2GB,系统就不至于进行 _swap_,即将硬盘当做内存使用。如果想要获得良好性能,这一点十分关键。 +有一点需要注意:你的电脑应该至少拥有 2 GB 内存,如果不够就进行升级。就我翻新过的电脑来说,使用者用到的内存(不包括数据缓存)一般在 0.5 到 2 GB 之间,很少超过 2 GB。如果将内存升级到 2GB,系统就不至于进行**内存交换**,即将硬盘当做内存使用。如果想要获得良好性能,这一点十分关键。 以我自己为例,我用来写作这篇文章的是一台有十年机龄的翻新电脑。取下 1 GB 内存条之后,它只剩下了 1 GB 内存,然后就慢得像一只乌龟。用它浏览网页,或者是做类似的事情,都让人感到灰心,甚至痛苦。一旦把内存条重新装回去,有了 2 GB 内存,它就立马回到了可以使用的状态。 @@ -76,19 +78,19 @@ Linux 的另一个好处是,拥有数以千计免费且开源的应用,不 ### 翻新电脑的局限 -那么,这些老爷机又有什么局限呢?由于它们的并发比不上最先进的计算机,所以应该使用轻量级浏览器,同时拦截广告(广告正是让网页加载变慢的罪魁祸首)。如果可以使用虚拟专用网络(VPN)拦截广告,为处理器免除广告加载的负荷,那就再好不过。此外,还需要禁用视频自动播放、Flash 以及网页动效;将浏览器上的标签页控制在少数几个,不要同时打开 20 个;以及下载可以开启/禁用 JavaScript 的浏览器扩展。 +那么,这些老爷机又有什么局限呢?由于它们的并发性能比不上最先进的计算机,所以应该使用轻量级浏览器,同时拦截广告(广告正是让网页加载变慢的罪魁祸首)。如果可以使用虚拟专用网络(VPN)拦截广告,为处理器免除加载广告的负荷,那就再好不过。此外,还需要禁用视频自动播放、Flash 以及网页动画效果;将浏览器上的标签页控制在少数几个,不要同时打开 20 个;以及下载可以开启/禁用 JavaScript 的浏览器扩展。 让处理器专注于你目前正在做的事情吧,不要同时打开一堆应用,也不要在后台运行很多程序。图像编辑和视频编辑的高级工具可能会很慢;至于运行虚拟机,还是别想了吧。 -那游戏呢?开源软件仓库提供了数以千计的游戏。这就是我为什么将显存列为三种核心硬件资源之一。如果你的电脑没有显卡,那很可能只有 32 或者 64 MB 的显存。可以增加一张显卡,将显存提升到 256 或者 512 MB,这样一来,处理器密集型的游戏就会顺畅很多了。如果不确定你的电脑有多少显存,可以参考[这里][17]。请注意,需要确保显卡与电脑的[显卡插槽][18](AGP、PCI-Express 或者 PCI)相匹配,同时使用正确的[连接线][19](VGA、DVI 或者 HDMI)。 +那游戏呢?开源软件仓库提供了数以千计的游戏。这就是我为什么将显存列为三种核心硬件资源之一。如果你的电脑没有独立显卡,那很可能只有 32 或者 64 MB 的显存。可以增加一张显卡,将显存提升到 256 或者 512 MB,这样一来,处理器密集型的游戏就会顺畅很多了。如果不确定你的电脑有多少显存,可以参考[这里][17]。请注意,需要确保显卡与电脑的[显卡插槽][18](AGP、PCI-Express 或者 PCI)相匹配,同时使用正确的[连接线][19](VGA、DVI 或者 HDMI)。 #### 与 Windows 系统的兼容性如何? -许多人关心 Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 的替代版本][20]。 +许多人关心 Linux 与 Windows 系统的兼容性如何。首先,对于任何一个 Windows 程序,都有一个 [Linux 版本的替代品][20]。 退一步说,即使你真的必须要运行某个特定的 Windows 程序,通常也可以借助 [Wine][21] 在 Linux 上运行。可以在 [Wine 数据库][22] 里查找一下你的应用,看看是否可以在 Wine 上运行,顺便学一些特殊安装技巧。[Winetricks][23] 和 [PlayOnLinux][24] 这两个辅助工具可以帮助你进行安装和配置。 -Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP、ME/98/95 和 3.1。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。借助 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 +Wine 的另一个优势是可以运行旧版本 Windows(例如 Vista、XP、ME/98/95 和 3.1)上的程序。我认识一个家伙,搭建了一台特别赞的游戏电脑,然后用来玩 XP 上的老游戏。借助 [DOSBox][26],你甚至还可以运行数以千计的[免费 DOS 程序][25]。但是有一点需要注意,如果 Windows 程序可以运行,那么 Windows [病毒][27]也同样可以。你需要保护 Linux 上的 Wine 环境,正如保护任何其他 Windows 环境一样。 对了,与 Microsoft Office 的兼容性又如何呢?我使用的是 LibreOffice,经常编辑并交换 Word 和 Excel 文件,完全没有问题。不过,你应该避免使用隐晦或者过于专业的功能。 @@ -96,7 +98,7 @@ Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP 假设选择了 Linux 作为操作系统,那么你还需要选择桌面环境、浏览器和各种应用。最简单的方法是,安装一个包含了你所需要的一切的发行版。 -通过从 [live USB][28] U 盘或者 DVD 启动,你无需安装任何程序,就可以尝试不同的发行版。关于在 Linux 或 Windows 上创建可启动的 Linux 的方法,可以参考 [这里][29]。 +通过从 [live USB][28] U 盘或者 DVD 启动,你无需安装任何程序,就可以尝试不同的发行版。关于在 Linux 或 Windows 上创建可启动的 Linux 的方法,可以参考[这里][29]。 我进行电脑翻新的目的是做慈善,所以无法指望电脑使用者具备任何相应知识。我需要的发行版应该具有以下特性: @@ -110,11 +112,11 @@ Wine 的另一个优势是可以运行 Windows 的老版本,例如 Vista、XP * 更重视可靠性,而不是尖端功能 * 可以通过图形化用户界面进行设置,而不是只能通过文本文件进行设置 -许多发行版都能够满足上面的要求。我曾经尝试成功的有 [Mint/Xfce][30]、[Xubuntu,][31] 和 [Lubuntu][32]。前两个发行版使用 Xfce 桌面环境,第三个使用 LXQt。相比 GNOME、Unity、KDE、MATE 和 Cinnamon 这些桌面环境,运行上面这两种桌面环境只需要[更少][33]的处理器和内存资源。 +许多发行版都能够满足上面的要求。我曾经尝试成功的有 [Mint/Xfce][30]、[Xubuntu][31] 和 [Lubuntu][32]。前两个发行版使用 Xfce 桌面环境,第三个使用 LXQt。相比 GNOME、Unity、KDE、MATE 和 Cinnamon 这些桌面环境,运行上面这两种桌面环境只需要[更少][33]的处理器和内存资源。 Xfce 和 LXQt 用起来非常简单,我的客户们之前从未见过 Linux,但是都可以自如使用这些简单的、菜单驱动的用户界面。 -对于旧电脑来说,运行最快速、最高效的浏览器是一件非常重要的事情。[很多人觉得][34] Chromium 是最好的浏览器;此外,我还安装了 Firefox Quantum,因为大家比较熟悉它,并且[它的性能][35]可以和 [Chromium 的性能][36]媲美。我还加上了 Opera,因为它速度快,而且有一些独特功能,比如内置的广告拦截,以及免费的 [虚拟专用网络][37]。Opera 是免费的,但并非开源。 +对于旧电脑来说,运行最快速、最高效的浏览器是一件非常重要的事情。[很多人觉得][34] Chromium 是最好的浏览器;此外,我还安装了 Firefox Quantum,因为大家比较熟悉它,并且[它的性能][35]可以和 [Chromium 的性能][36]媲美。我还加上了 Opera,因为它速度快,而且有一些独特功能,比如内置的广告拦截,以及免费的[虚拟专用网络][37]。Opera 是免费的,但并非开源。 无论你使用什么浏览器,一定要拦截广告和追踪器,尽量降低浏览器的负荷。此外,除非得到你的明确批准,否则视频和 Flash 都不应该被允许运行。 @@ -122,7 +124,7 @@ Xfce 和 LXQt 用起来非常简单,我的客户们之前从未见过 Linux, ### 行动起来吧 -你是否会对翻新后的电脑感到满意呢?就我来说,我所使用的两台电脑的机龄都已经超过十年了,其中一个装载的是 Intel 双核处理器([eMachines T5274a][38]),另一个装载的是 AMD 速龙 64 x2 处理器([HP dc5750][39]),两台电脑都有 2 GB 内存。它们和我的另一台具备四核 i5 处理器和 16 GB 内存 的电脑一样,完全能够胜任我的办公工作。如果说有什么功能是这两台电脑缺失的,那就是运行虚拟机了。 +你是否会对翻新后的电脑感到满意呢?就我来说,我所使用的两台电脑的机龄都已经超过十年了,其中一个装载的是 Intel 双核处理器([eMachines T5274a][38]),另一个装载的是 AMD 速龙 64 x2 处理器([HP dc5750][39]),两台电脑都有 2 GB 内存。它们和我的另一台具备四核 i5 处理器和 16 GB 内存的电脑一样,完全能够胜任我的办公工作。如果说有什么功能是这两台电脑缺失的,那就是运行虚拟机了。 我们生活在一个非常神奇的年代。只需要付出一点努力,就可以将一台机龄在 5 到 12 年之间的旧电脑,翻新为一台具备实用价值的机器。还有什么比这更有趣吗? @@ -133,11 +135,11 @@ via: https://opensource.com/article/19/7/how-make-old-computer-useful-again 作者:[Howard Fosdick][a] 选题:[lujun9972][b] 译者:[chen-ni](https://github.com/chen-ni) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 -[a]: https://opensource.com/users/howtechhttps://opensource.com/users/don-watkinshttps://opensource.com/users/suehlehttps://opensource.com/users/aseem-sharmahttps://opensource.com/users/sethhttps://opensource.com/users/marcobravohttps://opensource.com/users/dragonbitehttps://opensource.com/users/don-watkinshttps://opensource.com/users/jamesfhttps://opensource.com/users/seth +[a]: https://opensource.com/users/howtech [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.amazon.com/s/ref=nb_sb_noss_1?url=search-alias%3Daps&field-keywords=compressed+air+for+computers&rh=i%3Aaps%2Ck%3Acompressed+air+for+computers From 5d8cd4cc24adb26cc85a9d42d60913d2e70529ae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Jan 2020 06:41:56 +0800 Subject: [PATCH 15/17] PUB @chen-ni https://linux.cn/article-11746-1.html --- .../20190724 How to make an old computer useful again.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20190724 How to make an old computer useful again.md (99%) diff --git a/translated/tech/20190724 How to make an old computer useful again.md b/published/20190724 How to make an old computer useful again.md similarity index 99% rename from translated/tech/20190724 How to make an old computer useful again.md rename to published/20190724 How to make an old computer useful again.md index 60497a12b2..726436a18a 100644 --- a/translated/tech/20190724 How to make an old computer useful again.md +++ b/published/20190724 How to make an old computer useful again.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (chen-ni) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-11746-1.html) [#]: subject: (How to make an old computer useful again) [#]: via: (https://opensource.com/article/19/7/how-make-old-computer-useful-again) [#]: author: (Howard Fosdick https://opensource.com/users/howtech) From 3b9e205119021823c081167b846c92e8c91f12fd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 Jan 2020 07:24:32 +0800 Subject: [PATCH 16/17] Rename sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md to sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md --- ...ng- EA is Permanently Banning Linux Gamers on Battlefield V.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md (100%) diff --git a/sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md b/sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md similarity index 100% rename from sources/tech/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md rename to sources/news/20200104 Shocking- EA is Permanently Banning Linux Gamers on Battlefield V.md From a631c447635fe5f90954201d1cd1761d26ed0b81 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 4 Jan 2020 07:26:42 +0800 Subject: [PATCH 17/17] Rename sources/tech/20200103 What you need to know about Rust in 2020.md to sources/talk/20200103 What you need to know about Rust in 2020.md --- .../20200103 What you need to know about Rust in 2020.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20200103 What you need to know about Rust in 2020.md (100%) diff --git a/sources/tech/20200103 What you need to know about Rust in 2020.md b/sources/talk/20200103 What you need to know about Rust in 2020.md similarity index 100% rename from sources/tech/20200103 What you need to know about Rust in 2020.md rename to sources/talk/20200103 What you need to know about Rust in 2020.md