官术网_书友最值得收藏!

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "We can include other contexts through the use of the include directive."

A block of code is set as follows:

import scala.util.hashing.MurmurHash3._

val markLow = 0
val markHigh = 4096
val seed = 12345

def consistentFilter(s: String): Boolean = {
  val hash = stringHash(s.split(" ")(0), seed) >>> 16
  hash >= markLow && hash < markHigh
}

val w = new java.io.FileWriter(new java.io.File("out.txt"))
val lines = io.Source.fromFile("chapter01/data/iris/in.txt").getLines
lines.filter(consistentFilter).foreach { s =>
     w.write(s + Properties.lineSeparator)
}

Any command-line input or output is written as follows:

akozlov@Alexanders-MacBook-Pro]$ scala
Welcome to Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_40).
Type in expressions to have them evaluated.
Type :help for more information.

scala> import scala.util.Random
import scala.util.Random

New terms and important words are shown in bold. Words that you see on the screen, for example, in menus or dialog boxes, appear in the text like this: "Run all cells at once by navigating to Cell | Run All."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

主站蜘蛛池模板: 西安市| 彭阳县| 海门市| 平远县| 顺昌县| 嘉祥县| 平阴县| 临朐县| 定南县| 厦门市| 五台县| 攀枝花市| 隆林| 高邑县| 宿迁市| 漯河市| 安仁县| 健康| 资源县| 龙南县| 漳浦县| 龙井市| 牟定县| 汕尾市| 扎赉特旗| 合川市| 元氏县| 三亚市| 平阳县| 中卫市| 金华市| 阳朔县| 博客| 民和| 元氏县| 清涧县| 中西区| 玉屏| 阿勒泰市| 江川县| 鱼台县|