Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2019-01-05 15:53:48 +08:00
commit 7b9a31f372
4 changed files with 73 additions and 63 deletions

View File

@ -1,19 +1,20 @@
[#]: collector: (lujun9972)
[#]: translator: (zhs852)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-10416-1.html)
[#]: subject: (Let your Linux terminal speak its mind)
[#]: via: (https://opensource.com/article/18/12/linux-toy-espeak)
[#]: author: (Jason Baker https://opensource.com/users/jason-baker)
让 Linux 终端说出它的想法
======
> eSpeak 是一个可在 Linux 命令行中使用的开源的 TTS 合成器。
![](https://opensource.com/sites/default/files/styles/image-full-size/public/uploads/linux-toy-cava.png?itok=4EWYL8uZ)
欢迎回到《24 天介绍 Linux 命令行小玩具》。如果这是你首次阅读本系列文章,你大概连什么是 Linux 命令行小玩具都不知道。无需担心,你只需要边看边体会。通常来说,它有可能是游戏或其它能让你在终端中娱乐的小程序。
欢迎回到《24 天介绍 Linux 命令行小玩具》。如果这是你首次阅读本系列文章,你可能不知道什么是 Linux 命令行小玩具。无需担心,你只需要边看边体会。通常来说,它有可能是游戏或其它能让你在终端中娱乐的小程序。
或许你已经对一些玩具有了解了,不过我们相信,在本系列文章中总有那么几个你没见过的玩意。
@ -21,17 +22,17 @@
我们也许永远不会忘记来自 [2001 太空漫游][1] 中与机组人员交流的 HAL 9000。但是在 1960 年代到今天的时间里,是存在着许多能说话的计算机的。它们有些很出色,也有些不那么出色。
其中一个我最爱的是一个叫做 [eSpeak][2] 的开源项目。它以多种形式发布,比如可以嵌入你自己项目中的库。与此同时,它也提供了可供你安装的命令行版本。在我所用的发行版中,安装十分简单,只需使用:
其中一个我最爱的是一个叫做 [eSpeak][2] 的开源项目。它以多种形式发布,比如可以嵌入你自己项目中的库。与此同时,它也提供了可供你安装的命令行版本。在我所用的发行版中,安装十分简单,只需使用:
```
$ sudo dnf install espeak
```
你既可以与 eSpeak 交互,也可以用它来输出其它程序的信息,甚至通过简单的 echo 命令来使用它。[这里][3] 有一些可供 eSpeak 使用的声音文件,你可以在无聊时切换他们。甚者你可以制作一个属于你自己的声音。
你既可以与 eSpeak 交互,也可以用它来输出其它程序的信息,甚至通过简单的 `echo` 命令来使用它。[这里][3] 有一些可供 eSpeak 使用的声音文件,你可以在无聊时切换他们。甚者你可以制作一个属于你自己的声音。
在 2015 年,一些希望继续 eSpeak 开发的开发者创建了一个名为 eSpeak NG (即 "Next Generation"“下一代”的意思的项目。eSpeak 目前在 GPL v3 许可证下开源,你可以在 [SourceForge][2] 上详细了解这个项目或下载源代码。
在 2015 年,一些希望继续 eSpeak 开发的开发者创建了一个名为 eSpeak NG (即 “Next Generation”“下一代”的意思的项目。eSpeak 目前在 GPL v3 许可证下开源,你可以在 [SourceForge][2] 上详细了解这个项目或下载源代码。
别急,我今天还会介绍一个额外的小程序,它叫 [cava][4]。我经常希望用一张独一无二的截图作为我文章的头图,更何况今天的玩具主要是关于声音的,导致图片更少了。因此我需要一些东西来填补这些空白。Cava 是 "console-based audio visualizer for ALSA" (译注:基于 ALSA 的命令行音频可视化工具)(尽管它现在支持的比 ALSA 更多)的简写,它是一个优秀的命令行音频可视化工具,并且它正以 MIT 许可证开源。下面是一个将 eSpeak 输出可视化的命令:
别急,我今天还会介绍一个额外的小程序,它叫 [cava][4]。我经常希望用一张独一无二的截图作为我文章的头图,更何况今天的玩具主要是关于声音的,这就图片更少了。因此我需要一些东西来填补这些空白。Cava 是<ruby>基于 ALSA 的命令行音频可视化工具<rt>console-based audio visualizer for ALSA</rt></ruby>的简写(尽管它现在支持的比 ALSA 更多),它是一个优秀的命令行音频可视化工具,并且它正以 MIT 许可证开源。下面是一个将 eSpeak 输出可视化的命令:
```
$ echo "Rudolph, the red-nosed reindeer, had a very shiny nose." | espeak
@ -50,7 +51,7 @@ via: https://opensource.com/article/18/12/linux-toy-espeak
作者:[Jason Baker][a]
选题:[lujun9972][b]
译者:[zhs852](https://github.com/zhs852)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,3 +1,12 @@
[#]: collector: (lujun9972)
[#]: translator: (runningwater)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: subject: (The Rise and Rise of JSON)
[#]: via: ( https://twobithistory.org/2017/09/21/the-rise-and-rise-of-json.html)
[#]: author: (https://twobithistory.org)
[#]: url: ( )
The Rise and Rise of JSON
======
JSON has taken over the world. Today, when any two applications communicate with each other across the internet, odds are they do so using JSON. It has been adopted by all the big players: Of the ten most popular web APIs, a list consisting mostly of APIs offered by major companies like Google, Facebook, and Twitter, only one API exposes data in XML rather than JSON. Twitter, to take an illustrative example from that list, supported XML until 2013, when it released a new version of its API that dropped XML in favor of using JSON exclusively. JSON has also been widely adopted by the programming rank and file: According to Stack Overflow, a question and answer site for programmers, more questions are now asked about JSON than about any other data interchange format.
@ -80,7 +89,7 @@ via: https://twobithistory.org/2017/09/21/the-rise-and-rise-of-json.html
作者:[Two-Bit History][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[runningwater](https://github.com/runningwater)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,53 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Computer Laboratory Raspberry Pi: Lesson 0 Introduction)
[#]: via: (https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/introduction.html)
[#]: author: (Robert Mullins http://www.cl.cam.ac.uk/~rdm34)
Computer Laboratory Raspberry Pi: Lesson 0 Introduction
======
This introductory lesson does not contain a practical element, but exists to explain the basic concepts of what is an operating system, what is assembly code and other important basics. If you just want to get straight into practicals, it should be safe to skip this lesson.
### 1 Operating Systems
An operating system is just a very complicated program. It has the job of organising other programs on a computer, including sharing the computer's time, memory, hardware and other resources. Some big families of desktop operating systems that you may have heard of include GNU/Linux, Mac OS X and Microsoft Windows. Other devices also need operating systems such as phones, which may use operating systems such as Android, iOS and Windows Phone.[1]
Since the operating system has to interact with the hardware on a computer system, it also has to have specific knowledge of the hardware on a system. To allow operating systems to be used on a variety of computers, the concept of **drivers** was invented. Drivers are small bits of code that can be added and removed from the operating system in order to allow the operating system to talk to a particular piece of hardware. In this course, we do not cover how to create such removable drivers, and instead focus on making specific ones for the Raspberry Pi.
There are all kinds of different designs of operating systems, and this course can only just scratch the surface. In this course we will mainly focus on getting the operating system to interact with a variety of bits of hardware, as this is often the trickiest bit, and the part for which the least documentation and help exists online.
### 2 Assembly Code
```
A processor can often perform millions of instructions per second, but they must be simple.
```
This course will be written almost exclusively in assembly code. Assembly code is code that is very close to what the computer understands. How a computer really works is that there is a small device called a processor which is capable of performing simple jobs like adding numbers, and there is a set of one or more microchips called the **RAM** which are capable of storing numbers. When a computer has power, the processor works through a sequence of instructions given to it by the programmer, which cause it to change numbers in the RAM, and interact with connected hardware. Assembly code is a translation into human readable text of those commands.
When programming normally, the programmer writes code in a programming language such as C++, Java, C#, Basic, etc, and then a program called the compiler translates what the programmer wrote into assembly code, which is the further reduced into binary code[2]. Binary code is what the computer actually understands, but it is almost impossible for humans to read. Assembly code is much better, but it can be frustrating how few commands are possible. Remember that every command you write in assembly code is something that the processor understands directly, and so the commands are simple by design, as a physical circuit must process each one.
![Compiler process][1]
Just like with ordinary programming, there are many different assembly code languages, however unlike ordinary programming, the reason these exist is due to the fact that there exists many different processors, each designed to understand a different language. Thus a program written in assembly code for one machine, will not work on a different one. For most things, this would be a disaster as each program would have to be rewritten for every system it was used on, but for operating systems this isn't so much of a problem, as it would have to be rewritten anyway due to differing hardware. Nevertheless, most operating systems are written in C++ or C, so that they can be converted more easily, and only the sections that absolutely have to be written in assembly are.
You're now ready to move on to the first lesson, [Lesson 1: OK01][2]
--------------------------------------------------------------------------------
via: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/introduction.html
作者:[Robert Mullins][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: http://www.cl.cam.ac.uk/~rdm34
[b]: https://github.com/lujun9972
[1]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/images/compiling.png
[2]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/ok01.html

View File

@ -0,0 +1,53 @@
[#]: collector: (lujun9972)
[#]: translator: (qhwdw)
[#]: reviewer: ()
[#]: publisher: ()
[#]: url: ()
[#]: subject: (Computer Laboratory Raspberry Pi: Lesson 0 Introduction)
[#]: via: (https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/introduction.html)
[#]: author: (Robert Mullins http://www.cl.cam.ac.uk/~rdm34)
计算机实验室 树莓派:课程 0简介
======
这个课程简介不包含实践内容,但它解释了一个操作系统的基本概念、汇编代码、和其它很重要的一些基本原理。如果你想直接进入实践环节,跳过本课程并不会有什么问题。
### 1、操作系统
一个操作系统就是一个非常复杂的程序。它的任务就是组织安排计算机上的其它程序,包括共享计算机的时间、内存、硬件和其它资源。你可能听说过的一些比较大的桌面操作系统家族有 GNU/Linux、Mac OS X 和 Microsoft Windows。其它的设备比如电话也需要操作系统它可能使用的操作系统是 Android、iOS 和 [Windows Phone][https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/introduction.html#note1]
由于操作系统是用来与计算机系统上的硬件进行交互的,所以它必须有系统上硬件专有的内容。为了能让操作系统适用于各种类型的计算机,发明了 **驱动程序** 的概念。驱动程序是为了能够让操作系统与特定的硬件进行交互而添加(并可删除)到操作系统上的一小部分代码。在本课程中,我们并不涉及如何创建可删除的驱动程序,而是专注于特定的一个硬件:树莓派。
操作系统有各种不同的设计方式,在本课程中,我们只触及操作系统设计的皮毛。本课程中,我们主要专注于操作系统与各种硬件的交互部分,因为这经常是比较棘手的部分,并且也是在网络上文档和帮助最少的部分。
### 2、汇编代码
```
一个处理器每秒可以执行上百万的指令,但是这些指令必须要简单。
```
本课程几乎要完全靠汇编代码来写。汇编代码非常接近计算机的底层。计算机其实是靠一个叫处理器的设备来工作的,处理器能够执行像加法这样的简单任务,还有一组叫做 **RAM** 的芯片,它能够用来保存数字。当计算机通电后,处理器执行程序员给定的一系列指令,这将导致内存中的数字发生变化,以及与连接的硬件进行交互。汇编代码只是将这些机器命令转换为人类可读的文本。
常规的编程就是,程序员使用编程语言,比如 C++、Java、C#、Basic、等等来写代码然后一个叫编译器的程序将程序员写的代码转换成汇编代码然后进一步转换为[二进制代码][https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/introduction.html#note2]。二进制代码才是计算机真正能够理解的东西,但它是人类无法读取的东西。汇编代码比二进制代码好一点,至少它的命令是人类可读的,但它仍然让人很沮丧。请记住,你用汇编代码写的每个命令都是处理器可以直接认识的,因此这些命令设计的很简单,因为物理电路必须能够处理每个命令。
![Compiler process][1]
和普通编程一样,也有很多不同的汇编代码编程语言,但与普通编程不一样的是,每个汇编编程语言是面对不同的处理器的,每种处理器设计为去理解不同的语言。因此,用一个针对某种机器设计的汇编语言所写的汇编代码,是不能在其它种类的机器上运行的。很多情况下,这都是一个大灾难,因此每个程序都必须在使用它的不同种类的机器上重写一遍,但对于操作系统,这不是个问题,因为在不同的硬件上它必须得重写。尽管如此,大多数操作系统都是用 C++ 或 C 来写的,这样它们就可以很容易地在不同种类的硬件上使用,只需要重写那些必须用汇编代码来实现的部分即可。
现在,你已经准备好进入第一节课了,它是 [课程 1OK01][2]
--------------------------------------------------------------------------------
via: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/introduction.html
作者:[Robert Mullins][a]
选题:[lujun9972][b]
译者:[qhwdw](https://github.com/qhwdw)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: http://www.cl.cam.ac.uk/~rdm34
[b]: https://github.com/lujun9972
[1]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/images/compiling.png
[2]: https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/ok01.html