Conventions
In this book, you will find a number of styles of text 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: "For example, able
has a positive polarity of 0.125
and unable
has a negative polarity of 0.75
."
A block of code is set as follows:
let calculateSO (docs:string list list)(words:string list)= let mutable res = 0.0 for i in 0 .. docs.Length - 1 do for j in 0 .. docs.[i].Length - 1 do for pw in words do res <- res + pmi docs docs.[i].[j] pw res
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
Calling this function is simple as shown below. //The above rating matrix is represented as (float list)list in F# let ratings = [[4.;0.;5.;5.];[4.;2.;1.;0.];[3.;0.;2.;4.];[4.;4.;0.;0.];[2.;1.;3.;5.]] //Finding the predicted rating for user 1 for item 2 let p12 = Predictu ratings 0 1
Any command-line input or output is written as follows:
if d1 = 0.0 || d2 = 0.0 then 0.0 else num / ((sqrt d1) * (sqrt d2 ))
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes for example, appear in the text like this: "Navigate to user id and then on item id."
Note
Warnings or important notes appear in a box like this.
Tip
Tips and tricks appear like this.