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

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, and user input are shown as follows: "We can import modules with the import statement."

A block of code is set as follows:

def occurrencesOf[A](elem:A, collection:List[A]):List[Int] = {
  for { 
    (currentElem, index) <- collection.zipWithIndex
    if (currentElem == elem)
  } yield index
}

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

def occurrencesOf[A](elem:A, collection:List[A]):List[Int] = {
  for { 
    (currentElem, index) <- collection.zipWithIndex
    if (currentElem == elem)
  } yield index
}

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

scala> val nTosses = 100
nTosses: Int = 100

scala> def trial = (0 until nTosses).count { i =>
 util.Random.nextBoolean() // count the number of heads
}
trial: Int

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: "Clicking the Next button moves you to the next screen."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

主站蜘蛛池模板: 玉山县| 湘西| 繁昌县| 神农架林区| 孙吴县| 瑞安市| 长子县| 偏关县| 东宁县| 白城市| 西昌市| 日喀则市| 惠州市| 玉田县| 牙克石市| 琼海市| 海兴县| 鸡西市| 海口市| 错那县| 石家庄市| 石首市| 永昌县| 阿克苏市| 莱西市| 绥滨县| 镇安县| 岗巴县| 湾仔区| 江西省| 辽阳县| 克拉玛依市| 盐山县| 株洲市| 新丰县| 东乌珠穆沁旗| 彩票| 卢氏县| 鹤庆县| 中宁县| 大荔县|