Add software-engineering-basics
BIN
presentations/software-engineering-basics/Feathergraphics/1.pdf
Normal file
BIN
presentations/software-engineering-basics/Feathergraphics/2.pdf
Normal file
9
presentations/software-engineering-basics/Makefile
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
SOURCE = software-engineering-basics
|
||||||
|
|
||||||
|
make:
|
||||||
|
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
|
||||||
|
pdflatex -shell-escape $(SOURCE).tex -output-format=pdf
|
||||||
|
make clean
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -rf $(TARGET) *.class *.html *.log *.aux *.out *.glo *.glg *.gls *.ist *.xdy *.1 *.toc *.snm *.nav *.vrb *.fls *.fdb_latexmk *.pyg
|
|
@ -0,0 +1,52 @@
|
||||||
|
% This is the color theme file of the Feather theme.
|
||||||
|
% Copyright (c) 2014 by Lilyana Vaskova Vankova <lilqna.v@gmail.com>
|
||||||
|
%
|
||||||
|
% This program is free software: you can redistribute it and/or modify
|
||||||
|
% it under the terms of the GNU General Public License as published by
|
||||||
|
% the Free Software Foundation, either version 3 of the License, or
|
||||||
|
% (at your option) any later version.
|
||||||
|
%
|
||||||
|
% This program is distributed in the hope that it will be useful,
|
||||||
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
% GNU General Public License for more details.
|
||||||
|
%
|
||||||
|
% You can find the GNU General Public License at <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
|
\ProvidesPackage{beamercolorthemeFeather}[2014/04/08 v1.0.0 The Feather Beamer Theme]
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% Theme options and definitions
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% beamer specific options
|
||||||
|
|
||||||
|
\mode<presentation>%refers to the first four modes (beamer,handout,second and trans). That is, to all modes except the article mode
|
||||||
|
{
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% colors
|
||||||
|
%% defining colors
|
||||||
|
|
||||||
|
\definecolor{beamer@barcolor}{RGB}{194,193,204}% light blue
|
||||||
|
\definecolor{beamer@normaltextcolor}{RGB}{84,97,110}% gray blue
|
||||||
|
\definecolor{beamer@headercolor}{rgb}{0,0.41,0.54} % dark blue
|
||||||
|
|
||||||
|
|
||||||
|
%% setting the above deffinitions
|
||||||
|
|
||||||
|
\setbeamercolor{structure}{fg=beamer@headercolor}
|
||||||
|
\setbeamercolor{normal text}{fg=beamer@normaltextcolor}
|
||||||
|
\setbeamercolor{frametitle}{fg=white,bg=beamer@headercolor}
|
||||||
|
\setbeamercolor{Feather}{fg=beamer@barcolor,bg=beamer@headercolor}
|
||||||
|
}
|
||||||
|
|
||||||
|
\mode<all>
|
|
@ -0,0 +1,105 @@
|
||||||
|
% This is the inner theme file of the Feather theme.
|
||||||
|
% Copyright (c) 2014 by Lilyana Vaskova Vankova <lilqna.v@gmail.com>
|
||||||
|
%
|
||||||
|
% This program is free software: you can redistribute it and/or modify
|
||||||
|
% it under the terms of the GNU General Public License as published by
|
||||||
|
% the Free Software Foundation, either version 3 of the License, or
|
||||||
|
% (at your option) any later version.
|
||||||
|
%
|
||||||
|
% This program is distributed in the hope that it will be useful,
|
||||||
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
% GNU General Public License for more details.
|
||||||
|
%
|
||||||
|
% You can find the GNU General Public License at <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
|
\ProvidesPackage{beamerinnerthemeFeather}[2014/04/08 v1.0.0 The Feather Beamer Theme]
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% Theme options, definitions and templates.
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% beamer specific options
|
||||||
|
|
||||||
|
\mode<presentation> %refers to the first four modes (beamer,handout,second and trans). That is, to all modes except the article mode
|
||||||
|
{
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% title page
|
||||||
|
%% definitions for fonts of the different elements
|
||||||
|
|
||||||
|
\setbeamerfont{institute}{family=\rmfamily, size = \footnotesize}
|
||||||
|
\setbeamerfont{title}{family=\rmfamily, size = \Large}
|
||||||
|
\setbeamerfont{subtitle}{family=\rmfamily, size = \large}
|
||||||
|
\setbeamerfont{author}{family=\rmfamily, size = \normalsize}
|
||||||
|
\setbeamerfont{date}{family=\rmfamily, size = \footnotesize}
|
||||||
|
|
||||||
|
\setbeamertemplate{title page}
|
||||||
|
{
|
||||||
|
|
||||||
|
%% setting the above deffinitions
|
||||||
|
|
||||||
|
\begin{minipage}[c][\textheight][c]{\textwidth}
|
||||||
|
|
||||||
|
\centering
|
||||||
|
|
||||||
|
{\usebeamerfont{institute}\insertinstitute}\vspace*{30pt}
|
||||||
|
|
||||||
|
{\usebeamerfont{title}\usebeamercolor[fg]{title}\inserttitle}\vspace*{10pt}
|
||||||
|
|
||||||
|
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle}\vspace*{30pt}
|
||||||
|
|
||||||
|
{\usebeamerfont{author}\insertauthor}\vspace*{30pt}
|
||||||
|
|
||||||
|
{\usebeamerfont{date}\insertdate}\vspace*{\baselineskip}
|
||||||
|
|
||||||
|
\end{minipage}
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% final page
|
||||||
|
|
||||||
|
\defbeamertemplate{final page}{text}[1]
|
||||||
|
{
|
||||||
|
\begin{minipage}[c][\textheight][c]{\textwidth}
|
||||||
|
\centering
|
||||||
|
#1
|
||||||
|
\end{minipage}
|
||||||
|
}
|
||||||
|
\newcommand{\finalpage}[1]
|
||||||
|
{
|
||||||
|
\setbeamertemplate{final page}[text]{#1}
|
||||||
|
\usebeamertemplate{final page}
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% add the feather to the background of the titlepage and the final page
|
||||||
|
|
||||||
|
\newcommand{\1}
|
||||||
|
{
|
||||||
|
\setbeamertemplate{background}
|
||||||
|
{
|
||||||
|
\includegraphics[width=\paperwidth,height=\paperheight]{Feathergraphics/1}
|
||||||
|
\tikz[overlay] \fill[fill opacity=0.75,fill=white] (0,0) rectangle (-\paperwidth,\paperheight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% use numbers instead of a picture for the references
|
||||||
|
|
||||||
|
\setbeamertemplate{bibliography item}[text]
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
\mode<all>
|
|
@ -0,0 +1,266 @@
|
||||||
|
% This is the outer theme file of the Feather theme.
|
||||||
|
% Copyright (c) 2014 by Lilyana Vaskova Vankova <lilqna.v@gmail.com>
|
||||||
|
%
|
||||||
|
% This program is free software: you can redistribute it and/or modify
|
||||||
|
% it under the terms of the GNU General Public License as published by
|
||||||
|
% the Free Software Foundation, either version 3 of the License, or
|
||||||
|
% (at your option) any later version.
|
||||||
|
%
|
||||||
|
% This program is distributed in the hope that it will be useful,
|
||||||
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
% GNU General Public License for more details.
|
||||||
|
%
|
||||||
|
% You can find the GNU General Public License at <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
|
\ProvidesPackage{beamerouterthemeFeather}[2014/04/08 v1.0.0 The Feather Beamer Theme]
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% load required packages
|
||||||
|
|
||||||
|
\RequirePackage{tikz}
|
||||||
|
\RequirePackage{calc}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% Theme options, definitions and templates.
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% options for the progress bar/circle
|
||||||
|
|
||||||
|
\def\beamer@progressmovingCircCnt{movingCircCnt} % moving circular counter
|
||||||
|
\def\beamer@progressfixedCircCnt{fixedCircCnt} % fixed circular counter
|
||||||
|
\def\beamer@progresscorner{corner} % a counter
|
||||||
|
\def\beamer@progressstyle{movingCircCnt} % default
|
||||||
|
\DeclareOptionBeamer{progressstyle}{\def\beamer@progressstyle{#1}}
|
||||||
|
\DeclareOptionBeamer{rotationcw}{\def\beamer@rotationcw{true}}
|
||||||
|
\DeclareOptionBeamer{shownavsym}{\def\beamer@shownavsym{true}}
|
||||||
|
\ProcessOptionsBeamer
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% the height of the header is 2.5 times the lineheight of the frame title
|
||||||
|
|
||||||
|
\newlength{\beamer@height}
|
||||||
|
\usebeamerfont{frametitle} %use the frame title font
|
||||||
|
\setlength{\beamer@height}{2.5\baselineskip}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% reset fonts
|
||||||
|
|
||||||
|
\reset@font
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% radius of the logo
|
||||||
|
|
||||||
|
\newlength{\beamer@logoradius}
|
||||||
|
\setlength{\beamer@logoradius}{0.95\beamer@height/2}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% width of the border
|
||||||
|
|
||||||
|
\newlength{\beamer@borderwidth}
|
||||||
|
\setlength{\beamer@borderwidth}{1.05mm} % as small is the thickness of the border the whole circle goes up
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% inner radius of border of the logo frame
|
||||||
|
|
||||||
|
\newlength{\beamer@logoinnerradius}
|
||||||
|
\setlength{\beamer@logoinnerradius}{0.85\beamer@logoradius}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% radius of the outer border of the logo frame
|
||||||
|
|
||||||
|
\newlength{\beamer@logoouterradius}
|
||||||
|
\setlength{\beamer@logoouterradius}{\beamer@logoinnerradius+\beamer@borderwidth}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% radius of the counters
|
||||||
|
|
||||||
|
\newlength{\beamer@counterradius}
|
||||||
|
\setlength{\beamer@counterradius}{\beamer@logoinnerradius/2+\beamer@logoouterradius/2}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% beamer specific options
|
||||||
|
|
||||||
|
\mode<presentation> % refers to the first four modes (beamer,handout,second and trans). That is, to all modes except the article mode
|
||||||
|
{
|
||||||
|
\ifbeamercolorempty[fg]{Feather}
|
||||||
|
{
|
||||||
|
\setbeamercolor{Feather}{use={structure,palette sidebar primary},fg=palette sidebar primary.fg,bg=structure.fg}
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% headline
|
||||||
|
|
||||||
|
\setbeamertemplate{headline}
|
||||||
|
{
|
||||||
|
\featherheaderbackground
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% footline
|
||||||
|
|
||||||
|
\setbeamertemplate{footline}
|
||||||
|
{
|
||||||
|
\begin{beamercolorbox}[wd=1.0\paperwidth,ht=1.25ex,dp=1ex,left]{headfoot}
|
||||||
|
{\usebeamercolor[fg]{frametitle}\usebeamerfont{section in head/foot}\hspace*{3.5ex}
|
||||||
|
\insertshortauthor\ |\
|
||||||
|
\insertshorttitle
|
||||||
|
\insertshortsubtitle
|
||||||
|
}
|
||||||
|
\end{beamercolorbox}
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% frame title
|
||||||
|
|
||||||
|
\setbeamertemplate{frametitle}
|
||||||
|
{
|
||||||
|
\begin{minipage}[c][0.9\beamer@height][c]{\textwidth}
|
||||||
|
{\usebeamercolor[fg]{frametitle}\usebeamerfont{frametitle}\insertframetitle\par}
|
||||||
|
{\usebeamercolor[fg]{framesubtitle}\usebeamerfont{framesubtitle}\insertframesubtitle\par}
|
||||||
|
\end{minipage}
|
||||||
|
}
|
||||||
|
\ifx\beamer@shownavsym\undefined % insert navigation symbols
|
||||||
|
\setbeamertemplate{navigation symbols}
|
||||||
|
|
||||||
|
\fi
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% macros used in the theme
|
||||||
|
%% coordinate the fancy header background
|
||||||
|
|
||||||
|
\newcommand{\featherheaderbackground}[0]
|
||||||
|
{
|
||||||
|
\begin{tikzpicture}[overlay]
|
||||||
|
|
||||||
|
\coordinate (UL) at (0,0); %upper left corner of the slide
|
||||||
|
\coordinate (HLR) at (\paperwidth,-0.9\beamer@height); %lower right of the header
|
||||||
|
|
||||||
|
\coordinate (ULL) at (0,-0.95\beamer@height); % upper left corner of the line
|
||||||
|
\coordinate (LLR) at (\paperwidth,-1\beamer@height); % lower right corner of the line
|
||||||
|
|
||||||
|
\coordinate (ULF) at (0,-5.90\beamer@height); % upper left corner of the footline
|
||||||
|
\coordinate (LFR) at (\paperwidth,-6.08\beamer@height); % lower right corner of the footline
|
||||||
|
|
||||||
|
\coordinate (logopos) at ([shift={(-\beamer@logoouterradius-2.05\beamer@borderwidth,\beamer@height-\beamer@logoouterradius-5.5\beamer@borderwidth)}] HLR); % coordinate of the logo and the circ position
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%%draw the background of the header, the circle and the logo
|
||||||
|
|
||||||
|
{
|
||||||
|
\usebeamercolor{Feather}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% draw the blue background rectangle of the header and the line below it
|
||||||
|
|
||||||
|
\draw[draw=none,fill=Feather.bg] (UL) rectangle (HLR); % background rectabgle
|
||||||
|
\draw[draw=none,fill=Feather.fg] (ULL) rectangle (LLR); % line below the background rectangle
|
||||||
|
\draw[draw=none,fill=Feather.bg] (ULF) rectangle (LFR); % footline
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% draw the outer circle
|
||||||
|
|
||||||
|
\fill[fill=Feather.fg] (logopos) circle (\beamer@logoouterradius);
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% draw the inner circle
|
||||||
|
|
||||||
|
\fill[fill=normal text.bg] (logopos) circle (\beamer@logoinnerradius);
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% place the logo in the circle
|
||||||
|
|
||||||
|
\node at (logopos) {\includegraphics[width=1.75\beamer@logoradius]{Feathergraphics/2}};
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% draw progress circle/bar
|
||||||
|
|
||||||
|
\ifx\beamer@progressstyle\beamer@progressmovingCircCnt% the circular counter with a moving counter
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% calculate end position
|
||||||
|
|
||||||
|
\ifx\beamer@rotationcw\undefined% counterclockwise rotation
|
||||||
|
\pgfmathsetmacro{\progress}{220*\insertframestartpage/\inserttotalframenumber}; %%% 220 covers the entire circle, while 360 it goes twice
|
||||||
|
\else% clockwise rotation
|
||||||
|
\pgfmathsetmacro{\progress}{-220*\insertframestartpage/\inserttotalframenumber};
|
||||||
|
\fi
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% draw the arc
|
||||||
|
|
||||||
|
\draw[color=Feather.bg,line width=0.2*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc[radius=\beamer@counterradius, start angle=0, end angle=\progress];
|
||||||
|
\fill[fill=Feather.bg] ([shift={(\progress:\beamer@counterradius)}] logopos) circle (0.25\beamer@borderwidth);
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% place the current frame number
|
||||||
|
|
||||||
|
\node[fill=normal text.bg,draw=Feather.fg,thick,circle,minimum width=2*\beamer@borderwidth] at ([xshift=\beamer@counterradius]logopos) {{\usebeamercolor[fg]{normal text}\insertframenumber}};
|
||||||
|
\fi
|
||||||
|
\ifx\beamer@progressstyle\beamer@progressfixedCircCnt % the circular counter with a fixed counter
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% draw the current frame number
|
||||||
|
|
||||||
|
\ifx\beamer@rotationcw\undefined % counterclockwise rotation
|
||||||
|
\pgfmathsetmacro{\progress}{360*\insertframestartpage};
|
||||||
|
else% clockwise rotation
|
||||||
|
\pgfmathsetmacro{\progress}{-360*\insertframestartpage};
|
||||||
|
\fi
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% draw the arc
|
||||||
|
|
||||||
|
\draw[color=Feather.bg,line width=0.5*\beamer@borderwidth] ([xshift=\beamer@counterradius] logopos) arc (0:\progress:\beamer@counterradius);
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%% place the current frame number
|
||||||
|
|
||||||
|
\node[fill=normal text.bg,draw=Feather.fg,circle,thick,minimum width=2*\beamer@borderwidth] at ([shift={(\progress:\beamer@counterradius)}] logopos) {{\usebeamercolor[fg]{normal text}\insertframenumber}};
|
||||||
|
\fi
|
||||||
|
}
|
||||||
|
\end{tikzpicture}
|
||||||
|
}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%%setting the blocks
|
||||||
|
|
||||||
|
\setbeamertemplate{blocks}[rounded][shadow=true]
|
||||||
|
\setbeamercolor{block title}{fg=frametitle.fg, bg=frametitle.bg}
|
||||||
|
\setbeamercolor{block body}{parent=normal text, use=block title,bg=Feather.fg!30}
|
||||||
|
|
||||||
|
\mode<all>
|
|
@ -0,0 +1,52 @@
|
||||||
|
% This is the main beamer theme file of the Feather theme.
|
||||||
|
% Copyright (c) 2014 by Lilyana Vaskova Vankova <lilqna.v@gmail.com>
|
||||||
|
%
|
||||||
|
% This program is free software: you can redistribute it and/or modify
|
||||||
|
% it under the terms of the GNU General Public License as published by
|
||||||
|
% the Free Software Foundation, either version 3 of the License, or
|
||||||
|
% (at your option) any later version.
|
||||||
|
%
|
||||||
|
% This program is distributed in the hope that it will be useful,
|
||||||
|
% but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
% GNU General Public License for more details.
|
||||||
|
%
|
||||||
|
% You can find the GNU General Public License at <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
\NeedsTeXFormat{LaTeX2e}
|
||||||
|
\ProvidesPackage{beamerthemeFeather}[2014/04/08 v1.0.0 The Feather Beamer Theme]
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
% load required packages
|
||||||
|
|
||||||
|
\RequirePackage{tikz}
|
||||||
|
\RequirePackage{calc}
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
% Theme options and definitions
|
||||||
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
\DeclareOptionBeamer{progressstyle}{\PassOptionsToPackage{progressstyle=#1}{beamerouterthemeFeather}}
|
||||||
|
\DeclareOptionBeamer{rotationcw}{\PassOptionsToPackage{rotationcw}{beamerouterthemeFeather}}
|
||||||
|
\DeclareOptionBeamer{shownavsym}{\PassOptionsToPackage{shownavsym}{beamerouterthemeFeather}}
|
||||||
|
\ProcessOptionsBeamer
|
||||||
|
|
||||||
|
%----------------------------------------------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
%beamer specific options
|
||||||
|
|
||||||
|
\mode<presentation> %refers to the first four modes (beamer, handout, second and trans). That is, to all modes except the article mode
|
||||||
|
{
|
||||||
|
\useinnertheme{Feather}
|
||||||
|
\useoutertheme{Feather}
|
||||||
|
\usecolortheme{Feather}
|
||||||
|
}
|
||||||
|
|
||||||
|
\mode<all>
|
471
presentations/software-engineering-basics/feather.tex
Normal file
|
@ -0,0 +1,471 @@
|
||||||
|
\documentclass[10pt]{beamer}
|
||||||
|
\usetheme[
|
||||||
|
%%% option passed to the outer theme
|
||||||
|
% progressstyle=fixedCircCnt, % fixedCircCnt, movingCircCnt (moving is deault)
|
||||||
|
]{Feather}
|
||||||
|
|
||||||
|
% If you want to change the colors of the various elements in the theme, edit and uncomment the following lines
|
||||||
|
|
||||||
|
% Change the bar colors:
|
||||||
|
%\setbeamercolor{Feather}{fg=red!20,bg=red}
|
||||||
|
|
||||||
|
% Change the color of the structural elements:
|
||||||
|
%\setbeamercolor{structure}{fg=red}
|
||||||
|
|
||||||
|
% Change the frame title text color:
|
||||||
|
%\setbeamercolor{frametitle}{fg=blue}
|
||||||
|
|
||||||
|
% Change the normal text color background:
|
||||||
|
%\setbeamercolor{normal text}{fg=black,bg=gray!10}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
% INCLUDE PACKAGES
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
\usepackage[utf8]{inputenc}
|
||||||
|
\usepackage[english]{babel}
|
||||||
|
\usepackage[T1]{fontenc}
|
||||||
|
\usepackage{helvet}
|
||||||
|
\usepackage{multirow}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
% DEFFINING AND REDEFINING COMMANDS
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
% colored hyperlinks
|
||||||
|
\newcommand{\chref}[2]{
|
||||||
|
\href{#1}{{\usebeamercolor[bg]{Feather}#2}}
|
||||||
|
}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
% INFORMATION IN THE TITLE PAGE
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
\title[] % [] is optional - is placed on the bottom of the sidebar on every slide
|
||||||
|
{ % is placed on the title page
|
||||||
|
\textbf{Complete The Look Recommendation with Street Fashion Images}
|
||||||
|
}
|
||||||
|
|
||||||
|
\subtitle[Complete The Look Recommendation]
|
||||||
|
{
|
||||||
|
% \textbf{v. 1.0.0}
|
||||||
|
}
|
||||||
|
|
||||||
|
\author[Bhaskar Bagchi]
|
||||||
|
{ Bhaskar Bagchi \\
|
||||||
|
{\ttfamily bagchi.bhaskar@cse.iitkgp.ernet.in}
|
||||||
|
}
|
||||||
|
|
||||||
|
\institute[]
|
||||||
|
{
|
||||||
|
Department of Computer Science and Engineering\\
|
||||||
|
Indian Institute of Technology, Kharagpur\\
|
||||||
|
|
||||||
|
%there must be an empty line above this line - otherwise some unwanted space is added between the university and the country (I do not know why;( )
|
||||||
|
}
|
||||||
|
|
||||||
|
\date{\today}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
% THE BODY OF THE PRESENTATION
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
% THE TITLEPAGE
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
{\1% % this is the name of the PDF file for the background
|
||||||
|
\begin{frame}[plain,noframenumbering] % the plain option removes the header from the title page, noframenumbering removes the numbering of this frame only
|
||||||
|
\titlepage % call the title page information from above
|
||||||
|
\end{frame}}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}{Content}{}
|
||||||
|
\tableofcontents
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\section{Introduction}
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\subsection{Problem Definition}
|
||||||
|
\begin{frame}{Introduction}{Problem Definition}
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
\begin{itemize}
|
||||||
|
\item<1-> Given an item(clothing) in the shopping cart the problem statement is to suggest items complementary to it which may contain garments or accessories which makes a complete set as per current fashion.
|
||||||
|
% \item<2-> The rest of the theme is provided under the GNU General Public License v. 3 (GPLv3) \chref{http://www.gnu.org/licenses/}{http://www.gnu.org/licenses/}. This means that you can redistribute it and/or modify it under the same license.
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}{Introduction}{Problem Definition}
|
||||||
|
\begin{figure}[t]
|
||||||
|
\centering
|
||||||
|
\includegraphics[height=\dimexpr11\textheight/16\relax]{reco_exst_1}
|
||||||
|
\caption{Existing Recommendation Systems}
|
||||||
|
\end{figure}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}{Introduction}{Problem Definition}
|
||||||
|
\begin{figure}[t]
|
||||||
|
\centering
|
||||||
|
\includegraphics[height=\dimexpr11\textheight/16\relax]{Untitled}
|
||||||
|
\caption{Visualization of the problem statement}
|
||||||
|
\end{figure}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\section{Mathematical Formulation}
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\subsection{Feature Representation}
|
||||||
|
% \begin{frame}{Mathematical Formulation}{Feature Representation}
|
||||||
|
% %-------------------------------------------------------
|
||||||
|
|
||||||
|
% \begin{itemize}
|
||||||
|
% \pause
|
||||||
|
% \item<1-> Say we have n training images.
|
||||||
|
% \pause
|
||||||
|
% \item<2-> Each image `\emph{i}' has `\emph{p}' parts.
|
||||||
|
% \pause
|
||||||
|
% \item<3-> Each part is represented by a \emph{k-dimensional} feature vector, \emph{h}.
|
||||||
|
% \end{itemize}
|
||||||
|
|
||||||
|
% \pause
|
||||||
|
|
||||||
|
% \begin{block}{}
|
||||||
|
% Thus each can be represented as follows:
|
||||||
|
% \begin{itemize}
|
||||||
|
% \item {\tt Image H$_{i}${$^{T}$} = [h$_{i1}${$^{T}$}, h$_{i2}${$^{T}$},... , h$_{ip}${$^{T}$}].}
|
||||||
|
% \item {\tt Dataset H = [H$_{1}$, H$_{2}$,... , H$_{n}$]}
|
||||||
|
% \end{itemize}
|
||||||
|
% \end{block}
|
||||||
|
|
||||||
|
% \pause
|
||||||
|
% \begin{block}{}
|
||||||
|
% The recommendation task will be to generate a predictive model \emph{M}(\emph{H},\emph{q}), where \emph{H} is the training set and given some query \emph{q} with some part m missing, we can predict the m$^{th}$ part.
|
||||||
|
% \end{block}
|
||||||
|
|
||||||
|
% \end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
% %-------------------------------------------------------
|
||||||
|
% \subsection{Simplified Formulation}
|
||||||
|
% \begin{frame}{Mathematical Formulation}{Simplified Formulation}
|
||||||
|
% %-------------------------------------------------------
|
||||||
|
% The previous formulation is very rigid, where each image has to have \emph{p} parts. So we have following relaxation.
|
||||||
|
% \pause
|
||||||
|
% \begin{block}{Relaxations}
|
||||||
|
% \begin{itemize}
|
||||||
|
% \item Instead of asserting each image to have \emph{p} parts we keep it flexible.
|
||||||
|
% \item We also don't define any particular order of parts of clothings.
|
||||||
|
% \item Instead of using numeric features we use textual tags corresponding to each part of the garment/accessory as feature.
|
||||||
|
% \item Thus each image is defined by a number of features, which are 2--tuples $\{ Cloth-type \: {:} \: Cloth-description/color \}$.
|
||||||
|
% \end{itemize}
|
||||||
|
% \end{block}
|
||||||
|
% \end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Mathematical Formulation}{Simplified Formulation}
|
||||||
|
\begin{block}{}
|
||||||
|
Given an image $i$ containing `$k$' part--features, we describe the image $P_i$ as $P_i^{T} := [p_{i1}, p_{i2}, ..., p_{ik}]$ where each $p_{ij}$ are textual part--features, which are 2--tuples.
|
||||||
|
\end{block}
|
||||||
|
\pause
|
||||||
|
\begin{block}{}
|
||||||
|
We learn a model from our dataset of fashion images, say \textbf{P}, where \textbf{P} := $[P_1, P_2, ... P_n]^{T}$.
|
||||||
|
\end{block}
|
||||||
|
\pause
|
||||||
|
\begin{block}{}
|
||||||
|
The task of our recommendation system is, given one or more apparel, and corresponding part features $p$'s as input query, recommend garments which can be worn with it/them as a set.
|
||||||
|
\end{block}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
% \section{Approach}
|
||||||
|
% \subsection{Basic Approach}
|
||||||
|
% \begin{frame}{Approach}{Basic Approach}
|
||||||
|
% %-------------------------------------------------------
|
||||||
|
|
||||||
|
% \begin{enumerate}
|
||||||
|
% \pause
|
||||||
|
% \item Make a bipartite graph where one of the partite sets is \emph{images} and the other is \emph{features}. Edge exists if feature is present in the image.
|
||||||
|
% \pause
|
||||||
|
% \item Take the projection of this graph on the feature set, thus we get the co--occurrence graph.
|
||||||
|
% \pause
|
||||||
|
% \item For given query part--feature, calculate its SimRank with its neighbours and return the k--nearest--neighbours.
|
||||||
|
% \pause
|
||||||
|
% \item In case of more than one feature--parts in the query, for each part find the k--nearest--neighbours.
|
||||||
|
% \pause
|
||||||
|
% \item For each k--nearest--neighbour list combine them into a single list using \emph{Broda's Rank Aggregation}.
|
||||||
|
% \end{enumerate}
|
||||||
|
% \end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Approach}{Flow Diagram}
|
||||||
|
\begin{figure}[t]
|
||||||
|
\centering
|
||||||
|
\includegraphics[height=\dimexpr11\textheight/16\relax]{flowchart}
|
||||||
|
\caption{Flow Diagram of Proposed Approach}
|
||||||
|
\end{figure}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\subsection{Fashion Websites \& Ground Truth}
|
||||||
|
\begin{frame}{Fashion Websites \& Ground Truth}{Scraping Fashion Websites}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Scraped more than 500 images of female fashionstas from \url{www.chictopia.com}. These images covered an appreciable range of street fashion from corporate dressing sense to the most casual of the dresses.
|
||||||
|
\pause
|
||||||
|
\item Created a vocabulary of part features. Manually normalize the tags associated with each image.
|
||||||
|
\pause
|
||||||
|
\item Ended up with a codebook of total of \textit{48} unique categories including garments like tops, jeans, etc. and accessories like watches, bracelets, etc. and \textit{632} unique items i.e. category-description pair.
|
||||||
|
\end{itemize}
|
||||||
|
%\begin{figure}[t]
|
||||||
|
%\centering
|
||||||
|
%\includegraphics[scale=0.3]{simrank}
|
||||||
|
%\caption{Directed graph representing websites and hyperlinks}
|
||||||
|
%\end{figure}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
\subsection{Bipartite Network and Co--occurrence Graph}
|
||||||
|
\begin{frame}{Bipartite Network and Co--occurrence Graph}{}
|
||||||
|
\begin{itemize}
|
||||||
|
\item A bipartite graph is formed with dataset images $P$'s as the first partite sets and part--features $p_i$'s as the second partite set. There exists an edge between ever part feature and the image in which it occurred.
|
||||||
|
\pause
|
||||||
|
\item The bipartite graph is then projected to the set of part features.
|
||||||
|
\pause
|
||||||
|
\item The projected graph so obtained is a weighted co--occurrence graph of the part features. Construction of this graph gives us the relation between different garments and accessories which can be used together and are complementary to each other.
|
||||||
|
\pause
|
||||||
|
\item This step helps us learn a correlation and inter-dependence between various part features from the dataset.
|
||||||
|
\end{itemize}
|
||||||
|
|
||||||
|
|
||||||
|
%Mathematically SimRank score is defined recursively. Let us denote similarity between objects a and b by S(a, b) $\in$ [0, 1].
|
||||||
|
%\begin{block}{Formula}
|
||||||
|
%\begin{equation}
|
||||||
|
%S(a, b) = \left\{ \begin{array}{ll}
|
||||||
|
% 1 & \mbox{if $a=b$}; \\
|
||||||
|
% \frac{C}{\left | I(a) \right | \left | I(b) \right |}\sum_{i = 0}^{\left | I(a) \right |}\sum_{j = 0}^{\left | I(b) \right |}S\left(I_i\left(a\right), I_j\left(b\right ) \right) & \mbox{$otherwise$}.\end{array} \right.
|
||||||
|
%\end{equation}
|
||||||
|
|
||||||
|
%where, \emph{C} is a constant between 0 and 1 which controls the amount of score propagation in recursive call, \emph{I(a)} is the set of incoming edges to a and \emph{I(b)} is the set of incoming edges to b.
|
||||||
|
|
||||||
|
%\end{block}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\subsection{Similarity Measure \& Nearest Neighbor Consensus}
|
||||||
|
\begin{frame}{Similarity Measure \& Nearest Neighbor}{Similarity Measure}
|
||||||
|
\begin{itemize}
|
||||||
|
\item The co-occurrence graph falls in a domain where nodes represents the objects and edges represents the relations between them. We use \textit{Simrank} to measure the similarity based on \textit{structural context} of the graph.
|
||||||
|
\pause
|
||||||
|
\item Convert the co--occurrence graph into a directed graph where each edge between part features $p_a$ and $p_b$ in the original graph is replaced by two directed edges $p_a \rightarrow p_b$ and $p_b \rightarrow p_a$ both with weights equal to the weight of original edge.
|
||||||
|
\pause
|
||||||
|
\item Compute \textit{Simrank} between each pair of nodes.
|
||||||
|
\end{itemize}
|
||||||
|
|
||||||
|
%\pause
|
||||||
|
%\begin{block}{Types of rank aggregation problems}
|
||||||
|
%\begin{enumerate}
|
||||||
|
%\item If the individual lists contain all the elements in \emph{U} then they are called complete lists. They are a total ordering of \emph{U}.
|
||||||
|
%\item There are situations where full lists are not convenient, and even not possible. In such cases the lists contain an ordered list of a subset of elements of \emph{U}. $ \left | L_i \right | < \left | U \right |$. Such lists are called partial lists.
|
||||||
|
%\item A special case of the partial list problem is the top--K list. In this ranking we take the top K elements from each ordered list, and so we know that all the elements that are not present in the list are ranked below those which are present in the list.
|
||||||
|
%\end{enumerate}
|
||||||
|
%\end{block}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Similarity Measure \& Nearest Neighbor}{Nearest Neighbor Consensus}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Given a part--feature $p$ as query we locate the node corresponding to that part feature in the co--occurrence graph.
|
||||||
|
\pause
|
||||||
|
\item We find out other nodes which are close to it, i.e. nodes which have highest simrank value with this node.
|
||||||
|
\pause
|
||||||
|
\item The rationale behind this step is that since the graph had edges between part features that were used together by fashionistas and as the simrank values decrease with increase in node distances, the $k$--nearest--neighbors will be those part features which were frequently used with the selected item and are contemporary to it.
|
||||||
|
\pause
|
||||||
|
\item We get a list of k part features $p_1, p_2, ... p_k$ which are structurally close to the input feature and thus they can be recommended for the given query part feature.
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\subsection{Aggregating Ranked Item Recommendations}
|
||||||
|
\begin{frame}{Aggregating Ranked Item Recommendations}{Rank Aggregation}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Say we have $j$ part features $p_1, p_2, ... p_j$ as input query, we find out individual $k$--nearest--neighbors for each part feature.
|
||||||
|
\pause
|
||||||
|
\item we have $j$ ranked lists, each with $k$ members, which are recommendation related to each input feature.
|
||||||
|
\pause
|
||||||
|
\item Assigns a score corresponding to position in which a part feature appears within each ranked list. In our case, for each list $i$, ${p_a}^i$ is assigned a weight ${B_{p_a}}^i$ = $k$ * fraction of part features in the list appearing below $p_a$.
|
||||||
|
\pause
|
||||||
|
\item The \textit{Broda} score of each element $B_{p_a}$ is the the sum of \textit{Broda} scores for that part feature in all the lists.
|
||||||
|
\pause
|
||||||
|
\item We can recomment the top $k$ elements from this ranked list to the user.
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\section{Experimental Results}
|
||||||
|
\begin{frame}{Experimental Results}{Evaluation Methodology}
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\begin{itemize}
|
||||||
|
\item We took 20 images as test set from our dataset. Since each image is user tagged, we have labelled ground truth for computing the required metrics.
|
||||||
|
\pause
|
||||||
|
\item For each image we took, we used all its part features individually as one feature input. We also used various permutations of 2 part features and 3 part features as input to the recommender and compared the recommended part features with the ground truth.
|
||||||
|
\pause
|
||||||
|
\item Then we calculated \textit{precision, recall} and \textit{f1} values for 158 sets of recommendations.
|
||||||
|
\end{itemize}
|
||||||
|
\pause
|
||||||
|
\begin{block}{Formula}
|
||||||
|
$precision = \frac{no \ of \ matched \ recommendations}{no \ of \ recommendations}$
|
||||||
|
\newline
|
||||||
|
$recall = \frac{no \ of \ matched \ recommendation}{no \ of \ items \ in \ actual \ image}$
|
||||||
|
\end{block}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Experimental Results}{Results}
|
||||||
|
Out of the 158 recommendation sets that we tested, 53 were 1 part feature input, 54 were 2 part feature input and 51 as 3 part feature input. For each generated recommendations we calculated the precision and recall.
|
||||||
|
|
||||||
|
\begin{table}
|
||||||
|
\centering
|
||||||
|
\caption{Precision}
|
||||||
|
\begin{tabular}{|c|c|c|c|}
|
||||||
|
\hline
|
||||||
|
No. of inputs & Max Precision & Avg Precision\\
|
||||||
|
\hline\hline
|
||||||
|
1 & 1 & 0.31\\
|
||||||
|
2 & 0.75 & 0.31\\
|
||||||
|
3 & 0.6 & 0.28\\
|
||||||
|
\hline\end{tabular}
|
||||||
|
\label{table:precision}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\begin{table}
|
||||||
|
\centering
|
||||||
|
\caption{Recall}
|
||||||
|
\begin{tabular}{|c|c|c|c|}
|
||||||
|
\hline
|
||||||
|
No. of inputs & Max Recall & Avg Recall\\
|
||||||
|
\hline\hline
|
||||||
|
1 & 0.8 & 0.23\\
|
||||||
|
2 & 1 & 0.44\\
|
||||||
|
3 & 1 & 0.48\\
|
||||||
|
\hline\end{tabular}
|
||||||
|
\label{table:recall}
|
||||||
|
\end{table}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Experimental Results}{Results}
|
||||||
|
\begin{table}
|
||||||
|
\centering
|
||||||
|
\caption{f1 score}
|
||||||
|
\begin{tabular}{|c|c|c|}
|
||||||
|
\hline
|
||||||
|
No. of inputs & Max f1 & Min f1\\
|
||||||
|
\hline\hline
|
||||||
|
1 & 0.89 & 0.13\\
|
||||||
|
2 & 0.71 & 0.1\\
|
||||||
|
3 & 0.67 & 0.1\\
|
||||||
|
\hline\end{tabular}
|
||||||
|
\label{table:f1}
|
||||||
|
\end{table}
|
||||||
|
\begin{figure}[htb]
|
||||||
|
\centering
|
||||||
|
\includegraphics[scale=0.4]{g11}
|
||||||
|
\caption{Precision-Recall for 1 item input}
|
||||||
|
\label{fig:g1}
|
||||||
|
\end{figure}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Experimental Results}{Precision Recall Graphs}
|
||||||
|
\begin{figure}[htb]
|
||||||
|
\centering
|
||||||
|
\includegraphics[scale=0.4]{g22}
|
||||||
|
%\caption{Precision-Recall for 2 item input}
|
||||||
|
\label{fig:g2}
|
||||||
|
\end{figure}
|
||||||
|
\begin{figure}[htb]
|
||||||
|
\centering
|
||||||
|
\includegraphics[scale=0.4]{g33}
|
||||||
|
%\caption{Precision-Recall for 3 item input}
|
||||||
|
\label{fig:g3}
|
||||||
|
\end{figure}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Experimental Results}{Manual Evaluation Results}
|
||||||
|
\begin{table}
|
||||||
|
\centering
|
||||||
|
\caption{User rating for recommendation}
|
||||||
|
\begin{tabular}{|c|c|c|}
|
||||||
|
\hline
|
||||||
|
Rate(out of 10) & Frequency & Cumulative Freq.\\
|
||||||
|
\hline\hline
|
||||||
|
10 & 1 & 1\\
|
||||||
|
9 & 2 & 3\\
|
||||||
|
8 & 9 & 12\\
|
||||||
|
7 & 9 & 21\\
|
||||||
|
6 & 5 & 26\\
|
||||||
|
5 & 11 & 37\\
|
||||||
|
4 & 11 & 48\\
|
||||||
|
3 & 6 & 54\\
|
||||||
|
2 & 4 & 58\\
|
||||||
|
1 & 2 & 60\\
|
||||||
|
\hline\end{tabular}
|
||||||
|
\label{table:userRating}
|
||||||
|
\end{table}
|
||||||
|
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\section{Future Work}
|
||||||
|
\begin{frame}{Future Work}
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
\begin{itemize}
|
||||||
|
|
||||||
|
\item Features for representation of parts are to be improved by incorporating visual features. Inclusion of visual features will also include the analysis of features like color, texture, etc. which is expected to improve the quality of evaluation.
|
||||||
|
|
||||||
|
\item A feedback system can be added to the system as to increase edge weights to the features which are shopped together by users. This will be a self learning system and incorporate the changes in trending fashion all by itself.
|
||||||
|
|
||||||
|
\end{itemize}
|
||||||
|
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
%-------------------------------------------------------
|
||||||
|
\section{References}
|
||||||
|
\begin{frame}{References}
|
||||||
|
%-------------------------------------------------------
|
||||||
|
|
||||||
|
\bibliographystyle{abbrv}
|
||||||
|
%\bibliography{sigproc}
|
||||||
|
|
||||||
|
\begin{thebibliography}{1}
|
||||||
|
|
||||||
|
\bibitem{rankAggregation}
|
||||||
|
C.~Dwork, R.~Kumar, M.~Naor, and D.~Sivakumar.
|
||||||
|
\newblock Rank aggregation methods for the web.
|
||||||
|
\newblock In {\em Proceedings of the 10th International Conference on World
|
||||||
|
Wide Web}, WWW '01, pages 613--622, New York, NY, USA, 2001. ACM.
|
||||||
|
|
||||||
|
\bibitem{simrank}
|
||||||
|
G.~Jeh and J.~Widom.
|
||||||
|
\newblock Simrank: A measure of structural-context similarity.
|
||||||
|
\newblock In {\em Proceedings of the Eighth ACM SIGKDD International Conference
|
||||||
|
on Knowledge Discovery and Data Mining}, KDD '02, pages 538--543, New York,
|
||||||
|
NY, USA, 2002. ACM.
|
||||||
|
|
||||||
|
\bibitem{bundleReco}
|
||||||
|
T.~Zhu, P.~Harrington, J.~Li, and L.~Tang.
|
||||||
|
\newblock Bundle recommendation in ecommerce.
|
||||||
|
\newblock In {\em Proceedings of the 37th International ACM SIGIR Conference on
|
||||||
|
Research \&\#38; Development in Information Retrieval}, SIGIR '14, pages
|
||||||
|
657--666, New York, NY, USA, 2014. ACM.
|
||||||
|
|
||||||
|
\end{thebibliography}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
{\1
|
||||||
|
\begin{frame}[plain,noframenumbering]
|
||||||
|
\finalpage{Thank you! Questions?}
|
||||||
|
\end{frame}}
|
||||||
|
|
||||||
|
\end{document}
|
BIN
presentations/software-engineering-basics/graphics/car.jpg
Normal file
After Width: | Height: | Size: 393 KiB |
After Width: | Height: | Size: 362 KiB |
After Width: | Height: | Size: 59 KiB |
BIN
presentations/software-engineering-basics/graphics/git-blame.png
Normal file
After Width: | Height: | Size: 106 KiB |
BIN
presentations/software-engineering-basics/graphics/git-log.png
Normal file
After Width: | Height: | Size: 77 KiB |
BIN
presentations/software-engineering-basics/graphics/git-merge.png
Normal file
After Width: | Height: | Size: 100 KiB |
After Width: | Height: | Size: 141 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 76 KiB |
After Width: | Height: | Size: 36 KiB |
|
@ -0,0 +1,56 @@
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>GitFlow</title>
|
||||||
|
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.11.4/gitgraph.css" />
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<canvas id="gitGraph"></canvas>
|
||||||
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/gitgraph.js/1.11.4/gitgraph.min.js"></script>
|
||||||
|
<script>
|
||||||
|
/***********************
|
||||||
|
* CUSTOM TEMPLATES *
|
||||||
|
***********************/
|
||||||
|
|
||||||
|
var myTemplateConfig = {
|
||||||
|
colors: ["#979797", "#008fb5", "#f1c109"],
|
||||||
|
branch: {
|
||||||
|
lineWidth: 10,
|
||||||
|
spacingX: 50,
|
||||||
|
labelRotation: 0
|
||||||
|
},
|
||||||
|
commit: {
|
||||||
|
spacingY: -80,
|
||||||
|
dot: {
|
||||||
|
size: 12
|
||||||
|
},
|
||||||
|
message: {
|
||||||
|
displayAuthor: false,
|
||||||
|
displayBranch: false,
|
||||||
|
displayHash: false,
|
||||||
|
font: "normal 12pt Arial"
|
||||||
|
},
|
||||||
|
tooltipHTMLFormatter: function(commit) {
|
||||||
|
return "<b>" + commit.sha1 + "</b>" + ": " + commit.message;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
var myTemplate = new GitGraph.Template(myTemplateConfig);
|
||||||
|
|
||||||
|
var gitgraph = new GitGraph({
|
||||||
|
template: "metro",
|
||||||
|
reverseArrow: false,
|
||||||
|
orientation: "vertical",
|
||||||
|
//mode: "compact"
|
||||||
|
});
|
||||||
|
var master = gitgraph.branch("master");
|
||||||
|
master.commit({message: "ENH: feature 1", author: "Alice <alice@xyz.com>"});
|
||||||
|
master.commit({message: "ENH: feature 2", author: "Alice <alice@xyz.com>"});
|
||||||
|
feature = master.branch("feature");
|
||||||
|
master.commit({message: "ENH: feature 3", author: "Alice <alice@xyz.com>"});
|
||||||
|
feature.commit({message: "ENH: feature 4", author: "Alice <alice@xyz.com>"});
|
||||||
|
feature.commit({message: "ENH: feature 4 - fix 1", author: "Alice <alice@xyz.com>"});
|
||||||
|
feature.commit({message: "ENH: feature 4 - fix 2", author: "Alice <alice@xyz.com>"});
|
||||||
|
feature.merge(master);
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,301 @@
|
||||||
|
\documentclass{beamer}
|
||||||
|
\usetheme{Feather}
|
||||||
|
% \usecolortheme{default}
|
||||||
|
\usepackage{hyperref}
|
||||||
|
\definecolor{links}{HTML}{2A1B81}
|
||||||
|
\definecolor{green}{HTML}{008000}
|
||||||
|
\hypersetup{colorlinks,linkcolor=,urlcolor=links}
|
||||||
|
\usepackage[utf8]{inputenc} % this is needed for german umlauts
|
||||||
|
\usepackage[english]{babel} % this is needed for german umlauts
|
||||||
|
\usepackage[T1]{fontenc} % this is needed for correct output of umlauts in pdf
|
||||||
|
\usepackage{pifont}
|
||||||
|
\usepackage{graphicx}
|
||||||
|
\usepackage{minted} % needed for the inclusion of source code
|
||||||
|
\usepackage{csquotes}
|
||||||
|
|
||||||
|
|
||||||
|
\newcommand{\FolderOpen}[1][.8\ht\strutbox]{%
|
||||||
|
\includegraphics[height=#1]{graphics/FolderOpen}%
|
||||||
|
}
|
||||||
|
|
||||||
|
\newcommand{\FileImage}[1][.8\ht\strutbox]{%
|
||||||
|
\includegraphics[height=#1]{graphics/file}%
|
||||||
|
}
|
||||||
|
|
||||||
|
\begin{document}
|
||||||
|
|
||||||
|
\title{Software Engineering Basics}
|
||||||
|
% \subtitle{A subtitle}
|
||||||
|
\author{Martin Thoma}
|
||||||
|
\date{14. August 2018}
|
||||||
|
\subject{Software Engineering}
|
||||||
|
|
||||||
|
\frame{\titlepage}
|
||||||
|
|
||||||
|
\section{Intended Audience}
|
||||||
|
\subsection{A subsection!}
|
||||||
|
\begin{frame}{Intended Audience}
|
||||||
|
Software is written by people with different backgrounds and strengths. Not
|
||||||
|
everybody has a Software Engineering background. Those slides should help
|
||||||
|
you to get the basics.
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\subsection{A subsection!}
|
||||||
|
\begin{frame}{Alice and Bob}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{0.5\textwidth}
|
||||||
|
\includegraphics[width=1.0\textwidth]{graphics/car.jpg}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{0.5\textwidth}
|
||||||
|
\begin{itemize}
|
||||||
|
\item Project: Build self-driving car
|
||||||
|
\item Alice is in the US, Bob in Germany
|
||||||
|
\end{itemize}
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
% \subsection{Version Control}
|
||||||
|
\begin{frame}{Project structure}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{0.5\textwidth}
|
||||||
|
\begin{itemize}
|
||||||
|
\item[\FolderOpen] bin
|
||||||
|
\item[\FolderOpen] docs
|
||||||
|
\item[\FolderOpen] awesome\_project
|
||||||
|
\item[\FolderOpen] tests
|
||||||
|
\item[\FileImage] setup.py
|
||||||
|
\item[\FileImage] tox.ini
|
||||||
|
\end{itemize}
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{0.5\textwidth}
|
||||||
|
\begin{itemize}
|
||||||
|
\item[\textcolor{green}{\ding{58}}] \texttt{\$ grep -rnIi foobar}
|
||||||
|
\end{itemize}
|
||||||
|
Details on \href{https://martin-thoma.com/python-projects/}{my blog}.
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{git workflow}
|
||||||
|
\begin{enumerate}
|
||||||
|
\item \texttt{\$ git clone repostory.git}
|
||||||
|
\item \texttt{\$ git add filename}
|
||||||
|
\item \texttt{\$ git commit}
|
||||||
|
\item \texttt{\$ git push}
|
||||||
|
\end{enumerate}
|
||||||
|
|
||||||
|
\uncover<2>{\includegraphics[width=1.0\textwidth,height=0.5\textheight,keepaspectratio]{graphics/git-workflow.png}}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Version Control: git}
|
||||||
|
\includegraphics[width=1.0\textwidth]{graphics/git-simple.png}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{git log}
|
||||||
|
\includegraphics[width=0.9\textwidth]{graphics/git-log.png}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{git blame}
|
||||||
|
\includegraphics[width=1.0\textwidth]{graphics/git-blame.png}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{git status}
|
||||||
|
\includegraphics[width=1.0\textwidth]{graphics/git-status.png}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{}
|
||||||
|
\huge We read code MUCH more often than we write it.
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{git}
|
||||||
|
Problem: Dirty commit history due to bugs / fixes
|
||||||
|
\includegraphics[width=1.0\textwidth]{graphics/git-2-fixes.png}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Auto formatting}
|
||||||
|
\begin{itemize}[<+->]
|
||||||
|
\item PRs should not be about simple code style
|
||||||
|
\item Choose one \href{https://martin-thoma.com/python-style-guide/}{style guide}
|
||||||
|
and stick to it
|
||||||
|
\item Trailing spaces are just noise - make your editor remove them
|
||||||
|
automatically.
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{The Zen of Python, by Tim Peters (1)}
|
||||||
|
Beautiful is better than ugly.\\
|
||||||
|
Explicit is better than implicit.\\
|
||||||
|
Simple is better than complex.\\
|
||||||
|
Complex is better than complicated.\\
|
||||||
|
Flat is better than nested.\\
|
||||||
|
Sparse is better than dense.\\
|
||||||
|
Readability counts.\\
|
||||||
|
Special cases aren't special enough to break the rules.\\
|
||||||
|
Although practicality beats purity.\\
|
||||||
|
Errors should never pass silently.\\
|
||||||
|
Unless explicitly silenced.
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{The Zen of Python, by Tim Peters (2)}
|
||||||
|
In the face of ambiguity, refuse the temptation to guess.\\
|
||||||
|
There should be one-- and preferably only one --obvious way to do it.\\
|
||||||
|
Although that way may not be obvious at first unless you're Dutch.\\
|
||||||
|
Now is better than never.\\
|
||||||
|
Although never is often better than *right* now.\\
|
||||||
|
If the implementation is hard to explain, it's a bad idea.\\
|
||||||
|
If the implementation is easy to explain, it may be a good idea.\\
|
||||||
|
Namespaces are one honking great idea -- let's do more of those!
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{commit squashing}
|
||||||
|
\begin{columns}
|
||||||
|
\begin{column}{0.5\textwidth}
|
||||||
|
\textbf{Commit squashing}
|
||||||
|
|
||||||
|
Making multiple commits in a row become one
|
||||||
|
\end{column}
|
||||||
|
\begin{column}{0.5\textwidth}
|
||||||
|
\includegraphics[height=0.5\textheight]{graphics/commit-squashing.png}
|
||||||
|
{\small Image source: \href{https://stevenschwenke.de/GitToSquashOrNotToSquash}{stevenschwenke.de}}
|
||||||
|
\end{column}
|
||||||
|
\end{columns}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{git merge}
|
||||||
|
\includegraphics[width=1.0\textwidth,height=0.5\textheight,keepaspectratio]{graphics/git-merge.png}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{git merge vs git rebase}
|
||||||
|
\includegraphics[width=1.0\textwidth,height=0.8\textheight,keepaspectratio]{graphics/git-rebase.png}
|
||||||
|
|
||||||
|
{\small Image source: \href{https://jeffkreeftmeijer.com/git-rebase/}{Jeff Kreeftmeijer}}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
\section{Bugs}
|
||||||
|
\begin{frame}{Logic Bugs: Functions and McCabe}
|
||||||
|
\inputminted[linenos,
|
||||||
|
numbersep=7pt,
|
||||||
|
fontsize=\footnotesize, tabsize=4]{python}{src/sieve-v1.py}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Logic Bugs: Names}
|
||||||
|
\inputminted[linenos,
|
||||||
|
numbersep=7pt,
|
||||||
|
fontsize=\footnotesize, tabsize=4,
|
||||||
|
firstline=4]{python}{src/sieve-v2.py}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Logic Bugs: Doctests!}
|
||||||
|
\inputminted[linenos,
|
||||||
|
numbersep=7pt,
|
||||||
|
fontsize=\footnotesize, tabsize=4,
|
||||||
|
firstline=8, lastline=24]{python}{src/sieve-v3.py}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}{Falsehood Data Scientists Beliefes}
|
||||||
|
\begin{centering}
|
||||||
|
(1) Floating point numbers always look like this: 1.23456 or 0.000004577 or 12345.467765.
|
||||||
|
\end{centering}
|
||||||
|
|
||||||
|
\uncover<2->{
|
||||||
|
\begin{itemize}
|
||||||
|
\item<2-> Scientific notation: \texttt{4.577E-5} or \texttt{1.2345467765E4}
|
||||||
|
\item<3-> German decimal format: \texttt{1,23456} or \texttt{0,000004577}
|
||||||
|
\end{itemize}
|
||||||
|
}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Falsehood Data Scientists Beliefes}
|
||||||
|
\begin{centering}
|
||||||
|
(2.1) Country names have an unique representation
|
||||||
|
\end{centering}
|
||||||
|
|
||||||
|
\uncover<2>{
|
||||||
|
\enquote{Germany} vs \enquote{Deutschland}
|
||||||
|
}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Falsehood Data Scientists Beliefes}
|
||||||
|
\begin{centering}
|
||||||
|
(2.2) Country names have an unique representation in English
|
||||||
|
\end{centering}
|
||||||
|
|
||||||
|
\uncover<2>{
|
||||||
|
\enquote{United Kingdom} vs \enquote{UK}
|
||||||
|
}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Falsehood Data Scientists Beliefes}
|
||||||
|
\begin{centering}
|
||||||
|
(2.3) Country names have an unique unabreviated representation in English
|
||||||
|
\end{centering}
|
||||||
|
|
||||||
|
\uncover<2>{
|
||||||
|
\enquote{United Kingdom} vs \enquote{Great Britain} vs \enquote{England}
|
||||||
|
}
|
||||||
|
\uncover<3>{Solution: Use/Demand \textbf{ISO 3166-1 alpha-3 country codes} everywhere}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Falsehood Data Scientists Beliefes}
|
||||||
|
\begin{centering}
|
||||||
|
(3) Data is clean
|
||||||
|
\end{centering}
|
||||||
|
|
||||||
|
\uncover<2->{
|
||||||
|
No.
|
||||||
|
\begin{itemize}
|
||||||
|
\item<3-> User database: Birth date in the year 3.
|
||||||
|
\item<4-> User database: Active user who is more than 90 years old.
|
||||||
|
\item<5-> User database: User who is younger than 6.
|
||||||
|
\end{itemize}
|
||||||
|
}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Falsehood Data Scientists Beliefes}
|
||||||
|
\begin{centering}
|
||||||
|
(4) Time has no beginning and no end
|
||||||
|
\end{centering}
|
||||||
|
|
||||||
|
\uncover<2->{
|
||||||
|
Unix Time Stamp: Seconds since 1st of January, 1970. Stored in unsigned int.
|
||||||
|
}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
\begin{frame}{Falsehood Data Scientists Beliefes}
|
||||||
|
\begin{centering}
|
||||||
|
(4) To avoid the Year-2038 problem, I can store \texttt{YYYY-mm-dd HH:MM:ss}
|
||||||
|
\end{centering}
|
||||||
|
|
||||||
|
\uncover<2->{
|
||||||
|
\begin{itemize}
|
||||||
|
\item<2-> \href{http://strftime.org/}{Python's strftime directives}
|
||||||
|
\item<3-> Timezones
|
||||||
|
\item<4-> Whenever possible, store the timezone and use \textbf{ISO 8601}:
|
||||||
|
\texttt{2012-04-23T18:25:43.511+02:30} (\href{https://stackoverflow.com/a/15952652/562769}{reasons})
|
||||||
|
\end{itemize}
|
||||||
|
}
|
||||||
|
\end{frame}
|
||||||
|
|
||||||
|
|
||||||
|
\begin{frame}{See also}
|
||||||
|
\begin{itemize}
|
||||||
|
\item git
|
||||||
|
\begin{itemize}
|
||||||
|
\item \href{http://meldmerge.org/}{meld}: Tool for diff and merge (\texttt{\$ git mergetool})
|
||||||
|
\item \href{https://nvie.com/posts/a-successful-git-branching-model/}{A successful Git branching model}
|
||||||
|
\end{itemize}
|
||||||
|
\item \href{https://www.youtube.com/watch?v=8SNaW1nt6j0}{Debugging Python with ipdb and Sypder} - starting at 4:00
|
||||||
|
\item \href{https://docs.python.org/3/library/profile.html}{cprofile}: Check where code improvements are effective
|
||||||
|
\item David Goldberg: \href{https://www.itu.dk/~sestoft/bachelor/IEEE754_article.pdf}{What Every Computer Scientist Should Know About Floating-Point Arithmetic}
|
||||||
|
\item \href{https://martin-thoma.com/testing-python-code/}{Testing with Python}
|
||||||
|
\item \href{https://martin-thoma.com/logging-in-python/}{Logging with Python}
|
||||||
|
\item UML: \href{https://www.websequencediagrams.com/}{Sequence diagrams}, Flow charts (e.g. \href{https://wiki.gnome.org/Apps/Dia/}{Dia} or \href{https://www.draw.io/}{draw.io})
|
||||||
|
\item \href{https://balsamiq.com/}{Balsamiq}: Draft an UI
|
||||||
|
\item Web: \href{https://gist.github.com/alexserver/2fcc26f7e1ebcfc9f6d8}{REST basics}
|
||||||
|
\end{itemize}
|
||||||
|
\end{frame}
|
||||||
|
\end{document}
|
||||||
|
Bare excepts are only correct when trying to capture and forward exceptions - in all other cases, except Exception should be used to avoid catching KeyboardInterrupt.
|
17
presentations/software-engineering-basics/src/sieve-v1.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
from math import ceil
|
||||||
|
|
||||||
|
def f(n=1000000):
|
||||||
|
roundUp = lambda n, prime: int(ceil(float(n) / prime))
|
||||||
|
|
||||||
|
arr = [True] * n
|
||||||
|
arr[0] = False
|
||||||
|
arr[1] = False
|
||||||
|
primeList = []
|
||||||
|
|
||||||
|
for curr in range(2, n):
|
||||||
|
if not arr[curr]:
|
||||||
|
continue
|
||||||
|
primeList.append(curr)
|
||||||
|
for multiplicant in range(2, roundUp(n, curr)):
|
||||||
|
arr[multiplicant * curr] = False
|
||||||
|
return primeList
|
20
presentations/software-engineering-basics/src/sieve-v2.py
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
from math import ceil
|
||||||
|
|
||||||
|
|
||||||
|
def round_up(n, prime):
|
||||||
|
return int(ceil(float(n) / prime))
|
||||||
|
|
||||||
|
|
||||||
|
def get_primes_below_n(n=1000000):
|
||||||
|
is_prime_table = [True] * n
|
||||||
|
is_prime_table[0] = False
|
||||||
|
is_prime_table[1] = False
|
||||||
|
prime_list = []
|
||||||
|
|
||||||
|
for current_number in range(2, n):
|
||||||
|
if not is_prime_table[current_number]:
|
||||||
|
continue
|
||||||
|
prime_list.append(current_number)
|
||||||
|
for multiplicant in range(2, round_up(n, current_number)):
|
||||||
|
is_prime_table[multiplicant * current_number] = False
|
||||||
|
return prime_list
|
36
presentations/software-engineering-basics/src/sieve-v3.py
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
from math import ceil
|
||||||
|
|
||||||
|
|
||||||
|
def round_up(n, prime):
|
||||||
|
return int(ceil(float(n) / prime))
|
||||||
|
|
||||||
|
|
||||||
|
def get_primes_below_n(n=1000000):
|
||||||
|
"""
|
||||||
|
Get a list of all primes below n.
|
||||||
|
|
||||||
|
Parameters
|
||||||
|
----------
|
||||||
|
n : int
|
||||||
|
|
||||||
|
Returns
|
||||||
|
-------
|
||||||
|
prime_list : list
|
||||||
|
|
||||||
|
Examples
|
||||||
|
--------
|
||||||
|
>>> get_primes_below_n(10)
|
||||||
|
[2, 3, 5, 7]
|
||||||
|
"""
|
||||||
|
is_prime_table = [True] * n
|
||||||
|
is_prime_table[0] = False
|
||||||
|
is_prime_table[1] = False
|
||||||
|
prime_list = []
|
||||||
|
|
||||||
|
for currentPrime in range(2, n):
|
||||||
|
if not is_prime_table[currentPrime]:
|
||||||
|
continue
|
||||||
|
prime_list.append(currentPrime)
|
||||||
|
for multiplicant in range(2, round_up(n, currentPrime)):
|
||||||
|
is_prime_table[multiplicant * currentPrime] = False
|
||||||
|
return prime_list
|