slides/slides03.tex
changeset 218 22705d22c105
parent 217 e689375abcc1
child 320 cdfb2ce30a3d
equal deleted inserted replaced
217:e689375abcc1 218:22705d22c105
   114 \small
   114 \small
   115 \begin{lstlisting}[language=Scala, xleftmargin=-4mm,numbers=left]
   115 \begin{lstlisting}[language=Scala, xleftmargin=-4mm,numbers=left]
   116  def process_ratings(lines: List[String]) = {
   116  def process_ratings(lines: List[String]) = {
   117     val values = List[(String,String)]()
   117     val values = List[(String,String)]()
   118 
   118 
   119     for(line <- lines){
   119     for(line <- lines) {
   120         val splitList = line.split(",").toList
   120         val splitList = ...
   121 
   121 
   122         if(splitList(2).toInt >= 4){
   122         if(splitList(2).toInt >= 4){
   123             val userID = splitList(0)
   123             val userID = splitList(0)
   124             val movieID = splitList(1)
   124             val movieID = splitList(1)
   125             val tuple = (userID, movieID)
   125             val tuple = (userID, movieID)
   130     values
   130     values
   131  }
   131  }
   132 \end{lstlisting}
   132 \end{lstlisting}
   133 
   133 
   134 \normalsize
   134 \normalsize
   135 What does this function always return?
   135 What does this function (always) return?
   136 
   136 
   137 
   137 
   138 \end{frame}
   138 \end{frame}
   139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   139 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
   140 
   140