Merge remote-tracking branch 'LCTT/master'

This commit is contained in:
Xingyu.Wang 2019-03-30 01:13:27 +08:00
commit a6707f314b
11 changed files with 410 additions and 420 deletions

View File

@ -0,0 +1,209 @@
[#]: collector: (lujun9972)
[#]: translator: (GraveAccent)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-10664-1.html)
[#]: subject: (JSON vs XML vs TOML vs CSON vs YAML)
[#]: via: (https://www.zionandzion.com/json-vs-xml-vs-toml-vs-cson-vs-yaml/)
[#]: author: (Tim Anderson https://www.zionandzion.com)
JSON、XML、TOML、CSON、YAML 大比拼
======
### 一段超级严肃的关于样本序列化的集合、子集和超集的文字
我是一名开发者,我读代码,我写代码,我写会写代码的代码,我写会写出供其它代码读的代码的代码。这些都非常火星语,但是有其美妙之处。然而,最后一点,写会写出供其它代码读的代码的代码,可以很快变得比这段文字更费解。有很多方法可以做到这一点。一种不那么复杂而且开发者社区最爱的方式是数据序列化。对于那些不了解我刚刚抛给你的时髦词的人,数据序列化是从一个系统获取一些信息,将其转换为其它系统可以读取的格式,然后将其传递给其它系统的过程。
虽然[数据序列化格式][1]多到可以埋葬哈利法塔,但它们大多分为两类:
* 易于人类读写,
* 易于机器读写。
很难两全其美,因为人类喜欢让我们更具表现力的松散类型和灵活格式标准,而机器倾向于被确切告知一切事情而没有二义性和细节缺失,并且认为“严格规范”才是它们最爱的口味。
由于我是一名 web 开发者,而且我们是一个创建网站的机构,我们将坚持使用 web 系统可以理解或不需要太多努力就能理解的特殊格式而且对人类可读性特别有用的格式XML、JSON、TOML、CSON 以及 YAML。每个都有各自的优缺点和适当的用例场景。
### 事实最先
回到互联网的早期,[一些非常聪明的家伙][2]决定整合一种让每个系统都能理解的标准语言,并创造性地将其命名为<ruby>标准通用标记语言<rt>Standard Generalized Markup Language</rt></ruby>(简称 SGML。SGML 非常灵活,发布者也很好地定义了它。它成为了 XML、SVG 和 HTML 等语言之父。所有这三个都符合 SGML 规范,可是它们都是规则更严格、灵活性更少的子集。
最终人们开始看到非常小、简洁、易读且易于生成的数据的好处这些数据可以在系统之间以编程的方式共享而开销很小。大约在那个时候JSON 诞生了并且能够满足所有的需求。而另一方面,其它语言也开始出现以处理更多的专业用例,如 CSONTOML 和 YAML。
### XML不行了
原本XML 语言非常灵活且易于编写,但它的缺点是冗长,人类难以阅读、计算机非常难以读取,并且有很多语法对于传达信息并不是完全必要的。
今天,它在 web 上的数据序列化的用途已经消失了。除非你在编写 HTML 或者 SVG否则你不太能在许多其它地方看到 XML。一些过时的系统今天仍在使用它但是用它传递数据往往太重了。
我已经可以听到 XML 老爷爷开始在它们的石碑上乱写为什么 XML 是了不起的所以我将提供一个小小的补充XML 可以很容易地由系统和人读写。然而,真的,我的意思是荒谬的,很难创建一个可以规范的读取它的系统。这是一个简单美观的 XML 示例:
```
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
```
太棒了。易于阅读、理解、写入,也容易编码一个可以读写它的系统。但请考虑这个例子:
```
<!DOCTYPE r [ <!ENTITY y "a]>b"> ]>
<r>
<a b="&y;>" />
<![CDATA[[a>b <a>b <a]]>
<?x <a> <!-- <b> ?> c --> d
</r>
```
这上面是 100% 有效的 XML。几乎不可能阅读、理解或推理。编写可以使用和理解这个的代码将花费至少 36 根头发和 248 磅咖啡渣。我们没有那么多时间或咖啡,而且我们大多数老程序员们现在都是秃头。所以,让它活在我们的记忆里,就像 [css hacks][3]、[IE 6 浏览器][4] 和[真空管][5]一样好了。
### JSON并列聚会
好吧我们都同意XML = 差劲。那么,好的替代品是什么?<ruby>JavaScript 对象表示法<rt>JavaScript Object Notation</rt></ruby>,简称 JSON。JSON读起来像 Jason 这个名字) 是 Brendan Eich 发明的,并且得到了伟大而强力的 [JavaScript 意见领袖][6] Douglas Crockford 的推广。它现在几乎用在任何地方。这种格式很容易由人和机器编写,按规范中的严格规则[解析][7]也相当容易,并且灵活 —— 允许深层嵌套数据支持所有的原始数据类型及将集合解释为数组或对象。JSON 成为了将数据从一个系统传输到另一个系统的事实标准。几乎所有语言都有内置读写它的功能。
JSON语法很简单。方括号表示数组花括号表示记录由冒号分隔的两个值分别表示属性或“键”在左边、值在右边。所有键必须用双引号括起来
```
{
"books": [
{
"id": "bk102",
"author": "Crockford, Douglas",
"title": "JavaScript: The Good Parts",
"genre": "Computer",
"price": 29.99,
"publish_date": "2008-05-01",
"description": "Unearthing the Excellence in JavaScript"
}
]
}
```
这对你来说应该是完全有意义的。它简洁明了,并且从 XML 中删除了大量额外废话并传达相同数量的信息。JSON 现在是王道,本文剩下的部分会介绍其它语言格式,这些格式只不过是 JSON 的简化版,尝试让其更简洁或对人类更易读,可结构还是非常相似的。
### TOML: 缩短到彻底的利他主义
TOML<ruby>Tom 的显而易见的最小化语言<rt>Toms Obvious, Minimal Language</rt></ruby>)允许以相当快捷、简洁的方式定义深层嵌套的数据结构。名字中的 Tom 是指发明者 [Tom Preston Werner][8],他是一位活跃于我们行业的创造者和软件开发人员。与 JSON 相比,语法有点尴尬,更类似 [ini 文件][9]。这不是一个糟糕的语法,但是需要一些时间适应。
```
[[books]]
id = 'bk101'
author = 'Crockford, Douglas'
title = 'JavaScript: The Good Parts'
genre = 'Computer'
price = 29.99
publish_date = 2008-05-01T00:00:00+00:00
description = 'Unearthing the Excellence in JavaScript'
```
TOML 中集成了一些很棒的功能,例如多行字符串、保留字符的自动转义、日期、时间、整数、浮点数、科学记数法和“表扩展”等数据类型。最后一点是特别的,是 TOML 如此简洁的原因:
```
[a.b.c]
d = 'Hello'
e = 'World'
```
以上扩展到以下内容:
```
{
"a": {
"b": {
"c": {
"d": "Hello"
"e": "World"
}
}
}
}
```
使用 TOML你可以肯定在时间和文件长度上会节省不少。很少有系统使用它或非常类似的东西作为配置这是它最大的缺点。根本没有很多语言或库可以用来解释 TOML。
### CSON: 特定系统所包含的简单样本
首先,有两个 CSON 规范。 一个代表 CoffeeScript Object Notation另一个代表 Cursive Script Object Notation。后者不经常使用所以我们不会关注它。我们只关注 CoffeeScript。
[CSON][10] 需要一点介绍。首先,我们来谈谈 CoffeeScript。[CoffeeScript][11] 是一种通过运行编译器生成 JavaScript 的语言。它允许你以更加简洁的语法编写 JavaScript 并[转译][12]成实际的 JavaScript然后你可以在你的 web 应用程序中使用它。CoffeeScript 通过删除 JavaScript 中必需的许多额外语法,使编写 JavaScript 变得更容易。CoffeeScript 摆脱的一个大问题是花括号 —— 不需要它们。同样CSON 是没有大括号的 JSON。它依赖于缩进来确定数据的层次结构。CSON 非常易于读写,并且通常比 JSON 需要更少的代码行,因为没有括号。
CSON 还提供一些 JSON 不提供的额外细节。多行字符串非常容易编写,你可以通过使用 `#` 符号开始一行来输入[注释][13],并且不需要用逗号分隔键值对。
```
books: [
id: 'bk102'
author: 'Crockford, Douglas'
title: 'JavaScript: The Good Parts'
genre: 'Computer'
price: 29.99
publish_date: '2008-05-01'
description: 'Unearthing the Excellence in JavaScript'
]
```
这是 CSON 的大问题。它是 <ruby>CoffeScript 对象表示法<rt>CoffeeScript Object Notation</rt></ruby>。也就是说你要用 CoffeeScript 解析/标记化/lex/转译或其它方式来使用 CSON。CoffeeScript 是读取数据的系统。如果数据序列化的目的是允许数据从一个系统传递到另一个系统,这里我们有一个只能由单个系统读取的数据序列化格式,这使得它与防火火柴、防水海绵或者叉匙恼人的脆弱叉子部分一样有用。
如果这种格式被其它系统也采用,那它在开发者世界中可能非常有用。但到目前为止这基本上没有发生,所以在 PHP 或 JAVA 等替代语言中使用它是不行的。
### YAML年轻人的呼喊
开发人员感到高兴,因为 YAML 来自[一个 Python 的贡献者][14]。YAML 具有与 CSON 相同的功能集和类似的语法,有一系列新功能,以及几乎所有 web 编程语言都可用的解析器。它还有一些额外的功能,如循环引用、软包装、多行键、类型转换标签、二进制数据、对象合并和[集合映射][15]。它具有非常好的可读性和可写性,并且是 JSON 的超集,因此你可以在 YAML 中使用完全合格的 JSON 语法并且一切正常工作。你几乎不需要引号,它可以解释大多数基本数据类型(字符串、整数、浮点数、布尔值等)。
```
books:
- id: bk102
author: Crockford, Douglas
title: 'JavaScript: The Good Parts'
genre: Computer
price: 29.99
publish_date: !!str 2008-05-01
description: Unearthing the Excellence in JavaScript
```
业界的年轻人正在迅速采用 YAML 作为他们首选的数据序列化和系统配置格式。他们这样做很机智。YAML 具有像 CSON 一样简洁的所有好处,以及与 JSON 一样的数据类型解释的所有功能。YAML 像加拿大人容易相处一样容易阅读。
YAML 有两个问题对我而言第一个是大问题。在撰写本文时YAML 解析器尚未内置于多种语言,因此你需要使用第三方库或扩展来为你选择的语言解析 .yaml 文件。这不是什么大问题,可似乎大多数为 YAML 创建解析器的开发人员都选择随机将“附加功能”放入解析器中。有些允许[标记化][16],有些允许[链引用][17],有些甚至允许内联计算。这一切都很好(某种意义上),只是这些功能都不是规范的一部分,因此很难在其他语言的其他解析器中找到。这导致系统限定,你最终遇到了与 CSON 相同的问题。如果你使用仅在一个解析器中找到的功能,则其他解析器将无法解释输入。大多数这些功能都是无意义的,不属于数据集,而是属于你的应用程序逻辑,因此最好简单地忽略它们和编写符合规范的 YAML。
第二个问题是很少有解析器完全实现规范。所有的基本要素都有,但是很难找到一些更复杂和更新的东西,比如软包装、文档标记和首选语言的循环引用。我还没有看到对这些东西的刚需,所以希望它们不让你很失望。考虑到上述情况,我倾向于保持 [1.1 规范][18] 中呈现的更成熟的功能集,而避免在 [1.2 规范][19] 中找到的新东西。然而,编程是一个不断发展的怪兽,所以当你读完这篇文章时,你或许就可以使用 1.2 规范了。
### 最终哲学
这是最后一段话。每个序列化语言都应该以个案标准的方式评价。当涉及机器的可读性时,有些<ruby>无出其右<rt>the bees knees</rt></ruby>。对于人类可读性,有些<ruby>名至实归<rt>the cats meow</rt></ruby>,有些只是<ruby>金玉其外<rt>gilded turds</rt></ruby>。以下是最终细分:如果你要编写供其他代码阅读的代码,请使用 YAML。如果你正在编写能写出供其他代码读取的代码的代码请使用 JSON。最后如果你正在编写将代码转译为供其他代码读取的代码的代码请重新考虑你的人生选择。
--------------------------------------------------------------------------------
via: https://www.zionandzion.com/json-vs-xml-vs-toml-vs-cson-vs-yaml/
作者:[Tim Anderson][a]
选题:[lujun9972][b]
译者:[GraveAccent](https://github.com/GraveAccent)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.zionandzion.com
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats
[2]: https://en.wikipedia.org/wiki/Standard_Generalized_Markup_Language#History
[3]: https://www.quirksmode.org/css/csshacks.html
[4]: http://www.ie6death.com/
[5]: https://en.wikipedia.org/wiki/Vacuum_tube
[6]: https://twitter.com/BrendanEich/status/773403975865470976
[7]: https://en.wikipedia.org/wiki/Parsing#Parser
[8]: https://en.wikipedia.org/wiki/Tom_Preston-Werner
[9]: https://en.wikipedia.org/wiki/INI_file
[10]: https://github.com/bevry/cson#what-is-cson
[11]: http://coffeescript.org/
[12]: https://en.wikipedia.org/wiki/Source-to-source_compiler
[13]: https://en.wikipedia.org/wiki/Comment_(computer_programming)
[14]: http://clarkevans.com/
[15]: http://exploringjs.com/es6/ch_maps-sets.html
[16]: https://www.tutorialspoint.com/compiler_design/compiler_design_lexical_analysis.htm
[17]: https://en.wikipedia.org/wiki/Fluent_interface
[18]: http://yaml.org/spec/1.1/current.html
[19]: http://www.yaml.org/spec/1.2/spec.html

View File

@ -1,41 +1,42 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-10663-1.html)
[#]: subject: (Get cooking with GNOME Recipes on Fedora)
[#]: via: (https://fedoramagazine.org/get-cooking-with-gnome-recipes-on-fedora/)
[#]: author: (Ryan Lerch https://fedoramagazine.org/introducing-flatpak/)
在 Fedora 上使用 GNOME Recipes 烹饪
======
![](https://fedoramagazine.org/wp-content/uploads/2019/03/gnome-recipes-816x345.jpg)
你喜欢烹饪吗?在 Fedora 中寻找管理食谱的更好方法么? GNOME Recipes 是一个非常棒的应用,可以在 Fedora 中安装,用于保存和组织你的食谱。
![][1]
GNOME Recipes 是 GNOME 项目中的食谱管理工具。它有现代 GNOME 应用的视觉风格,类似于 GNOME Software但它是对于食物
GNOME Recipes 是 GNOME 项目中的食谱管理工具。它有现代 GNOME 应用的视觉风格,类似于 GNOME “软件”,但它是针对食物的
### 安装 GNOME Recipes
Recipes 可从第三方 Flathub 仓库安装。如果你之前从未安装过 Flathub 的应用,请使用以下指南进行设置:
[Install Flathub apps on Fedora](https://fedoramagazine.org/install-flathub-apps-fedora/)
- [在 Fedora 上安装 Flathub 应用](https://fedoramagazine.org/install-flathub-apps-fedora/)
正确设置 Flathub 作为软件源后,你将能够通过 GNOME Software 搜索和安装 Recipes。
正确设置 Flathub 作为软件源后,你将能够通过 GNOME “软件”搜索和安装 Recipes。
### 食谱管理
Recipes 能让你手动添加自己的食谱集合,包括照片、配料,说明,以及额外的元数据,如准备时间、烹饪风格和辛辣程度。
Recipes 能让你手动添加自己的食谱集合,包括照片、配料、说明,以及更多的元数据,如准备时间、烹饪风格和辛辣程度。
![][2]
当输入新项时GNOME Recipes 有一系列不同的测量单位可供选择, 以及特殊的标签, 如温度等, 让你可以轻松地切换单位。
当输入新的食谱时GNOME Recipes 可为该食谱选择一系列不同的测量单位,如温度等,让你可以轻松地切换单位。
### 社区食谱
除了手动输入你喜欢的菜肴供你自己使用外,它还能让你查找、使用和贡献食谱给社区。此外,你可以标记你的收藏夹,并通过搜索集合的大量元数据查找菜谱。
除了手动输入你喜欢的菜肴供你自己使用外,它还能让你查找、使用和贡献食谱给社区。此外,你可以标记你的喜爱的食谱,并通过大量的食谱元数据搜索菜谱。
![][3]
@ -52,7 +53,7 @@ via: https://fedoramagazine.org/get-cooking-with-gnome-recipes-on-fedora/
作者:[Ryan Lerch][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@ -1,113 +0,0 @@
Modrisco is translating
10 Games You Can Play on Linux with Wine
======
![](https://www.maketecheasier.com/assets/uploads/2017/09/wine-games-feat.jpg)
Linux _does_ have games. It has a lot of them, actually. Linux is a thriving platform for indie gaming, and it 's not too uncommon for Linux to be supported on day one by top indie titles. In stark contrast, however, Linux is still largely ignored by the big-budget AAA developers, meaning that the games your friends are buzzing about probably won't be getting a Linux port anytime soon.
It's not all bad, though. Wine, the Windows compatibility layer for Linux, Mac, and BSD systems, is making huge strides in both the number of titles supported and performance. In fact, a lot of big name games now work under Wine. No, you won't get native performance, but they are playable and can actually run very well, depending on your system. Here are some games that it might surprise you can run with Wine on Linux.
### 10. World of Warcraft
![World of Warcraft Wine][1]
The venerable king of MMORPGs is still alive and going strong. Even though it might not be the most graphically advanced game, it still takes some power to crank all the settings up to max. World of Warcraft has actually worked under Wine for years. Until this latest expansion, WoW supported OpenGL for its Mac version, making it very easy to get working under Linux. That's not quite the case anymore.
You'll need to run WoW with DX9 and will definitely see some benefit from the [Gallium Nine][2] patches, but you can confidently make the switch over to Linux without missing raid night.
### 9. Skyrim
![Skyrim Wine][3]
Skyrim's not exactly new, but it's still fueled by a thriving modding community. You can now easily enjoy Skyrim and its many, many mods if you have a Linux system with enough resources to handle it all. Remember that Wine uses more system power than running the game natively, so account for that in your mod usage.
### 8. StarCraft II
![StarCraft II Wine][4]
StarCraft II is easily one of the most popular RTS games on the market and works very well under Wine. It is actually one of the best performing games under Wine. That means that you can play your favorite RTS on Linux with minimal hassle and near-native performance.
Given the competitive nature of this game, you obviously need the game to run well. Have no fear there. You should have no problem playing competitively with adequate hardware.
This is an instance where you'll benefit from the "staging" patches, so continue using them when you're getting the game set up.
### 7. Fallout 3/New Vegas
![Fallout 3 Wine][5]
Before you ask, Fallout 4 is on the verge of working. At the time you're reading this, it might. For now, though, Fallout 3 and New Vegas both work great, both with and without mods. These games run very well under Wine and can even handle loads of mods to keep them fresh and interesting. It doesn't seem like a bad compromise to hold you over until Fallout 4 support matures.
### 6. Doom (2016)
![Doom Wine][6]
Doom is one of the most exciting shooters of the past few years, and it run very well under Wine with the latest versions and the "staging" patches. Both single player and multiplayer work great, and you don't need to spend loads of time configuring Wine and tweaking settings. Doom just works. So, if you're looking for a brutal AAA shooter on Linux, consider giving Doom a try.
### 5. Guild Wars 2
![Guild Wars 2 Wine][7]
Guild War 2 is a sort-of hybrid MMO/dungeon crawler without a monthly fee. It's very popular and boasts some really innovative features for the genre. It also runs smoothly on Linux with Wine.
Guild Wars 2 isn't some ancient MMO either. It's tried to keep itself modern graphically and has fairly high resolution textures and visual effects for the genre. All of it looks and works very well under Wine.
### 4. League Of Legends
![League Of Legends Wine][8]
There are two top players in the MOBA world: DoTA2 and League of Legends. Valve ported DoTA2 to Linux some time ago, but League of Legends has never been made available to Linux gamers. If you're a Linux user and a fan of League, you can still play your favorite MOBA through Wine.
League of Legends is an interesting case. The game itself runs fine, but the installer breaks because it requires Adobe Air. There are some installer scripts available from Lutris and PlayOnLinux that get you through the process. Once it's installed, you should have no problem running League and even playing it smoothly in competitive situations.
### 3. Hearthstone
![HearthStone Wine][9]
Hearthstone is a popular and addictive free-to-play digital card game that's available on a variety of platforms … except Linux. Don't worry, it works very well in Wine. Hearthstone is such a lightweight game that it's actually playable through Wine on even the lowest powered systems. That's good news, too, but because Hearthstone is another competitive game where performance matters.
Hearthstone doesn't require any special configuration or even patches. It just works.
### 2. Witcher 3
![Witcher 3 Wine][10]
If you're surprised to see this one here, you're not alone. With the latest "staging" patches, The Witcher 3 finally works. Despite originally being promised a native release, Linux gamers have had to wait a good long while to get the third installment in the Witcher franchise.
Don't expect everything to be perfect just yet. Support for Witcher 3 is _very_ new, and some things might not work as expected. That said, if you only have Linux to game on, and you 're willing to deal with a couple of rough edges, you can enjoy this awesome game for the first time with few, if any, troubles.
### 1. Overwatch
![Overwatch Wine][11]
Finally, there's yet another "white whale" for Linux gamers. Overwatch has been an elusive target that many feel should have been working on Wine since day one. Most Blizzard games have. Overwatch was a very different case. It only ever supported DX11, and that was a serious pain point for Wine.
Overwatch doesn't have the best performance yet, but you can definitely still play Blizzard's wildly popular shooter using a specially-patched version of Wine with the "staging" patches and additional ones just for Overwatch. That means Linux gamers wanted Overwatch so bad that they developed a special set of patches for it.
There were certainly games left off of this list. Most were just due to popularity or only conditional support under Wine. Other Blizzard games, like Heroes of the Storm and Diablo III also work, but this list would have been even more dominated by Blizzard, and that's not the point.
If you're going to try playing any of these games, consider using the "staging" or [Gallium Nine versions][2] of Wine. Many of the games here won't work without them. Even still, the latest patches and improvements land in "staging" long before they make it into the mainstream Wine release. Using it will keep you on the leading edge of progress.
Speaking of progress, right now Wine is making massive strides in DirectX11 support. While that doesn't mean much to Windows gamers, it's a huge deal for Linux. Most new games support DX11 and DX12, and until recently Wine only supported DX9. With DX11 support, Wine is gaining support for loads of games that were previously unplayable. So keep checking regularly to see if your favorite games from Windows started working in Wine. You might be very pleasantly surprised.
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/games-play-on-linux-with-wine/
作者:[Nick Congleton][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/nickcongleton/
[1]:https://www.maketecheasier.com/assets/uploads/2017/09/wow.jpg (World of Warcraft Wine)
[2]:https://www.maketecheasier.com/install-wine-gallium-nine-linux
[3]:https://www.maketecheasier.com/assets/uploads/2017/09/skyrim.jpg (Skyrim Wine)
[4]:https://www.maketecheasier.com/assets/uploads/2017/09/sc2.jpg (StarCraft II Wine)
[5]:https://www.maketecheasier.com/assets/uploads/2017/09/Fallout_3.jpg (Fallout 3 Wine)
[6]:https://www.maketecheasier.com/assets/uploads/2017/09/doom.jpg (Doom Wine)
[7]:https://www.maketecheasier.com/assets/uploads/2017/09/gw2.jpg (Guild Wars 2 Wine)
[8]:https://www.maketecheasier.com/assets/uploads/2017/09/League_of_legends.jpg (League Of Legends Wine)
[9]:https://www.maketecheasier.com/assets/uploads/2017/09/HearthStone.jpg (HearthStone Wine)
[10]:https://www.maketecheasier.com/assets/uploads/2017/09/witcher3.jpg (Witcher 3 Wine)
[11]:https://www.maketecheasier.com/assets/uploads/2017/09/Overwatch.jpg (Overwatch Wine)

View File

@ -1,11 +1,3 @@
[#]: collector: (lujun9972)
[#]: translator: (runningwater)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What a shell dotfile can do for you)
[#]: via: (https://opensource.com/article/18/9/shell-dotfile)
[#]: author: (H.Waldo Grunenwald https://opensource.com/users/gwaldo)
What a shell dotfile can do for you
======
@ -231,7 +223,7 @@ via: https://opensource.com/article/18/9/shell-dotfile
作者:[H.Waldo Grunenwald][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[runningwater](https://github.com/runningwater)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

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

View File

@ -1,52 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (sanfusu)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Blockchain 2.0: Revolutionizing The Financial System [Part 2])
[#]: via: (https://www.ostechnix.com/blockchain-2-0-revolutionizing-the-financial-system/)
[#]: author: (EDITOR https://www.ostechnix.com/author/editor/)
Blockchain 2.0: Revolutionizing The Financial System [Part 2]
======
This is the second part of our [**Blockchain 2.0**][1] series. The blockchain can transform how individuals and institutions deal with their finances. This post looks at how the existing monetary system evolved and how new blockchain systems are bringing in change as the next crucial step in the evolution of money.
Two key ideas will lay the foundation for this article. **PayPal** , when it was launched, was revolutionary in terms of its operation. The company would gather, process and confirm massive amounts of consumer data to facilitate online transactions of all kinds, virtually allowing platforms such as eBay to grow into trustful sources for commerce, and laying the benchmark for digital payment systems worldwide. The second, albeit much more important key idea to be highlighted here, is a somewhat existential question. We all use money or rather currency for our day-to-day needs. A ten-dollar bill will get you a cup or two from your favorite coffee shop and get you a head start on your day for instance. We depend on our respective national currencies for virtually everything.
Sure, mankind has come a long way since the **barter system** ruled what you ate for breakfast, but still, what exactly is currency? Who or what gives it its a value? And as the popular rumor suggests, does going to a bank and giving them a dollar bill actually get you the true value of whatever that currency “token” stands for?
The answer to most of those questions doesnt exist. If they do, theyll to be undependably vague and subjective at best. Back in the day when civilization started off establishing small cities and towns, the local currency deemed legal by the guy who ruled over them, was almost always made of something precious to that community. Indians are thought to have transacted in peppercorns while ancient Greeks and Romans in **salt** [1]. Gradually most of these little prehistoric civilizations adopted precious metals and stones as their tokens to transact. Gold coins, silver heirlooms, and rubies became eponymous with “value”. With the industrial revolution, people started printing these tokens of transaction and we finally seemed to have found our calling in paper currencies. They were dependable and cheap to produce and as long as a nation-state guaranteed its users that the piece of paper, they were holding was just a token for an amount of “value” they had and as long as they were able to show them that this value when demanded could be supported with precious substances such as gold or hard assets, people were happy to use them. However, if you still believe that the currency note you hold in your hand right now has the same guarantee, youre wrong. We currently live in an age where almost all the major currencies in circulation around the globe are what economists would call a **fiat currency** [2]. Value-less pieces of paper that are only backed by the guarantees of the nation-state youre residing in. The exact nature of fiat currencies and why they may possibly be a flawed system falls into the domain of economics and we wont get into that now.
In fact, the only takeaway from all of this history that is relevant to this post is that civilizations started using tokens that hinted or represented value for trading goods and services rather than the non-practical barter system. Tokens. Naturally, this is the crucial concept behind cryptocurrencies as well. They dont have any inherent value attached to them. Their value is tied to the number of people adopting that particular platform, the trust the adopters have on the system, and of course if released by a supervising entity, the background of the entity itself. The high price and market cap of **Bitcoin (BTC)** isnt a coincidence, they were among the first in business and had a lot of early adopters. This ultimate truth behind cryptocurrencies is what makes it so important yet so unforgivingly complex to understand. Its the natural next step in the evolution of “money”. Some understand this and some still like to think of the solid currency concept where “real” money is always backed by something of inherent value.[3] Though there have been countless debates and studies on this dilemma, there is no looking back from a blockchain powered future.
For instance, the country of **Ecuador** made headlines in 2015 for its purported plans to develop and release **its own national cryptocurrency** [4]. Albeit the attempt officially was to aid and support their existing currency system. Since then other countries and their regulatory bodies have or are drafting up papers to control the “epidemic” that is cryptocurrency with some already having published frameworks to the extent of creating a roadmap for blockchain and crypto development. **Germany** is thought to be investing in a long term blockchain project to streamline its taxation and financial systems[5]. Banks in developing countries are joining in on something called a Bank chain, cooperating in creating a **private blockchain** to increase efficiency in and optimize their operations
Now is when we tie both the ends of the stories together, remember the first mention of PayPal before the casual history lesson? Experts have compared Bitcoins (BTC) adoption rate with that of PayPal when it was launched. Initial consumer hesitation, where only a few early adopters are ready to jump into using the said product and then all a wider adoption gradually becoming a benchmark for similar platforms. Bitcoin (BTC) is already a benchmark for similar cryptocurrency platforms with major coins such as **Ethereum (ETH)** and **Ripple (XRP)** [6]. Adoption is steadily increasing, legal and regulatory frameworks being made to support it, and active research and development being done on the front as well. And not unlike PayPal, experts believe that cryptocurrencies and platforms utilizing blockchain tech for their digital infrastructure will soon become the standard norm rather than the exception.
Although the rise in cryptocurrency prices in 2018 can be termed as an economic bubble, companies and governments have continued to invest as much or more into the development of their own blockchain platforms and financial tokens. To counteract and prevent such an incident in the future while still looking forward to investing in the area, an alternative to traditional cryptocurrencies called **stablecoins** have made the rounds recently.
Financial behemoth **JP Morgan** came out with their own enterprise ready blockchain solution called **Quorum** handling their stablecoin called **JPM Coin** [7]. Each such JPM coin is tied to 1 USD and their value is guaranteed by the parent organization under supporting legal frameworks, in this case, JP Morgan. Platforms such as this one make it easier for large financial transactions to the tunes of millions or billions of dollars to be transferred instantaneously over the internet without having to rely on conventional banking systems such as SWIFT which involve lengthy procedures and are themselves decades old.
In the same spirit of making the niceties of the blockchain available for everyone, The Ethereum platform allows 3rd parties to utilize their blockchain or derive from it to create and administer their own takes on the triad of the **Blockchain-protocol-token** system thereby leading to wider adoption of the standard with lesser work on its foundations.
The blockchain allows for digital versions of existing financial instruments to be created, recorded, and traded quickly over a network without the need for third-party monitoring. The inherent safety and security features of the system makes the entire process totally safe and immune to fraud and tampering, basically the only reason why third-party monitoring was required in the sector. Another area where governmental and regulatory bodies presided over when it came to financial services and instruments were in regards to transparency and auditing. With blockchain banks and other financial institutes will be able to maintain a fully transparent, layered, almost permanent and tamper-proof record of all their transactions rendering auditing tasks near useless. Much needed developments and changes to the current financial system and services industry can be made possible by exploiting blockchains. The platform being distributed, tamper-proof, near permanent, and quick to execute is highly valuable to bankers and government regulators alike and their investments in this regard seem to be well placed[8].
In the next article of the series, we see how companies are using blockchains to deliver the next generation of financial services. Looking at individual firms creating ripples in the industry, we explore how the future of a blockchain backed economy would look like.
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/blockchain-2-0-revolutionizing-the-financial-system/
作者:[EDITOR][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/editor/
[b]: https://github.com/lujun9972
[1]: https://www.ostechnix.com/blockchain-2-0-an-introduction/

View File

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

View File

@ -0,0 +1,112 @@
10款你可以通过Wine在Linux上玩的游戏
======
![](https://www.maketecheasier.com/assets/uploads/2017/09/wine-games-feat.jpg)
Linux _确实_ 能玩游戏,而且还能玩不少游戏。独立游戏在 Linux 平台上蓬勃发展,顶级的独立游戏也常常会在发售首日便发布 Linux 版本。然而3A 游戏大作的开发者们却常常忽略 Linux所以你不会很快就能玩上身边朋友们口中正火的那些游戏。
但情况还没有糟透。Wine —— 一个能使 Windows 应用在类似 Linux, BSD 和 OS X 上运行的兼容层,在支持的游戏数量和性能表现上都取得了巨大进步。很多游戏大作都可以在 Wine 的支持下运行。你不能完全释放本机性能,但还是可以跑起来游戏,运行也还算流畅,当然这也要取决与你的系统配置。下面我们来盘点一下这些可能会令你大吃一惊的可以通过 Wine 在 Linux 上玩的游戏。
### 10. 魔兽世界
![World of Warcraft Wine][1]
这款经典的 MMORPG 之王仍旧坚挺并保持活力。虽然这不是一款以画面见长的游戏,但想要开到全画质也需要费一些功夫。魔兽世界已经在 Wine 的支持下运行了很多年。到了最新资料片发布时,魔兽世界为它的 Mac 版本提供了 OpenGL 支持,使得游戏也可以很轻松地在 Linux 下运行。这已经不再是个问题了。
你需要通过 DX9 来运行游戏并从 [Gallium Nine][2] 补丁来获得一些性能提升,不过你也可以放心大胆地在 Linux 中下副本了。
### 9. 上古卷轴 5天际
![Skyrim Wine][3]
上古卷轴 5 已经不是款新游戏了,但它的 mod 社区依旧活跃。如果你的 Linux 系统有足够资源的话,你可以很轻松地加上很多很多 mod。需要记住的是 Wine 运行时要比游戏占用更多的系统资源,所以使用 mod 时也要考虑这一点。
### 8. 星际争霸 II
![StarCraft II Wine][4]
星际争霸 II 是成为市场上最受欢迎的 RTS 游戏之一,并且在 Wine 下运作良好。它实际上也是 Wine 下表现最好的游戏之一。
考虑到这款游戏本身的竞技性,你当然希望游戏能够流畅地运行。不过不用担心,只要你的硬件够用就绝对没问题。
这是一个你可以从 “staging” 补丁获益的例子,所以在你设置游戏时请继续使用它们。
### 7. 辐射3 / 辐射:新维加斯
![Fallout 3 Wine][5]
在你提问之前,辐射 4 已经很快就准备就绪,也许就在你正读这篇文章的时候就可以玩了。就目前而言,辐射 3 和 辐射:新维加斯都能在有无 mod 的情况下良好运行。这些游戏在 Wine 下运行地非常好,甚至还能加载大量 mod 来保持游戏的新鲜性和趣味性。在辐射 4 获得全面支持前玩这些旧作也不算是个很大的妥协。
### 6. Doom (2016)
![Doom Wine][6]
Doom毁灭战士是过去几年中最刺激的射击游戏之一。在 Wine 支持下并加载 “staging” 补丁可以流畅地运行最新版本。单人模式和多人模式都有很棒的游戏体验,而且也不需要花费大量时间来配置 Wine 和调整设置。所以你想在 Linux 上体验 3A 级射击游戏的话,不妨尝试一下 Doom 。
### 5. 激战 2
![Guild Wars 2 Wine][7]
激战 2 是一款无月卡(买断制)的融合了多人和迷宫探险元素的游戏。它在市场上很受欢迎,并自称在游戏中有着很多创新。你同样可以通过 Wine 在 Linux 上玩到这款游戏。
激战 2 也不算一款很老的 MMO 游戏。它试图以图像表现来保持现代风格,并具有着相当高分辨率的纹理和视觉效果。所有这些特点都能在 Wine 下顺利运行。
### 4. 英雄联盟
![League Of Legends Wine][8]
在 MOBA 游戏的世界中有两个强者DoTA2 和英雄联盟。Valve 已经将 DoTA2 移植到 Linux 上很久了,但玩家们却从没在 Linux 上玩过英雄联盟。如果你是 Linux 的使用者并热衷英雄联盟,你还是可以通过 Wine 来玩这款你最爱的 MOBA 游戏。
英雄联盟是个很有趣的例子。它的游戏本身运行良好,但安装程序却会因为需要 Adobe Air 而中断。一些安装程序脚本例如 Lutris 和 PlayOnLinux 能帮你通过这一步骤。一旦安装完毕,你就可以毫无困难地运行游戏,甚至在激烈的战况中依旧畅快玩耍。
### 3. 炉石传说
![HearthStone Wine][9]
炉石传说是一款流行且令人上瘾的免费卡牌游戏,你可在各种平台上来一局......除了 Linux。不过别担心在 Wine 中你可以轻松玩到这款游戏。炉石并不大,所以即使在最低配置的系统里也都能玩,这是个好消息。不过由于它的竞技性所以还是要对游戏性能有一定要求。
玩炉石不需要任何特殊配置和补丁,直接开玩!
### 2. 巫师3
![Witcher 3 Wine][10]
你不是唯一一个对在这份榜单中看到了巫师 3 而感到吃惊的人。在最新版 “stage” 补丁的支持下,你终于可以在 Linux 中体验这款游戏了。尽管最初承诺会有原生版本,但 Linux 玩家还是等了很久才迎来了巫师系列的第三部。
不过最好不要指望一切都能完美运行。巫师 3 _刚刚_ 得到支持,有些内容可能还不会达到预期。也就是说,如果你只能用 Liux 来玩游戏,并且愿意处理一些问题。那么你也可以享受到这款完美游戏带来的初体验了。
### 1. 守望先锋
![Overwatch Wine][11]
最后,让我们来谈谈 Linux 玩家心中的另一个“白鲸”。很多人认为守望先锋会像大多数暴雪游戏一样,在发售当日就能在 Wine 上获得支持。不过情况非常不同,因为守望先锋只支持 DX11这也正是 Wine 面临的一个痛点。
守望先锋目前还不能拥有最佳性能表现,但是你还是可以通过装有特殊补丁的 Wine 和包括“staging”在内的一系列定制补丁包来运行游戏。这也说明了 Linux 玩家们真的很渴望游玩这款游戏,以至于自己开发了一套补丁来为它提供支持。
这份榜单当然会遗漏一些其他游戏。大多数是由于受欢迎程度或只能从 Wine 中得到有限的支持。其他暴雪游戏,如“风暴英雄”和“暗黑破坏神 3”也能很好地运行但这样来写就会使暴雪游戏霸占这份榜单这不是我们想突出的重点。
如果你正打算玩以上任一款游戏,请使用 Wine 的 [Gallium Nine versions][2] 版本并装载“staging”补丁否则游戏可能无法正常运行。“staging”中装载的最新补丁和提升要比正式的 Wine 发行版提供的内容要早很多,使用它会令你在性能上处于领先地位。
说到进步Wine 目前在对 DirectX11 的支持有了很大进步。对于 Windows 玩家这可能不算什么,但对于 Linux 玩家来说绝对算是一件大事。大多数游戏新作支持 DX11 和 DX12而最新版本的 Wine 仍只是支持 DX9。有了 DX11 的支持Wine 将会让很多过去无法在 Linux 上玩的游戏运行起来。所以,定期查看你最喜欢的 Windows 游戏是否也可以开始在 Wine 上运行,你可能会非常惊喜。
--------------------------------------------------------------------------------
via: https://www.maketecheasier.com/games-play-on-linux-with-wine/
作者:[Nick Congleton][a]
译者:[Modrisco](https://github.com/Modrisco)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:https://www.maketecheasier.com/author/nickcongleton/
[1]:https://www.maketecheasier.com/assets/uploads/2017/09/wow.jpg (World of Warcraft Wine)
[2]:https://www.maketecheasier.com/install-wine-gallium-nine-linux
[3]:https://www.maketecheasier.com/assets/uploads/2017/09/skyrim.jpg (Skyrim Wine)
[4]:https://www.maketecheasier.com/assets/uploads/2017/09/sc2.jpg (StarCraft II Wine)
[5]:https://www.maketecheasier.com/assets/uploads/2017/09/Fallout_3.jpg (Fallout 3 Wine)
[6]:https://www.maketecheasier.com/assets/uploads/2017/09/doom.jpg (Doom Wine)
[7]:https://www.maketecheasier.com/assets/uploads/2017/09/gw2.jpg (Guild Wars 2 Wine)
[8]:https://www.maketecheasier.com/assets/uploads/2017/09/League_of_legends.jpg (League Of Legends Wine)
[9]:https://www.maketecheasier.com/assets/uploads/2017/09/HearthStone.jpg (HearthStone Wine)
[10]:https://www.maketecheasier.com/assets/uploads/2017/09/witcher3.jpg (Witcher 3 Wine)
[11]:https://www.maketecheasier.com/assets/uploads/2017/09/Overwatch.jpg (Overwatch Wine)

View File

@ -1,212 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (GraveAccent)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (JSON vs XML vs TOML vs CSON vs YAML)
[#]: via: (https://www.zionandzion.com/json-vs-xml-vs-toml-vs-cson-vs-yaml/)
[#]: author: (Tim Anderson https://www.zionandzion.com)
JSON vs XML vs TOML vs CSON vs YAML
======
### 一段超级严肃的关于样本序列化的集合、子集和超集的文字
我是开发者。我读代码。我写代码。我写会写代码的代码。我写会写供其它代码读的代码的代码。这些都非常火星语,但是有其美妙之处。然而,最后一点,写会写供其它代码读的代码的代码,可以很快变得比这段文字更费解。有很多方法可以做到这一点。一种不那么复杂而且开发者社区最爱的方式是数据序列化。对于那些不了解我刚刚向你抛的时髦词的人,数据序列化是从一个系统获取一些信息,将其转换为其它系统可以读取的格式,然后将其传递给其它系统的过程。
虽然[数据序列化格式][1]多到可以埋葬哈利法塔,但它们大多分为两类:
* 易于人类读写,
* 易于机器读写。
很难两全其美,因为人类喜欢让我们更具表现力的松散类型和灵活格式标准,而机器倾向于被确切告知一切事情不带疑惑和细节缺失,并且认为“严格规范”是他们最爱的 Ben & Jerry's 口味。
由于我是一名 web 开发者而且我们是一个创建网站的代理商,我们将坚持使用 web 系统可以理解或不需要太多努力就能理解以及对人类可读性特别有用的特殊格式XMLJSONTOMLCSON以及 YAML。每个都有各自的优缺点和适当的用例。
### 事实最先
回到互联网的早期,[一些非常聪明的家伙][2]决定整合一种标准语言即每个系统都能理解创造性地将其命名为标准通用标记语言简称SGML。SGML 非常灵活,发布者也很好地定义了它。他成为了 XMLSVG 和 HTML 等语言之父。所有这三个都符合 SGML 规范,可是它们都是规则更严格、灵活性更少的子集。
最终人们开始看到大量非常小、简洁、易读且易于生成的数据这些数据可以在系统之间以程序的方式共享而开销很小。大约在那个时候JSON 诞生了并且能够满足所有的需求。反过来,其它语言开始出现以处理更多的专业用例,如 CSONTOML 和 YAML。
### XML: 不行了
最初XML语言非常灵活且易于编写但它的缺点是冗长人类难以阅读计算机非常难以读取并且有很多语法对于传达信息并不是完全必要的。
今天,它在 web 上的数据序列化目的已经消失了。除非你在编写 HTML 或者 SVG否则你不太能在许多其它地方看到XML。一些过时的系统今天仍在使用它但是用它传递数据往往太重了。
我已经可以听到 XML 老人开始在他们的石碑上乱写为什么 XML 是了不起的所以我将提供一个小的附录XML可以很容易地由系统和人读写。然而真的我的意思是荒谬很难创建一个可以将其读入规范的系统。这是一个简单美观的 XML 示例:
```
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
```
太棒了。易于阅读,推理,编写和编码的可以读写的系统。但请考虑这个例子:
```
<!DOCTYPE r [ <!ENTITY y "a]>b"> ]>
<r>
<a b="&y;>" />
<![CDATA[[a>b <a>b <a]]>
<?x <a> <!-- <b> ?> c --> d
</r>
```
这上面是 100% 有效的 XML。不可能阅读、理解或推理。编写可以使用和理解这个的代码将花费至少36头的头发和248磅咖啡。我们没有那么多时间或咖啡而且我们大多数老人现在都是秃头。所以让它活在我们的记忆里就像 [css hacks][3][internet explorer][4] 和[真空管][5]那样。
### JSON: 并列聚会
好吧我们都同意了。XML = 差劲。那么什么是好的替代品JavaScript 对象表示法,简称 JSON。JSON读起来像 Jason 这个名字) 是 Brendan Eich 发明的,并且被 [JavaScript 的荷兰叔叔][6] Douglas Crockford 推广。它现在几乎用在任何地方。这种格式很容易由人和机器编写,相当容易用规范中的严格规则[解析][7],并且灵活-允许深层嵌套数据所有原始数据类型和集合如数组和对象的解释。JSON 成为了将数据从一个系统传输到另一个系统的事实标准。几乎所有语言都有内置读写它的功能。
JSON语法很简单。 方括号表示数组,花括号表示记录,由冒号分隔两个值表示属性(或“键”)在左边,值在右边。所有键必须用双引号括起来:
```
{
"books": [
{
"id": "bk102",
"author": "Crockford, Douglas",
"title": "JavaScript: The Good Parts",
"genre": "Computer",
"price": 29.99,
"publish_date": "2008-05-01",
"description": "Unearthing the Excellence in JavaScript"
}
]
}
```
这对你来说应该是完全合理的。它简洁明了,并且从 XML 中删除了大量额外废话以传达相同数量的信息。JSON 现在是王道,本文剩下的部分会介绍其它语言格式,这些格式只不过是煮沸了的 JSON尝试让其更简洁或更易读可结构还是非常相似的。
### TOML: 缩短到彻底的利他主义
TOMLTom 的显而易见最低限度语言)允许快速简洁地定义深层嵌套的数据结构。名字中的名字是指发明者 [Tom Preston Werner][8],他是一位活跃于我们行业的创造者和软件开发人员。与 JSON 相比,语法有点尴尬,更类似 [ini 文件][9]。这不是一个糟糕的语法,但是需要一些时间适应。
```
[[books]]
id = 'bk101'
author = 'Crockford, Douglas'
title = 'JavaScript: The Good Parts'
genre = 'Computer'
price = 29.99
publish_date = 2008-05-01T00:00:00+00:00
description = 'Unearthing the Excellence in JavaScript'
```
TOML 中集成了一些很棒的功能例如多行字符串保留字符的自动转义日期时间整数浮点数科学记数法和“表扩展”等数据类型。最后一点是特别的是TOML如此简洁的原因
```
[a.b.c]
d = 'Hello'
e = 'World'
```
以上扩展到以下内容:
```
{
"a": {
"b": {
"c": {
"d": "Hello"
"e": "World"
}
}
}
}
```
使用TOML你可以肯定在时间和文件长度上会节省不少。很少有系统使用它或非常类似的东西作为配置这是它最大的缺点。根本没有很多语言或库可以用来解释 TOML。
### CSON: 特定系统所包含的简单样本
首先,有两个 CSON 规范。 一个代表 CoffeeScript Object Notation另一个代表 Cursive Script Object Notation。后者不经常使用所以我们不会关注它。我们只关注 CoffeeScript。
[CSON][10] 会介绍一点。首先,我们来谈谈 CoffeeScript。[CoffeeScript][11] 是一种通过运行编译器生成 JavaScript 的语言。它允许你以更加简洁的语法编写 JavaScript 并[转译][12]成实际的 JavaScript然后你可以在你的 web 应用程序中使用它。CoffeeScript 通过删除 JavaScript 中必需的许多额外语法,使编写 JavaScript 变得更容易。CoffeeScript 摆脱的一个大问题是花括号 - 不需要他们。同样CSON 是没有大括号的 JSON。它依赖于缩进来确定数据的层次结构。CSON 非常易于读写,并且通常比 JSON 需要更少的代码行,因为没有括号。
CSON 还提供一些 JSON 不提供的额外细节。多行字符串非常容易编写,你可以通过使用 hash 符号开始一行来输入[注释][13],并且不需要用逗号分隔键值对。
```
books: [
id: 'bk102'
author: 'Crockford, Douglas'
title: 'JavaScript: The Good Parts'
genre: 'Computer'
price: 29.99
publish_date: '2008-05-01'
description: 'Unearthing the Excellence in JavaScript'
]
```
这是 CSON 的重大问题。它是 **CoffeScript** 对象表示法。也就是说你用 CoffeeScript 解析/标记化/lex/转译或其它方式使用 CSON。CoffeeScript 是读取数据的系统。如果数据序列化的目的是允许数据从一个系统传递到另一个系统,这里我们有一个只能由单个系统读取的数据序列化格式,这使得它与防火的火柴、防水的海绵或者叉勺恼人的脆弱分叉处一样有用。
如果其它系统采用这种格式,它在开发者世界中可能非常有用。到目前为止这整体上没有发生,所以在 PHP 或 JAVA 等替代语言中使用它是不行的。
### YAML:年轻人的呼喊
开发人员感到高兴,因为 YAML 来自[一个 Python 的贡献者][14]。YAML 具有与 CSON 相同的功能集和类似的语法,一系列新功能,以及几乎所有 web 编程语言都可用的解析器。它还有一些额外的功能,如循环引用,软包装,多行键,类型转换标签,二进制数据,对象合并和[集合映射][15]。它具有令人难以置信的良好的可读性和可写性,并且是 JSON 的超集,因此你可以在 YAML 中使用完全合格的 JSON 语法并且一切正常工作。你几乎从不需要引号,它可以解释大多数基本数据类型(字符串,整数,浮点数,布尔值等)。
```
books:
- id: bk102
author: Crockford, Douglas
title: 'JavaScript: The Good Parts'
genre: Computer
price: 29.99
publish_date: !!str 2008-05-01
description: Unearthing the Excellence in JavaScript
```
业界的年轻人正在迅速采用 YAML 作为他们首选的数据序列化和系统配置格式。他们这样做很机智。YAML 有像 CSON 一样简洁带来的所有好处,有 JSON 在数据类型解释方面的所有功能。YAML 像加拿大人容易相处一样容易阅读。
YAML 有两个问题对我而言第一个是大问题。在撰写本文时YAML 解析器尚未内置于多种语言,因此你需要使用第三方库或扩展来为你选择的语言解析 .yaml 文件。这不是什么大问题,可似乎大多数为 YAML 创建解析器的开发人员都选择随机将“附加功能”放入解析器中。有些允许[标记化][16],有些允许[链引用][17],有些甚至允许内联计算。这一切都很好(某种意义上),除了这些功能都不是规范的一部分,因此很难在其他语言的其他解析器中找到。这导致系统锁定,你最终遇到了与 CSON 相同的问题。如果你使用仅在一个解析器中找到的功能,则其他解析器将无法解释输入。大多数这些功能都是无意义的,不属于数据集,而是属于你的应用程序逻辑,因此最好简单地忽略它们和编写符合规范的 YAML。
第二个问题是很少有解析器完全实现规范。所有的基本要素都在那里,但是很难找到一些更复杂和更新的东西,比如软包装,文档标记和首选语言的循环引用。我还没有看到对这些东西的刚需,所以希望它们不让你很失望。考虑到上述情况,我倾向于保持 [1.1 规范][18] 中呈现的更成熟的功能集,避免在 [1.2 规范][19] 中找到的新东西。然而,编程是一个不断发展的怪兽,所以当你读完这篇文章时,你或许可以使用 1.2 规范。
### 最终哲学
这是最后一段话。每个序列化语言都应该以其用例的标准评价。当涉及机器的可读性时,有些是蜜蜂的膝盖。对于人类可读性,有些是猫的喵喵声,有些只是镀金的粪便。以下是最终细分:如果你要编写供其他代码阅读的代码,请使用 YAML。如果你正在编写能写供其他代码读取的代码的代码请使用 JSON。最后如果你正在编写将代码转译为供其他代码读取的代码的代码请重新考虑你的人生选择。
--------------------------------------------------------------------------------
via: https://www.zionandzion.com/json-vs-xml-vs-toml-vs-cson-vs-yaml/
作者:[Tim Anderson][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/GraveAccent)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.zionandzion.com
[b]: https://github.com/lujun9972
[1]: https://en.wikipedia.org/wiki/Comparison_of_data_serialization_formats
[2]: https://en.wikipedia.org/wiki/Standard_Generalized_Markup_Language#History
[3]: https://www.quirksmode.org/css/csshacks.html
[4]: http://www.ie6death.com/
[5]: https://en.wikipedia.org/wiki/Vacuum_tube
[6]: https://twitter.com/BrendanEich/status/773403975865470976
[7]: https://en.wikipedia.org/wiki/Parsing#Parser
[8]: https://en.wikipedia.org/wiki/Tom_Preston-Werner
[9]: https://en.wikipedia.org/wiki/INI_file
[10]: https://github.com/bevry/cson#what-is-cson
[11]: http://coffeescript.org/
[12]: https://en.wikipedia.org/wiki/Source-to-source_compiler
[13]: https://en.wikipedia.org/wiki/Comment_(computer_programming)
[14]: http://clarkevans.com/
[15]: http://exploringjs.com/es6/ch_maps-sets.html
[16]: https://www.tutorialspoint.com/compiler_design/compiler_design_lexical_analysis.htm
[17]: https://en.wikipedia.org/wiki/Fluent_interface
[18]: http://yaml.org/spec/1.1/current.html
[19]: http://www.yaml.org/spec/1.2/spec.html

View File

@ -0,0 +1,53 @@
[#]: collector: (lujun9972)
[#]: translator: (sanfusu)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Blockchain 2.0: Revolutionizing The Financial System [Part 2])
[#]: via: (https://www.ostechnix.com/blockchain-2-0-revolutionizing-the-financial-system/)
[#]: author: (EDITOR https://www.ostechnix.com/author/editor/)
区块链2.0:金融体系改革[第2部分]
======
这是我们[**Blockchain 2.0**] [1]系列的第二部分。区块链可以改变个人和机构处理他们财务状况的方式。本文着眼于现有货币体系如何演变以及新的区块链系统如何为货币演变的下一个关键步骤带来改变。
两个关键思想将为本文奠定基础。 **PayPal** 在推出之时,其运营操作上具有革命性。该公司将收集,处理和确认大量的消费者数据,以促进各种在线交易,从而切实允许 eBay 等平台成长为可信赖的商业来源,并为全球数字支付系统奠定基准。其二,虽然是要强调的更为重要的关键思想,但却是一个存在性问题。我们都使用金钱或货币来满足我们的日常需求。一张 10 美元的账单可以让你从最喜欢的咖啡店买到一两杯咖啡,从而开始美好的一天。事实上,我们各方面都依赖于各自的国家货币。
当然,自从**易货系统**开始决定你的早餐是什么起,人类已经度过了漫长的时间。但是,货币到底是什么?谁或什么赋予它的价值?正如流行的谣言所说,去银行并给他们一美元钞票就可以获得货币“符号”所代表的真正价值吗?
大多数问题的答案都不存在。如果他们这样做,他们最多将是不可思议的模糊和主观。早在文明开始建立小城镇的那一天,本地货币被统治者认为合法是合法货币,并且几乎总是由那个社区中宝贵的东西组成。人们认为印第安人使用干胡椒进行交易,而古希腊人和罗马人则使用**盐**[1]交易。渐渐地,这些史前启蒙文明中的大部分都采用贵重金属和石头作为代​​币进行交易。金币,银饰和红宝石开始与“价值”同名。随着工业发展,人们开始印刷这些交易凭证,我们终于似乎看到了对纸币需求的呼吁。纸币可靠且廉价,只要国家为其用户所持纸币提供担保,纸币所代表的“价值”可以在需要时,由同等价值的黄金或硬通货作支撑,人们便乐于使用它们。但是,如果你仍然认为你现在持有的纸币具有相同的保证,那么您就错了。我们目前生活在一个几乎所有主要货币都在全球流通的时代,经济学家称之为**法定货币** [2]。缺少价值的纸片只能得到你所居住的国家的保证支持。法定货币的确切性质以及为什么它们可能是一个有缺陷的系统属于经济领域,我们目前不会涉及。
事实上,所有这一历史中与本篇文章相关的唯一的一点是,文明开始使用暗示或代表商品和服务贸易价值的代币,而不是非实际的易货系统。代币,当然,这也是加密货币背后的关键概念。他们没有任何固有的价值。它们的价值取决于采用该特定平台的人数,采用者对系统的信任,当然还有监管实体本身的背景(如果有监管实体的话)。 **比特币BTC**的高价格和市值并非巧合,它们是业内第一个加密货币并且有很多早期采用者。加密货币背后的最终真理使其如此重要而又具有如此难以理解的复杂性。这是“金钱”自然演变的下一步。有些人理解这一点,有些人仍然想到坚实的货币概念,其中“真正的”货币总是由某种内在价值支持。[3]虽然已经有无数关于这种困境的辩论和研究,但仍没有着眼于区块链的未来。
例如,**厄瓜多尔**在 2015 年成为头条新闻,因为它声称计划开发和发布**自己的国家加密货币** [4]。虽然官方尝试是为了援助和支持他们现有的货币体系。从那时起,其他国家及其监管机构已经或正在起草文件来控制加密货币的“流行病”,其中一些已经发布了框架,以创建区块链和加密开发的路线图。 **德国**被认为正在长期投资区块链项目,以简化其税收和金融系统[5]。发展中国家的银行正在加入一个名为银行链的体系中,用以合作创建**私有区块链**以提高他们的效率并优化其运营
现在当我们将故事的两端结合在一起时还记得在休闲历史课之前首次提到PayPal吗专家们将比特币BTC的采用率与 PayPal 的采用率进行了比较。消费者最初有所犹豫只有少数早期采用者准备好使用上述产品但随后更广泛的采用逐渐成为类似平台的标杆态势。比特币BTC已经成为类似加密货币平台的基准其主要硬币包括**以太坊ETH**和**波纹XRP** [6]。采用正在稳步增加,法律和监管框架也正在制定以支持它,积极的研究和开发也在进行中。与 PayPal 不同,专家认为,利用区块链技术为其数字基础设施提供加密货币和平台将很快成为标准规范而非个例。
尽管 2018 年加密货币价格的上涨可以被称为经济泡沫,但公司和政府仍在继续投资开发自己的区块链平台和金融代币。为了抵制和预防未来发生这样的事件,并同时同时继续在该领域投资,替代传统加密货币的**稳定币**已经开发成功。
金融巨头**摩根大通**推出了他们自己的企业就绪区块链解决方案,名为**Quorum**,用来处理被称为 **JPM Coin**[7]的稳定币。每个这样的 JPM 硬币都与 1 美元挂钩,其价值由母公司在支持法律框架下保证。像这样的平台使大型金融交易更容易通过互联网瞬间传输数百万或数十亿美元的音乐,而不必依赖 SWIFT 这样的传统银行系统,这些系统有着冗长的程序,而且本身已有数十年历史。
为了让区块链的细节可供所有人使用,以太坊平台允许第三方利用他们的区块链或从中派生以创建和管理他们自己对**区块链-协议-令牌**三元组的看法。该系统使用更少的基础工作量来推动更广泛的标准采纳。
区块链允许通过网络快速创建,记录和交易现有金融工具的数字版本,而无需第三方监控。该系统固有的安全性和安保特性使整个过程完全安全,并且不受欺诈和篡改的影响,这基本上是该部门需要第三方监控的唯一原因。政府和监管机构在金融服务和工具方面涉及的另一个领域是透明度和审计。通过区块链,银行和其他金融机构将能够维护完全透明,分层,几乎永久保存和防篡改的所有交易记录,使审计任务几乎无用。通过利用区块链,可以使当前金融系统和服务行业急需的发展和变化成为可能。分布式,防篡改,接近永久性存储和快速执行的平台对于银行家和政府监管机构来说都是非常有价值的,他们在这方面的投资似乎很有用[8]。
在本系列的下一篇文章中,我们将了解公司如何使用区块链来提供下一代金融服务。纵观在行业中创造涟漪的个别公司后,我们将探讨区块链下的经济未来会如何发展。
-------------------------------------------------- ------------------------------
通过https//www.ostechnix.com/blockchain-2-0-revolutionizing-the-financial-system/
作者:[EDITOR] [A]
选题:[lujun9972] [B]
译者:[sanfusu]https://github.com/sanfusu
校对校对者ID]https://github.com/校对者ID
本文由[LCTT]https://github.com/LCTT/TranslateProject原创编译[Linux中国]https://linux.cn/)荣誉推出
[a]https//www.ostechnix.com/author/editor/
[b]https//github.com/lujun9972
[1]https//www.ostechnix.com/blockchain-2-0-an-introduction/

View File

@ -7,37 +7,37 @@
[#]: via: (https://www.2daygeek.com/navigate-switch-directory-without-using-cd-command-in-linux/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
How To Navigate Inside A Directory/Folder In Linux Without CD Command?
如何在 Linux 中不使用 CD 命令进入目录/文件夹?
======
As everybody know that we cant navigate inside a directory in Linux without CD command.
众所周知,如果没有 CD 命令,我们无法 Linux 中切换目录。
Yes thats true but we have the Linux built-in command called `shopt` that help us to solve this issue.
这个没错,但我们有一个名为 `shopt` 的 Linux 内置命令能帮助我们解决这个问题。
[shopt][1] is a shell builtin command to set and unset various bash shell options, which is installed so, we no need to install it again.
[shopt][1] 是一个 shell 内置命令,用于设置和取消设置各种 bash shell 选项,由于它已安装,因此我们不需要再次安装它。
Yes we can navigate inside a directory without CD command after enabling this option.
是的,我们可以在启用此选项后,可以不使用 CD 命令切换目录。
We will show you, how to do this in this article. This is a small tweak but its very useful for newbies who all are moving from Windows to Linux.
我们将在本文中向你展示如何操作。这是一个小的调整,但对于那些从 Windows 迁移到 Linux 的新手来说非常有用。
This is not useful for Linux administrator because we wont navigate to the directory without CD command, as we had a good practices on this.
这对 Linux 管理员没用,因为我们不会在没有 CD 命令的情况下切换到该目录,因为我们对此有一个很好的做法。
If you are trying to navigate a directory/folder in Linux without cd command, you will be getting the following error message. This is common in Linux.
如果你尝试在没有 cd 命令的情况下切换 Linux 的目录/文件夹,你将看到以下错误消息。这在 Linux 中很常见。
```
$ Documents/
bash: Documents/: Is a directory
```
To achieve this, we need to append the following values in a user `.bashrc` file.
为此,我们需要在用户 `.bashrc` 中追加以下值。
### What Is the .bashrc File?
### 什么是 .bashrc
The “.bashrc” file is a shell script which is run every time a user opens a new shell in interactive mode.
“.bashrc” 是一个 shell 脚本,每次用户以交互模式打开新 shell 时都会运行该脚本。
You can add any command in that file that you want to type at the command prompt.
你可以在该文件中添加要在命令提示符下输入的任何命令。
The .bashrc file itself contains a series of configurations for the terminal session. This includes setting up or enabling: colouring, completion, the shell history, command aliases and more.
.bashrc 文件本身包含终端会话的一系列配置。包括设置和启用着色、补全shell 历史,命令别名等。
```
$ vi ~/.bashrc
@ -45,13 +45,13 @@ $ vi ~/.bashrc
shopt -s autocd
```
Run the following command to make the changes to take effect.
运行以下命令使更改生效。
```
$ source ~/.bashrc
```
We have done all the configuration. Simple do the testing on this to confirm whether this working or not.
我们已完成所有配置。简单地对此进行测试以确认这是否有效。
```
$ Documents/
@ -68,12 +68,12 @@ $ pwd
```
![][3]
Yes, its working fine as expected.
是的,它正如预期的那样正常工作。
However, its working fine in `fish shell` without making any changes in the `.bashrc` file.
而且,它在 `fish shell` 中工作正常,而无需对 `.bashrc` 进行任何更改。
![][4]
If you would like to perform this action for temporarily then use the following commands (set/unset). This will go away when you reboot the system.
如果要暂时执行此操作请使用以下命令set/unset。重启系统时它将消失。
```
# shopt -s autocd
@ -87,7 +87,7 @@ autocd on
autocd off
```
shopt command is offering so many other options and if you want to verify those, run the following command.
shopt 命令提供了许多其他选项,如果要验证这些选项,请运行以下命令。
```
$ shopt
@ -146,9 +146,9 @@ sourcepath on
xpg_echo off
```
I had found few other utilities, that are help us to navigate a directory faster in Linux compared with cd command.
我找到了一些其他程序,它们可以帮助我们在 Linux 中比 cd 命令更快地切换目录。
Those are pushd, popd, up shell script and bd utility. We will cover these topics in the upcoming articles.
它们是 pushd、popd、up shell 脚本和 bd 工具。我们将在接下来的文章中介绍这些主题。
--------------------------------------------------------------------------------
@ -156,7 +156,7 @@ via: https://www.2daygeek.com/navigate-switch-directory-without-using-cd-command
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出