From 739590e2ca61ba47a553f9ce23c149003520faa6 Mon Sep 17 00:00:00 2001 From: Srikant Date: Mon, 30 Jan 2012 11:23:59 +0530 Subject: except nose test --- TDD/using_python_framework_for_tdd/tdd2_script.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/TDD/using_python_framework_for_tdd/tdd2_script.rst b/TDD/using_python_framework_for_tdd/tdd2_script.rst index ccaa0ec..add7e7e 100755 --- a/TDD/using_python_framework_for_tdd/tdd2_script.rst +++ b/TDD/using_python_framework_for_tdd/tdd2_script.rst @@ -162,19 +162,19 @@ tests into collections and improves reporting. To run unittest on our fibonacci function let us create a new file ``test_fibonacci.py``. This new file will host the -test code. To begin unittesting let us subclass - the TestCase class in unittest. We need fibonacci.py - and fibonacci_testcases.py files too. +test code. +To begin unittesting let us subclass the TestCase class +in unittest. We need fibonacci.py and fibonacci_testcases.py +files too. .. L12 {{{ Show slide13, unittesting fibonacci.py }}} - .. R13 This brings us to the end of the tutorial.In this tutorial, - we have learnt to, +we have learnt to, 1. Undestand the basic steps involved in Test driven development. #. Design a Test driven approach for a given ``fibonacci`` function. -- cgit From 4bd5c61c396c0406f547b8576207c6a25fbd4c8a Mon Sep 17 00:00:00 2001 From: ikkiran Date: Mon, 30 Jan 2012 12:57:09 +0530 Subject: Few changes: R4 - R7. --- TDD/using_python_framework_for_tdd/tdd2_script.rst | 26 +++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/TDD/using_python_framework_for_tdd/tdd2_script.rst b/TDD/using_python_framework_for_tdd/tdd2_script.rst index ca503f1..e460f70 100755 --- a/TDD/using_python_framework_for_tdd/tdd2_script.rst +++ b/TDD/using_python_framework_for_tdd/tdd2_script.rst @@ -49,15 +49,15 @@ tutorial on "Test driven development-part 1". .. R4 -To test ``fibonacci`` function we have used two test cases. +To test ``fibonacci`` function, we have used two test cases. It is inconvenient to repeatedly change the test conditions in -the fibonacci.py file.Each time a new test case is added it -introduces a 'if' statement too. -So it is good practice to write the test cases in a separate file. -The file will contain multiple lines,each line for separate test case, -each line consist of two comma separated values, -first column is the integer value which has to be passed to the function - and the second column is the return value from the function. +the fibonacci.py file. Each time a new test case is added, it +introduces an 'if' statement too. +So, it is a good practice to write the test cases in a separate file. +This file containa multiple lines, each line representing a test case. +Each line consists of two comma separated values in which the +first column is the integer value that has to be passed to the function. + The second column is the return value from the function. @@ -69,8 +69,8 @@ first column is the integer value which has to be passed to the function .. R5 -Lets open the same fibonacci.py file which we have used in our -previous tutorial.Change the code to use fibonacci_testcases.dat +Let us open the fibonacci.py file which we have used in our +previous tutorial. Now, change the code to use 'fibonacci_testcases.dat' file for test cases. @@ -81,7 +81,7 @@ file for test cases. .. R6 -Save the fibonacci.py file. Go to terminal and run +Save the fibonacci.py file. Switch to terminal and run ``python fibonacci.py``. It should pass all the tests. @@ -95,9 +95,9 @@ Save the fibonacci.py file. Go to terminal and run .. R7 So far we have used simple repetitive tests. -Now we will see how ``Python testing frameworks`` can do the +Now, let us see how ``Python testing frameworks`` does the same job efficiently. -Python provides two frameworks for testing code, unittest and +Python provides two frameworks for testing code: unittest and doctest. .. L7 -- cgit From 70562e864d4122d30653e781d3a472a65f8f7dac Mon Sep 17 00:00:00 2001 From: ikkiran Date: Mon, 30 Jan 2012 13:09:16 +0530 Subject: Changes: R8 - End. --- TDD/using_python_framework_for_tdd/tdd2_script.rst | 30 +++++++++++----------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/TDD/using_python_framework_for_tdd/tdd2_script.rst b/TDD/using_python_framework_for_tdd/tdd2_script.rst index e460f70..be41e6d 100755 --- a/TDD/using_python_framework_for_tdd/tdd2_script.rst +++ b/TDD/using_python_framework_for_tdd/tdd2_script.rst @@ -54,7 +54,7 @@ It is inconvenient to repeatedly change the test conditions in the fibonacci.py file. Each time a new test case is added, it introduces an 'if' statement too. So, it is a good practice to write the test cases in a separate file. -This file containa multiple lines, each line representing a test case. +This file contains multiple lines, each line representing a test case. Each line consists of two comma separated values in which the first column is the integer value that has to be passed to the function. The second column is the return value from the function. @@ -106,25 +106,25 @@ doctest. .. R8 -Let us first see how doctest works. +First, let us see how doctest works. A docstring is used to document function. Along with the description, interactive interpretor session's input and output are also added. -When executed doctest module pick up all such interactive +When executed, the doctest module picks up all such interactive examples, executes them and determines if the code runs as documented. .. L8 -{{{switch to slide7 for 3 seconds and move to to slide8, +{{{switch to slide7 for 3 seconds and move to slide8, Doctest for fibonacci.py}}} .. R9 -To initiate doctest we need to import doctest module. +To initiate doctest, we need to import the doctest module. Testmod automatically picks all sample sessions, executes them and compares with the documented output. -Doctest doesn't give any output when all test pass, +Doctest doesn't give any output when all the tests pass, it complains only when any test fails. .. L9 @@ -135,7 +135,7 @@ it complains only when any test fails. Let us run doctests by typing ``python fibonacci.py``. As all tests pass, doctest doesn't give any output. -For more detailed information we can run with -v argument. +For detailed information, we may run the file with -v argument. Run as ``python -v fibonacci.py``. .. L10 @@ -150,19 +150,19 @@ Run as ``python -v fibonacci.py``. So far we have seen doctest, which is simple to use. But when it comes to automate the process, unittest is better. -Unittest initializes code and data, it aggregate +Unittest initializes code and data, it aggregates tests into collections and improves reporting. .. L11 -{{{ switch to slide-11, Unittest }}} +{{{ Switch to slide-11, Unittest }}} .. R12 -To run unittest on our fibonacci function let us create a -new file ``test_fibonacci.py``. This new file will host the -test code. To begin unittesting let us subclass +To run unittest on our fibonacci function, let us create a +new file ``test_fibonacci.py``. This new file hosts the +test code. To begin unittesting, let us subclass the TestCase class in unittest. We need fibonacci.py and fibonacci_testcases.py files too. @@ -173,10 +173,10 @@ test code. To begin unittesting let us subclass .. R13 -This brings us to the end of the tutorial.In this tutorial, +This brings us to the end of the tutorial. In this tutorial, we have learnt to, - 1. Undestand the basic steps involved in Test driven development. + 1. Understand the basic steps involved in Test driven development. #. Design a Test driven approach for a given ``fibonacci`` function. @@ -213,5 +213,5 @@ Thank you! .. L16 -{{{ Switch to slide-16, Thankyou}}} +{{{ Switch to slide-16, Thank you}}} -- cgit From 9c943d7375af3ed25c2c1d32f42bdf359f13d115 Mon Sep 17 00:00:00 2001 From: ikkiran Date: Mon, 30 Jan 2012 13:54:14 +0530 Subject: Minor Changes: R10. --- TDD/using_python_framework_for_tdd/tdd2_script.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TDD/using_python_framework_for_tdd/tdd2_script.rst b/TDD/using_python_framework_for_tdd/tdd2_script.rst index be41e6d..53165fa 100755 --- a/TDD/using_python_framework_for_tdd/tdd2_script.rst +++ b/TDD/using_python_framework_for_tdd/tdd2_script.rst @@ -44,7 +44,7 @@ At the end of this tutorial, you will be able to, .. R3 -Before beginning this tutorial,we would suggest you to complete the +Before beginning this tutorial,we suggest you to complete the tutorial on "Test driven development-part 1". .. R4 @@ -133,7 +133,7 @@ it complains only when any test fails. .. R10 -Let us run doctests by typing ``python fibonacci.py``. +Let us run doctest by typing ``python fibonacci.py``. As all tests pass, doctest doesn't give any output. For detailed information, we may run the file with -v argument. Run as ``python -v fibonacci.py``. -- cgit From 35f82333e6e9d6b75c5e3b4b533ecf762a532761 Mon Sep 17 00:00:00 2001 From: Srikant Date: Mon, 30 Jan 2012 16:12:40 +0530 Subject: finished till unittest --- TDD/using_python_framework_for_tdd/tdd2_script.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/TDD/using_python_framework_for_tdd/tdd2_script.rst b/TDD/using_python_framework_for_tdd/tdd2_script.rst index b1fd1ef..f8365f5 100755 --- a/TDD/using_python_framework_for_tdd/tdd2_script.rst +++ b/TDD/using_python_framework_for_tdd/tdd2_script.rst @@ -171,8 +171,21 @@ files too. {{{ Show slide13, unittesting fibonacci.py }}} + .. R13 +The function ``setUp`` will read all the test data and store +it in a list.The next function ``test_fibonacci`` contains +test code. The last function deletes the data from test_cases +list and closes ``fibonacci_testcases.dat`` file. + +.. L13 + +{{{ Show slide13(stay for 3 seconds and switch to slide14 }}} + + +.. R23 + This brings us to the end of the tutorial.In this tutorial, we have learnt to, @@ -180,7 +193,7 @@ we have learnt to, #. Design a Test driven approach for a given ``fibonacci`` function. -.. L13 +.. L23 {{{ switch to slide-13,Summary }}} -- cgit From c2cb335fa1071861925745fb830b0f688e80eca6 Mon Sep 17 00:00:00 2001 From: Srikant Date: Mon, 30 Jan 2012 16:42:53 +0530 Subject: fixed few typos --- TDD/using_python_framework_for_tdd/tdd2_script.rst | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/TDD/using_python_framework_for_tdd/tdd2_script.rst b/TDD/using_python_framework_for_tdd/tdd2_script.rst index bd5090b..4343b2a 100755 --- a/TDD/using_python_framework_for_tdd/tdd2_script.rst +++ b/TDD/using_python_framework_for_tdd/tdd2_script.rst @@ -160,20 +160,13 @@ tests into collections and improves reporting. .. R12 -<<<<<<< HEAD To run unittest on our fibonacci function let us create a new file ``test_fibonacci.py``. This new file will host the test code. To begin unittesting let us subclass the TestCase class in unittest. We need fibonacci.py and fibonacci_testcases.py files too. -======= -To run unittest on our fibonacci function, let us create a -new file ``test_fibonacci.py``. This new file hosts the -test code. To begin unittesting, let us subclass - the TestCase class in unittest. We need fibonacci.py - and fibonacci_testcases.py files too. ->>>>>>> 9c943d7375af3ed25c2c1d32f42bdf359f13d115 + .. L12 @@ -182,7 +175,6 @@ test code. To begin unittesting, let us subclass .. R13 -<<<<<<< HEAD The function ``setUp`` will read all the test data and store it in a list.The next function ``test_fibonacci`` contains test code. The last function deletes the data from test_cases @@ -197,10 +189,6 @@ list and closes ``fibonacci_testcases.dat`` file. This brings us to the end of the tutorial.In this tutorial, we have learnt to, -======= -This brings us to the end of the tutorial. In this tutorial, - we have learnt to, ->>>>>>> 9c943d7375af3ed25c2c1d32f42bdf359f13d115 1. Understand the basic steps involved in Test driven development. #. Design a Test driven approach for a given ``fibonacci`` function. -- cgit From e3276253509dbb50815e14022c1fb8c193507992 Mon Sep 17 00:00:00 2001 From: Srikant Date: Mon, 30 Jan 2012 16:57:29 +0530 Subject: fixed few typos --- TDD/using_python_framework_for_tdd/tdd2_script.rst | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/TDD/using_python_framework_for_tdd/tdd2_script.rst b/TDD/using_python_framework_for_tdd/tdd2_script.rst index 4343b2a..d90c5eb 100755 --- a/TDD/using_python_framework_for_tdd/tdd2_script.rst +++ b/TDD/using_python_framework_for_tdd/tdd2_script.rst @@ -63,8 +63,8 @@ first column is the integer value that has to be passed to the function. .. L4 -{{{ Switch to slide4 ,Persistent test cases,(after 3 seconds) show the - fibonacci_testcases.dat file}}} +{{{ Switch to slide4 ,Persistent test cases, (after 3 seconds) show the +fibonacci_testcases.dat file}}} .. R5 @@ -77,7 +77,7 @@ file for test cases. .. L5 {{{ Switch to slide5, Modify fibonacci.py , show the modified - fibonacci.py file}}} +fibonacci.py file}}} .. R6 @@ -175,14 +175,15 @@ files too. .. R13 -The function ``setUp`` will read all the test data and store -it in a list.The next function ``test_fibonacci`` contains -test code. The last function deletes the data from test_cases -list and closes ``fibonacci_testcases.dat`` file. +The ``setUp`` function will read all the test data and store +it in a list test_cases. The ``test_fibonacci`` function +consists the actual test code. And the third function ``tearDown`` +deletes the data from test_cases +and closes ``fibonacci_testcases.dat`` file. .. L13 -{{{ Show slide13(stay for 3 seconds and switch to slide14 }}} +{{{ Show slide13(stay for 3 seconds) and switch to slide14 }}} .. R23 -- cgit From d32b08f82f5d0b354cc840de80ca2010c978341e Mon Sep 17 00:00:00 2001 From: Harish Badrinath Date: Tue, 31 Jan 2012 13:08:14 +0530 Subject: Language changes to script and slides based on review by sushma. --- Latex/Latex6/latex_math2beamer.tex | 6 ++- Latex/Latex6/latex_math_biblo_beamer_script.rst | 53 +++++++++++++------------ 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/Latex/Latex6/latex_math2beamer.tex b/Latex/Latex6/latex_math2beamer.tex index 4ae4f28..d8ba927 100644 --- a/Latex/Latex6/latex_math2beamer.tex +++ b/Latex/Latex6/latex_math2beamer.tex @@ -69,7 +69,8 @@ \label{sec-2} At the end of this tutorial, you will be able to, \begin{itemize} - \item Write and typeset simple mathematical formulae in LaTeX. + \item Write simple mathematical formulae in {\LaTeX}. + \item Typeset simple mathematical formulae in {\LaTeX}. \item Write bibliography for a LaTeX document. \item Make presentations in LaTeX, using beamer. \end{itemize} @@ -398,7 +399,8 @@ \label{sec-8} In this tutorial, we have, \begin{itemize} - \item Written and typeset simple math formulae in LaTeX. + \item Written simple mathematical formulae in {\LaTeX}. + \item Typeset simple mathematical formulae in {\LaTeX}. \item Written bibliography for a LaTeX document. \item Made a sample presentations in LaTeX, using beamer. \end{itemize} diff --git a/Latex/Latex6/latex_math_biblo_beamer_script.rst b/Latex/Latex6/latex_math_biblo_beamer_script.rst index 20fe5fb..b98a750 100644 --- a/Latex/Latex6/latex_math_biblo_beamer_script.rst +++ b/Latex/Latex6/latex_math_biblo_beamer_script.rst @@ -1,15 +1,20 @@ .. Objectives .. ---------- -.. By the end of this tutorial, you will be able to +.. At the end of this tutorial, you will be able to -.. 1. Write and typeset simple mathematical formulae in LaTeX. +.. 1. Write simple mathematical formulae in LaTeX. +.. #. Typeset simple mathematical formulae in LaTeX. .. #. Write bibliography for a LaTeX document. .. #. Make presentations in LaTeX, using beamer. .. Prerequisites .. ------------- +.. 1. Introduction to LaTeX. +.. #. Basics of LaTeX and its document structure. +.. #. Typesetting LaTeX text. + .. 1. latex_intro .. Author : Harish Badrinath < harish [at] fossee [dot] in > Internal Reviewer : @@ -36,9 +41,10 @@ formulae, bibliography and presentations, using LaTeX. .. R2 -.. By the end of this tutorial, you will be able to +.. At the end of this tutorial, you will be able to -.. 1. Write and typeset simple mathematical formulae in LaTeX. +.. 1. Write simple mathematical formulae in LaTeX. +.. #. Typeset simple mathematical formulae in LaTeX. .. #. Write bibliography for a LaTeX document. .. #. Make presentations in LaTeX, using beamer. @@ -48,32 +54,30 @@ formulae, bibliography and presentations, using LaTeX. .. R3 -Before beginning this tutorial,we would suggest you complete the tutorials titled -"Introduction to LaTeX","Basics of LaTeX and its document structure","Basics of -LaTeX and its documents structure" and "Typesetting LaTeX text". +Before beginning this tutorial, it is recommended to complete the tutorials +given in the prerequisite. .. L4 .. R4 -In general, it is advised to use the AMS-LaTeX bundle to typeset mathematics in -LaTeX. AMS-LaTeX is a collection of packages and classes for mathematical +In general, it is advisable to use the AMS-LaTeX bundle to typeset mathematics +in LaTeX. AMS-LaTeX is a collection of packages and classes for mathematical typesetting. -We load amsmath by issuing the \usepackage{amsmath} in the preamble.It must be -noted that amsmath is included in the base distribution of LaTex, in atleast +We can load amsmath by issuing the \usepackage{amsmath} in the preamble.It must +be noted that amsmath is included in the base distribution of LaTex, in atleast the most recent versions. -Math formulae can be embedded in two ways. One is inline, and the other way is - to enclose them in a dedicated environment as and when required. -The first method is also called text style and second method is also called -displayed style. +Math formulae can be embedded in two ways, + “inline” or “text style ” method, which is done by enclosing the + required command and text within two dollar signs or between an backslash + opening bracket and backslash closing bracket. -In-lining is done by enclosing the required command and text withing two dollar -signs or between an backslash opening bracket and backslash closing bracket. + By enclosing them in a dedicated environment respectively/displayed style. The most common LaTeX environment used to typeset mathematical formulae is -from equation family. Its use is given in more detail, further in the tutorial. +from equation family. .. L5 @@ -98,8 +102,7 @@ The screen shows the an example, that renders different types of matrices using LaTeX. It also shows the two ways in which mathmatical formulae can be embedded into -LaTeX documents. The second method of embedding mathamtical formula will be -explained in detail, later in the tutorial. +LaTeX documents. Please pause the tutorial and go through the example shown on the screen. @@ -131,10 +134,9 @@ the sum and int command are specified using the carat and underscore characters .. R9 -As mention earlier, we can display mathematical formulas in either one of two -ways. The first was mentioned earlier, now we use the equation environment -to render mathematical formulae, which are numbered. The equation star -environment is used to render unnumbered equations. +We now move onto using the equation environment to render mathematical formulae, +which are numbered. Another environment called equation star environment renders +unnumbered equations. Backslash and opening square bracket and its counterpart the backslash closing square bracket is a short hand for equation star environment. @@ -261,7 +263,8 @@ example shown on the screen. This brings us to the end of this tutorial. In this tutorial, we have, -.. 1. Written and typeset simple math formulae in LaTeX. +.. 1. Written simple mathematical formulae in LaTeX. +.. #. Typeset simple mathematical formulae in LaTeX. .. #. Written bibliography for a LaTeX document. .. #. Made a sample presentations in LaTeX, using beamer. -- cgit