From 4f190be89aaf9413c2dc93910cd09991e230b6b7 Mon Sep 17 00:00:00 2001
From: hardythe1
Date: Tue, 10 Mar 2015 11:58:22 +0530
Subject: modified 'using_sage' script cut it to 2
---
getting_started_with_for/script.odt | Bin 0 -> 36511 bytes
getting_started_with_for/script.txt | 256 +++++++++++++++++++++++++
getting_started_with_for/slides.tex | 334 +++++++++++++++------------------
getting_started_with_lists/script.odt | Bin 0 -> 34989 bytes
getting_started_with_lists/script.rst | 77 +++-----
getting_started_with_lists/script.txt | 230 +++++++++++++++++++++++
getting_started_with_lists/slides.tex | 248 +++++++++++++-----------
images/fossee-logo.png | Bin 13587 -> 10564 bytes
images/iitb-logo.png | Bin 13756 -> 0 bytes
script2col.rst | 267 ++++++++++++++++++++++++++
using_sage_for_calculus/folder.png | Bin 0 -> 45829 bytes
using_sage_for_calculus/quickref.tex | 8 +
using_sage_for_calculus/script.odt | Bin 0 -> 35167 bytes
using_sage_for_calculus/script.rst | 327 ++++++++++++++++++++++++++++++++
using_sage_for_calculus/script.txt | 269 ++++++++++++++++++++++++++
using_sage_for_calculus/script2col.rst | 166 ++++++++++++++++
using_sage_for_calculus/slides.org | 117 ++++++++++++
using_sage_for_calculus/slides.tex | 200 ++++++++++++++++++++
using_sage_for_graphs/part2.rst | 178 ++++++++++++++++++
using_sage_for_graphs/script.odt | Bin 0 -> 33593 bytes
using_sage_for_graphs/slides.tex | 149 +++++++++++++++
21 files changed, 2476 insertions(+), 350 deletions(-)
create mode 100644 getting_started_with_for/script.odt
create mode 100644 getting_started_with_for/script.txt
create mode 100644 getting_started_with_lists/script.odt
create mode 100644 getting_started_with_lists/script.txt
delete mode 100644 images/iitb-logo.png
create mode 100644 script2col.rst
create mode 100644 using_sage_for_calculus/folder.png
create mode 100644 using_sage_for_calculus/quickref.tex
create mode 100644 using_sage_for_calculus/script.odt
create mode 100644 using_sage_for_calculus/script.rst
create mode 100644 using_sage_for_calculus/script.txt
create mode 100644 using_sage_for_calculus/script2col.rst
create mode 100644 using_sage_for_calculus/slides.org
create mode 100644 using_sage_for_calculus/slides.tex
create mode 100644 using_sage_for_graphs/part2.rst
create mode 100644 using_sage_for_graphs/script.odt
create mode 100644 using_sage_for_graphs/slides.tex
diff --git a/getting_started_with_for/script.odt b/getting_started_with_for/script.odt
new file mode 100644
index 0000000..b51b55c
Binary files /dev/null and b/getting_started_with_for/script.odt differ
diff --git a/getting_started_with_for/script.txt b/getting_started_with_for/script.txt
new file mode 100644
index 0000000..eb4b705
--- /dev/null
+++ b/getting_started_with_for/script.txt
@@ -0,0 +1,256 @@
+
+{| style="border-spacing:0;"
+| style="border-top:0.05pt double #808080;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"|
'''Visual Cue'''
+| style="border:0.05pt double #808080;padding:0.049cm;"| '''Narration'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 1
+
+Title Slide
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hello friends and welcome to the tutorial on '''“Getting Started with For Loop”'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 2
+
+Objectives
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| At the end of this tutorial, you will be able to,
+
+# Understand indentation in '''Python'''
+# Use the for '''loop'''.
+# Use '''range()''' '''function'''.
+# Write blocks in '''Python''' '''shell'''
+# Write blocks in '''IPython''' '''interpreter'''
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 3
+
+White-space
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| In '''Python''' whitespace is significant, and the blocks are visually separated. The convention is to indent the code using four spaces.
+
+As you can see in the slide, '''"Block B"''' is an '''inner block''', indented by 4 spaces. After '''"Block B"''' the next statement in '''"Block A" '''starts from the same indentation level of other '''"Block A" '''Statements.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 4
+
+Excercise 1
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Now, let us move straight into '''for''' '''loop'''. Write a '''for loop''' which iterates through a list of numbers and find the square root of each number. Numbers are 1369, 7225, 3364, 7056, 5625, 729, 7056, 576, 2916
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Open text editor
+
+numbers = [1369, 7225, 3364, 7056, 5625, 729, 7056, 576, 2916]
+
+for each in numbers:
+
+print “Suare root of”, each, “is ”, sqrt(each)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| For the problem, first we need to create a list of numbers and then iterate over the list and find the square root of each element in it.
+
+Let us create a script, rather than typing it out in the '''interpreter''' itself.
+
+Open your '''text editor''' and type '''numbers '''''is equal to within round brackets'' 1369 ''coma'' 7225 ''coma'' 3364, 7056, 5625, 729, 7056, 576, 2916.
+
+We have the list of numbers. Now, to iterate over it we say '''for''' '''each''' in '''numbers''' ''colon'' '''print''' ''opening double quotes'' Square root of ''closing double quotes'' ''coma'' '''each''' ''coma'' in ''double quotes'' '''is''' ''coma'' '''sqrt''' ''within'' ''round brackets'' '''each. '''Save the script as''' list_roots.py. '''
+
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| %run -i list_roots.py
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We will run the script from the '''IPython interpreter. '''So, switch to your terminal start the '''ipython interpreter''' and run the script as, ''percentage '''''run minus i list_roots.py '''and we get the square roots of the numbers.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Switch to text editor
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| So that was easy! All what we did was iterate over the list element by element and then use the element for calculation. Note that here we used two variables, the variable '''numbers''', which is a list, and the other variable '''each''', which is the element of list under consideration in each cycle of the '''for loop'''. The variable names can be chosen by you.
+
+Note that the lines after for statement, is indented using four spaces.
+
+It means that line is a part of the '''for loop''' and it is a block of code, although it is only a single statement in the block.
+
+Also, the fourth line or the immediate line after the for block is not '''indented'''.
+
+It means that it is not a part of the for loop and the lines after that don't fall in the scope of the for loop.
+
+Thus each block is separated by the '''indentation''' level and that marks the importance of white-spaces in '''Python'''.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 5
+
+Assignment 2
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Print the square root of numbers in the list. And this time let us do it right in the '''IPython''' '''interpreter'''.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Switch to the IPython interpreter
+
+numbers = [1369, 7225, 3364, 7056, 5625, 729, 7056, 576, 2916]
+
+for each in numbers:
+
+print "Square root of", each,
+
+print "is", sqrt(each)
+
+Hit enter twice
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Switch to your '''terminal '''and type '''numbers '''''is equal to within round brackets'' 1369 ''coma'' 7225 ''coma'' 3364, 7056, 5625, 729, 7056, 576, 2916.
+
+We have the list of numbers.
+
+Write the same '''for loop '''we wrote in the script.
+
+Notice that, as soon as you press the enter key after for statement, the prompt changes to four dots and the cursor is not right after the four dots but there are four spaces from the dots. Please note that '''IPython '''automatically indents the block. The four dots tell you that you are inside the block.
+
+Now type the rest of the '''for loop'''.
+
+Now we have finished the statements in the block, and still the interpreter is showing four dots, this means that you are still inside the block. To exit from the block press the return key or the enter key twice without entering anything else.
+
+We get the expected ouput.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show slide 6
+
+Exercise 3
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We will now perform an exercise to find cubes of numbers from 1 to 10 in the '''Python shell'''.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Switch to the terminal
+
+python
+
+
+for i in range(1,11):
+
+Hit enter
+
+print i, "cube is", i**3
+
+Hit enter
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| You can start the '''shell '''by issuing the command '''python''' from your '''terminal'''.
+
+Type the '''for '''statement as for i in range''' '''''within round brackets ''one ''coma ''eleven ''colon. ''
+
+Press enter once, and we will see that this time it shows three dots, but the cursor is close to the dots, so we have to indent the block. The '''python shell '''does not indent the code automatically. So enter four spaces there and then type the following print i ''coma in double quotes ''cube is ''coma ''i star star three.
+
+Now when we hit enter, we still see the four dots. To get out of the block, hit enter once again.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 7
+
+range() function
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Okay! so the main thing we learned here is how to use the '''Python shell''' and the '''IPython interpreter''' to specify blocks. But while we were writing for loops we used something new, '''range() function'''.
+
+'''range() '''is a built in function in '''Python''' which can be used to generate a list of '''integers''' from a starting number to an ending number. Note that the ending number that you specify will not be included in the list.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 8
+
+Assignment 4
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Print all the odd numbers from 1 to 50.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Switch focus to ipython interpreter
+
+ipython
+
+print range(1,51,2)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Let us do it in our '''IPython''' interpreter for ease of use.
+
+The problem can be solved by just using the range() function.
+
+It can be solved as, print range ''within square brackets ''one coma fifty one coma two
+
+This time we passed three parameters to range() function unlike the previous case where we passed only two parameters. The first parameter is the starting number of the sequence and the second parameter is the end of the range.
+
+Note that the sequence does not include the ending number. The third parameter is for stepping through the sequence.
+
+Here we gave two which means we are skipping every alternate element.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 9
+
+Summary
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| This brings us to the end of the tutorial. In this tutorial,we learned to,
+
+# create blocks in python using '''for loop'''
+# indent the blocks of code
+# iterate over a list using '''for loop'''
+# use the '''range() function'''
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 10
+
+Evaluation
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Here are some self assessment questions for you to solve
+
+# 1. '''Indentation''' is not mandatory in '''Python'''
+
+*
+** True
+** False
+
+# 2. Write a code using '''for loop''' to print the product of all natural numbers from 1 to 20.
+
+3. What will be the output of -
+
+range ''within square brackets ''one ''coma ''five
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 11
+
+Solutions
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| And the answers,
+
+# 1. False. Indentation is essential in python.
+
+2. We use the '''for loop''' in the following manner.
+
+y = 1
+
+for x in range(1,21):
+
+ y*=x
+
+print y
+
+# '''range(1, 5)''' will produce a list of integers from 1 to 4.
+# [1,2,3,4]
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 12
+
+FOSSEE
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| FOSSEE is Free and Open-source Software for Science and Engineering Education. The goal of this project is to enable all to use open source software tools. For more details, please visit the given link.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 13
+
+About the Spoken Tutorial Project
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Watch the video available at the following link. It summarizes the Spoken Tutorial project. If you do not have good bandwidth, you can download and watch it.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 14
+
+Spoken Tutorial Workshop
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The Spoken Tutorial Project Team conducts SELF workshops using spoken tutorials, gives certificates to those who pass an online test. For more details, you may write to contact@spoken-tutorial.org
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 15
+
+Acknowledgements
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Spoken Tutorial Project is a part of the "Talk to a Teacher" project. It is supported by the National Mission on Education through ICT, MHRD, Government of India. More information on this mission is available at the given link.
+
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 16
+
+Thank You
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hope you have enjoyed this tutorial and found it useful. Thank you!
+
+|}
+
diff --git a/getting_started_with_for/slides.tex b/getting_started_with_for/slides.tex
index 68c6100..b80cd8e 100644
--- a/getting_started_with_for/slides.tex
+++ b/getting_started_with_for/slides.tex
@@ -1,97 +1,82 @@
-% Created 2011-05-24 Tue 11:11
-\documentclass[presentation]{beamer}
+\documentclass[17pt]{beamer}
+%\documentclass{beamer}
+\usetheme{Madrid}
+\useoutertheme{noslidenum}
+\setbeamertemplate{navigation symbols}{}
+\usepackage{beamerthemesplit}
+\usepackage{ae,aecompl}
+\usepackage[scaled=.95]{helvet}
+\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
-\usepackage{fixltx2e}
-\usepackage{graphicx}
-\usepackage{longtable}
-\usepackage{float}
-\usepackage{wrapfig}
-\usepackage{soul}
-\usepackage{textcomp}
-\usepackage{marvosym}
-\usepackage{wasysym}
-\usepackage{latexsym}
-\usepackage{amssymb}
-\usepackage{hyperref}
-\tolerance=1000
-\usepackage[english]{babel} \usepackage{ae,aecompl}
-\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+\usepackage{mathpazo,courier,euler}
\usepackage{listings}
-\lstset{language=Python, basicstyle=\ttfamily\bfseries,
-commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
-showstringspaces=false, keywordstyle=\color{blue}\bfseries}
-\providecommand{\alert}[1]{\textbf{#1}}
+\lstset{language=sh,
+ basicstyle=\ttfamily\bfseries,
+ showstringspaces=false,
+ keywordstyle=\color{black}\bfseries}
+
+% theme split
+\usepackage{verbatim}
+\newenvironment{colorverbatim}[1][]%
+{%
+\color{blue}
+\verbatim
+}%
+{%
+\endverbatim
+}%
+
+\definecolor{NavyBlue}{RGB}{0, 76, 153}
+\setbeamercolor{structure}{fg=NavyBlue}
+\author[FOSSEE]{}
+\institute[IIT Bombay]{}
+\date[]{}
+
+% logo
+\logo{\includegraphics[height=1.30cm]{../images/3t-logo.pdf}}
+\logo{\includegraphics[height=0.6cm]{../images/fossee-logo.png}
+
+\hspace{200pt}
+\includegraphics[scale=0.5]{../images/fossee-logo.png}\\
+\hspace{275pt}
+\includegraphics[scale=0.9]{../images/3t-logo.pdf}}
-\title{}
-\author{FOSSEE}
-\date{}
-
-\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
\begin{document}
-
-
-
-
-
-
-
-
-
-
+\sffamily \bfseries
+\title
+[Getting Started With For Loop]
+{Getting Started With For Loop}
+\author
+[FOSSEE, IIT - Bombay]
+{\small Talk to a Teacher\\{\color{blue}\url{http://spoken-tutorial.org}}\\National Mission on Education
+ through ICT\\{\color{blue}\url{http://sakshat.ac.in}} \\ [0.8cm]Script by: Hardik Ghaghada \\ Narration by: \\
+ [0.5cm]
+{\small 15 May 2013}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
-
-\begin{center}
-\vspace{12pt}
-\textcolor{blue}{\huge Getting started with \texttt{for}}
-\end{center}
-\vspace{18pt}
-\begin{center}
-\vspace{10pt}
-\includegraphics[scale=0.95]{../images/fossee-logo.png}\\
-\vspace{5pt}
-\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\
-\scriptsize Funded by National Mission on Education through ICT\\
-\scriptsize MHRD,Govt. of India\\
-\includegraphics[scale=0.30]{../images/iitb-logo.png}\\
-\end{center}
+ \titlepage
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Objectives}
-\label{sec-2}
-
At the end of this tutorial, you will be able to,
-
\begin{itemize}
-\item Write blocks of code in python.
-\item Use the ``for`` loop.
-\item Use ``range()`` function.
-\item Write blocks in python interpreter
-\item Write blocks in ipython interpreter.
-\end{itemize}
-\end{frame}
-\begin{frame}
-\frametitle{Pre-requisite}
-\label{sec-3}
-
- Spoken tutorial on-
-
-\begin{itemize}
-\item Getting started with Lists
+\item Understand indentation in Python
+\item Use the for loop
+\item Use range() function
+\item Write blocks in Python shell
+\item Write blocks in IPython interpreter
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Whitespace in Python}
-\label{sec-4}
-
-
\begin{itemize}
\item Whitespace is significant
-\begin{itemize}
-\item blocks are visually separated
-\end{itemize}
-\item Blocks are indented using 4 spaces
+\item Blocks are conventionally indented using 4 spaces
\begin{verbatim}
Block A
Block A
@@ -99,157 +84,136 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
Block B
Block A
\end{verbatim}
-
- \verb~Block B~ is an inner block and is indented using 4 spaces
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Exercise 1}
-\label{sec-5}
-
Write a \verb~for~ loop which iterates through a list of numbers and find
the square root of each number.
-\begin{verbatim}
-
-\end{verbatim}
-
The numbers are,
\begin{verbatim}
- 1369, 7225, 3364, 7056, 5625, 729, 7056,
+ 1369, 7225, 3364, 7056,
+ 5625, 729, 7056,
576, 2916
\end{verbatim}
\end{frame}
-\begin{frame}[fragile]
-\frametitle{Solution 1}
-\label{sec-6}
-
-
-\begin{itemize}
-\item Open text editor and type the following code
-\lstset{language=Python}
-\begin{lstlisting}
-numbers = [1369, 7225, 3364, 7056, 5625, 729, 7056,
- 576, 2916]
-
-for each in numbers:
- print "Square root of", each, "is", sqrt(each)
-
-print "This is not in for loop!"
-\end{lstlisting}
-\end{itemize}
-\end{frame}
-\begin{frame}[fragile]
-\frametitle{Save \& run script}
-\label{sec-7}
-
-
-\begin{itemize}
-\item Save the script as \verb~list_roots.py~
-\item Run in \verb~ipython~ interpreter as,
-\begin{verbatim}
- In []: %run -i list_roots.py
-\end{verbatim}
-
-\end{itemize}
-\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Exercise 2}
-\label{sec-8}
-
Print the square root of numbers in the list.
-\begin{verbatim}
-
-\end{verbatim}
-
Numbers are,
\begin{verbatim}
- 7225, 3268, 3364, 2966, 7056, 5625, 729, 5547,
- 7056, 576, 2916
+7225, 3268, 3364, 2966, 7056,
+5625, 729, 5547, 7056, 576, 2916
\end{verbatim}
+\emph{do it in the ipython interpreter}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Exercise 3}
-\label{sec-9}
-
- Find out the cube of all the numbers from 1 to 10.
-\begin{verbatim}
-
-\end{verbatim}
-
- \emph{do it in the python interpreter}
+ Find out the cube of all the numbers from 1 to 10. \\
+ \emph{do it in the python shell}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{\verb~range()~ function}
-\label{sec-10}
-
-
-\begin{itemize}
-\item in built function in Python
-\item generates a list of integers
-\begin{itemize}
-\item \emph{syntax:} range([start,] stop[, step])
-\item \emph{example:}
-\begin{itemize}
-\item range(1, 20) - \emph{generates integers from 1 to 20}
-\item range(20) - \emph{generates integers from 0 to 20}
-\end{itemize}
-\end{itemize}
-\end{itemize}
+ \begin{itemize}
+ \item built in function in Python
+ \item generates a list of integers
+ \begin{itemize}
+ \item \emph{syntax:} range([start,] stop[, step])
+ \item \emph{example:}
+ \begin{itemize}
+ \item range(1, 20) - \emph{generates integers from 1 to 20}
+ \item range(20) - \emph{generates integers from 0 to 20}
+ \end{itemize}
+ \end{itemize}
+ \end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Exercise 4}
-\label{sec-11}
-
Print all the odd numbers from 1 to 50.
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Summary}
-\label{sec-12}
-
In this tutorial,we learnt to,
-
\begin{itemize}
-\item Create blocks in python using ``for
+\item Create blocks in python using ``for''
\item Indent the blocks of code
-\item Iterate over a list using ``for`` loop
-\item Use the ``range()`` function
+\item Iterate over a list using ``for'' loop
+\item Use the ``range()'' function
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Evaluation}
-\label{sec-13}
-
-
\begin{enumerate}
-\item Indentation is not mandatory in Python
-\begin{itemize}
-\item True
-\item False
-\end{itemize}
-\vspace{8pt}
-\item Write a code using ``for`` loop to print the product of all natural numbers from 1 to 20.
-\vspace{8pt}
-\item What will be the output of-
- range(1,5)
+ \item Indentation is not mandatory in Python
+ \begin{itemize}
+ \item True
+ \item False
+ \end{itemize}
+ \vspace{8pt}
+ \item Write a ``for'' loop to print the product of all natural numbers from 1 to 20
+ \vspace{8pt}
+ \item What will be the output of-range(1,5)
\end{enumerate}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Solutions}
-\label{sec-14}
-
-
\begin{enumerate}
-\item False
-\vspace{8pt}
-\item y = 1\\
-for x in range(1,21):\\
-\hspace{12pt}
- y*=x\\
- print y
-\vspace{8pt}
-\item {[1,2,3,4]}
+ \item False
+ \vspace{8pt}
+ \item y = 1\\
+ for x in range(1,21):\\
+ \hspace{12pt}
+ y*=x\\
+ print y
+ \vspace{8pt}
+ \item {[1,2,3,4]}
\end{enumerate}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{FOSSEE}
+{\color{NavyBlue}Free and Open Source Software for \\Education} \\
+\begin{itemize}
+\item To enable the use of free and open source software tools
+\item For more details, please visit: {\color{blue}\url{http://fossee.in/}}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{About the Spoken Tutorial Project}
+\begin{itemize}
+\item Watch the video available at {\color{blue}\url{http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial}}
+\item It summarises the Spoken Tutorial project
+\item If you do not have good bandwidth, you can download and watch it
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Spoken Tutorial Workshops}The Spoken Tutorial Project Team
+\begin{itemize}
+\item Conducts workshops using spoken tutorials
+\item Gives certificates to those who pass an online test
+\item For more details, please write to \\ \hspace {0.5cm}{\color{blue}contact@spoken-tutorial.org}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Acknowledgements}
+\begin{itemize}
+\item Spoken Tutorial Project is a part of the Talk to a Teacher project
+\item Supported by the National Mission on Education through ICT, MHRD, Government of India
+\item More information: \\{\color{blue}\url{http://spoken-tutorial.org/NMEICT-Intro}}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{block}{}
@@ -260,9 +224,9 @@ for x in range(1,21):\\
\begin{block}{}
\begin{center}
For more Information, visit our website\\
- \url{http://fossee.in/}
+ {\color{blue}\url{http://fossee.in/}}
\end{center}
\end{block}
\end{frame}
-
-\end{document}
\ No newline at end of file
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end{document}
diff --git a/getting_started_with_lists/script.odt b/getting_started_with_lists/script.odt
new file mode 100644
index 0000000..065a8d2
Binary files /dev/null and b/getting_started_with_lists/script.odt differ
diff --git a/getting_started_with_lists/script.rst b/getting_started_with_lists/script.rst
index d3d528e..43bb612 100644
--- a/getting_started_with_lists/script.rst
+++ b/getting_started_with_lists/script.rst
@@ -1,58 +1,32 @@
-.. Objectives
-.. ----------
-
-.. By the end of this tutorial, you will be able to
-
-.. Create Lists.
-.. Access List elements.
-.. Append elemets to list
-.. Delete list elemets
-
-.. 1. getting started with ipython
-
-
-
-.. Prerequisites
-.. -------------
-
-.. 1. getting started with strings
-.. #. getting started with lists
-.. #. basic datatypes
-
-.. Author : Amit
- Internal Reviewer : Anoop Jacob Thomas
- External Reviewer :
- Language Reviewer : Bhanukiran
- Checklist OK? : <12-11-2010, Anand, OK> [2010-10-05]
-
-
Script
------
.. L1
-{{{ Show the first slide containing title, name of the production
-team along with the logo of MHRD }}}
+{{{ Show the Title slide }}}
.. R1
Hello friends and welcome to the tutorial on "Getting started with
-lists".
+Lists".
.. L2
-{{{ Show slide with objectives }}}
+{{{ Show 'objectives' slide }}}
.. R2
-In this tutorial we will be getting acquainted with a python data
-structure called lists.
At the end of this tutorial, you will be able to,
1. Create lists
#. Access list elements
#. Append elements to lists
#. Delete elements from lists
+ #. Find length of the lists
+
+.. L3
+
+{{{ Show 'Lists' slide }}}
.. R3
@@ -60,37 +34,38 @@ List is a compound data type, it can contain data of mutually
different datatypes. List is also a sequence data type where all the
elements are arranged in a specific order.
-Start the ipython interpreter and first create an empty list with no
-elements.
+.. L4
-.. L3
-::
-
ipython
empty = []
type(empty)
.. R4
-
-This is an empty list without any elements.
-Lets define a non-empty list as:
+Let us start the IPython interpreter and creat an empty list. So, type on the
+terminal ipython. Now, to create an empty list we say empty is equal to empty
+square brackets. Remember that 'empty' is just a name of the list, we could give
+any name required. Further, let us check the data type of the 'empty'. For this
+we say, type(empty) and hitenter. As we can see 'empty' variable is of type
+list.
-.. L4
-::
+.. L5
+::
nonempty = ['spam', 'eggs', 100, 1.234]
.. R5
+
+That was about empty list. Now, let us define a non-empty list with some
+elements in it. So, we say, nonempty is equal to within square brackets in
+single quotes spam coma in single quotes eggs coma hundred coma one point two
+three four.
+
-Thus, the simplest way of creating a list is typing out a sequence
-of comma-separated values (or items) between two square brackets.
+.. L4
+
+.. R5
-As we can see, lists can contain different kinds of data. In the
-previous example 'spam' and 'eggs' are strings whereas 100 and 1.234 are
-integer and float respectively. Thus, we can put elements of different
-datatypes in lists including lists itself. This property makes lists
-heterogeneous data structures.
Let us include a list within a list.
diff --git a/getting_started_with_lists/script.txt b/getting_started_with_lists/script.txt
new file mode 100644
index 0000000..825da3a
--- /dev/null
+++ b/getting_started_with_lists/script.txt
@@ -0,0 +1,230 @@
+
+{| style="border-spacing:0;"
+| style="border-top:0.05pt double #808080;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| '''Visual Cue'''
+| style="border:0.05pt double #808080;padding:0.049cm;"| '''Narration'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 1
+
+Title Slide
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hello friends and welcome to the tutorial on "Getting started with lists".
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 2
+
+Objectives
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| In this tutorial we will be getting acquainted with a python data structure called lists. At the end of this tutorial, you will be able to,
+
+# Create lists
+# Access list elements
+# Append elements to lists
+# Delete elements from lists
+# Find out length of lists
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 3
+
+Lists
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| List is a compound data type, it can contain data of mutually different data types. List is also a sequence data type where all the elements are arranged in a specific order.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| ipython
+
+empty = []
+
+type(empty)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Lets start with creating an empty list. So, start the ipython interpreter and first create an empty list with no elements. Go to the '''terminal''', type '''ipython''' and hit enter. Now, to create an empty list we say '''empty''' ''is equal to empty square brackets''. Note that '''empty''' is just a name of the variable. To check the type of the variable '''empty''' we say type ''within round brackets'' name of the variable which in our case is '''empty'''''.'' As you can see the type is '''list'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty = ['spam', 'eggs', 100, 1.234]
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| That was about creating an empty list. Now, lets create a non empty list with some values in it. So, we say '''nonempty''''' is equal to within square brackets, in single quotes'' '''spam''' coma ''in single quotes'' '''eggs''' coma hundred coma one point two three four.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| listinlist=[[4,2,3,4],'and', 1, 2, 3, 4]
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Thus, the simplest way of creating a list is typing out a sequence of comma-separated values (or items) between two square brackets.
+
+As we can see, lists can contain different kinds of data. In the previous example ''''spam'''' and ''''eggs'''' are strings whereas '''100''' and '''1.234''' is '''integer''' and '''float''' respectively. Thus, we can put elements of different data types in lists including lists itself. This property makes lists heterogeneous data structures.
+
+Let us include a list within a list. So, type '''listiinlist''' ''is equal to within square brackets opening sqare bracket'' four coma two coma three coma four ''closing square bracket'' coma ''in single quotes'' '''and''' coma one coma two coma three coma four
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty[0]
+
+nonempty[1]
+
+nonempty[3]
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We can access an element of a list using its corresponding index. Index of the first element of a list is 0. So for the list nonempty, '''nonempty '''''within square brackets'' zero gives the first element, '''nonempty''' ''within square brackets one ''gives the second element and so on.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 4
+
+Excercise 1
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Pause the video here, try out the following exercise and resume the video.
+
+What happens when you do '''nonempty '''''within square brackets minus ''one.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Switch to the terminal
+
+nonempty[-1]
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| As you can see you get the last element which is 1.234.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty[-2]
+
+nonempty[-4]
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| In '''python''' negative indices are used to access elements from the end. -1 gives the last element which is the 4th element , -2 gives second element to last and -4 gives the fourth from the last which, in this case, is the first element.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty.append('onemore')
+
+nonempty
+
+nonempty.append(6)
+
+nonempty
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We can also append elements to the end of a list using the ''append'' function. So, type '''nonempty''' ''dot append within round brackets in single quotes'' '''onemore'''. Then type '''nonempty''', as you can see the element '''onemore''' has been appended to the list. Type '''nonempty''' ''within square brackets'' '''six'''. Type '''nonempety '''and you can see '''six''' is appended to the list.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 5
+
+Exercise 2
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Please, pause the video here. Do the following exercise and then continue.
+
+# What is the syntax to get the element ''''and'''' in the list, '''listinlist'' '''''?
+# How would you get ''''and'''' using negative indices?
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 6
+
+Solution 2
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The solution is on your screen
+
+To get the element ''''''''and'''''''' from the list '''listlinlist''''' ''se say '''listinlist''''' within square brackets'' '''one'''. Next, to access the element ''''''''and'''''' ''using negative index, we say '''listinlist''''' within square brackets'' minus five
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| del(nonempty[1])
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Just like we can append elements to a list, we can also remove them. There are two ways of doing it. One is by using index. We can use the '''del''' function to do this. So, type '''del''' ''within round brackets'' '''nonempty''' within ''square brackets'' '''one'''.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty.remove(100)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The function '''del''' deletes the element at index one, i.e the second element of the list which is ''''eggs''''.
+
+The other way is removing element is by content. Lets say one wishes to delete 100 from nonempty list. For this, one could use the function remove. So, type '''nonempty''' ''dot'' '''remove''' ''within round brackets'' hundred.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| nonempty.append('spam')
+
+nonempty
+
+nonempty.remove('spam')
+
+nonempty
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| But what if there were two 100's. To check that lets do a small experiment. We add one more element ''''spam'''' to our list '''nonempty'''. To do this we say '''nonempty''' ''dot'' '''append''' ''within round brackets'' in ''single quotes'' '''spam'''. Now, we remove the element '''spam''' using the '''remove''' function. If we now check, we will see that the first occurrence ''''spam'''' is removed and therefore the function '''remove''''' ''removes the first occurrence of the element in the sequence and leaves others untouched. One should remember this, that while '''del''' removes by index number, '''remove''''' ''removes on the basis of content being passed on.
+
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 7
+
+Exercise 3
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Pause the video here, try out the following exercise and resume the video.
+
+# Remove the third element from the list, '''listinlist'''.
+# Remove 'and' from the list, '''listinlist'''.
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 8
+
+Solution 3
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The solution is on your screen.
+
+'''Del '''''within round brackets '''''listinlist '''''within square brackets '''''two, '''this will remove the third element from the list '''listinlist. '''To remove the element '''and '''you can do '''listinlist '''''dot '''''remove '''''within round brackets in single quotes '''''and'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| len(nonempty)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Let us move further. We can use '''len''' function to check the number of elements in the list. Let us find out the length of the list ''''nonempty''''. Type '''len''' ''withing round brackets'' '''nonempty'''. It returns the number of elements in the list nonempty.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 9
+
+Summary
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| This brings us to the end of this tutorial. In this tutorial, we have learnt to,
+
+# Create lists.
+# Access lists using their index numbers.
+# Append elements to list using the function '''append'''.
+# Delete Element from lists by specifying the index number of the element to be deleted in the '''del''' function.
+# Delete element from list by content using '''remove''' function.
+# Find out the list length using '''len''' function.
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 10
+
+Evaluation
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Here are some self assessment questions for you to solve
+
+# How do you create an empty list ?
+# Can you have a list inside a list ?
+# How would you access the end of a list without finding its length?
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 11
+
+Solutions
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| And the answers,
+
+# We create an empty list just by leaving the space inside the square brackets empty.'''Empty''' ''is equal to empty square brackets''.
+#
+# Yes. List can contain all the other data types, including list.
+#
+# We can access the last element of the list without knowing its length using negative indices.
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 12
+
+FOSSEE
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| FOSSEE is Free and Open-source Software for Science and Engineering Education. The goal of
this project is to enable all to use open source
software tools. For more details, please visit the
given link.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 13
+
+About the Spoken Tutorial Project
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Watch the video available at the following link. It summarizes the Spoken Tutorial project. If you do
not have good bandwidth, you can download and
watch it.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 14
+
+Spoken Tutorial Workshop
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The Spoken Tutorial Project Team conducts
SELF workshops using spoken tutorials, gives
certificates to those who pass an online test.
For more details, you may write to contact@spoken-tutorial.org
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 15
+
+Acknowledgements
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Spoken Tutorial Project is a part of the "Talk to a
Teacher" project. It is supported by the National
Mission on Education through ICT, MHRD,
Government of India. More information on this
mission is available at the given link.
+
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 16
+
+Thank You
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hope you have enjoyed this tutorial and found it
useful. Thank you!
+
+|}
+
diff --git a/getting_started_with_lists/slides.tex b/getting_started_with_lists/slides.tex
index 01f8b10..c705a4c 100644
--- a/getting_started_with_lists/slides.tex
+++ b/getting_started_with_lists/slides.tex
@@ -1,70 +1,68 @@
-% Created 2011-05-24 Tue 09:52
-\documentclass[presentation]{beamer}
-\usepackage[utf8]{inputenc}
+\documentclass[17pt]{beamer}
+%\documentclass{beamer}
+\usetheme{Madrid}
+\useoutertheme{noslidenum}
+\setbeamertemplate{navigation symbols}{}
+\usepackage{beamerthemesplit}
+\usepackage{ae,aecompl}
+\usepackage[scaled=.95]{helvet}
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
-\usepackage{fixltx2e}
-\usepackage{graphicx}
-\usepackage{longtable}
-\usepackage{float}
-\usepackage{wrapfig}
-\usepackage{soul}
-\usepackage{textcomp}
-\usepackage{marvosym}
-\usepackage{wasysym}
-\usepackage{latexsym}
-\usepackage{amssymb}
-\usepackage{hyperref}
-\tolerance=1000
-\usepackage[english]{babel} \usepackage{ae,aecompl}
-\usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+\usepackage{mathpazo,courier,euler}
\usepackage{listings}
-\lstset{language=Python, basicstyle=\ttfamily\bfseries,
-commentstyle=\color{red}\itshape, stringstyle=\color
-{darkgreen},
-showstringspaces=false, keywordstyle=\color{blue}\bfseries}
-\providecommand{\alert}[1]{\textbf{#1}}
+\lstset{language=sh,
+ basicstyle=\ttfamily\bfseries,
+ showstringspaces=false,
+ keywordstyle=\color{black}\bfseries}
+
+% theme split
+\usepackage{verbatim}
+\newenvironment{colorverbatim}[1][]%
+{%
+\color{blue}
+\verbatim
+}%
+{%
+\endverbatim
+}%
+
+\definecolor{NavyBlue}{RGB}{0, 76, 153}
+\setbeamercolor{structure}{fg=NavyBlue}
+\author[FOSSEE]{}
+\institute[IIT Bombay]{}
+\date[]{}
+
+% logo
+\logo{\includegraphics[height=1.30cm]{../images/3t-logo.pdf}}
+\logo{\includegraphics[height=0.6cm]{../images/fossee-logo.png}
+
+\hspace{200pt}
+\includegraphics[scale=0.5]{../images/fossee-logo.png}\\
+\hspace{275pt}
+\includegraphics[scale=0.9]{../images/3t-logo.pdf}}
-\title{}
-\author{FOSSEE}
-\date{2010-09-14 Tue}
-
-\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
\begin{document}
-
-
-
-
-
-
-
-
-
-
-
+\sffamily \bfseries
+\title
+[Getting Started With Lists]
+{Getting Started With Lists}
+\author
+[FOSSEE, IIT - Bombay]
+{\small Talk to a Teacher\\{\color{blue}\url{http://spoken-tutorial.org}}\\National Mission on Education
+ through ICT\\{\color{blue}\url{http://sakshat.ac.in}} \\ [0.8cm]Script by: Hardik Ghaghada \\ Narration by: \\
+ [0.5cm]
+{\small 15 May 2013}}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
-
-\begin{center}
-\vspace{12pt}
-\textcolor{blue}{\huge Getting started with Lists}
-\end{center}
-\vspace{18pt}
-\begin{center}
-\vspace{10pt}
-\includegraphics[scale=0.95]{../images/fossee-logo.png}\\
-\vspace{5pt}
-\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\
-\scriptsize Funded by National Mission on Education through ICT\\
-\scriptsize MHRD,Govt. of India\\
-\includegraphics[scale=0.30]{../images/iitb-logo.png}\\
-\end{center}
+ \titlepage
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Objectives}
-\label{sec-2}
-
At the end of this tutorial, you will be able to,
-
\begin{itemize}
\item Create lists
\item Access list elements
@@ -72,108 +70,130 @@ showstringspaces=false, keywordstyle=\color{blue}\bfseries}
\item Delete elements from lists
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Lists}
+List is a compound data type, it can contain data of mutually
+different datatypes. List is also a sequence data type where all the
+elements are arranged in a specific order.
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Exercise 1}
-\label{sec-3}
-
-
\begin{itemize}
\item What happens when you do nonempty[-1].
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Exercise 2}
-\label{sec-4}
-
-
\begin{itemize}
\item What is the syntax to get the element `and'
in the list,listinlist ?
\item How would you get `and' using negative indices?
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Solution 2}
-\label{sec-5}
-
-
\lstset{language=Python}
\begin{lstlisting}
-
listinlist[1]
listinlist[-5]
\end{lstlisting}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Exercise 3}
-\label{sec-6}
-
-
-
\begin{itemize}
\item Remove the third element from the list, listinlist.
\item Remove `and' from the list, listinlist.
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}[fragile]
\frametitle{Solution 3}
-\label{sec-7}
-
\lstset{language=Python}
\begin{lstlisting}
-
del(listinlist[2])
listinlist.remove('and')
\end{lstlisting}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[fragile]
+ \frametitle{Summary}
+ In this tutorial we have learnt how to,
+ \begin{itemize}
+ \item Create lists
+ \item Access elements
+ \item Use ``append'' function
+ \item Use ``del'' function
+ \item Use ``remove'' function.
+ \item Use ``len'' function.
+ \end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[fragile]
+ \frametitle{Evaluation}
+ \begin{enumerate}
+ \item How do you create an empty list ?
+ \vspace{8pt}
+ \item Can you have a list inside a list ?
+ \vspace{8pt}
+ \item How would you access the last element of a list without finding its length?
+ \end{enumerate}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}[fragile]
+ \frametitle{Solutions}
+ \begin{enumerate}
+ \item empty=[]
+ \vspace{8pt}
+ \item Yes we can have list inside list\\
+ \vspace{8pt}
+ \item Use negative index to access the last element of the list
+ \end{enumerate}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
-\frametitle{Summary}
-\label{sec-8}
-
- In this tutorial, we have learnt to –
-
+\frametitle{FOSSEE}
+{\color{NavyBlue}Free and Open Source Software for \\Education} \\
\begin{itemize}
-\item Create lists.
-\item Access lists using their index numbers.
-\item Append elements to list using the function ``append``.
-\item Delete Element from lists by specifying the index number of the
- element to be deleted in the ``del`` function.
-\item Delete element from list by content using ``remove`` function.
-\item Find out the list length using the ``len`` function.
+\item To enable the use of free and open source software tools
+\item For more details, please visit: {\color{blue}\url{http://fossee.in/}}
\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
-\frametitle{Evaluation}
-\label{sec-9}
-
-
-\begin{enumerate}
-\item How do you create an empty list?
-\vspace{8pt}
-\item Can you have a list inside a list ?
-\vspace{8pt}
-\item How would you access the end of a list without finding its length?
-\end{enumerate}
+\frametitle{About the Spoken Tutorial Project}
+\begin{itemize}
+\item Watch the video available at {\color{blue}\url{http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial}}
+\item It summarises the Spoken Tutorial project
+\item If you do not have good bandwidth, you can download and watch it
+\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
-\frametitle{Solutions}
-\label{sec-10}
-
-
-\begin{enumerate}
-\item empty=[]
-\vspace{8pt}
-\item Yes\\
-list\_in\_list=[2.3,[2,4,6],'string,'all datatypes can be there']
-\vspace{8pt}
-\item Using negative indices\\
-nonempty = ['spam', `eggs', 100, 1.234]\\
- nonempty[-1]
-\end{enumerate}
+\frametitle{Spoken Tutorial Workshops}The Spoken Tutorial Project Team
+\begin{itemize}
+\item Conducts workshops using spoken tutorials
+\item Gives certificates to those who pass an online test
+\item For more details, please write to \\ \hspace {0.5cm}{\color{blue}contact@spoken-tutorial.org}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Acknowledgements}
+\begin{itemize}
+\item Spoken Tutorial Project is a part of the Talk to a Teacher project
+\item Supported by the National Mission on Education through ICT, MHRD, Government of India
+\item More information: \\{\color{blue}\url{http://spoken-tutorial.org/NMEICT-Intro}}
+\end{itemize}
\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
- \begin{block}{}
+ \begin{block}{}
\begin{center}
\textcolor{blue}{\Large THANK YOU!}
\end{center}
@@ -181,9 +201,9 @@ nonempty = ['spam', `eggs', 100, 1.234]\\
\begin{block}{}
\begin{center}
For more Information, visit our website\\
- \url{http://fossee.in/}
+ {\color{blue}\url{http://fossee.in/}}
\end{center}
\end{block}
\end{frame}
-
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document}
diff --git a/images/fossee-logo.png b/images/fossee-logo.png
index 49d1797..c0ea381 100644
Binary files a/images/fossee-logo.png and b/images/fossee-logo.png differ
diff --git a/images/iitb-logo.png b/images/iitb-logo.png
deleted file mode 100644
index 38ec17e..0000000
Binary files a/images/iitb-logo.png and /dev/null differ
diff --git a/script2col.rst b/script2col.rst
new file mode 100644
index 0000000..3e820d6
--- /dev/null
+++ b/script2col.rst
@@ -0,0 +1,267 @@
+.. Objectives
+.. ----------
+
+.. At the end of this tutorial, you will be able to
+
+.. 1. Execute python scripts from command line.
+.. #. Use import in scripts.
+.. #. Import scipy and pylab modules
+.. #. Use python standard modules and 3rd party modules.
+
+
+.. Prerequisites
+.. -------------
+
+.. 1. should have ``pylab`` installed.
+.. #. using plot command interactively.
+.. #. embellishing a plot.
+.. #. saving plots.
+
+.. Author : Anoop Jacob Thomas
+ Internal Reviewer : Puneeth
+ External Reviewer :
+ Language Reviewer : Bhanukiran
+ Checklist OK? : <11-11-2010, Anand, OK> [2010-10-05]
+
+
+====================
+Using Python modules
+====================
+
+
+
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the first slide containing title, name of the production | Hello Friends and Welcome to the spoken tutorial on |
+| team along with the logo of MHRD }}} | 'Using Python Modules'. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to objectives slide }}} | At the end of this tutorial, you will be able to , |
+| | |
+| | 1. Execute python scripts from command line. |
+| | #. Use import in scripts. |
+| | #. Import scipy and pylab modules. |
+| | #. Use python standard modules and 3rd party modules. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Switch to the pre-requisite slide }}} | Before beginning this tutorial,we would suggest you to complete the |
+| | tutorial on "Using plot interactively", "Embellishing a plot" and |
+| | "Saving plots". |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide on running python scripts from | |
+| command line }}} | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | Let us create a simple python script to print hello world. Open your |
+| | text editor and type the following, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ open the text editor and type the following }}} | |
+| :: | |
+| | |
+| print "Hello world!" | |
+| print | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ save the script as hello.py }}} | Now save this script as ``hello.py``, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Open the terminal }}} | Start the ipython interpreter |
+| :: | |
+| | |
+| ipython | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | In the previous tutorials,we have seen how to run a script using |
+| | the IPython interpreter using ``%run`` |
+| %run -i hello.py | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Close the terminal }}} | but this is not the correct way of running a python |
+| | script. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ open terminal and navigate to directory where hello.py was saved }}} | The correct method is to run it using the Python interpreter. Open the |
+| | terminal and navigate to the directory where hello.py is, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | now run the Python script as, |
+| | |
+| python hello.py | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | It executed the script and we got the output ``Hello World!``. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide }}} | The syntax is ``python space filename``. |
+| {{{ highlight ``python filename`` syntax on slide while narrating }}} | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, four plot problem }}} | Now, we have a four plot problem where we have plotted four plots in a |
+| | single figure. Let us run that script from command line. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ open the four_plot.py file in text editor and show }}} | If you don't have the script, then make one with the following set of |
+| {{{ Pause for some time and then continue }}} | commands |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | Now let us run four_plot.py as a python script. |
+| | |
+| python four_plot.py | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | Oops! even though it was supposed to work, it didn't. It gave an error |
+| | ``linspace()`` is not defined, which means that the function |
+| | ``linspace()`` is not available in the current name-space. |
+| | |
+| | But if you try to run the same script using ``%run -i four_plot.py`` |
+| | in your IPython interpreter started with the option ``-pylab`` it will |
+| | work, because the ``-pylab`` option does some work for us by importing |
+| | the required modules to our name-space when ipython interpreter |
+| | starts. And thus we don't have to explicitly import modules. |
+| | |
+| | So now let us try to fix the problem and run the script in command |
+| | line, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, fix ``linspace`` problem }}} | add this line as the first line in the script, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ add the line as first line in four_plot.py and save }}} | |
+| :: | |
+| | |
+| from scipy import * | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | Now let us run the script again, |
+| | |
+| python four_plot.py | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | Now it gave another error -- plot not defined, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, thank you slide }}} | let us edit the file again and add this line as the |
+| | second line in our script and save it, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ add the line as second line in four_plot.py and save }}} | |
+| :: | |
+| | |
+| from pylab import * | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Switch to the terminal }}} | And now, run the script, |
+| :: | |
+| | |
+| python four_plot.py | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | Yes! it worked. So what did we do? |
+| | |
+| | We actually imported the required modules using the keyword ``import``. |
+| | It could also be done as by using, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, better way of fixing }}} | from scipy import linspace |
+| {{{ highlight the required line while narrating }}} | |
+| | instead of, |
+| | |
+| | from scipy import * |
+| | |
+| | So in practice it is always good to use function names instead of |
+| | asterisk or star. If we use asterisk to import from a particular |
+| | module then it will replace any existing functions with the same name |
+| | in our name-space. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, Instead of ``*`` }}} | So let us modify four_plot.py as, |
+| | Hence we delete the first two lines of our code which we had added |
+| | and add these lines |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Switch to script 'four_plot.py' }}} | |
+| {{{ delete the first two lines and add the following }}} | |
+| :: | |
+| | |
+| from scipy import linspace, pi, sin | |
+| from pylab import plot, legend, annotate | |
+| from pylab import xlim, ylim, title, show | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | Now let us try running the code again as, |
+| | |
+| python four_plot.py | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | It works! In this method we actually imported the functions to the |
+| | current name-space.There is one more way of doing it. And that |
+| | is, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to slide 'another fix' }}} | Notice that we use ``scipy.pi`` instead of just ``pi`` as in the |
+| {{{ highlight the required line while narrating }}} | previous method, and the functions are called as ``pylab.plot()`` and |
+| | ``pylab.annotate()`` and not as ``plot()`` and ``annotate()``. |
+| | |
+| | Pause the video here, try out the following exercise and resume the video. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show slide with exercise 1 }}} | Write a script to plot a sine wave from minus two pi to two pi. |
+| | |
+| | It can solved as, |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ open sine.py and show it }}} | The first line we import the required functions ``linspace()`` , |
+| | ``sin()`` and constant ``pi`` from the module scipy. The second and |
+| | third line we import the functions ``plot()``, ``legend()``, |
+| | ``show()``, ``title()``, ``xlabel()`` and ``ylabel()``. And the rest |
+| | the code to generate the plot. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Pause for sometime and then continue }}} | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Switch to the terminal }}} | We can run it as, |
+| :: | |
+| | |
+| python sine.py | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | As we can see, we our sine plot.Let us move further in our topic. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, What is a module? }}} | Until now we have been learning about importing modules, now what is a |
+| | module? |
+| | |
+| | A module is simply a file containing Python definitions and |
+| | statements. Definitions from a module can be imported into other |
+| | modules or into the main module. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, Python standard library }}} | Python has a very rich standard library of modules. It is very |
+| | extensive, offering a wide range of facilities. Some of the standard |
+| | modules are, |
+| | |
+| | for Math: math, random |
+| | for Internet access: urllib2, smtplib |
+| | for System, Command line arguments: sys |
+| | for Operating system interface: os |
+| | for regular expressions: re |
+| | for compression: gzip, zipfile, tarfile |
+| | And there are lot more. |
+| | |
+| | Find more information at Python Library reference, |
+| | ``http://docs.python.org/library/`` |
+| | |
+| | There are a lot of other modules like pylab, scipy, Mayavi, etc which |
+| | are not part of the standard python library. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ switch to next slide, summary }}} | This brings us to the end of this tutorial. In this tutorial, we have |
+| | learnt to, |
+| | |
+| | 1. Run scripts from command line, |
+| | #. Import modules by specifying the module name followed by |
+| | an asterisk. |
+| | #. Import only the required functions from modules by specifying |
+| | the function name. |
+| | #. Use python standard library. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{Show self assessment questions slide}}} | Here are some self assessment questions for you to solve |
+| | |
+| | 1. Which among this is correct ? |
+| | |
+| | - from scipy import plot |
+| | - from numpy import plot |
+| | - from matplotlib import plot |
+| | - from pylab import plot |
+| | |
+| | 2. Which among these libraries is part of python standard library ? |
+| | |
+| | - Mayavi |
+| | - scipy |
+| | - matplotlib |
+| | - urllib2 |
+| | |
+| | 3. Functions ``xlim()`` and ``ylim()`` can be imported to the current |
+| | name-space as, |
+| | |
+| | - from pylab import xlim, ylim |
+| | - import pylab |
+| | - from scipy import xlim, ylim |
+| | - import scipy |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{solution of self assessment questions on slide}}} | And the answers, |
+| | |
+| | 1. The option ``from pylab import plot`` is the correct one, since plot |
+| | is a function of module module. |
+| | |
+| | 2. ``urllib2`` is a part of the python standard library. |
+| | |
+| | 3. Functions ``xlim()`` and ``ylim()`` can be imported to the current |
+| | name-space as, ``from pylab import xlim, ylim``. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| | Hope you have enjoyed this tutorial and found it useful. |
+| | Thank you! |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
diff --git a/using_sage_for_calculus/folder.png b/using_sage_for_calculus/folder.png
new file mode 100644
index 0000000..42d01a2
Binary files /dev/null and b/using_sage_for_calculus/folder.png differ
diff --git a/using_sage_for_calculus/quickref.tex b/using_sage_for_calculus/quickref.tex
new file mode 100644
index 0000000..b26d168
--- /dev/null
+++ b/using_sage_for_calculus/quickref.tex
@@ -0,0 +1,8 @@
+Creating a linear array:\\
+{\ex \lstinline| x = linspace(0, 2*pi, 50)|}
+
+Plotting two variables:\\
+{\ex \lstinline| plot(x, sin(x))|}
+
+Plotting two lists of equal length x, y:\\
+{\ex \lstinline| plot(x, y)|}
diff --git a/using_sage_for_calculus/script.odt b/using_sage_for_calculus/script.odt
new file mode 100644
index 0000000..f26e438
Binary files /dev/null and b/using_sage_for_calculus/script.odt differ
diff --git a/using_sage_for_calculus/script.rst b/using_sage_for_calculus/script.rst
new file mode 100644
index 0000000..f465248
--- /dev/null
+++ b/using_sage_for_calculus/script.rst
@@ -0,0 +1,327 @@
+.. Objectives
+.. ----------
+
+.. By the end of this tutorial you will --
+
+.. 1. Get an idea of the range of things for which Sage can be used.
+.. #. Know some of the functions for Calculus
+.. #. Get some insight into Graphs in Sage.
+
+
+.. Prerequisites
+.. -------------
+
+.. Getting Started -- Sage
+
+Script
+------
+
+.. L1
+
+{{{ Show the title slide }}}
+
+.. R1
+
+Hello Friends and Welcome to the tutorial on 'Using Sage for Calculus'.
+
+.. L2
+
+{{{ show the 'objectives' slide }}}
+
+.. R2
+
+At the end of this tutorial, you will be able to,
+
+ 1. Learn the range of things for which Sage can be used.
+ #. Perform integrations & other Calculus in Sage.
+ #. Perform matrix algebra in sage.
+
+.. L3
+
+{{{ show the 'pre-requisite' slide }}}
+
+.. R3
+
+Before beginning this tutorial,we would suggest you to complete the
+tutorial on "Getting started with Sage".
+
+Let us begin with Calculus. We shall be looking at limits,
+differentiation, integration, and Taylor polynomial.
+
+.. L4
+
+{{{ open sage notebook }}}
+
+.. R4
+
+We have our Sage notebook running. In case, you don't have it running,
+start is using the command, ``sage --notebook``.
+
+.. R5
+
+To begin with, let us find the limit of the function x*sin(1/x), at x=0.
+To do this we say
+
+.. L5
+::
+
+ lim(x*sin(1/x), x=0)
+
+.. R6
+
+As expected, we get the limit to be 0.
+
+It is also possible to limit a point from one direction. For
+example, let us find the limit of 1/x at x=0, when approaching from
+the positive side.
+
+.. L6
+::
+
+ lim(1/x, x=0, dir='right')
+
+.. R7
+
+We get the limit from positive side.
+To find the limit from the negative side, we say,
+
+.. L7
+::
+
+ lim(1/x, x=0, dir='left')
+
+.. L8
+
+{{{ Show the 'differential expression' slide }}}
+
+.. R8
+
+Let us now see how to perform differentiation, using Sage. We shall
+find the differential of the expression ``exp(sin(x^2))/x`` w.r.t ``x``.
+For this, we shall first define the expression, and then use the ``diff``
+function to obtain the differential of the expression. So, switch to the sage
+notebook and type
+
+.. L9
+::
+
+ var('x')
+ f = exp(sin(x^2))/x
+ diff(f, x)
+
+.. R9
+
+And we get the expected differential of the expression.
+
+.. L10
+
+{{{ Show the slide 'Partial Differentiation' }}}
+
+.. R10
+
+We can also obtain the partial differentiation of an expression with one of the
+vriables. Let us differentiate the expression
+``exp(sin(y - x^2))/x`` w.r.t x and y. Switch to sage notebook and type
+
+.. L11
+::
+
+ var('x y')
+ f = exp(sin(y - x^2))/x
+ diff(f, x)
+ diff(f, y)
+
+.. R11
+
+Thus we get our partial differential solution.
+
+.. L12
+
+{{{ Show the 'integration' slide }}}
+
+.. R12
+
+Now, let us look at integration. We shall use the expression obtained
+from the differentiation that we calculated before, ``diff(f, y)``
+which gave us the expression ---``cos(-x^2 + y)*e^(sin(-x^2 + y))/x``.
+The ``integrate`` command is used to obtain the integral of an
+expression or function. So, switch to sage notebook and type.
+
+.. L13
+{{{ Switch to sage }}}
+::
+
+ integrate(cos(-x^2 + y)*e^(sin(-x^2 + y))/x, y)
+
+.. R13
+
+As we can see, we get back the correct expression. The minus sign being
+inside or outside the ``sin`` function doesn't change much.
+
+Now, let us find the value of the integral between the limits 0 and
+pi/2.
+
+.. L14
+::
+
+ integral(e^(sin(-x^2 + y))*cos(-x^2 + y)/x, y, 0, pi/2)
+
+.. R14
+
+Hence we get our solution for the definite integration.
+Let us now see how to obtain the Taylor expansion of an expression
+using sage. We will obtain the Taylor expansion of ``(x + 1)^n`` up to
+degree 4 about 0.
+
+.. L15
+::
+
+ var('x n')
+ taylor((x+1)^n, x, 0, 4)
+
+.. R15
+
+We easily got the Taylor expansion,using the function ``taylor()``.
+This brings us to the end of the features of Sage for Calculus, that
+we will be looking at.
+
+.. L16
+
+{{{ Show the 'More on Calculus' slide }}}
+
+.. R16
+
+For more on calculus you may look at the Calculus quick-ref from the Sage
+documentation at the given link.
+
+.. L17
+
+{{{ show the 'Equation' slide }}}
+
+.. R17
+
+Next let us move on to Matrix Algebra.
+Let us begin with solving the equation ``Ax = v``, where A is the
+matrix ``matrix([[1,2],[3,4]])`` and v is the vector
+``vector([1,2])``.
+
+.. R18
+
+To solve the equation, ``Ax = v`` we simply say
+
+.. L18
+
+{{{ Switch back to sage notebook page }}}
+::
+
+ A = matrix([[1,2],
+ [3,4]])
+ v = vector([1,2])
+ x = A.solve_right(v)
+ x
+
+.. R19
+
+To solve the equation, ``xA = v`` we simply say.
+The left and right here, denote the position of ``A``, relative to x.
+
+.. L19
+::
+
+ x = A.solve_left(v)
+ x
+
+.. L20
+
+{{{ show the 'Summary' slide }}}
+
+.. R20
+
+This brings us to the end of this tutorial. In this tutorial we have learned to
+
+1. Use functions like lim(), integrate(), integral(), solve()
+#. Use sage for performing matrix algebra, integrations & other calculus
+operations using the above mentioned functions.
+
+.. L21
+
+{{{ Show the 'Evaluation' slide }}}
+
+.. R21
+
+Here are some self assessment questions for you to solve.
+
+ 1. How do you find the limit of the function x/sin(x) as x tends to 0 from the
+ negative side.
+
+ #. Solve the system of linear equations
+ x-2y+3z = 7
+ 2x+3y-z = 5
+ x+2y+4z = 9
+
+Try the xercises and switch to next slide for solutions.
+
+.. L22
+
+{{{ Show the 'Solutions' slide }}}
+
+.. R22
+
+ 1. To find the limit of the function x/sin(x) as x tends to 0 from negative
+side, use the lim function as: lim(x/sin(x), x=0, dir'left')
+
+ #. A = Matrix([1, -2, 3], [2, 3, -1], [1, 2, 4]])
+ b = vector([7, 5, 9])
+ x = A.solve_right(b)
+ x
+
+.. L23
+
+{{{ Show the 'FOSSEE' slide }}}
+
+.. R23
+
+FOSSEE is Free and Open-source Software for Science and Engineering Education.
+The goal of this project is to enable all to use open source software tools.
+For more details, please visit the given link.
+
+.. L24
+
+{{{ Show the 'About the Spoken Tutorial Project' slide }}}
+
+.. R24
+
+Watch the video available at the following link. It summarizes the Spoken
+Tutorial project. If you do not have good bandwidth, you can download and
+watch it.
+
+.. L25
+
+{{{ Show the 'Spoken Tutorial Workshops' slide }}}
+
+.. R25
+
+The Spoken Tutorial Project Team conducts workshops using spoken tutorials,
+gives certificates to those who pass an online test.
+
+For more details, please write to contact@spoken-tutorial.org
+
+.. L26
+
+{{{ Show the 'Acknowledgements' slide }}}
+
+.. R26
+
+Spoken Tutorial Project is a part of the "Talk to a Teacher" project.
+It is supported by the National Mission on Education through ICT, MHRD,
+Government of India. More information on this mission is available at the
+given link.
+
+.. L27
+
+{{{Show the 'Thank you' slide }}}
+
+.. R27
+
+Hope you have enjoyed this tutorial and found it useful.
+Thank you!
diff --git a/using_sage_for_calculus/script.txt b/using_sage_for_calculus/script.txt
new file mode 100644
index 0000000..87a4d7d
--- /dev/null
+++ b/using_sage_for_calculus/script.txt
@@ -0,0 +1,269 @@
+
+{| style="border-spacing:0;"
+| style="border-top:0.05pt double #808080;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| '''Visual Cue'''
+| style="border:0.05pt double #808080;padding:0.049cm;"| '''Narration'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 1
+
+Title Slide
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hello Friends and Welcome to the tutorial on 'Using Sage'.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 2
+
+Objectives
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| # At the end of this tutorial, you will be able to,
+#
+# 1. Learn the range of things for which Sage can be used.
+# 2. Perform integrations & other Calculus in Sage.
+# 3. Perform matrix algebra in sage.
+
+Let us begin with Calculus. We shall be looking at limits, differentiation, integration, and Taylor polynomial.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Open sage notebook
+
+lim(x*sin(1/x), x=0)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We have our '''Sage''' '''notebook''' running. In case, you don't have it running,
start is using the command, '''sage''' ''space hyphen hyphen'' '''notebook.
'''
+
+To begin with, let us find the limit of the function '''x*sin(1/x)''', at '''x=0'''.
To do this we can use the '''lim''' '''funtcion''' as, '''lim''' ''within brackets'' '''x''' ''star '''''sin''' ''within brackets'' '''one''' ''divided by'' '''x '''''coma '''''x '''''is equal to '''''zero'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| lim(1/x, x=0, dir='right')
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We get the limit to be 0, as expected.
+
+It is also possible to limit a point from one direction. For example, let us find the limit of '''1/x''' at '''x=0''', when approaching from the positive side. So we say '''lim '''''within brackets '''''one by x, x=0, dir '''''is equal to in single quotes '''''right.'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| lim(1/x, x=0, dir='left')
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The same way we can even find the limit from the negative side, we say, '''lim '''''within brackets '''''one by x, x=0, dir '''''is equal to in single quotes '''''left.'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 3
+
+
+Differential Expression
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Let us now see how to perform '''differentiation''', using '''Sage'''. We shall find the '''differential''' of the expression '''sin''' '''square''' '''by x''' with reference to '''x '''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| var('x')
+
+f = exp(sin(x^2))/x
+
+diff(f, x)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| So switch to the sage notebook.
+
+We shall first define the expression, and then use the '''diff '''function to obtain the differential of the expression.
+
+So, type '''var '''''within round brackets in single quotes '''''x. '''Now, '''f '''''is equal to '''''exp '''''within brackets '''''sin '''''within brackets '''''x '''''to the power '''''two by x.'''
+
+We have the expression now and will obtain the differential using the '''diff function.'''
+
+Type '''diff '''''within brackets '''''f '''''coma '''''x.'''
+
+We get the differential.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show slide 4
+
+Partial Differential Expression
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We can also obtain the partial differentiation of an expression with one of the vriables.
+
+Let us '''differentiate''' the '''expression
'''shown on the slide with
+
+reference to '''x''' and '''y'''. Switch to sage notebook
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| var('x y')
+
+f = exp(sin(y - x^2))/x
+
+
+diff(f, x)
+
+
+diff(f, y)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| We first define the expression.
+
+So type, '''var '''''within round brackets in single quotes '''''x y'''
+
+Then, '''f '''''is equal to '''''exp '''''in brackets '''''sin '''''in brackets '''''y '''''minus '''''x '''''to the power''''' two by x.'''
+
+So the expression is ready now to get the partial differential of the expression we say '''diff '''''in brackets '''''f, x.'''
+
+Similarly for '''y '''we say '''diff '''''in brackets '''''f, y''.'''''
+
+Thus we get our partial differential solution.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 5
+
+Integration
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Now, let us look at integration. We shall use the expression obtained from the differentiation that we calculated before, diff(f, y) which gave us the expression shown on the slide.
+
+The integrate command is used to obtain the integral of an expression or function.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| integrate(cos(-x^2 + y)*e^(sin(-x^2 + y))/x, y)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| So, switch to sage notebook and type, '''integrate '''and the expression we got from the previous calculation. As we can see, we get back the correct expression.
+
+The minus sign being
inside or outside the '''sin function''' doesn't change much.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| integral(e^(sin(-x^2 + y))*cos(-x^2 + y)/x, y, 0, pi/2)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| As we can see,we get back the correct expression. The minus sign being inside or outside the sin function doesn't change much.
+
+Now, let us find the value of the integral between the limits 0 and pi/2.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| var('x n')
+
+taylor((x+1)^n, x, 0, 4)
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hence we get our solution for the definite integration. Let us now see how to obtain the Taylor expansion of an expression using sage using '''taylor function'''.
+
+Let us obtain the Taylor expansion of(x+1)^nup to degree 4 about 0.
+
+For this, type, '''var '''''in brackets '''''x n'''
+
+Now, '''taylor '''''in brackets again in brackets '''''x + one '''''the whole to the power '''''n '''''coma '''''x, zero, four.'''
+
+We easily got the Taylor expansion,using the function taylor().
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 6
+
+
+More on Calculus
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| That we will be all about the features of '''Sage '''for calculus we will be looking at. For more, look at the Calculus quick-ref from the Sage Wiki.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 7
+
+Equation
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Next let us move on to Matrix Algebra. Let us begin with solving the equation. Ax = v, where A is the matrix matrix([[1,2],[3,4]]) and v is the vector vector([1,2]).
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Switch back to sage notebook page
+
+A = matrix([[1,2],
+
+ [3,4]])
+
+v = vector([1,2])
+
+x = A.solve_right(v)
+
+x
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| To solve the equation, Ax = v we simply say,
+
+
+'''A '''''is equal to '''''matrix '''''within round brackets in square brackets '''''one, two, '''''again in square brackets '''''three, four'''
+
+'''v '''''is equal to '''''vector '''''within round brackets in square brackets '''''one, two'''
+
+'''x '''''is equal to '''''A '''''dot '''''solve_right '''''in brackets '''''v'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| x = A.solve_left(v)
+
+x
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| To solve the equation, xA = v we simply say,
+
+
+'''x '''''is equal to '''''A '''''dot '''''solve_left '''''in brackets '''''v'''
+
+
+'''The left and right here, denote the position of A, relative to x.'''
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 8
+
+Summary slide
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| # This brings us to the end of this tutorial. In this tutorial we have learned to
+#
+# 1. Use functions like '''lim(), integrate(), integral(), solve()'''
+# #. Use '''sage''' for performing '''matrix algebra, integrations''' & other calculus
operations using the above mentioned functions.
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 9
+
+Evaluation
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Here are some self assessment questions for you to solve
+
+1. How do you find the limit of the function '''x/sin(x)''' as '''x''' tends to '''0''' from the
negative side.
+
+2. Solve the system of linear equations
+
+x-2y+3z = 7
+
+2x+3y-z = 5
+
+x+2y+4z = 9
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 10
+
+Solutions
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| And the answers,
+
+# 1. To find the limit of the function x/sin(x) as x tends to 0 from negative
side, use the lim function as:
+#
+
+ lim(x/sin(x), x=0, dir="left")
+
+# We shall first write the equations in '''matrix''' form and then use the '''solve()''' function
+#
+
+ A = Matrix([[1, -2, 3],
+ [2, 3, -1],
+ [1, 2, 4]])
+
+b = vector([7, 5, 9])
+
+
+x = A.solve_right(b)
+
+To view the output type x
+
+x
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 11
+
+FOSSEE
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| FOSSEE is Free and Open-source Software for Science and Engineering Education. The goal of this project is to enable all to use open source software tools. For more details, please visit the given link.
+
+|}
+
+{| style="border-spacing:0;"
+| style="border-top:0.05pt double #808080;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 12
+
+About the Spoken Tutorial Project
+| style="border:0.05pt double #808080;padding:0.049cm;"| Watch the video available at the following link. It summarizes the Spoken Tutorial project. If you do not have good bandwidth, you can download and watch it.
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 13
+
+Spoken Tutorial Workshop
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| The Spoken Tutorial Project Team conducts SELF workshops using spoken tutorials, gives certificates to those who pass an online test. For more details, you may write to contact@spoken-tutorial.org
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 14
+
+Acknowledgements
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Spoken Tutorial Project is a part of the "Talk to a Teacher" project. It is supported by the National Mission on Education through ICT, MHRD, Government of India. More information on this mission is available at the given link.
+
+
+
+
+|-
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:none;padding:0.049cm;"| Show Slide 15
+
+Thank You
+| style="border-top:none;border-bottom:0.05pt double #808080;border-left:0.05pt double #808080;border-right:0.05pt double #808080;padding:0.049cm;"| Hope you have enjoyed this tutorial and found it useful. Thank you!
+
+|}
+
diff --git a/using_sage_for_calculus/script2col.rst b/using_sage_for_calculus/script2col.rst
new file mode 100644
index 0000000..16c4871
--- /dev/null
+++ b/using_sage_for_calculus/script2col.rst
@@ -0,0 +1,166 @@
+.. Objectives
+.. ----------
+
+.. By the end of this tutorial you will --
+
+.. 1. Get an idea of the range of things for which Sage can be used.
+.. #. Know some of the functions for Calculus
+.. #. Get some insight into Graphs in Sage.
+
+
+.. Prerequisites
+.. -------------
+
+.. Getting Started -- Sage
+
+Script
+------
+
+
+
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the title slide }}} | Hello Friends and Welcome to the tutorial on 'Using Sage for Calculus'. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ show the 'objectives' slide }}} | At the end of this tutorial, you will be able to, |
+| | |
+| | 1. Learn the range of things for which Sage can be used. |
+| | #. Perform integrations & other Calculus in Sage. |
+| | #. Perform matrix algebra in sage. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ show the 'pre-requisite' slide }}} | Before beginning this tutorial,we would suggest you to complete the |
+| | tutorial on "Getting started with Sage". |
+| | |
+| | Let us begin with Calculus. We shall be looking at limits, |
+| | differentiation, integration, and Taylor polynomial. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ open sage notebook }}} | We have our Sage notebook running. In case, you don't have it running, |
+| | start is using the command, ``sage --notebook``. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | To begin with, let us find the limit of the function x*sin(1/x), at x=0. |
+| | To do this we say |
+| lim(x*sin(1/x), x=0) | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | As expected, we get the limit to be 0. |
+| | |
+| lim(1/x, x=0, dir='right') | It is also possible to limit a point from one direction. For |
+| | example, let us find the limit of 1/x at x=0, when approaching from |
+| | the positive side. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | We get the limit from positive side. |
+| | To find the limit from the negative side, we say, |
+| lim(1/x, x=0, dir='left') | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'differential expression' slide }}} | Let us now see how to perform differentiation, using Sage. We shall |
+| | find the differential of the expression ``exp(sin(x^2))/x`` w.r.t ``x``. |
+| | For this, we shall first define the expression, and then use the ``diff`` |
+| | function to obtain the differential of the expression. So, switch to the sage |
+| | notebook and type |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | And we get the expected differential of the expression. |
+| | |
+| var('x') | |
+| f = exp(sin(x^2))/x | |
+| diff(f, x) | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the slide 'Partial Differentiation' }}} | We can also obtain the partial differentiation of an expression with one of the |
+| | vriables. Let us differentiate the expression |
+| | ``exp(sin(y - x^2))/x`` w.r.t x and y. Switch to sage notebook and type |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | Thus we get our partial differential solution. |
+| | |
+| var('x y') | |
+| f = exp(sin(y - x^2))/x | |
+| diff(f, x) | |
+| diff(f, y) | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'integration' slide }}} | Now, let us look at integration. We shall use the expression obtained |
+| | from the differentiation that we calculated before, ``diff(f, y)`` |
+| | which gave us the expression ---``cos(-x^2 + y)*e^(sin(-x^2 + y))/x``. |
+| | The ``integrate`` command is used to obtain the integral of an |
+| | expression or function. So, switch to sage notebook and type. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Switch to sage }}} | As we can see, we get back the correct expression. The minus sign being |
+| :: | inside or outside the ``sin`` function doesn't change much. |
+| | |
+| integrate(cos(-x^2 + y)*e^(sin(-x^2 + y))/x, y) | Now, let us find the value of the integral between the limits 0 and |
+| | pi/2. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | Hence we get our solution for the definite integration. |
+| | Let us now see how to obtain the Taylor expansion of an expression |
+| integral(e^(sin(-x^2 + y))*cos(-x^2 + y)/x, y, 0, pi/2) | using sage. We will obtain the Taylor expansion of ``(x + 1)^n`` up to |
+| | degree 4 about 0. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | We easily got the Taylor expansion,using the function ``taylor()``. |
+| | This brings us to the end of the features of Sage for Calculus, that |
+| var('x n') | we will be looking at. |
+| taylor((x+1)^n, x, 0, 4) | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'More on Calculus' slide }}} | For more on calculus you may look at the Calculus quick-ref from the Sage |
+| | documentation at the given link. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ show the 'Equation' slide }}} | Next let us move on to Matrix Algebra. |
+| | Let us begin with solving the equation ``Ax = v``, where A is the |
+| | matrix ``matrix([[1,2],[3,4]])`` and v is the vector |
+| | ``vector([1,2])``. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Switch back to sage notebook page }}} | To solve the equation, ``Ax = v`` we simply say |
+| :: | |
+| | |
+| A = matrix([[1,2], | |
+| [3,4]]) | |
+| v = vector([1,2]) | |
+| x = A.solve_right(v) | |
+| x | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| :: | To solve the equation, ``xA = v`` we simply say. |
+| | The left and right here, denote the position of ``A``, relative to x. |
+| x = A.solve_left(v) | |
+| x | |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ show the 'Summary' slide }}} | This brings us to the end of this tutorial. In this tutorial we have learned to |
+| | |
+| | 1. Use functions like lim(), integrate(), integral(), solve() |
+| | #. Use sage for performing matrix algebra, integrations & other calculus |
+| | operations using the above mentioned functions. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'Evaluation' slide }}} | Here are some self assessment questions for you to solve. |
+| | |
+| | 1. How do you find the limit of the function x/sin(x) as x tends to 0 from the |
+| | negative side. |
+| | |
+| | #. Solve the system of linear equations |
+| | x-2y+3z = 7 |
+| | 2x+3y-z = 5 |
+| | x+2y+4z = 9 |
+| | |
+| | Try the xercises and switch to next slide for solutions. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'Solutions' slide }}} | 1. To find the limit of the function x/sin(x) as x tends to 0 from negative |
+| | side, use the lim function as: lim(x/sin(x), x=0, dir'left') |
+| | |
+| | #. A = Matrix([1, -2, 3], [2, 3, -1], [1, 2, 4]]) |
+| | b = vector([7, 5, 9]) |
+| | x = A.solve_right(b) |
+| | x |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'FOSSEE' slide }}} | FOSSEE is Free and Open-source Software for Science and Engineering Education. |
+| | The goal of this project is to enable all to use open source software tools. |
+| | For more details, please visit the given link. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'About the Spoken Tutorial Project' slide }}} | Watch the video available at the following link. It summarizes the Spoken |
+| | Tutorial project. If you do not have good bandwidth, you can download and |
+| | watch it. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'Spoken Tutorial Workshops' slide }}} | The Spoken Tutorial Project Team conducts workshops using spoken tutorials, |
+| | gives certificates to those who pass an online test. |
+| | |
+| | For more details, please write to contact@spoken-tutorial.org |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{ Show the 'Acknowledgements' slide }}} | Spoken Tutorial Project is a part of the "Talk to a Teacher" project. |
+| | It is supported by the National Mission on Education through ICT, MHRD, |
+| | Government of India. More information on this mission is available at the |
+| | given link. |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
+| {{{Show the 'Thank you' slide }}} | Hope you have enjoyed this tutorial and found it useful. |
+| | Thank you! |
++----------------------------------------------------------------------------------+----------------------------------------------------------------------------------+
diff --git a/using_sage_for_calculus/slides.org b/using_sage_for_calculus/slides.org
new file mode 100644
index 0000000..c5e35c8
--- /dev/null
+++ b/using_sage_for_calculus/slides.org
@@ -0,0 +1,117 @@
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+#+BEAMER_FRAME_LEVEL: 1
+
+#+BEAMER_HEADER_EXTRA: \usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent}
+#+COLUMNS: %45ITEM %10BEAMER_env(Env) %10BEAMER_envargs(Env Args) %4BEAMER_col(Col) %8BEAMER_extra(Extra)
+#+PROPERTY: BEAMER_col_ALL 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 :ETC
+
+#+LaTeX_CLASS: beamer
+#+LaTeX_CLASS_OPTIONS: [presentation]
+
+#+LaTeX_HEADER: \usepackage[english]{babel} \usepackage{ae,aecompl}
+#+LaTeX_HEADER: \usepackage{mathpazo,courier,euler} \usepackage[scaled=.95]{helvet}
+
+#+LaTeX_HEADER: \usepackage{listings}
+
+#+LaTeX_HEADER:\lstset{language=Python, basicstyle=\ttfamily\bfseries,
+#+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen},
+#+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries}
+
+#+TITLE:
+#+AUTHOR: FOSSEE
+#+EMAIL:
+#+DATE:
+
+#+DESCRIPTION:
+#+KEYWORDS:
+#+LANGUAGE: en
+#+OPTIONS: H:3 num:nil toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
+#+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc
+
+*
+#+begin_latex
+\begin{center}
+\vspace{12pt}
+\textcolor{blue}{\huge Using Sage}
+\end{center}
+\vspace{18pt}
+\begin{center}
+\vspace{10pt}
+\includegraphics[scale=0.95]{../images/fossee-logo.png}\\
+\vspace{5pt}
+\scriptsize Developed by FOSSEE Team, IIT-Bombay. \\
+\scriptsize Funded by National Mission on Education through ICT\\
+\scriptsize MHRD,Govt. of India\\
+\includegraphics[scale=0.30]{../images/iitb-logo.png}\\
+\end{center}
+#+end_latex
+* Objectives
+ At the end of this tutorial, you will be able to,
+
+ - Learn the range of things for which Sage can be used.
+ - Know some of the functions for Calculus.
+ - Learn about graph theory and number theory using Sage.
+* Pre-requisite
+ Spoken tuorial on -
+ - Getting started with Sage
+* Equation
+ Ax = v,
+ where A is the matrix,'' matrix([[1,2],[3,4]])''
+ v is the vector, ''vector([1,2])''.
+* Summary
+In this tutorial, we have learnt to,
+ - Use functions for calculus like --
+ - lim()-- to find out the limit of a function
+ - diff()-- to find out the differentiation of an expression
+ - integrate()-- to integrate over an expression
+ - integral()-- to find out the definite integral of an
+ expression by specifying the limits
+ - solve()-- to solve a function, relative to it's postion.
+ - Create Both a simple graph and a directed graph, using the
+ functions ``graph()`` and ``digraph()`` respectively.
+ - Use functions for Number theory.For eg:
+ - primes\_range()-- to find out the prime numbers within the
+ specified range
+ - factor()-- to find out the factorized form of the number specified
+ - Permutations(), Combinations()-- to obtain the required permutation
+ and combinations for the given set of values.
+* Evaluation
+ 1. How do you find the limit of the function ``x/sin(x)`` as ``x`` tends
+ to ``0`` from the negative side.
+
+ 2. List all the primes between 2009 and 2900.
+
+ 3. Solve the system of linear equations
+
+ x-2y+3z = 7
+ 2x+3y-z = 5
+ x+2y+4z = 9
+* Solutions
+1. lim(x/sin(x), x=0, dir="below")
+
+2. prime\_range(2009, 2901)
+
+3. A = Matrix([[1, -2, 3],
+ [2, 3, -1],
+ [1, 2, 4]])
+
+ b = vector([7, 5, 9])
+
+ solve\_right(A, b)
+*
+#+begin_latex
+ \begin{block}{}
+ \begin{center}
+ \textcolor{blue}{\Large THANK YOU!}
+ \end{center}
+ \end{block}
+\begin{block}{}
+ \begin{center}
+ For more Information, visit our website\\
+ \url{http://fossee.in/}
+ \end{center}
+ \end{block}
+#+end_latex
+
+
diff --git a/using_sage_for_calculus/slides.tex b/using_sage_for_calculus/slides.tex
new file mode 100644
index 0000000..c9b58e6
--- /dev/null
+++ b/using_sage_for_calculus/slides.tex
@@ -0,0 +1,200 @@
+\documentclass[17pt]{beamer}
+\usetheme{Madrid}
+\useoutertheme{noslidenum}
+\setbeamertemplate{navigation symbols}{}
+\usepackage{beamerthemesplit}
+\usepackage{ae,aecompl}
+\usepackage[scaled=.95]{helvet}
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{mathpazo,courier,euler}
+\usepackage{listings}
+
+\lstset{language=sh,
+ basicstyle=\ttfamily\bfseries,
+ showstringspaces=false,
+ keywordstyle=\color{black}\bfseries}
+
+\definecolor{NavyBlue}{RGB}{0, 76, 153}
+\setbeamercolor{structure}{fg=NavyBlue}
+\author[FOSSEE]{}
+\institute[IIT Bombay]{}
+\date[]{}
+
+% theme split
+\usepackage{verbatim}
+\newenvironment{colorverbatim}[1][]%
+{%
+\color{blue}
+\verbatim
+}%
+{%
+\endverbatim
+}%
+
+% logo
+\logo{\includegraphics[height=1.30 cm]{../images/3t-logo.pdf}}
+\logo{\includegraphics[height=1.30 cm]{../images/fossee-logo.png}
+
+\hspace{7.5cm}
+\includegraphics[scale=0.3]{../images/fossee-logo.png}\\
+\hspace{281pt}
+\includegraphics[scale=0.80]{../images/3t-logo.pdf}}
+
+\begin{document}
+
+\sffamily \bfseries
+\title
+[Using Sage for Calculus]
+{Using Sage for Calculus}
+\author
+[FOSSEE]
+{\small Talk to a Teacher\\{\color{blue}\url{http://spoken-tutorial.org}}\\National Mission on Education
+ through ICT\\{\color{blue}\url{http://sakshat.ac.in}} \\ [0.8cm]Script by: Hardik Ghaghada \\Narration by: \\ [0.7cm]
+{\small 15 May 2013}}
+
+% slide 1
+\begin{frame}
+ \titlepage
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Objectives}
+ At the end of this tutorial, you will be able to,
+\begin{itemize}
+\item Learn the range of things for which Sage can be used.
+\item Perform integrations \& other Calculus in Sage.
+\item Perform matrix algebra in sage.
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Differential Expression}
+$exp(sin(x^2))/x$\\
+w.r.t $x$
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Partial Differential Expression}
+$exp(sin(y - x^2))/x$\\
+w.r.t $x, y$
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Integration}
+\begin{itemize}
+\item $diff(f, y)$\\
+\item $cos(-x^2 + y)*e^(sin(-x^2 + y))/x$\\
+\item $integrate$
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{More on Calculus}
+\url{www.sagemath.org/help.html}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Equation}
+ $Ax = v$\\
+ where A is the matrix,\\
+ $matrix([[1,2],[3,4]])$\\
+ v is the vector,\\
+ $vector([1,2])$
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Summary}
+In this tutorial, we have learnt to,
+\begin{itemize}
+\item Use functions like lim(), integrate(), integral(), solve()
+\item Use sage for performing matrix algebra, integrations \& other calculus
+operations using the above mentioned functions.
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Evaluation}
+\begin{enumerate}
+\item How do you find the limit of the function ``x/sin(x)'' as ``x'' tends
+ to ``0'' from the negative side.
+\vspace{3pt}
+\vspace{3pt}
+\item Solve the system of linear equations
+ x-2y+3z = 7\\
+ 2x+3y-z = 5\\
+ x+2y+4z = 9
+\end{enumerate}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Solutions}
+\begin{enumerate}
+\item lim(x/sin(x), x=0, dir=`left')
+\vspace{4pt}
+\item A = Matrix([[1, -2, 3], \\
+\hspace{1.78cm}
+ [2, 3, -1], \\
+\hspace{1.78cm}
+ [1, 2, 4]]) \\
+\vspace{2pt}
+ b = vector([7, 5, 9])\\
+\vspace{2pt}
+ x = A.solve$\_{\mathrm{right}}$(b)\\
+\vspace{2pt}
+ x
+\end{enumerate}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{FOSSEE}
+{\color{blue}Free and Open-source Software for \\Science and Engineering Education} \\
+\begin{itemize}
+\item Goal - enabling all to use open source software tools
+\item For more details, please visit {\color{blue}\url{http://fossee.in/}}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{About the Spoken Tutorial Project}
+\begin{itemize}
+\item Watch the video available at {\color{blue}\url{http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial}}
+\item It summarises the Spoken Tutorial project
+\item If you do not have good bandwidth, you can download and watch it
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Spoken Tutorial Workshops}The Spoken Tutorial Project Team
+\begin{itemize}
+\item Conducts workshops using spoken tutorials
+\item Gives certificates to those who pass an online test
+\item For more details, please write to \\ \hspace {0.5cm}{\color{blue}contact@spoken-tutorial.org}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Acknowledgements}
+\begin{itemize}
+\item Spoken Tutorial Project is a part of the Talk to a Teacher project
+\item It is supported by the National Mission on Education through ICT, MHRD, Government of India
+\item More information on this Mission is available at: \\{\color{blue}\url{http://spoken-tutorial.org/NMEICT-Intro}}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+ \begin{block}{}
+ \begin{center}
+ \textcolor{blue}{\Large THANK YOU!}
+ \end{center}
+ \end{block}
+\begin{block}{}
+ \begin{center}
+ For more Information, visit our website\\
+ \url{http://fossee.in/}
+ \end{center}
+ \end{block}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end{document}
diff --git a/using_sage_for_graphs/part2.rst b/using_sage_for_graphs/part2.rst
new file mode 100644
index 0000000..7eaca67
--- /dev/null
+++ b/using_sage_for_graphs/part2.rst
@@ -0,0 +1,178 @@
+########## Break Here ##########
+
+Now, let us look at Graph Theory in Sage.
+
+We shall look at some ways to create graphs and some of the graph
+families available in Sage.
+
+The simplest way to define an arbitrary graph is to use a dictionary
+of lists. We create a simple graph by using the ``Graph()`` function.
+
+.. L17
+::
+
+ G = Graph({0:[1,2,3], 2:[4]})
+
+.. R18
+
+to view the visualization of the graph, we say
+
+.. L18
+::
+
+ G.show()
+
+.. R19
+
+Similarly, we can obtain a directed graph using the ``DiGraph``
+function.
+
+.. L19
+::
+
+ G = DiGraph({0:[1,2,3], 2:[4]})
+
+.. R20
+
+Sage also provides a lot of graph families which can be viewed by
+typing ``graph.``. Let us obtain a complete graph with 5 vertices
+and then show the graph.
+
+.. L20
+::
+
+ G = graphs.CompleteGraph(5)
+
+ G.show()
+
+.. R21
+
+Sage provides other functions for Number theory and
+Combinatorics. Let's have a glimpse of a few of them.
+``prime_range`` gives primes in the range 100 to 200.
+
+.. L21
+::
+
+ prime_range(100, 200)
+
+.. R22
+
+``is_prime`` checks if 1999 is a prime number or not.
+
+.. L22
+::
+
+ is_prime(1999)
+
+.. R23
+
+``factor(2001)`` gives the factorized form of 2001.
+
+.. L23
+::
+
+ factor(2001)
+
+.. R24
+
+The ``Permutations()`` gives the permutations of ``[1, 2, 3, 4]``
+
+.. L24
+::
+
+ C = Permutations([1, 2, 3, 4])
+ C.list()
+
+.. R25
+
+And the ``Combinations()`` gives all the combinations of ``[1, 2, 3, 4]``
+
+.. L25
+::
+
+ C = Combinations([1, 2, 3, 4])
+ C.list()
+
+.. L26
+
+{{{ Show summary slide }}}
+
+.. R26
+
+This brings us to the end of the tutorial.In this tutorial,
+we have learnt to,
+
+ 1. Use functions for calculus like --
+ - lim()-- to find out the limit of a function
+ - diff()-- to find out the differentiation of an expression
+ - integrate()-- to integrate over an expression
+ - integral()-- to find out the definite integral of an
+ expression by specifying the limits
+ - solve()-- to solve a function, relative to it's position.
+ #. Create Both a simple graph and a directed graph, using the
+ functions ``graph`` and ``digraph`` respectively.
+ #. Use functions for Number theory.For eg:
+ - primes_range()-- to find out the prime numbers within the
+ specified range
+ - factor()-- to find out the factorized form of the number specified
+ - Permutations(), Combinations()-- to obtain the required permutation
+ and combinations for the given set of values.
+
+.. L27
+
+{{{Show self assessment questions slide}}}
+
+.. R27
+
+Here are some self assessment questions for you to solve
+
+1. How do you find the limit of the function ``x/sin(x)`` as ``x`` tends
+ to ``0`` from the negative side.
+
+
+2. List all the primes between 2009 and 2900
+
+
+3. Solve the system of linear equations
+
+ x-2y+3z = 7
+ 2x+3y-z = 5
+ x+2y+4z = 9
+
+.. L28
+
+{{{solution of self assessment questions on slide}}}
+
+.. R28
+
+And the answers,
+
+1. To find out the limit of an expression from the negative side,we add
+ an argument dir="left" as
+::
+
+ lim(x/sin(x), x=0, dir="left")
+
+2. The prime numbers from 2009 and 2900 can be obtained as,
+::
+
+ prime_range(2009, 2901)
+
+3. We shall first write the equations in matrix form and then use the
+ solve() function
+::
+
+ A = Matrix([[1, -2, 3],
+ [2, 3, -1],
+ [1, 2, 4]])
+
+ b = vector([7, 5, 9])
+
+ x = A.solve_right(b)
+
+To view the output type x
+::
+
+ x
+
diff --git a/using_sage_for_graphs/script.odt b/using_sage_for_graphs/script.odt
new file mode 100644
index 0000000..53dd5f4
Binary files /dev/null and b/using_sage_for_graphs/script.odt differ
diff --git a/using_sage_for_graphs/slides.tex b/using_sage_for_graphs/slides.tex
new file mode 100644
index 0000000..18e2d1c
--- /dev/null
+++ b/using_sage_for_graphs/slides.tex
@@ -0,0 +1,149 @@
+\documentclass[17pt]{beamer}
+\usetheme{Madrid}
+\useoutertheme{noslidenum}
+\setbeamertemplate{navigation symbols}{}
+\usepackage{beamerthemesplit}
+\usepackage{ae,aecompl}
+\usepackage[scaled=.95]{helvet}
+\usepackage[english]{babel}
+\usepackage[latin1]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{mathpazo,courier,euler}
+\usepackage{listings}
+
+\lstset{language=sh,
+ basicstyle=\ttfamily\bfseries,
+ showstringspaces=false,
+ keywordstyle=\color{black}\bfseries}
+
+\definecolor{NavyBlue}{RGB}{0, 76, 153}
+\setbeamercolor{structure}{fg=NavyBlue}
+\author[FOSSEE]{}
+\institute[IIT Bombay]{}
+\date[]{}
+
+% theme split
+\usepackage{verbatim}
+\newenvironment{colorverbatim}[1][]%
+{%
+\color{blue}
+\verbatim
+}%
+{%
+\endverbatim
+}%
+
+% logo
+\logo{\includegraphics[height=1.30 cm]{../images/3t-logo.pdf}}
+\logo{\includegraphics[height=1.30 cm]{../images/fossee-logo.png}
+
+\hspace{7.5cm}
+\includegraphics[scale=0.3]{../images/fossee-logo.png}\\
+\hspace{281pt}
+\includegraphics[scale=0.80]{../images/3t-logo.pdf}}
+
+\begin{document}
+
+\sffamily \bfseries
+\title
+[Graph Theory in Sage]
+{Grapy Theory in Sage}
+\author
+[FOSSEE]
+{\small Talk to a Teacher\\{\color{blue}\url{http://spoken-tutorial.org}}\\National Mission on Education
+ through ICT\\{\color{blue}\url{http://sakshat.ac.in}} \\ [0.8cm]Script by: Hardik Ghaghada \\Narration by: \\ [0.7cm]
+{\small 15 May 2013}}
+
+% slide 1
+\begin{frame}
+ \titlepage
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Objectives}
+ By the end of this tutorial, you will,
+\begin{itemize}
+\item Learn about graph theory using Sage
+\item Learn about number theory using Sage
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Summary}
+In this tutorial, we have learnt to,
+\begin{itemize}
+\item Create Both a simple graph and a directed graph, using the functions
+graph() and DiGraph() respectively
+\item Create a complete graph using CompleteGraph() function
+\item Use functions like primes_range(), factor(), Permutations(),
+Combinations()
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Evaluation}
+\begin{enumerate}
+\item Find Permutations for the list ['a', 'b', 'c', 'd']
+\item List all the primes between 2009 and 2900 including 2900
+\end{enumerate}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Solutions}
+\begin{enumerate}
+\item C = Permutations(['a', 'b', 'c', 'd'])
+\item prime_range(2009, 2901)
+\end{enumerate}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{FOSSEE}
+{\color{blue}Free and Open-source Software for \\Science and Engineering Education} \\
+\begin{itemize}
+\item Goal - enabling all to use open source software tools
+\item For more details, please visit {\color{blue}\url{http://fossee.in/}}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{About the Spoken Tutorial Project}
+\begin{itemize}
+\item Watch the video available at {\color{blue}\url{http://spoken-tutorial.org /What\_is\_a\_Spoken\_Tutorial}}
+\item It summarises the Spoken Tutorial project
+\item If you do not have good bandwidth, you can download and watch it
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Spoken Tutorial Workshops}The Spoken Tutorial Project Team
+\begin{itemize}
+\item Conducts workshops using spoken tutorials
+\item Gives certificates to those who pass an online test
+\item For more details, please write to \\ \hspace {0.5cm}{\color{blue}contact@spoken-tutorial.org}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+\frametitle{Acknowledgements}
+\begin{itemize}
+\item Spoken Tutorial Project is a part of the Talk to a Teacher project
+\item It is supported by the National Mission on Education through ICT, MHRD, Government of India
+\item More information on this Mission is available at: \\{\color{blue}\url{http://spoken-tutorial.org/NMEICT-Intro}}
+\end{itemize}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\begin{frame}
+ \begin{block}{}
+ \begin{center}
+ \textcolor{blue}{\Large THANK YOU!}
+ \end{center}
+ \end{block}
+\begin{block}{}
+ \begin{center}
+ For more Information, visit our website\\
+ \url{http://fossee.in/}
+ \end{center}
+ \end{block}
+\end{frame}
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\end{document}
--
cgit