226 \end{itemize} |
226 \end{itemize} |
227 |
227 |
228 \end{frame}} |
228 \end{frame}} |
229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
229 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
230 |
230 |
|
231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
232 \mode<presentation>{ |
|
233 \begin{frame}[c] |
|
234 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}} |
|
235 |
|
236 \begin{enumerate} |
|
237 \item given an URL, read the corresponding webpage |
|
238 \item extract all links from it |
|
239 \item call the web-crawler again for all these links |
|
240 \end{enumerate} |
|
241 |
|
242 \end{frame}} |
|
243 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
244 |
|
245 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
246 \mode<presentation>{ |
|
247 \begin{frame}[c] |
|
248 \frametitle{\begin{tabular}{c}A Web Crawler\end{tabular}} |
|
249 |
|
250 \begin{enumerate} |
|
251 \item given an URL, read the corresponding webpage |
|
252 \item if not possible print, out a problem |
|
253 \item if possible, extract all links from it |
|
254 \item call the web-crawler again for all these links |
|
255 \end{enumerate}\bigskip\pause |
|
256 |
|
257 \small (we need to bound the number of recursive calls) |
|
258 |
|
259 \small (the purpose is to check all links on my own webpage) |
|
260 \end{frame}} |
|
261 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
|
262 |
231 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
263 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
232 \mode<presentation>{ |
264 \mode<presentation>{ |
233 \begin{frame}[c] |
265 \begin{frame}[c] |
234 \frametitle{\begin{tabular}{c}Scala\end{tabular}} |
266 \frametitle{\begin{tabular}{c}Scala\end{tabular}} |
235 |
267 |
236 \footnotesize a simple function for reading webpages |
268 \footnotesize a simple Scala function for reading webpages\\[-3mm] |
237 |
269 |
238 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
270 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
239 \texttt{\lstinputlisting{app0.scala}}}\pause\bigskip |
271 \texttt{\lstinputlisting{app0.scala}}}\pause\bigskip |
|
272 |
|
273 \footnotesize slightly more complicated for handling errors:\\[-3mm] |
240 |
274 |
241 \footnotesize |
275 \footnotesize |
242 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
276 {\lstset{language=Scala}\fontsize{8}{10}\selectfont |
243 \texttt{\lstinputlisting{app1.scala}}} |
277 \texttt{\lstinputlisting{app1.scala}}} |
244 |
278 |