# HG changeset patch # User Puneeth Chaganti # Date 1289424619 -19800 # Node ID 5d032e2535800042c371d170c3213803bdb42438 # Parent 68c324a9981c079b10a67b57a0f8e2c2939a1dc2 Changes to getting started with Sage notebook. diff -r 68c324a9981c -r 5d032e253580 getting-started-sagenotebook/quickref.tex --- a/getting-started-sagenotebook/quickref.tex Thu Nov 11 02:55:20 2010 +0530 +++ b/getting-started-sagenotebook/quickref.tex Thu Nov 11 03:00:19 2010 +0530 @@ -1,8 +0,0 @@ -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 -r 68c324a9981c -r 5d032e253580 getting-started-sagenotebook/script.rst --- a/getting-started-sagenotebook/script.rst Thu Nov 11 02:55:20 2010 +0530 +++ b/getting-started-sagenotebook/script.rst Thu Nov 11 03:00:19 2010 +0530 @@ -14,7 +14,7 @@ .. #. Be able to evaluate cells, create and delete cells, navigate them. .. #. Be able to make annotations in the worksheet .. #. Be able to use tab completion. -.. #. Be able to use code from other languages in the cells. +.. #. Be able to use code from other languages in the cells. .. Prerequisites .. ------------- @@ -30,10 +30,10 @@ Script ------ +{{{ Show the slide containing the title }}} + Hello friends. Welcome to this spoken tutorial on Getting started with -sage and sage notebook. - -{{{ Show the slide containing the title }}} +Sage and Sage notebook. {{{ Show the slide containing the outline }}} @@ -57,9 +57,10 @@ We are assuming that you have Sage installed on your computer now. If not please visit the page http://sagemath.org/doc/tutorial/introduction.html#installation for -the tutorial on how to install Sage. Let us move on now. +the tutorial on how to install Sage. -On the terminal type:: + +Let us now learn how to start Sage. On the terminal type:: sage @@ -81,8 +82,8 @@ {{{ Intentional *cough* *cough* }}} to use Sage and nothing else! The Sage notebook also provides a -convenient way of sharing and publishing our work which is very handy -when we use Sage for research or for teaching. +convenient way of sharing and publishing our work, which is very handy +for research and teaching. However we can also run our own instances of Sage notebook servers on all the computers we have a local installation of Sage. To start the @@ -319,5 +320,3 @@ Hope you have enjoyed and found it useful. Thank you! - - diff -r 68c324a9981c -r 5d032e253580 getting-started-sagenotebook/slides.org --- a/getting-started-sagenotebook/slides.org Thu Nov 11 02:55:20 2010 +0530 +++ b/getting-started-sagenotebook/slides.org Thu Nov 11 03:00:19 2010 +0530 @@ -18,7 +18,7 @@ #+LaTeX_HEADER: commentstyle=\color{red}\itshape, stringstyle=\color{darkgreen}, #+LaTeX_HEADER: showstringspaces=false, keywordstyle=\color{blue}\bfseries} -#+TITLE: Accessing parts of arrays +#+TITLE: Getting started -- Sage #+AUTHOR: FOSSEE #+EMAIL: #+DATE: @@ -30,81 +30,38 @@ #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc * Outline - - Manipulating one and multi dimensional arrays - - Access and change individual elements - - Access and change rows and columns - - Slicing and striding on arrays to access chunks - - Read images into arrays and manipulations -* Sample Arrays - #+begin_src python - In []: A = array([12, 23, 34, 45, 56]) - - In []: C = array([[11, 12, 13, 14, 15], - [21, 22, 23, 24, 25], - [31, 32, 33, 34, 35], - [41, 42, 43, 44, 45], - [51, 52, 53, 54, 55]]) - - #+end_src -* Question 1 - Change the last column of ~C~ to zeroes. -* Solution 1 - #+begin_src python - In []: C[:, -1] = 0 - #+end_src -* Question 2 - Change ~A~ to ~[11, 12, 13, 14, 15]~. -* Solution 2 - #+begin_src python - In []: A[:] = [11, 12, 13, 14, 15] - #+end_src -* squares.png - #+begin_latex - \begin{center} - \includegraphics[scale=0.6]{squares} - \end{center} - #+end_latex -* Question 3 - - obtain ~[22, 23]~ from ~C~. - - obtain ~[11, 21, 31, 41]~ from ~C~. - - obtain ~[21, 31, 41, 0]~. -* Solution 3 - #+begin_src python - In []: C[1, 1:3] - In []: C[0:4, 0] - In []: C[1:5, 0] - #+end_src -* Question 4 - Obtain ~[[23, 24], [33, -34]]~ from ~C~ -* Solution 4 - #+begin_src python - In []: C[1:3, 2:4] - #+end_src -* Question 5 - Obtain the square in the center of the image -* Solution 5 - #+begin_src python - In []: imshow(I[75:225, 75:225]) - #+end_src -* Question 6 - Obtain the following - #+begin_src python - [[12, 0], [42, 0]] - [[12, 13, 14], [0, 0, 0]] - #+end_src - -* Solution 6 - #+begin_src python - In []: C[::3, 1::3] - In []: C[::4, 1:4] - #+end_src + - Know what Sage and Sage notebook are. + - Be able to start a Sage shell or notebook + - Be able to start using the notebook + - Be able to create new worksheets + - Know about the menu options available + - Know about the cells in the worksheet + - Be able to evaluate cells, create and delete cells, navigate them. + - Be able to make annotations in the worksheet + - Be able to use tab completion. + - Be able to use code from other languages in the cells. +* What is Sage? + - free, open-source mathematical software. + - can do a lot of math for you, including, but not limited to + + algebra + + geometry + + cryptography + + graph theory + - can be used as aid in teaching and research * Summary - You should now be able to -- - - Manipulate 1D \& Multi dimensional arrays - - Access and change individual elements - - Access and change rows and columns - - Slice and stride on arrays - - Read images into arrays and manipulate them. + + What is Sage + + How to start Sage shell + + What is Sage notebook + + How to start the Sage notebook + + How to create accounts and start using the notebook + + How to create new worksheets + + The menus available on the notebook + + About cells in the worksheet + + Methods to evaluate the cell, create new cells, delete the cells + and navigate around the cells + + To make annotations in the worksheet + + Tab completions + + And embedding code of other scripting languages in the cells * Thank you! #+begin_latex \begin{block}{} diff -r 68c324a9981c -r 5d032e253580 getting-started-sagenotebook/slides.tex --- a/getting-started-sagenotebook/slides.tex Thu Nov 11 02:55:20 2010 +0530 +++ b/getting-started-sagenotebook/slides.tex Thu Nov 11 03:00:19 2010 +0530 @@ -1,95 +1,104 @@ -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%Tutorial slides on Python. -% -% Author: FOSSEE -% Copyright (c) 2009, FOSSEE, IIT Bombay -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% - -\documentclass[14pt,compress]{beamer} -%\documentclass[draft]{beamer} -%\documentclass[compress,handout]{beamer} -%\usepackage{pgfpages} -%\pgfpagesuselayout{2 on 1}[a4paper,border shrink=5mm] - -% Modified from: generic-ornate-15min-45min.de.tex -\mode -{ - \usetheme{Warsaw} - \useoutertheme{infolines} - \setbeamercovered{transparent} -} - -\usepackage[english]{babel} +% Created 2010-11-11 Thu 02:40 +\documentclass[presentation]{beamer} \usepackage[latin1]{inputenc} -%\usepackage{times} \usepackage[T1]{fontenc} - -\usepackage{ae,aecompl} -\usepackage{mathpazo,courier,euler} -\usepackage[scaled=.95]{helvet} +\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{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}} -\definecolor{darkgreen}{rgb}{0,0.5,0} - -\usepackage{listings} -\lstset{language=Python, - basicstyle=\ttfamily\bfseries, - commentstyle=\color{red}\itshape, - stringstyle=\color{darkgreen}, - showstringspaces=false, - keywordstyle=\color{blue}\bfseries} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Macros -\setbeamercolor{emphbar}{bg=blue!20, fg=black} -\newcommand{\emphbar}[1] -{\begin{beamercolorbox}[rounded=true]{emphbar} - {#1} - \end{beamercolorbox} -} -\newcounter{time} -\setcounter{time}{0} -\newcommand{\inctime}[1]{\addtocounter{time}{#1}{\tiny \thetime\ m}} - -\newcommand{\typ}[1]{\lstinline{#1}} - -\newcommand{\kwrd}[1]{ \texttt{\textbf{\color{blue}{#1}}} } - -% Title page -\title{Your Title Here} - -\author[FOSSEE] {FOSSEE} - -\institute[IIT Bombay] {Department of Aerospace Engineering\\IIT Bombay} +\title{Getting started -- Sage} +\author{FOSSEE} \date{} -% DOCUMENT STARTS +\usetheme{Warsaw}\usecolortheme{default}\useoutertheme{infolines}\setbeamercovered{transparent} \begin{document} +\maketitle + + + + + + + + + \begin{frame} - \maketitle -\end{frame} +\frametitle{Outline} +\label{sec-1} -\begin{frame}[fragile] - \frametitle{Outline} - \begin{itemize} - \item - \end{itemize} +\begin{itemize} +\item Know what Sage and Sage notebook are. +\item Be able to start a Sage shell or notebook +\item Be able to start using the notebook +\item Be able to create new worksheets +\item Know about the menu options available +\item Know about the cells in the worksheet +\item Be able to evaluate cells, create and delete cells, navigate them. +\item Be able to make annotations in the worksheet +\item Be able to use tab completion. +\item Be able to use code from other languages in the cells. +\end{itemize} \end{frame} +\begin{frame} +\frametitle{What is Sage?} +\label{sec-2} + +\begin{itemize} +\item free, open-source mathematical software. +\item can do a lot of math for you, including, but not limited to -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -%% All other slides here. %% -%% The same slides will be used in a classroom setting. %% -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +\begin{itemize} +\item algebra +\item geometry +\item cryptography +\item graph theory +\end{itemize} + +\item can be used as aid in teaching and research +\end{itemize} +\end{frame} +\begin{frame} +\frametitle{Summary} +\label{sec-3} -\begin{frame}[fragile] - \frametitle{Summary} - \begin{itemize} - \item - \end{itemize} +\begin{itemize} +\item What is Sage +\item How to start Sage shell +\item What is Sage notebook +\item How to start the Sage notebook +\item How to create accounts and start using the notebook +\item How to create new worksheets +\item The menus available on the notebook +\item About cells in the worksheet +\item Methods to evaluate the cell, create new cells, delete the cells + and navigate around the cells +\item To make annotations in the worksheet +\item Tab completions +\item And embedding code of other scripting languages in the cells +\end{itemize} \end{frame} +\begin{frame} +\frametitle{Thank you!} +\label{sec-4} -\begin{frame} - \frametitle{Thank you!} \begin{block}{} \begin{center} This spoken tutorial has been produced by the diff -r 68c324a9981c -r 5d032e253580 progress.org --- a/progress.org Thu Nov 11 02:55:20 2010 +0530 +++ b/progress.org Thu Nov 11 03:00:19 2010 +0530 @@ -27,10 +27,10 @@ | 4.4 LO: | Least square fit | 2 | Nishanth | Punch (Done) | | | 4.5 LO: | Assessment | 3 | Punch | | | |---------+----------------------------------------+-------+----------+-----------------+-----------| -| 5.1 LO: | getting started with sage notebook | 3 | Madhu | | | -| 5.2 LO: | getting started with symbolics | 3 | Amit | Pending | | +| 5.1 LO: | getting started with sage notebook | 3 | Madhu | Punch (Done) | | +| 5.2 LO: | getting started with symbolics | 3 | Amit | Punch (Done) | | | 5.3 LO: | using Sage | 4 | Punch | Anoop (Done) | | -| 5.4 LO: | using sage to teach | 3 | Nishanth | | | +| 5.4 LO: | using sage to teach | 3 | Nishanth | Punch (Done) | | | 5.5 LO: | Assessment | 3 | Anoop | | | |---------+----------------------------------------+-------+----------+-----------------+-----------| | 6.1 LO: | basic datatypes & operators | 4 | Amit | Punch (Done) | | diff -r 68c324a9981c -r 5d032e253580 writing_python_scripts/script.rst --- a/writing_python_scripts/script.rst Thu Nov 11 02:55:20 2010 +0530 +++ b/writing_python_scripts/script.rst Thu Nov 11 03:00:19 2010 +0530 @@ -149,5 +149,5 @@ This tutorial was created as a part of FOSSEE project, NME ICT, MHRD India Hope you have enjoyed and found it useful. -Thankyou +Thank you!