parsing_data/slides.tex
author Amit Sethi
Tue, 09 Nov 2010 12:31:05 +0530
changeset 414 f76622c8cbd9
parent 280 40b6a90f41b7
permissions -rw-r--r--
Review of addition ipython
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
     1
% Created 2010-10-10 Sun 18:28
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
     2
\documentclass[presentation]{beamer}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     3
\usepackage[latin1]{inputenc}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
     4
\usepackage[T1]{fontenc}
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
     5
\usepackage{fixltx2e}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
     6
\usepackage{graphicx}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
     7
\usepackage{longtable}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
     8
\usepackage{float}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
     9
\usepackage{wrapfig}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    10
\usepackage{soul}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    11
\usepackage{textcomp}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    12
\usepackage{marvosym}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    13
\usepackage{wasysym}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    14
\usepackage{latexsym}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    15
\usepackage{amssymb}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    16
\usepackage{hyperref}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    17
\tolerance=1000
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    18
\usepackage[english]{babel} \usepackage{ae,aecompl}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    19
\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    20
\usepackage{listings}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    21
\lstset{language=Python, basicstyle=\ttfamily\bfseries,
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    22
commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    23
showstringspaces=false, keywordstyle=\color{blue}\bfseries}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    24
\providecommand{\alert}[1]{\textbf{#1}}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    25
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    26
\title{Parsing Data}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    27
\author{FOSSEE}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    28
\date{}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    29
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    30
\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    31
\begin{document}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    32
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    33
\maketitle
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    34
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    35
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    36
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    37
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    38
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    39
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    40
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    41
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    42
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    43
\begin{frame}
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    44
\frametitle{Outline}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    45
\label{sec-1}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    46
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    47
\begin{itemize}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    48
\item What is meant by parsing data?
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    49
\item String operations required for parsing
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    50
\item Converting between data-types.
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    51
\end{itemize}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    52
\end{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    53
\begin{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    54
\frametitle{Question 1}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    55
\label{sec-2}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    56
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    57
  Split the variable line using a space as argument. Is it same as
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    58
  splitting without an argument ?
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    59
\end{frame}
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    60
\begin{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    61
\frametitle{Solution 1}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    62
\label{sec-3}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    63
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    64
  We see that when we split on space, multiple whitespaces are not
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    65
  clubbed as one and there is an empty string everytime there are two
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    66
  consecutive spaces.
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    67
\end{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    68
\begin{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    69
\frametitle{Question 2}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    70
\label{sec-4}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    71
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    72
  What happens to the white space inside the sentence when it is
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    73
  stripped? 
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    74
\end{frame}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    75
\begin{frame}[fragile]
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    76
\frametitle{Solution 2}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    77
\label{sec-5}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    78
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    79
\lstset{language=Python}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    80
\begin{lstlisting}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    81
In []: a_str = "     white      space     "
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    82
In []: a_str.strip()
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    83
\end{lstlisting}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    84
\end{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    85
\begin{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    86
\frametitle{Question 3}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    87
\label{sec-6}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    88
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    89
  What happens if you do \texttt{int("1.25")}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    90
\end{frame}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
    91
\begin{frame}[fragile]
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    92
\frametitle{Solution 3}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    93
\label{sec-7}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    94
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    95
  It raises an error since converting a float string into integer
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    96
  directly is not possible. It involves an intermediate step of
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    97
  converting to float.
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    98
\lstset{language=Python}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
    99
\begin{lstlisting}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   100
In []: dcml_str = "1.25"
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   101
In []: flt = float(dcml_str)
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   102
In []: flt
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   103
In []: number = int(flt)
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   104
In []: number
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   105
\end{lstlisting}
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   106
\end{frame}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   107
\begin{frame}
280
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   108
\frametitle{Summary}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   109
\label{sec-8}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   110
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   111
\begin{itemize}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   112
\item How to tokenize a string using various delimiters
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   113
\item How to get rid of extra white space around
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   114
\item How to convert from one type to another
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   115
\item How to parse input data and perform computations on it
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   116
\end{itemize}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   117
\end{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   118
\begin{frame}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   119
\frametitle{Thank you!}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   120
\label{sec-9}
40b6a90f41b7 Slides for parsing data LO.
Puneeth Chaganti <punchagan@fossee.in>
parents: 238
diff changeset
   121
238
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   122
  \begin{block}{}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   123
  \begin{center}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   124
  This spoken tutorial has been produced by the
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   125
  \textcolor{blue}{FOSSEE} team, which is funded by the 
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   126
  \end{center}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   127
  \begin{center}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   128
    \textcolor{blue}{National Mission on Education through \\
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   129
      Information \& Communication Technology \\ 
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   130
      MHRD, Govt. of India}.
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   131
  \end{center}  
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   132
  \end{block}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   133
\end{frame}
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   134
c507e9c413c6 Converted the parsing_data into new template form
Nishanth <nishanth@fossee.in>
parents:
diff changeset
   135
\end{document}