day2/session3.tex
changeset 56 7a8cb7b07ebb
parent 46 63704b5650f1
child 57 73462010a2fe
equal deleted inserted replaced
55:09c73bf81987 56:7a8cb7b07ebb
    20 % h/w = 0.888
    20 % h/w = 0.888
    21 
    21 
    22 
    22 
    23 \mode<presentation>
    23 \mode<presentation>
    24 {
    24 {
    25   \usetheme{CambridgeUS}
    25   \usetheme{Warsaw}
    26   %\usetheme{Boadilla}
    26   %\usetheme{Boadilla}
    27   %\usetheme{default}
    27   %\usetheme{default}
    28   \useoutertheme{split}
    28   \useoutertheme{split}
    29   \setbeamercovered{transparent}
    29   \setbeamercovered{transparent}
    30 }
    30 }
   508 
   508 
   509 if __name__ == '__main__':
   509 if __name__ == '__main__':
   510     import nose
   510     import nose
   511     nose.main()
   511     nose.main()
   512   \end{lstlisting}
   512   \end{lstlisting}
   513 \inctime{15}
   513 \inctime{10}
   514 \end{frame}
   514 \end{frame}
   515 
   515 
   516 \begin{frame}[fragile]
   516 \begin{frame}[fragile]
   517     \frametitle{Example}
   517     \frametitle{Example}
   518     \begin{block}{Problem Statement:}
   518     \begin{block}{Problem Statement:}
   564 
   564 
   565 Tweak the code to pass this test.
   565 Tweak the code to pass this test.
   566 \end{frame}
   566 \end{frame}
   567 
   567 
   568 \begin{frame}[fragile]
   568 \begin{frame}[fragile]
   569     \frametitle{Exercise: Some more tests.}
   569     \frametitle{Lets write some test!}
   570 \begin{lstlisting}    
   570 \begin{lstlisting}    
   571 def test_function_ignore_spaces_in_text():
   571 #for form of equation y=mx+c
   572     input = "ab raca carba"
   572 #given m and c for two equation,
   573     assert is_palindrome(input) == True
   573 #finding the intersection point.
       
   574 def intersect(m1,c1,m2,c2):
       
   575     x = (c2-c1)/(m1-m2)
       
   576     y = m1*x+c1
       
   577     return (x,y)
   574 \end{lstlisting}
   578 \end{lstlisting}
   575 Check
   579 
   576 
   580 Create a simple test for this
   577 \PythonCode{$ nosetests test.py} 
   581 
   578 
   582 function which will make it fail.
   579 Tweak the code to pass this test.
       
   580 
   583 
   581 \inctime{15} 
   584 \inctime{15} 
   582 \end{frame}
   585 \end{frame}
   583 
   586 
   584 \end{document}
   587 \end{document}