Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

start new repo

  • Loading branch information...
commit 164f7a7d015b5d800f65a50624c151c665d7a6fe 0 parents
@miekg authored
Showing with 3,887 additions and 0 deletions.
  1. +18 −0 Makefile
  2. +231 −0 blocksbook.cls
  3. BIN  creative_commons/cc_by_30.pdf
  4. +96 −0 creative_commons/cc_by_30.svg
  5. BIN  creative_commons/cc_cc_30.pdf
  6. +79 −0 creative_commons/cc_cc_30.svg
  7. BIN  creative_commons/cc_dev_nations_30.pdf
  8. +100 −0 creative_commons/cc_dev_nations_30.svg
  9. BIN  creative_commons/cc_nc_30.pdf
  10. +76 −0 creative_commons/cc_nc_30.svg
  11. BIN  creative_commons/cc_nd_30.pdf
  12. +89 −0 creative_commons/cc_nd_30.svg
  13. BIN  creative_commons/cc_pd_30.pdf
  14. +96 −0 creative_commons/cc_pd_30.svg
  15. BIN  creative_commons/cc_sa_30.pdf
  16. +85 −0 creative_commons/cc_sa_30.svg
  17. BIN  creative_commons/cc_sampling_30.pdf
  18. +61 −0 creative_commons/cc_sampling_30.svg
  19. BIN  creative_commons/cc_sampling_plus_30.pdf
  20. +76 −0 creative_commons/cc_sampling_plus_30.svg
  21. +36 −0 ex-basics/ex-for.tex
  22. +43 −0 ex-basics/ex-strings.tex
  23. +13 −0 ex-basics/src/for-func.go
  24. +9 −0 ex-basics/src/for.go
  25. +11 −0 ex-basics/src/string1.go
  26. +12 −0 ex-basics/src/string2.go
  27. +41 −0 ex-channels/ex-for-channels.tex
  28. +18 −0 ex-channels/src/for-chan.go
  29. +24 −0 ex-channels/src/for-quit-chan.go
  30. +17 −0 ex-fib.tex
  31. 0  ex-intro/.gitempty
  32. +26 −0 ex-map.tex
  33. +10 −0 fig/Makefile
  34. BIN  fig/array-vs-slice.pdf
  35. +601 −0 fig/array-vs-slice.svg
  36. BIN  fig/bumper-inverse.png
  37. BIN  fig/bumper.png
  38. BIN  fig/drawing.pdf
  39. +167 −0 go-allocation.tex
  40. +46 −0 go-appendix.tex
  41. +643 −0 go-basics.tex
  42. +86 −0 go-cc-license.tex
  43. +9 −0 go-channels.tex
  44. +8 −0 go-colophon.tex
  45. +53 −0 go-functions.tex
  46. +109 −0 go-interfaces.tex
  47. +156 −0 go-intro.tex
  48. +24 −0 go-packages.tex
  49. +100 −0 go-setup.tex
  50. +101 −0 go.bib
  51. +117 −0 go.tex
  52. +22 −0 map.tex
  53. +4 −0 src/Makefile
  54. +21 −0 src/array-and-slices.2.go
  55. +9 −0 src/array-and-slices.go
  56. +15 −0 src/even.go
  57. +38 −0 src/fib.go
  58. +7 −0 src/helloworld.go
  59. +30 −0 src/map.go
  60. +11 −0 src/myeven.go
  61. +2 −0  src/short.go
  62. +8 −0 src/types.go
  63. +219 −0 tab/Book1.tex
  64. +14 −0 todo
18 Makefile
@@ -0,0 +1,18 @@
+# simple makefile
+.PHONY: fig fig/*.svg
+
+all: fig go.pdf
+
+go.pdf: go.tex go-*.tex ex-*/*.tex src/*.go blocksbook.cls go.bib
+ xelatex go.tex && bibtex go && makeindex go && xelatex go.tex && xelatex go.tex
+
+fig: fig/*.svg
+ ( cd fig; make all )
+
+clean:
+ rm -f go.lol go.aux *.log map.log go.pdf go.bbl go.blg go.toc go.ind go.lot go.lof
+ rm -f go.ilg go.idx go.lgpl missfont.log doc_data.txt
+ ( cd src; make clean )
+
+distclean: clean
+ ( cd fig; make clean )
231 blocksbook.cls
@@ -0,0 +1,231 @@
+\NeedsTeXFormat{LaTeX2e}[1995/12/01]
+\ProvidesClass{blocksbook}[2006/06/10 v0.1
+ Layout with blocks]
+\RequirePackage{ifthen}
+\RequirePackage{scalefnt}
+
+
+%% supported options:
+%% draft - place DRAFT in the left hand side and give to memoir
+%% serif - don't use sans serif fonts
+%% headbold - display the head also in bold
+%% bold - use also bold in description, etc
+
+%% Class Options Defaults
+\newcommand{\headplaceholder}{}
+\newcommand{\myheadplaceholder}{}
+\newcommand{\myfamily}{\sffamily}
+\newcommand{\myseries}{\bfseries}
+\newcommand{\myheadseries}{}
+\newcommand{\mytitlepage}{}
+\newcounter{bottomline}
+\setcounter{bottomline}{0}
+
+\DeclareOption{draft}{
+ \renewcommand{\myheadplaceholder}
+ {\myfamily\bfseries\headplaceholder{}\normalfont\scshape{} draft}
+ \PassOptionsToClass{draft}{memoir}
+}
+\DeclareOption{serif}{
+ \renewcommand{\myfamily}{\rmfamily}
+}
+\DeclareOption{headbold}{
+ \renewcommand{\myheadseries}{\bfseries}
+}
+\DeclareOption{bold}{
+ \renewcommand{\myheadseries}{\myseries}
+}
+\DeclareOption{bottomline}{
+ \setcounter{bottomline}{1}
+}
+
+\DeclareOption{titlepagenr}{
+ \renewcommand{\mytitlepage}{
+ \addtolength{\fboxsep}{0.5ex}
+ \framebox{\myfamily\thepage}
+ }
+}
+
+%% Pass all unknown options to memoir
+\DeclareOption*{\PassOptionsToClass{\CurrentOption}{memoir}}
+\ProcessOptions
+\LoadClass{memoir}
+
+\setcounter{secnumdepth}{2}
+%%
+\makepagestyle{blocks}
+\aliaspagestyle{chapter}{empty}
+\aliaspagestyle{part}{empty}
+\setlength{\headwidth}{\textwidth}
+ \addtolength{\headwidth}{\marginparsep}
+ \addtolength{\headwidth}{\marginparwidth}
+
+\makepsmarks{blocks}{
+ \let\@mkboth\markboth
+ \def\chaptermark##1{\markboth{\myheadseries##1}{\myfamily##1}} %% left & right marks
+ \def\sectionmark##1{\markright{ %% right mark
+ \ifnum \c@secnumdepth>\z@
+ \normalfont\myfamily\myheadseries\thesection{ }
+ \fi
+ \normalfont\myheadseries\myfamily##1}}
+}
+
+\makerunningwidth{blocks}{\headwidth}
+\makeevenhead{blocks}{
+ \addtolength{\fboxsep}{0.5ex}
+ \framebox{\myfamily\thepage}
+ % hack to get spacing correct
+ \vspace{-0.1mm}
+ \hrule
+}{
+ \raisebox{0.2ex}{\parbox{\headwidth}{
+ \hspace{1em}
+ \ifthenelse{\value{page} > 9}%
+ {\hspace{1em}}{}
+ \ifthenelse{\value{page} > 99}%
+ {\hspace{1em}}{}
+ \ifthenelse{\value{page} > 999}%
+ {\hspace{1em}}{}
+ { }\normalfont\leftmark %
+ \vspace{1.1mm}
+ }}
+}{\myheadplaceholder}
+
+\makeoddhead{blocks}{\myheadplaceholder}
+{
+ \raisebox{0.2ex}{\parbox{\headwidth}{
+ \raggedleft
+ \normalfont\rightmark %
+ \hspace{1em}
+ \ifthenelse{\value{page} > 9}%
+ {\hspace{1em}}{}
+ \ifthenelse{\value{page} > 99}%
+ {\hspace{1em}}{}
+ \ifthenelse{\value{page} > 999}%
+ {\hspace{1em}}{}
+ \vspace{1.1mm}
+ } }
+}
+{
+ \addtolength{\fboxsep}{0.5ex}
+ \framebox{\myfamily{\thepage}}
+ %% hack to get spacing correct
+ \vspace{-0.14mm}
+ \hspace{-1.2mm}
+ \hrule
+%% \rule{\linewidth}{0.1mm}
+}
+\ifthenelse{\value{bottomline} = 1}%
+{\makefootrule{blocks}{\headwidth}{\normalrulethickness}{\footruleskip}}%
+{}
+%% centreert de header wat meer als ik dit uit zet, anders wordt ie
+%% echt breed
+%%\makeheadposition{blocks}{flushright}{flushleft}{flushright}{flushleft}
+\addtolength{\headsep}{\headsep}
+
+%% chapter style
+\makechapterstyle{blocks}{%
+ \renewcommand{\chapterheadstart}{\vspace{2cm}}
+ \renewcommand{\printchaptername}{}
+ \renewcommand{\chapternamenum}{}
+ \renewcommand{\printchapternum}{%
+ \addtolength{\fboxsep}{2ex} %% \numtoName
+ \framebox{\myseries\myfamily\scalefont{6.0}{\thechapter}}
+}
+ \renewcommand{\afterchapternum}{\hskip 5mm}
+ \renewcommand{\printchaptertitle}[1]{%
+ \normalfont\raggedright\HUGE{{\myfamily##1}}%
+ \chaptermark{\myfamily##1}%
+ }
+ \renewcommand{\afterchaptertitle}{%
+ \vskip\onelineskip \vskip\onelineskip}
+}
+
+%% part style
+\makepagestyle{part}
+\renewcommand{\partname}{}
+\renewcommand{\partnumfont}{\HUGE\myseries\myfamily}
+\renewcommand{\parttitlefont}{\HUGE\myseries\myfamily}
+\renewcommand{\printparttitle}[1]{\vspace{10ex}\parttitlefont #1}
+\renewcommand{\printpartnum}{%
+ \raggedright
+ \addtolength{\fboxsep}{5ex}
+ \framebox{\partnumfont\thepart}
+}
+
+%% bibliography style
+\renewcommand{\bibsection}{%
+ \chapter{\bibname}
+ \bibmark
+ \ifnobibintoc\else
+ \phantomsection
+ \addcontentsline{toc}{chapter}{\bibname}
+ \fi
+\prebibhook}
+
+%% index style
+\makeatletter
+\renewenvironment{theindex}{%
+ \if@twocolumn
+ \@restonecolfalse
+ \else
+ \@restonecoltrue
+ \fi
+ \ifonecolindex
+ \onecolumn
+ \chapter*{\indexname}
+ \preindexhook
+ \else
+ \setlength{\columnseprule}{\indexrule}%
+ \setlength{\columnsep}{\indexcolsep}%
+%% \twocolumn[\@makeschapterhead{\indexname} %% disabled
+%% \preindexhook]%
+ \fi
+ \indexmark
+ \ifnoindexintoc\else
+ \phantomsection
+ \addcontentsline{toc}{chapter}{\indexname}%
+ \fi
+ \thispagestyle{chapter}\parindent\z@
+ \parskip\z@ \@plus .3\p@\relax
+ \let\item\@idxitem}%
+ {\if@restonecol\onecolumn\else\twocolumn\fi}
+\makeatother
+
+%% title page style - always odd... XXX
+\makepagestyle{tblocks}
+\makeoddfoot{tblocks}{}{\mytitlepage}{}
+
+%% section style
+\setsecheadstyle{\raggedright\myfamily\Large}
+ \setbeforesecskip{-\onelineskip}
+ \setaftersecskip{\onelineskip}
+
+%% subsection
+\setsubsecheadstyle{\sethangfrom{\noindent ##1}\raggedright\myfamily\slshape}
+%%\setsubsecheadstyle{\raggedleft\myfamily\thesubsection\raggedright\myfamily\hskip 1em}
+ \setbeforesubsecskip{-\onelineskip}
+ \setaftersubsecskip{\onelineskip}
+
+%% subsubsection
+\setsubsubsecheadstyle{\sethangfrom{\noindent ##1}\raggedright\myfamily\slshape}
+ \setbeforesubsubsecskip{-\onelineskip}
+ \setaftersubsubsecskip{\onelineskip}
+
+%% paragraph
+\setparaheadstyle{\sethangfrom{\noindent ##1}\raggedright\myfamily\slshape}
+
+%% description
+\renewcommand*{\descriptionlabel}[1]{\hspace\labelsep
+ \normalfont\myfamily\textbf{#1}\quad}
+
+%% tableofcontents
+\renewcommand{\cftpartfont}{\myfamily\myseries}
+\renewcommand{\cftchapterfont}{\myfamily\myseries}
+
+%% set the options for the document
+\captiontitlefont{\small\myfamily} %% small? TODO
+\captionnamefont{\myfamily}
+\pagestyle{blocks}
+\chapterstyle{blocks}
+\aliaspagestyle{title}{tblocks}
BIN  creative_commons/cc_by_30.pdf
Binary file not shown
96 creative_commons/cc_by_30.svg
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.3379"
+ height="23.33691"
+ id="svg2532"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2534" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="16.197517"
+ inkscape:cx="11.66895"
+ inkscape:cy="11.668455"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="154"
+ inkscape:window-y="154" />
+ <metadata
+ id="metadata2537">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-574.04534,-169.26516)">
+ <g
+ transform="translate(330.17574,166.25493)"
+ id="g275">
+ <circle
+ style="fill:#ffffff"
+ sodipodi:ry="10.80664"
+ sodipodi:rx="10.80664"
+ sodipodi:cy="15.31348"
+ sodipodi:cx="255.55124"
+ id="circle277"
+ r="10.80664"
+ cy="15.31348"
+ cx="255.55124" />
+
+ <g
+ id="g279">
+ <path
+ id="path281"
+ d="M 258.67819,12.18701 C 258.67819,11.77051 258.3403,11.4331 257.92526,11.4331 L 253.15182,11.4331 C 252.73678,11.4331 252.39889,11.7705 252.39889,12.18701 L 252.39889,16.95996 L 253.72994,16.95996 L 253.72994,22.61182 L 257.34713,22.61182 L 257.34713,16.95996 L 258.67818,16.95996 L 258.67818,12.18701 L 258.67819,12.18701 z " />
+
+ <circle
+ sodipodi:ry="1.63281"
+ sodipodi:rx="1.63281"
+ sodipodi:cy="9.1723604"
+ sodipodi:cx="255.53854"
+ id="circle283"
+ r="1.63281"
+ cy="9.1723604"
+ cx="255.53854" />
+
+ </g>
+
+ <path
+ style="fill-rule:evenodd"
+ id="path285"
+ d="M 255.5239,3.40723 C 252.29148,3.40723 249.55515,4.53516 247.31589,6.79102 C 245.01804,9.12452 243.8696,11.88672 243.8696,15.07569 C 243.8696,18.26466 245.01804,21.00733 247.31589,23.30225 C 249.61374,25.59668 252.35007,26.74414 255.5239,26.74414 C 258.73679,26.74414 261.52195,25.58789 263.87742,23.27295 C 266.09715,21.07568 267.2075,18.34326 267.2075,15.07568 C 267.2075,11.8081 266.07762,9.04687 263.8198,6.79101 C 261.56003,4.53516 258.79538,3.40723 255.5239,3.40723 z M 255.55319,5.50684 C 258.20163,5.50684 260.45065,6.44092 262.30026,8.30811 C 264.1694,10.15528 265.10397,12.41114 265.10397,15.07569 C 265.10397,17.75928 264.18893,19.98633 262.35885,21.75587 C 260.43014,23.66212 258.16256,24.61476 255.55319,24.61476 C 252.94284,24.61476 250.69381,23.67189 248.80612,21.78517 C 246.91647,19.89845 245.97311,17.66212 245.97311,15.0757 C 245.97311,12.48879 246.92721,10.23341 248.83541,8.30812 C 250.6655,6.44092 252.90475,5.50684 255.55319,5.50684 z "
+ clip-rule="evenodd" />
+
+ </g>
+ </g>
+</svg>
BIN  creative_commons/cc_cc_30.pdf
Binary file not shown
79 creative_commons/cc_cc_30.svg
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="31.48"
+ height="31.48"
+ id="svg2756"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2758" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="22.4"
+ inkscape:cx="18.491557"
+ inkscape:cy="21.303375"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="1024"
+ inkscape:window-height="699"
+ inkscape:window-x="-4"
+ inkscape:window-y="-4"
+ width="31.48px"
+ height="31.48px" />
+ <metadata
+ id="metadata2761">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-358.56797,-470.90766)">
+ <g
+ transform="matrix(0.872921,0,0,0.872921,-36.465341,461.35074)"
+ id="g5908_7_">
+ <path
+ style="fill:#ffffff"
+ d="M 486.26599,30.10776 C 486.27154,38.788 479.2381,45.82929 470.55786,45.83487 C 461.87768,45.83936 454.83526,38.80701 454.83081,30.1268 C 454.83081,30.12009 454.83081,30.11447 454.83081,30.10776 C 454.82629,21.42642 461.85864,14.38513 470.53888,14.38068 C 479.22022,14.37506 486.26038,21.40854 486.26599,30.08875 C 486.26599,30.09433 486.26599,30.10104 486.26599,30.10776 z "
+ rx="22.939548"
+ type="arc"
+ cy="264.3577"
+ ry="22.939548"
+ cx="296.35416"
+ id="path5906_7_" />
+ <g
+ transform="translate(-289.6157,99.0653)"
+ id="g5706_7_">
+ <path
+ d="M 772.94055,-81.76028 C 776.42651,-78.27432 778.16943,-74.00637 778.16943,-68.95755 C 778.16943,-63.90873 776.45666,-59.68552 773.03112,-56.29016 C 769.39635,-52.71359 765.09936,-50.92587 760.1422,-50.92587 C 755.24449,-50.92587 751.02233,-52.69903 747.47594,-56.24542 C 743.93077,-59.79068 742.15758,-64.02841 742.15758,-68.95755 C 742.15758,-73.88666 743.93077,-78.1535 747.47594,-81.76028 C 750.93175,-85.24734 755.1538,-86.98922 760.1422,-86.98922 C 765.18994,-86.98923 769.45569,-85.24734 772.94055,-81.76028 z M 749.82312,-79.41544 C 746.87634,-76.43961 745.40405,-72.95252 745.40405,-68.95307 C 745.40405,-64.95472 746.86181,-61.49787 749.77832,-58.58243 C 752.69373,-55.66593 756.16626,-54.20822 760.19482,-54.20822 C 764.22338,-54.20822 767.72497,-55.68045 770.7008,-58.6272 C 773.52673,-61.36249 774.94079,-64.80371 774.94079,-68.95307 C 774.94079,-73.07111 773.50439,-76.56602 770.63366,-79.43781 C 767.76305,-82.30848 764.28381,-83.74378 760.19482,-83.74378 C 756.10583,-83.74378 752.64905,-82.30063 749.82312,-79.41544 z M 757.57812,-70.71283 C 757.12731,-71.69394 756.45263,-72.18509 755.55432,-72.18509 C 753.9646,-72.18509 753.17029,-71.11557 753.17029,-68.97656 C 753.17029,-66.83642 753.9646,-65.76693 755.55432,-65.76693 C 756.60376,-65.76693 757.35327,-66.28823 757.80298,-67.33202 L 760.00574,-66.15847 C 758.95642,-64.29354 757.38123,-63.36053 755.28028,-63.36053 C 753.66028,-63.36053 752.36256,-63.85723 751.38819,-64.84957 C 750.41151,-65.84298 749.92603,-67.2123 749.92603,-68.95754 C 749.92603,-70.67254 750.42725,-72.03515 751.43299,-73.04314 C 752.43873,-74.05111 753.68946,-74.55565 755.1908,-74.55565 C 757.41028,-74.55565 759.0011,-73.6808 759.96106,-71.93334 L 757.57812,-70.71283 z M 767.94092,-70.71283 C 767.49011,-71.69394 766.82996,-72.18509 765.9585,-72.18509 C 764.33753,-72.18509 763.52637,-71.11557 763.52637,-68.97656 C 763.52637,-66.83642 764.33753,-65.76693 765.9585,-65.76693 C 767.00904,-65.76693 767.74512,-66.28823 768.16578,-67.33202 L 770.41773,-66.15847 C 769.36951,-64.29354 767.79664,-63.36053 765.70008,-63.36053 C 764.0824,-63.36053 762.78687,-63.85723 761.81361,-64.84957 C 760.84144,-65.84298 760.35487,-67.2123 760.35487,-68.95754 C 760.35487,-70.67254 760.84925,-72.03515 761.83717,-73.04314 C 762.82496,-74.05111 764.08241,-74.55565 765.61061,-74.55565 C 767.8268,-74.55565 769.41432,-73.6808 770.37196,-71.93334 L 767.94092,-70.71283 z "
+ id="path5708_7_" />
+ </g>
+ </g>
+ </g>
+</svg>
BIN  creative_commons/cc_dev_nations_30.pdf
Binary file not shown
100 creative_commons/cc_dev_nations_30.svg
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.3379"
+ height="23.33692"
+ id="svg2680"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2682" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="1.4"
+ inkscape:cx="193.19555"
+ inkscape:cy="73.091652"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="22"
+ inkscape:window-y="22" />
+ <metadata
+ id="metadata2685">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-231.18819,-120.69372)">
+ <g
+ transform="translate(235.65053,-275.13731)"
+ id="g9580_1_">
+
+ <path
+ style="fill:#ffffff"
+ d="M 17.97516,407.91357 C 17.97516,413.95947 13.07282,418.86084 7.02594,418.86084 C 0.98004,418.86084 -3.9223,413.95947 -3.9223,407.91357 C -3.9223,401.86572 0.98004,396.96533 7.02594,396.96533 C 13.07281,396.96533 17.97516,401.86572 17.97516,407.91357 z "
+ rx="18.765432"
+ type="arc"
+ cy="861.86731"
+ ry="18.765432"
+ cx="394.51389"
+ id="path9540_1_" />
+
+ <path
+ d="M 7.1861,396.22803 C 3.95758,396.22803 1.22223,397.35596 -1.018,399.61084 C -3.31683,401.9458 -4.46234,404.70752 -4.46234,407.89502 C -4.46234,411.08643 -3.31683,413.82764 -1.018,416.12354 C 1.28376,418.41749 4.01716,419.56495 7.1861,419.56495 C 10.39997,419.56495 13.18903,418.40968 15.54255,416.09327 C 17.7613,413.89698 18.87556,411.16358 18.87556,407.89503 C 18.87556,404.62745 17.74958,401.86866 15.48884,399.61085 C 13.22809,397.35596 10.46344,396.22803 7.1861,396.22803 z M 7.21735,398.32861 C 9.86579,398.32861 12.11676,399.26123 13.96735,401.12841 C 15.83844,402.97509 16.77399,405.23486 16.77399,407.89501 C 16.77399,410.57958 15.85895,412.80614 14.02497,414.57763 C 12.09724,416.48486 9.83063,417.43408 7.21735,417.43408 C 4.60797,417.43408 2.35993,416.4917 0.47321,414.60693 C -1.41644,412.72021 -2.36175,410.48291 -2.36175,407.89502 C -2.36175,405.31006 -1.40472,403.05225 0.50251,401.12842 C 2.33258,399.26123 4.57086,398.32861 7.21735,398.32861 z "
+ id="path9542_1_" />
+
+ <path
+ d="M 6.69781,397.03369 L 6.69781,418.74853 L 7.71832,418.74853 L 7.71832,397.03369 L 6.69781,397.03369 z "
+ id="path9544_1_" />
+
+ <path
+ d="M -3.60394,407.38916 L -3.60394,408.41064 L 18.00153,408.41064 L 18.00153,407.38916 L -3.60394,407.38916 z "
+ id="path9546_1_" />
+
+ <path
+ d="M -1.48871,400.771 L -1.76215,401.75538 C 4.48492,403.54151 10.46734,403.771 16.15973,401.73683 L 15.81403,400.78956 C 10.35797,402.73877 4.61676,402.51514 -1.48871,400.771 z "
+ id="path9548_1_" />
+
+ <path
+ d="M 2.39508,398.38232 C -0.15277,404.5874 -0.34613,410.95263 2.39508,417.38037 L 3.32477,416.97998 C 0.68512,410.78857 0.88043,404.76123 3.34235,398.76514 L 2.39508,398.38232 z "
+ id="path9550_1_" />
+
+ <path
+ d="M 7.04352,412.82275 C 4.06207,412.76806 1.11872,413.10986 -1.7807,414.00732 L -1.47113,414.97412 C 4.09235,413.25146 9.87262,413.66846 15.88629,414.99267 L 16.10504,413.98974 C 13.05231,413.31689 10.02594,412.87646 7.04352,412.82275 z "
+ id="path9552_1_" />
+
+ <path
+ d="M 11.96637,398.36377 L 11.03668,398.76514 C 13.67633,404.95557 13.49859,410.98194 11.03668,416.97998 L 11.98492,417.36279 C 14.5318,411.15674 14.7066,404.7915 11.96637,398.36377 z "
+ id="path9554_1_" />
+
+ </g>
+ </g>
+</svg>
BIN  creative_commons/cc_nc_30.pdf
Binary file not shown
76 creative_commons/cc_nc_30.svg
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.337896"
+ height="23.337404"
+ id="svg2574"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2576" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.35"
+ inkscape:cx="375"
+ inkscape:cy="291.42857"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="110"
+ inkscape:window-y="110" />
+ <metadata
+ id="metadata2579">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-279.75962,-489.26491)">
+ <g
+ transform="matrix(1.146822,0,0,1.146822,478.22789,502.58592)"
+ id="g6379_1_">
+
+ <path
+ style="fill:#ffffff"
+ d="M -154.14499,-1.09436 C -154.14157,3.73257 -158.051,7.64752 -162.87836,7.65134 C -167.70488,7.65433 -171.62026,3.74448 -171.62366,-1.0816 C -171.62366,-1.0867 -171.62366,-1.09054 -171.62366,-1.09436 C -171.62706,-5.92175 -167.71765,-9.8367 -162.89115,-9.84051 C -158.06376,-9.8435 -154.14838,-5.93365 -154.145,-1.10757 C -154.14499,-1.1033 -154.14499,-1.09863 -154.14499,-1.09436 z "
+ rx="29.209877"
+ type="arc"
+ cy="252.08646"
+ ry="29.209877"
+ cx="475.97119"
+ id="path6381_1_" />
+
+ <path
+ d="M -162.89709,-11.26941 C -160.04528,-11.26941 -157.63372,-10.28589 -155.66412,-8.31925 C -153.69452,-6.35178 -152.70929,-3.94321 -152.70929,-1.09437 C -152.70929,1.75445 -153.67749,4.13704 -155.61304,6.05385 C -157.66779,8.07198 -160.09552,9.08022 -162.8971,9.08022 C -165.66544,9.08022 -168.0506,8.07967 -170.05428,6.07854 C -172.05794,4.07827 -173.05935,1.68672 -173.05935,-1.09437 C -173.05935,-3.87593 -172.05795,-6.28449 -170.05428,-8.31925 C -168.1017,-10.28589 -165.71568,-11.26941 -162.89709,-11.26941 z M -170.77042,-3.82825 C -171.07357,-2.96945 -171.22513,-2.05832 -171.22513,-1.09436 C -171.22513,1.16092 -170.40254,3.11054 -168.75568,4.7561 C -167.1088,6.40045 -165.14771,7.22345 -162.87156,7.22345 C -160.59623,7.22345 -158.61897,6.39276 -156.93803,4.73013 C -156.37516,4.18686 -155.91108,3.59335 -155.54747,2.95044 L -159.38365,1.24268 C -159.64339,2.53318 -160.79295,3.40473 -162.18352,3.5069 L -162.18352,5.07587 L -163.35182,5.07587 L -163.35182,3.5069 C -164.49374,3.49414 -165.59733,3.02707 -166.44035,2.28879 L -165.03958,0.87567 C -164.3643,1.51089 -163.68904,1.79617 -162.76768,1.79617 C -162.17073,1.79617 -161.5091,1.56241 -161.5091,0.78454 C -161.5091,0.50906 -161.6164,0.31747 -161.78412,0.17355 L -162.75403,-0.25901 L -163.96237,-0.79633 C -164.55929,-1.06287 -165.06511,-1.28727 -165.57347,-1.51377 L -170.77042,-3.82825 z M -162.87155,-9.43817 C -165.18092,-9.43817 -167.1335,-8.62451 -168.72928,-6.99597 C -169.16441,-6.5574 -169.54164,-6.0993 -169.86353,-5.62158 L -165.97286,-3.88955 C -165.62201,-4.96887 -164.59676,-5.62371 -163.35181,-5.69607 L -163.35181,-7.26504 L -162.18351,-7.26504 L -162.18351,-5.69607 C -161.37882,-5.65734 -160.49662,-5.43679 -159.62721,-4.76321 L -160.96412,-3.38885 C -161.45716,-3.7384 -162.07963,-3.98492 -162.70295,-3.98492 C -163.20875,-3.98492 -163.92236,-3.82992 -163.92236,-3.19513 C -163.92236,-3.09763 -163.89085,-3.01245 -163.83123,-2.93668 L -162.5301,-2.35764 L -161.64961,-1.96506 C -161.08674,-1.71344 -160.54857,-1.47501 -160.01552,-1.23743 L -154.80239,1.08343 C -154.62954,0.40093 -154.54354,-0.32544 -154.54354,-1.09437 C -154.54354,-3.41865 -155.35845,-5.38487 -156.9883,-6.99598 C -158.60193,-8.62451 -160.56302,-9.43817 -162.87155,-9.43817 z "
+ id="path6383_1_" />
+
+ </g>
+ </g>
+</svg>
BIN  creative_commons/cc_nd_30.pdf
Binary file not shown
89 creative_commons/cc_nd_30.svg
@@ -0,0 +1,89 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.3379"
+ height="23.337883"
+ id="svg2609"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2611" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.7"
+ inkscape:cx="390.46465"
+ inkscape:cy="107.08936"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="132"
+ inkscape:window-y="132" />
+ <metadata
+ id="metadata2614">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-454.04534,-363.55038)">
+ <g
+ transform="matrix(0.624995,0,0,0.624995,11.5654,452.74052)"
+ id="g6501">
+
+ <path
+ style="fill:#ffffff"
+ d="M 743.93005,-123.39972 C 743.93634,-113.98871 736.31128,-106.35272 726.89868,-106.34491 C 717.48767,-106.34021 709.85168,-113.96213 709.84387,-123.37628 C 709.84387,-123.38409 709.84387,-123.39346 709.84387,-123.39972 C 709.83764,-132.81229 717.46264,-140.44675 726.87524,-140.45456 C 736.28784,-140.46237 743.92224,-132.83728 743.93005,-123.42471 C 743.93005,-123.4169 743.93005,-123.40909 743.93005,-123.39972 z "
+ rx="29.209877"
+ type="arc"
+ cy="252.08646"
+ ry="29.209877"
+ cx="475.97119"
+ id="path6503" />
+
+ <g
+ transform="translate(-23.9521,-87.92102)"
+ id="g6505">
+ <path
+ d="M 750.57263,-54.14914 C 745.39917,-54.14914 741.02258,-52.34604 737.43976,-48.7366 C 733.76319,-45.00219 731.92566,-40.58343 731.92566,-35.4787 C 731.92566,-30.37552 733.76318,-25.98956 737.43976,-22.3161 C 741.11633,-18.64419 745.49292,-16.80823 750.57263,-16.80823 C 755.71179,-16.80823 760.16809,-18.66138 763.93835,-22.36298 C 767.48999,-25.88019 769.2666,-30.25211 769.2666,-35.4787 C 769.2666,-40.70844 767.45874,-45.12564 763.8446,-48.7366 C 760.23059,-52.34604 755.80554,-54.14914 750.57263,-54.14914 z M 750.61951,-50.79129 C 754.85547,-50.79129 758.45398,-49.29599 761.41492,-46.30691 C 764.40558,-43.3522 765.90088,-39.74435 765.90088,-35.47869 C 765.90088,-31.1849 764.43683,-27.62237 761.50708,-24.7911 C 758.42273,-21.74108 754.79297,-20.21764 750.61951,-20.21764 C 746.44294,-20.21764 742.84449,-21.72545 739.82257,-24.74578 C 736.80066,-27.76299 735.28973,-31.34115 735.28973,-35.47869 C 735.28973,-39.61935 736.81628,-43.22719 739.86944,-46.30691 C 742.79919,-49.29599 746.38196,-50.79129 750.61951,-50.79129 z "
+ id="path6507" />
+
+ <g
+ id="g6509">
+ <path
+ d="M 757.65088,-39.90375 L 744.07727,-39.90375 L 744.07727,-36.68964 L 757.65088,-36.68964 L 757.65088,-39.90375 z M 757.65088,-33.90369 L 744.07727,-33.90369 L 744.07727,-30.68961 L 757.65088,-30.68961 L 757.65088,-33.90369 z "
+ id="path6511" />
+
+ </g>
+
+ </g>
+
+ </g>
+ </g>
+</svg>
BIN  creative_commons/cc_pd_30.pdf
Binary file not shown
96 creative_commons/cc_pd_30.svg
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.33791"
+ height="23.337885"
+ id="svg2639"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2641" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.7"
+ inkscape:cx="414.72573"
+ inkscape:cy="-71.707275"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="154"
+ inkscape:window-y="154" />
+ <metadata
+ id="metadata2644">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-348.33105,-517.83609)">
+ <g
+ transform="matrix(1.146822,0,0,1.146822,61.005341,165.58783)"
+ id="g6848_1_">
+
+ <path
+ style="fill:#ffffff"
+ d="M 270.07806,317.67285 C 270.07977,322.84338 265.8919,327.03723 260.72137,327.03979 C 255.55125,327.04232 251.35743,322.85446 251.35444,317.68392 C 251.35444,317.68053 251.35444,317.67711 251.35444,317.67284 C 251.35061,312.50231 255.53976,308.30846 260.71029,308.30507 C 265.88043,308.30254 270.07424,312.49123 270.07806,317.66179 C 270.07806,317.66519 270.07806,317.66943 270.07806,317.67285 z "
+ rx="22.939548"
+ type="arc"
+ cy="264.3577"
+ ry="22.939548"
+ cx="296.35416"
+ id="path6096_1_" />
+
+ <g
+ transform="matrix(0.54498,0,0,0.54498,411.367,265.3489)"
+ id="g6687_1_">
+ <path
+ style="fill:#010101"
+ d="M -276.45773,77.3403 C -281.62964,77.3403 -286.00625,79.14654 -289.58908,82.75439 C -293.26569,86.4888 -295.10477,90.90759 -295.10477,96.01074 C -295.10477,101.11392 -293.26569,105.50143 -289.58908,109.17334 C -285.91406,112.84525 -281.53589,114.68121 -276.45773,114.68121 C -271.31707,114.68121 -266.86233,112.82962 -263.09201,109.12646 C -259.5404,105.61084 -257.76382,101.23892 -257.76382,96.01074 C -257.76382,90.78259 -259.57009,86.3638 -263.18576,82.75439 C -266.79984,79.14655 -271.22333,77.3403 -276.45773,77.3403 z M -276.41086,80.70126 C -272.17334,80.70126 -268.57642,82.195 -265.61545,85.18097 C -262.62482,88.13883 -261.12949,91.74664 -261.12949,96.01074 C -261.12949,100.30453 -262.59201,103.86706 -265.52329,106.69833 C -268.60611,109.7499 -272.2374,111.27337 -276.41086,111.27337 C -280.58591,111.27337 -284.18436,109.76397 -287.20627,106.74676 C -290.22815,103.72644 -291.73911,100.14828 -291.73911,96.01074 C -291.73911,91.87164 -290.21253,88.26224 -287.1594,85.18097 C -284.23123,82.19501 -280.64841,80.70126 -276.41086,80.70126 z "
+ id="path6689_1_" />
+
+ <g
+ id="g6691_1_">
+ <path
+ style="fill:#010101"
+ d="M -282.61871,92.66385 L -280.51715,92.66385 C -279.34369,92.66385 -278.84994,93.22791 -278.84994,94.2576 C -278.84994,95.05451 -279.27026,95.82169 -280.44528,95.82169 L -282.61871,95.82169 L -282.61871,92.66385 L -282.61871,92.66385 z M -285.19843,101.0686 L -282.59061,101.0686 L -282.59061,97.73574 L -280.57495,97.73574 C -277.039,97.73574 -276.27023,95.61855 -276.27023,94.24197 C -276.27023,92.19821 -277.29992,90.74975 -280.08276,90.74975 L -285.19842,90.74975 L -285.19842,101.0686 L -285.19843,101.0686 z "
+ id="path6693_1_" />
+
+ <path
+ style="fill:#010101"
+ d="M -275.56866,101.0686 L -271.56707,101.0686 C -268.4233,101.0686 -266.30764,99.57641 -266.30764,95.90918 C -266.30764,92.24197 -268.4233,90.74976 -271.56707,90.74976 L -275.56866,90.74976 L -275.56866,101.0686 z M -272.98895,92.92477 L -271.52487,92.92477 C -269.58267,92.92477 -268.88736,94.24197 -268.88736,95.90918 C -268.88736,97.57483 -269.58267,98.89514 -271.51083,98.89514 L -272.98895,98.89514 L -272.98895,92.92477 L -272.98895,92.92477 z "
+ id="path6695_1_" />
+
+ </g>
+
+ </g>
+
+ </g>
+ </g>
+</svg>
BIN  creative_commons/cc_sa_30.pdf
Binary file not shown
85 creative_commons/cc_sa_30.svg
@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.336914"
+ height="23.337406"
+ id="svg2540"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2542" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="11.2"
+ inkscape:cx="9.3631331"
+ inkscape:cy="14.273926"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="111"
+ inkscape:window-y="156" />
+ <metadata
+ id="metadata2545">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-279.76012,-303.55063)">
+ <g
+ transform="matrix(0.624995,0,0,0.624995,411.5203,402.56245)"
+ id="g6316_1_">
+
+ <path
+ style="fill:#ffffff"
+ d="M -175.0083,-139.1153 C -175.00204,-129.7035 -182.62555,-122.06751 -192.03812,-122.06049 C -201.44913,-122.05341 -209.08512,-129.67774 -209.09293,-139.09028 C -209.09293,-139.09809 -209.09293,-139.10749 -209.09293,-139.1153 C -209.09919,-148.52784 -201.47413,-156.1623 -192.06311,-156.17011 C -182.65054,-156.17713 -175.01456,-148.55207 -175.0083,-139.14026 C -175.0083,-139.13092 -175.0083,-139.1239 -175.0083,-139.1153 z "
+ rx="29.209877"
+ type="arc"
+ cy="252.08646"
+ ry="29.209877"
+ cx="475.97119"
+ id="path6318_1_" />
+
+ <g
+ transform="translate(-23.9521,-89.72962)"
+ id="g6320_1_">
+ <path
+ d="M -168.2204,-68.05536 C -173.39234,-68.05536 -177.76892,-66.25067 -181.35175,-62.64203 C -185.02836,-58.90759 -186.86588,-54.48883 -186.86588,-49.38568 C -186.86588,-44.28253 -185.02836,-39.89416 -181.35175,-36.22308 C -177.67673,-32.55114 -173.29859,-30.71521 -168.2204,-30.71521 C -163.07974,-30.71521 -158.62503,-32.56677 -154.85312,-36.26996 C -151.30307,-39.78558 -149.52652,-44.15827 -149.52652,-49.38568 C -149.52652,-54.6123 -151.33432,-59.03265 -154.94843,-62.64203 C -158.5625,-66.25067 -162.98599,-68.05536 -168.2204,-68.05536 z M -168.17352,-64.69519 C -163.936,-64.69519 -160.33752,-63.20221 -157.37655,-60.21466 C -154.38748,-57.25836 -152.89214,-53.64899 -152.89214,-49.38568 C -152.89214,-45.09186 -154.35466,-41.52856 -157.28438,-38.69653 C -160.36876,-35.64727 -163.99849,-34.12304 -168.17351,-34.12304 C -172.34856,-34.12304 -175.94701,-35.63244 -178.96892,-38.64965 C -181.9908,-41.66918 -183.50176,-45.24657 -183.50176,-49.38567 C -183.50176,-53.52398 -181.97518,-57.13414 -178.92205,-60.21465 C -175.9939,-63.20221 -172.41107,-64.69519 -168.17352,-64.69519 z "
+ id="path6322_1_" />
+
+ <path
+ d="M -176.49548,-52.02087 C -175.75171,-56.71856 -172.44387,-59.22949 -168.30008,-59.22949 C -162.33911,-59.22949 -158.70783,-54.90448 -158.70783,-49.1372 C -158.70783,-43.50982 -162.57194,-39.13793 -168.39383,-39.13793 C -172.39856,-39.13793 -175.98297,-41.60277 -176.63611,-46.43877 L -171.93292,-46.43877 C -171.7923,-43.92778 -170.1626,-43.04418 -167.83447,-43.04418 C -165.1813,-43.04418 -163.4563,-45.50908 -163.4563,-49.27709 C -163.4563,-53.22942 -164.94693,-55.32244 -167.74228,-55.32244 C -169.79074,-55.32244 -171.55948,-54.57787 -171.93292,-52.02087 L -170.56418,-52.02789 L -174.26734,-48.32629 L -177.96894,-52.02789 L -176.49548,-52.02087 z "
+ id="path6324_1_" />
+
+ </g>
+
+ </g>
+ </g>
+</svg>
BIN  creative_commons/cc_sampling_30.pdf
Binary file not shown
61 creative_commons/cc_sampling_30.svg
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.33691"
+ height="23.3379"
+ id="svg2747"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2749" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="257.4855"
+ inkscape:cy="-41.852092"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showborder="true"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="66"
+ inkscape:window-y="66" />
+ <metadata
+ id="metadata2752">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-368.33154,-466.40752)">
+ <path
+ d="M 388.28076,470.18929 C 386.02099,467.93343 383.25635,466.80452 379.98486,466.80452 C 376.75244,466.80452 374.01709,467.93343 371.77783,470.18929 C 369.47998,472.52327 368.33154,475.28499 368.33154,478.47445 C 368.33154,481.66391 369.47998,484.40609 371.77783,486.70101 C 374.07471,488.99593 376.81103,490.14242 379.98486,490.14242 C 383.19775,490.14242 385.98291,488.98617 388.33935,486.67172 C 390.5581,484.47445 391.66845,481.74203 391.66845,478.47445 C 391.66845,475.20687 390.53955,472.44515 388.28076,470.18929 z M 373.29638,471.70687 C 375.12743,469.83968 377.36572,468.90609 380.01415,468.90609 C 382.66258,468.90609 384.91161,469.83968 386.7622,471.70687 C 388.63036,473.55453 389.56493,475.81039 389.56493,478.47445 C 389.56493,478.60531 389.55223,478.72933 389.54833,478.85824 L 386.39208,478.85824 C 386.1831,478.85824 385.99462,478.98422 385.91552,479.17758 C 385.91552,479.17758 385.65575,479.80258 385.41747,480.37778 C 385.14696,478.10923 384.67528,474.14731 384.67528,474.14731 C 384.64403,473.88461 384.41844,473.68735 384.15282,473.69223 C 383.88817,473.69711 383.66942,473.90219 383.64794,474.16684 C 383.64794,474.16684 383.42626,476.85825 383.20849,479.49692 C 382.96728,476.3104 382.72607,473.1229 382.72607,473.1229 C 382.70556,472.85435 382.48193,472.64634 382.2124,472.64536 C 382.21142,472.64536 382.21142,472.64536 382.21142,472.64536 C 381.94189,472.64536 381.71728,472.85337 381.69677,473.12192 C 381.69677,473.12192 381.48779,475.80551 381.29052,478.34165 C 381.03466,474.26743 380.77685,470.1688 380.77685,470.1688 C 380.75927,469.89634 380.53369,469.68442 380.26025,469.68442 C 379.98779,469.6854 379.7622,469.89731 379.7456,470.16977 C 379.7456,470.16977 379.50732,474.09067 379.26806,478.00864 C 379.04931,474.64048 378.82665,471.21469 378.82665,471.21469 C 378.80907,470.94321 378.58349,470.73129 378.31103,470.73129 C 378.03857,470.73129 377.81396,470.94223 377.79541,471.21371 C 377.79541,471.21371 377.55322,474.89926 377.31006,478.58383 C 377.09522,475.62875 376.87451,472.60336 376.87451,472.60336 C 376.85498,472.33481 376.63232,472.12582 376.36279,472.12387 C 376.09424,472.12192 375.86865,472.32797 375.84521,472.59653 C 375.84521,472.59653 375.53369,476.21469 375.25048,479.49985 C 375.10204,478.49106 374.91943,477.24887 374.91943,477.24887 C 374.88623,477.02426 374.71045,476.8475 374.48486,476.81332 C 374.26025,476.78012 374.03955,476.8973 373.94189,477.10238 C 373.94189,477.10238 373.31298,478.4266 373.10791,478.85824 L 370.45166,478.85824 C 370.44678,478.73031 370.43408,478.60433 370.43408,478.47445 C 370.43408,475.88851 371.38818,473.6307 373.29638,471.70687 z M 386.81982,485.15414 C 384.89209,487.06039 382.62353,488.01352 380.01416,488.01352 C 377.40479,488.01352 375.15576,487.07016 373.26709,485.18344 C 371.73389,483.65121 370.8335,481.88461 370.54541,479.89145 L 373.43408,479.89145 C 373.6333,479.89145 373.81494,479.77622 373.90088,479.59653 C 373.90088,479.59653 374.05322,479.27524 374.14502,479.08188 C 374.42041,480.95688 374.87354,484.03598 374.87354,484.03598 C 374.91163,484.29477 375.13819,484.4852 375.39991,484.47739 C 375.66163,484.4686 375.87647,484.26645 375.89893,484.00473 C 375.89893,484.00473 376.11182,481.53207 376.31592,479.15903 C 376.56787,482.61997 376.8208,486.08774 376.8208,486.08774 C 376.84033,486.35825 377.06592,486.56821 377.3374,486.56723 C 377.60888,486.56625 377.83252,486.35532 377.85107,486.08481 C 377.85107,486.08481 378.08056,482.60336 378.3081,479.14926 C 378.53857,482.69516 378.77001,486.25766 378.77001,486.25766 C 378.78759,486.53012 379.01415,486.74106 379.28661,486.74106 C 379.55907,486.74008 379.78466,486.52817 379.80126,486.25571 C 379.80126,486.25571 380.03564,482.40122 380.27001,478.55844 C 380.49462,482.1268 380.72118,485.7352 380.72118,485.7352 C 380.73876,486.00571 380.96239,486.21762 381.2329,486.21958 C 381.50438,486.22153 381.73095,486.01353 381.75145,485.74302 C 381.75145,485.74302 381.97899,482.81431 382.20457,479.91392 C 382.43797,482.99693 382.67234,486.0897 382.67234,486.0897 C 382.69285,486.35825 382.9155,486.56626 383.18504,486.56724 C 383.18602,486.56724 383.18602,486.56724 383.18699,486.56724 C 383.45554,486.56724 383.67918,486.36119 383.70164,486.09263 C 383.70164,486.09263 383.98387,482.66392 384.25633,479.36118 C 384.43016,480.82016 384.62547,482.46177 384.62547,482.46177 C 384.65281,482.69419 384.83445,482.87974 385.06785,482.91197 C 385.30027,482.9442 385.52488,482.81529 385.61473,482.59752 C 385.61473,482.59752 386.52586,480.40123 386.7368,479.89147 L 389.46336,479.89147 C 389.19091,481.94906 388.31689,483.70687 386.81982,485.15414 z "
+ id="path33" />
+ </g>
+</svg>
BIN  creative_commons/cc_sampling_plus_30.pdf
Binary file not shown
76 creative_commons/cc_sampling_plus_30.svg
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://web.resource.org/cc/"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="23.3379"
+ height="23.337891"
+ id="svg2734"
+ sodipodi:version="0.32"
+ inkscape:version="0.45.1"
+ version="1.0"
+ inkscape:output_extension="org.inkscape.output.svg.inkscape">
+ <defs
+ id="defs2736" />
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ gridtolerance="10000"
+ guidetolerance="10"
+ objecttolerance="10"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="0.98994949"
+ inkscape:cx="257.48451"
+ inkscape:cy="82.821786"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ inkscape:showpageshadow="false"
+ inkscape:window-width="748"
+ inkscape:window-height="579"
+ inkscape:window-x="44"
+ inkscape:window-y="44" />
+ <metadata
+ id="metadata2739">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1"
+ transform="translate(-376.90248,-440.69324)">
+ <g
+ transform="translate(-128.21715,287.86075)"
+ id="g193">
+
+ <path
+ style="fill:#ffffff"
+ d="M 526.89404,164.89844 C 526.89697,159.31739 522.37646,154.79004 516.79541,154.78614 C 511.21338,154.78321 506.68799,159.30469 506.68311,164.88477 C 506.68311,164.88965 506.68311,164.89356 506.68311,164.89844 C 506.6792,170.47852 511.20166,175.00586 516.78174,175.00977 C 522.36279,175.0127 526.89014,170.49219 526.89404,164.91114 C 526.89404,164.90625 526.89404,164.90332 526.89404,164.89844 z "
+ rx="27.711935"
+ type="arc"
+ cy="731.05353"
+ ry="27.711935"
+ cx="537.76129"
+ id="path6428_1_" />
+
+ <path
+ id="path196"
+ d="M 513.60986,172.51318 C 513.62939,172.78369 513.85498,172.99267 514.12646,172.99218 C 514.39794,172.9912 514.62158,172.78027 514.64013,172.50927 C 514.64013,172.50927 514.83544,169.53466 515.04443,166.35839 L 513.16162,166.35839 C 513.39307,169.54346 513.60986,172.51318 513.60986,172.51318 z M 517.73291,164.65137 L 518.07178,164.65137 C 517.81787,160.61426 517.56494,156.59278 517.56494,156.59278 C 517.54736,156.32032 517.32178,156.1084 517.04834,156.10889 C 516.77588,156.10889 516.55029,156.32129 516.53369,156.59375 C 516.53369,156.59375 516.42139,158.43994 516.27392,160.86426 L 517.7329,160.86426 L 517.7329,164.65137 L 517.73291,164.65137 z M 516.01221,163.76367 C 515.80811,160.625 515.61377,157.63818 515.61377,157.63818 C 515.59619,157.3667 515.37061,157.15576 515.09815,157.15576 C 514.82569,157.15576 514.60108,157.3667 514.58253,157.63818 C 514.58253,157.63818 514.35499,161.09033 514.12159,164.65136 L 516.01221,164.65136 L 516.01221,163.76367 L 516.01221,163.76367 z M 516.01221,166.3584 L 515.146,166.3584 C 515.35987,169.62549 515.55811,172.68311 515.55811,172.68311 C 515.57666,172.95508 515.80225,173.16651 516.07471,173.16602 C 516.34717,173.16504 516.57276,172.95264 516.58936,172.68067 C 516.58936,172.68067 516.65186,171.65821 516.74366,170.14649 L 516.01221,170.14649 L 516.01221,166.3584 z M 525.06885,156.61328 C 522.81006,154.35742 520.04541,153.22949 516.77393,153.22949 C 513.54151,153.22949 510.80616,154.35742 508.5669,156.61328 C 506.26807,158.94629 505.11963,161.70898 505.11963,164.89844 C 505.11963,168.0879 506.26807,170.83008 508.5669,173.125 C 510.86378,175.41992 513.6001,176.56738 516.77393,176.56738 C 519.98584,176.56738 522.771,175.40918 525.12745,173.09668 C 527.34718,170.89844 528.45753,168.16504 528.45753,164.89844 C 528.45753,161.63184 527.32764,158.86914 525.06885,156.61328 z M 521.50732,164.65137 L 521.50732,166.3584 L 521.11279,166.3584 C 521.26513,167.6416 521.41357,168.88526 521.41357,168.88526 C 521.44091,169.11866 521.62255,169.30372 521.85595,169.33594 C 522.08837,169.36768 522.31298,169.23877 522.40283,169.02198 C 522.40283,169.02198 523.31396,166.8252 523.5249,166.31544 L 526.25244,166.31544 C 525.979,168.37355 525.10498,170.13136 523.60889,171.57814 C 521.68018,173.48439 519.41162,174.43752 516.80323,174.43752 C 514.19385,174.43752 511.94385,173.49416 510.05616,171.60842 C 508.52198,170.07571 507.62159,168.3091 507.3335,166.31545 L 510.22217,166.31545 C 510.42139,166.31545 510.60303,166.2007 510.68799,166.02053 C 510.68799,166.02053 510.84131,165.69875 510.93408,165.50442 C 511.20947,167.37942 511.6626,170.46096 511.6626,170.46096 C 511.70069,170.72024 511.92725,170.90969 512.18897,170.90188 C 512.45069,170.89407 512.66553,170.69143 512.68799,170.4302 C 512.68799,170.4302 512.85694,168.46536 513.03858,166.35842 L 512.23878,166.35842 L 512.23878,164.65139 L 514.07276,164.65139 C 513.86768,161.81594 513.66358,159.02688 513.66358,159.02688 C 513.64405,158.75833 513.42139,158.54983 513.15284,158.54836 C 512.88331,158.54641 512.65772,158.75197 512.63429,159.02004 C 512.63429,159.02004 512.32277,162.6382 512.03956,165.92385 C 511.89112,164.91457 511.70851,163.6719 511.70851,163.6719 C 511.67531,163.4468 511.49953,163.27004 511.27394,163.23635 C 511.04933,163.20266 510.82863,163.31985 510.73097,163.52541 C 510.73097,163.52541 510.10109,164.85012 509.89601,165.28225 L 507.23976,165.28225 C 507.23488,165.15383 507.22218,165.02883 507.22218,164.89846 C 507.22218,162.31155 508.17726,160.05569 510.08546,158.13088 C 511.91554,156.26272 514.1548,155.3301 516.80323,155.3301 C 519.45166,155.3301 521.69971,156.26272 523.5503,158.13088 C 525.41944,159.97756 526.35401,162.2344 526.35401,164.89846 C 526.35401,165.02932 526.34131,165.15383 526.33741,165.28225 L 523.18018,165.28225 C 522.9712,165.28225 522.78272,165.40823 522.70362,165.6011 C 522.70362,165.6011 522.44385,166.22708 522.20557,166.80178 C 521.93506,164.53274 521.46338,160.57082 521.46338,160.57082 C 521.43213,160.30764 521.20654,160.11086 520.94092,160.11574 C 520.67627,160.12062 520.45752,160.32521 520.43604,160.58937 C 520.43604,160.58937 520.27979,162.4839 520.10206,164.65138 L 521.50732,164.65138 L 521.50732,164.65137 z M 519.51514,159.54785 C 519.49463,159.27881 519.271,159.0708 519.00147,159.0708 C 519.00049,159.0708 519.00049,159.0708 519.00049,159.0708 C 518.73096,159.0708 518.50635,159.27783 518.48584,159.54687 C 518.48584,159.54687 518.28369,162.14794 518.08838,164.65136 L 519.90186,164.65136 C 519.6958,161.94043 519.51514,159.54785 519.51514,159.54785 z M 517.73291,170.14648 L 517.3833,170.14648 C 517.45947,171.35937 517.50928,172.16015 517.50928,172.16015 C 517.52686,172.43115 517.74951,172.64208 518.021,172.64453 C 518.29248,172.64648 518.51905,172.43848 518.53955,172.16797 C 518.53955,172.16797 518.76709,169.25342 518.9917,166.3584 L 517.73291,166.3584 L 517.73291,170.14648 z M 519.46143,172.51465 C 519.48194,172.7832 519.70459,172.99121 519.97413,172.99219 C 519.97511,172.99219 519.97511,172.99219 519.97608,172.99219 C 520.24463,172.99219 520.46827,172.78565 520.49073,172.51807 C 520.49073,172.51807 520.74171,169.47315 520.99757,166.3584 L 518.99562,166.3584 C 519.22803,169.43555 519.46143,172.51465 519.46143,172.51465 z " />
+
+ </g>
+ </g>
+</svg>
36 ex-basics/ex-for.tex
@@ -0,0 +1,36 @@
+\begin{Exercise}[title={For-loop},difficulty=1]
+\label{ex:for-loop}
+\Question \label{ex:for-loop q1} Create a simple loop with the \key{for} contruct. Make it loop
+10 times and print out the loop counter with the \package{fmt} package.
+
+\Question \label{ex:for-loop q2} Put the body of the loop in a seperate function.
+
+\Question \label{ex:for-loop q3} Rewrite the loop from 1. to use \key{goto}. The
+keyword \key{for} may not be used.
+\end{Exercise}
+
+\begin{Answer}
+
+\Question There is a multitude of possible programs,
+one the solutions could be:
+\lstinputlisting[label=for,caption=Simple for-loop]{ex-basics/src/for.go}
+Lets compile this on an Intel 386 Linux machine and look at the
+output.
+\begin{alltt}
+% 8g for.go && 8l -o for for.8
+% ./for
+0
+1
+.
+.
+.
+9
+\end{alltt}
+
+\Question Next we put the body of the
+loop - the \key{fmt.Printf} - in a separate function.
+\lstinputlisting[label=for-func,caption=Loop calls function]{ex-basics/src/for-func.go}
+The presented program should be self explanatory, note however the
+"\lstinline{j int}" instead of the more "normal" "\lstinline{int j}".
+
+\end{Answer}
43 ex-basics/ex-strings.tex
@@ -0,0 +1,43 @@
+\begin{Exercise}[title={Strings},difficulty=1]
+\label{ex:strings}
+\Question \label{ex:strings q1} Create a Go program that prints
+the following (up to 100 characters):
+\begin{alltt}
+A
+AA
+AAA
+AAAA
+AAAAA
+AAAAAA
+AAAAAAA
+\ldots
+\end{alltt}
+
+
+\Question \label{ex:strings q2} Create a program that counts
+the numbers of characters/runes in this string:
+\begin{alltt}
+asSASA ddd dsjkdsjs dk
+\end{alltt}
+Make it also output the number of bytes in that string.
+
+\Question \label{ex:string q3} Extend the program from
+the previous question to replace the three runes at
+position 4 with 'abc'.
+
+\end{Exercise}
+
+\begin{Answer}
+
+\Question The following program is an answer to the first question.
+\lstinputlisting[label=string1,caption=Strings]{ex-basics/src/string1.go}
+
+\Question To answer this question we need some help of
+the \package{string}-package. First we check the documentation
+with \prog{godoc strings | less}. When we read the documentation
+we notice two functions: \lstinline{func Bytes(s string) []byte} and
+\lstinline{func Runes(s string) []int}. Both return values are
+almost what we need, namely (\type{slices}) So we return the length of
+them. Putting this together leads to the following program.
+\lstinputlisting[label=string2,caption=Runes in strings]{ex-basics/src/string2.go}
+\end{Answer}
13 ex-basics/src/for-func.go
@@ -0,0 +1,13 @@
+package main
+
+import "fmt"
+
+func main() {
+ for i := 0; i < 10; i++ {
+ show(i)
+ }
+}
+
+func show(j int) {
+ fmt.Printf("%d\n", j)
+}
9 ex-basics/src/for.go
@@ -0,0 +1,9 @@
+package main
+
+import "fmt"
+
+func main() {
+ for i := 0; i < 10; i++ {
+ fmt.Printf("%d\n", i)
+ }
+}
11 ex-basics/src/string1.go
@@ -0,0 +1,11 @@
+package main
+
+import "fmt"
+
+func main() {
+ str := "A"
+ for i := 0; i < 100; i++ {
+ fmt.Printf("%s\n", str)
+ str = str + "A"
+ }
+}
12 ex-basics/src/string2.go
@@ -0,0 +1,12 @@
+package main
+
+import (
+ "fmt"
+ "strings"
+)
+
+func main() {
+ str := "dsjkdshdjsdh‥js"
+ fmt.Printf("String %s\nLenght: %v, Runes: %d\n", str,
+ len(strings.Bytes(str)), len(strings.Runes(str)))
+}
41 ex-channels/ex-for-channels.tex
@@ -0,0 +1,41 @@
+\begin{Exercise}[title={Channels},difficulty=4]
+\label{ex:channels}
+\Question\label{ex:channels q1} Modify the program you created in
+exercise Q\ref{ex:for-loop}
+to use channels, in other words, the function called in the body
+should now be a goroutine and communication should happen via
+channels. You should not worry yourself on how the goroutine
+terminates.
+
+\Question\label{ex:channels q2} There are a few annoying issues left if
+you resolve question \ref{ex:channels q1}. One of the problems is
+that the goroutine isn't neatly cleaned up when \func{main.main()}
+exits. And worse, due to a race condition between the exit of
+\func{main.main()} and \func{main.shower()} not all numbers are printed.
+It should print up until 9, but sometimes it prints only to 8. Adding
+a second quit-channel you can remedy both issues. Do this.\footnote{You
+will need the \func{select} statement.}
+
+\end{Exercise}
+
+\begin{Answer}
+\Question A possible program is:
+\lstinputlisting[label=go-chan,caption=Channels in Go]{ex-channels/src/for-chan.go}
+We start of in the usual way, then at line 6 we create a new channel of
+\key{int}s. In the next line we fire off the function \func{shower} with
+the \prog{ch} variable as it argument, so that we may communicate with
+it. Next we start our for-loop (lines 8-10) and in the loop
+we send (with \lstinline{<-}) our number to the function (now a goroutine) \func{shower}.
+
+In the function \func{shower} we wait (as this blocks) until we receive a number (line
+15). Any received number is printed (line 16) and then continue the endless loop
+started on line 14.
+
+\Question The answer is
+\lstinputlisting[label=go-quit-chan,caption=Adding extra quit channel]{ex-channels/src/for-quit-chan.go}
+On line 20 we read from the quit channel and we discard the value we
+read. We could have used \lstinline{q := <-quit}, but then we would have used
+the variabele only once - which is illegal in Go. Another trick you
+might have pulled out of your hat may be: \lstinline{\_ = <-quit}. This is
+valid in Go, but the Go idiom favors the one given on line 20.
+\end{Answer}
18 ex-channels/src/for-chan.go
@@ -0,0 +1,18 @@
+package main
+
+import "fmt"
+
+func main() {
+ ch := make(chan int)
+ go shower(ch)
+ for i := 0; i < 10; i++ {
+ ch <- i
+ }
+}
+
+func shower(c chan int) {
+ for {
+ j := <-c
+ fmt.Printf("%d\n", j)
+ }
+}
24 ex-channels/src/for-quit-chan.go
@@ -0,0 +1,24 @@
+package main
+
+import "fmt"
+
+func main() {
+ ch := make(chan int)
+ quit := make(chan bool)
+ go shower(ch, quit)
+ for i := 0; i < 10; i++ {
+ ch <- i
+ }
+ quit <- false // or true, does not matter
+}
+
+func shower(c chan int, quit chan bool) {
+ for {
+ select {
+ case j := <-c:
+ fmt.Printf("%d\n", j)
+ case <-quit:
+ break
+ }
+ }
+}
17 ex-fib.tex
@@ -0,0 +1,17 @@
+\begin{Exercise}[title={Fibonaci},difficulty=5]
+\label{ex:fibonaci}
+The Fibonaci sequence starts as follows: $1, 1, 2, 3, 5, 8, 13, \ldots$
+Or in mathematical terms: $ x_1 = 1; x_2 = 1; x_n = x_{n-1} +
+x_{n-2}\quad\forall n > 2 $.
+
+\Question\label{ex:fibonaci q1}Write a function that takes an \type{int} value and gives to
+Fibonaci sequence up to that value.
+
+\end{Exercise}
+
+\begin{Answer}
+\Question
+\lstinputlisting[label=src:fib,caption=A Fibonaci function in \go]{src/fib.go}
+\end{Answer}
+
+
0  ex-intro/.gitempty
No changes.
26 ex-map.tex
@@ -0,0 +1,26 @@
+\begin{Exercise}[title={Map function},difficulty=4]
+\label{ex:map function}
+A \func{map()}-function is a function that takes
+a function and a list. The function is applied to
+each member in the list and a new list containing
+these calculated values is returned.
+Thus:
+$$ map(f(), (a_1,a_2,\ldots,a_{n-1},a_n)) = (f(a_1), f(a_2),\ldots,f(a_{n-1}), f(a_n)) $$
+\Question \label{ex:map function q1} Write a simple
+\func{map()}-function in Go. It is sufficient
+for this function only to work for \type{int}s.
+\Question \label{ex:map function q2} Expand your code to also work on a list of \type{strings}.
+\Question \label{ex:map funtion q3} Now make it generic using interfaces.
+
+\end{Exercise}
+
+\begin{Answer}
+
+\Question
+
+\lstinputlisting[label=src:map,caption=A map function in Go]{src/map.go}
+\Question Answer to question
+\Question Answer to question
+\end{Answer}
+
+
10 fig/Makefile
@@ -0,0 +1,10 @@
+pdfs := $(patsubst %.svg,%.pdf,$(wildcard *.svg))
+
+%.pdf: %.svg
+ inkscape --export-pdf=$@ $<
+ pdfcrop $@ output.pdf && mv output.pdf $@
+
+all: ${pdfs}
+
+clean:
+ rm -f *.pdf
BIN  fig/array-vs-slice.pdf
Binary file not shown
601 fig/array-vs-slice.svg
@@ -0,0 +1,601 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ width="744.09448819"
+ height="1052.3622047"
+ id="svg2"
+ version="1.1"
+ inkscape:version="0.47pre4 r22446"
+ sodipodi:docname="array-vs-slice.svg">
+ <defs
+ id="defs4">
+ <marker
+ inkscape:stockid="Arrow2Send"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow2Send"
+ style="overflow:visible;">
+ <path
+ id="path3716"
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ transform="scale(0.3) rotate(180) translate(-2.3,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow2Lend"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow2Lend"
+ style="overflow:visible;">
+ <path
+ id="path3704"
+ style="font-size:12.0;fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+ d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+ transform="scale(1.1) rotate(180) translate(1,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Mend"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Mend"
+ style="overflow:visible;">
+ <path
+ id="path3713"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ transform="scale(0.4) rotate(180) translate(10,0)" />
+ </marker>
+ <marker
+ inkscape:stockid="Arrow1Lend"
+ orient="auto"
+ refY="0.0"
+ refX="0.0"
+ id="Arrow1Lend"
+ style="overflow:visible;">
+ <path
+ id="path3707"
+ d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1.0pt;marker-start:none;"
+ transform="scale(0.8) rotate(180) translate(12.5,0)" />
+ </marker>
+ <inkscape:perspective
+ sodipodi:type="inkscape:persp3d"
+ inkscape:vp_x="0 : 526.18109 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_z="744.09448 : 526.18109 : 1"
+ inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+ id="perspective10" />
+ <inkscape:perspective
+ id="perspective3618"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3618-0"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3618-3"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective3673"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5277"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5353"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <inkscape:perspective
+ id="perspective5846"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ inkscape:stockid="Arrow1Mend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Mend-2"
+ style="overflow:visible">
+ <path
+ id="path3713-9"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+ transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+ </marker>
+ <inkscape:perspective
+ id="perspective5846-6"
+ inkscape:persp3d-origin="0.5 : 0.33333333 : 1"
+ inkscape:vp_z="1 : 0.5 : 1"
+ inkscape:vp_y="0 : 1000 : 0"
+ inkscape:vp_x="0 : 0.5 : 1"
+ sodipodi:type="inkscape:persp3d" />
+ <marker
+ inkscape:stockid="Arrow1Mend"
+ orient="auto"
+ refY="0"
+ refX="0"
+ id="Arrow1Mend-1"
+ style="overflow:visible">
+ <path
+ id="path3713-1"
+ d="M 0,0 5,-5 -12.5,0 5,5 0,0 z"
+ style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;marker-start:none"
+ transform="matrix(-0.4,0,0,-0.4,-4,0)" />
+ </marker>
+ </defs>
+ <sodipodi:namedview
+ id="base"
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1.0"
+ inkscape:pageopacity="0.0"
+ inkscape:pageshadow="2"
+ inkscape:zoom="2.8"
+ inkscape:cx="323.79373"
+ inkscape:cy="905.9967"
+ inkscape:document-units="px"
+ inkscape:current-layer="layer1"
+ showgrid="true"
+ inkscape:snap-global="true"
+ inkscape:window-width="1366"
+ inkscape:window-height="736"
+ inkscape:window-x="0"
+ inkscape:window-y="29"
+ inkscape:window-maximized="1">
+ <inkscape:grid
+ type="xygrid"
+ id="grid2884" />
+ </sodipodi:namedview>
+ <metadata
+ id="metadata7">
+ <rdf:RDF>
+ <cc:Work
+ rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+ <dc:title />
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <rect
+ style="fill:none"
+ id="rect2818"
+ width="22.857143"
+ height="28.571428"
+ x="55.714287"
+ y="140.93361" />
+ <rect
+ style="fill:none"
+ id="rect2820"
+ width="48.57143"
+ height="40"
+ x="125.71429"
+ y="158.07646" />
+ <rect
+ style="fill:none"
+ id="rect2822"
+ width="58.57143"
+ height="40"
+ x="88.571426"
+ y="106.6479"
+ ry="11.428572" />
+ <rect
+ style="fill:none"
+ id="rect2824"
+ width="31.428572"
+ height="37.142857"
+ x="85.714287"
+ y="103.79076"
+ ry="11.428572" />
+ <rect
+ style="fill:none"
+ id="rect2826"
+ width="38.57143"
+ height="31.428574"
+ x="68.571426"
+ y="42.362183"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604"
+ width="40"
+ height="35.714287"
+ x="51.42857"
+ y="30.933611"
+ ry="0" />
+ <rect
+ style="fill:none"
+ id="rect2826-8"
+ width="38.57143"
+ height="31.428574"
+ x="120.96429"
+ y="76.897903"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-5"
+ width="40"
+ height="35.714287"
+ x="91.5"
+ y="31.035675"
+ ry="0" />
+ <rect
+ style="fill:none"
+ id="rect2826-9"
+ width="38.57143"
+ height="31.428574"
+ x="91.428566"
+ y="172.36215"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-6"
+ width="40"
+ height="35.714287"
+ x="171.42857"
+ y="30.933578"
+ ry="0" />
+ <rect
+ style="fill:none"
+ id="rect2826-85"
+ width="38.57143"
+ height="31.428574"
+ x="192.39288"
+ y="74.040756"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-61"
+ width="40"
+ height="35.714287"
+ x="131.88777"
+ y="31.005047"
+ ry="0" />
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="227.14285"
+ y="121.6479"
+ id="text3657"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3659"
+ x="227.14285"
+ y="121.6479" /></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="225"
+ y="47.362183"
+ id="text3661"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3663"
+ x="225"
+ y="47.362183">. . .</tspan></text>
+ <rect
+ style="fill:none"
+ id="rect2826-84"
+ width="38.57143"
+ height="31.428574"
+ x="274.28574"
+ y="42.61219"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-8"
+ width="40"
+ height="35.714287"
+ x="257.14285"
+ y="31.183619"
+ ry="0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-5-1"
+ width="40"
+ height="35.714287"
+ x="297.21429"
+ y="31.285685"
+ ry="0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-6-0"
+ width="40"
+ height="35.714287"
+ x="377.14285"
+ y="31.183588"
+ ry="0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-61-3"
+ width="40"
+ height="35.714287"
+ x="337.60205"
+ y="31.25506"
+ ry="0" />
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="380"
+ y="112.36218"
+ id="text5075"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5077"
+ x="380"
+ y="112.36218">len = cap</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="445"
+ y="52.362183"
+ id="text5265"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5267"
+ x="445"
+ y="52.362183">array</tspan></text>
+ <rect
+ style="fill:none"
+ id="rect2826-3"
+ width="38.57143"
+ height="31.428574"
+ x="72.623947"
+ y="163.00095"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-1"
+ width="40"
+ height="35.714287"
+ x="55.481091"
+ y="151.57239"
+ ry="0" />
+ <rect
+ style="fill:none"
+ id="rect2826-8-7"
+ width="38.57143"
+ height="31.428574"
+ x="125.01682"
+ y="197.53667"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-5-5"
+ width="40"
+ height="35.714287"
+ x="95.552521"
+ y="151.67444"
+ ry="0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-6-9"
+ width="40"
+ height="35.714287"
+ x="175.48109"
+ y="151.57234"
+ ry="0" />
+ <rect
+ style="fill:none"
+ id="rect2826-85-6"
+ width="38.57143"
+ height="31.428574"
+ x="196.4454"
+ y="194.67952"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-61-2"
+ width="40"
+ height="35.714287"
+ x="135.94029"
+ y="151.64381"
+ ry="0" />
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="227.62395"
+ y="169.42952"
+ id="text3661-1"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3663-7"
+ x="227.62395"
+ y="169.42952">. . .</tspan></text>
+ <rect
+ style="fill:none"
+ id="rect2826-84-8"
+ width="38.57143"
+ height="31.428574"
+ x="278.33826"
+ y="163.25096"
+ ry="11.428572" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-8-5"
+ width="40"
+ height="35.714287"
+ x="261.19537"
+ y="151.82239"
+ ry="0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-5-1-7"
+ width="40"
+ height="35.714287"
+ x="301.26682"
+ y="151.92445"
+ ry="0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-6-0-4"
+ width="40"
+ height="35.714287"
+ x="381.19537"
+ y="151.82236"
+ ry="0" />
+ <rect
+ style="fill:none;stroke:#000000;stroke-opacity:1"
+ id="rect3604-61-3-1"
+ width="40"
+ height="35.714287"
+ x="341.6546"
+ y="151.89383"
+ ry="0" />
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="410"
+ y="232.36218"
+ id="text5075-5"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5077-9"
+ x="410"
+ y="232.36218">cap</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="450"
+ y="172.36218"
+ id="text5265-7"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5267-5"
+ x="450"
+ y="172.36218">slice</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="205"
+ y="232.36218"
+ id="text5075-5-6"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5077-9-4"
+ x="205"
+ y="232.36218">len </tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="65"
+ y="52.362183"
+ id="text5373"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5375"
+ x="65"
+ y="52.362183">0</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="70"
+ y="172.36218"
+ id="text5377"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5379"
+ x="70"
+ y="172.36218">0</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="185"
+ y="52.362183"
+ id="text5381"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5383"
+ x="185"
+ y="52.362183">n</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="190"
+ y="172.36218"
+ id="text5385"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5387"
+ x="190"
+ y="172.36218">n</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="390"
+ y="52.362183"
+ id="text5389"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5391"
+ x="390"
+ y="52.362183">m</tspan></text>
+ <text
+ xml:space="preserve"
+ style="font-size:16px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;fill:#000000;fill-opacity:1;stroke:none;font-family:Droid Serif;-inkscape-font-specification:Droid Serif"
+ x="395"
+ y="172.36218"
+ id="text5393"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan5395"
+ x="395"
+ y="172.36218">m</tspan></text>
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:none;marker-end:url(#Arrow1Mend)"
+ d="m 415,97.362183 c 0,-20 0,-25 0,-25"
+ id="path2894"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:none;marker-end:url(#Arrow1Mend)"
+ d="m 215,217.36218 c 0,-20 0,-25 0,-25"
+ id="path2894-3"
+ sodipodi:nodetypes="cc" />
+ <path
+ style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-start:none;marker-end:url(#Arrow1Mend)"
+ d="m 420,217.36218 c 0,-20 0,-25 0,-25"
+ id="path2894-5"
+ sodipodi:nodetypes="cc" />
+ </g>
+</svg>
BIN  fig/bumper-inverse.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  fig/bumper.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
BIN  fig/drawing.pdf
Binary file not shown
167 go-allocation.tex
@@ -0,0 +1,167 @@
+\epi{\lstinline{fmt.Printf("\%p", i)}}{Printing the address of a pointer in Go.}
+\noindent
+You may have wished otherwise, but Go has pointers.
+There is however now pointer arithmetic and they are still useful.
+Remember Go when you call a function in Go the variables you pass are
+pass-by-value. So, for efficiency and the possibility to modify a
+passed value \emph{in} the function we have pointers.
+
+%% Do we need a whole chapter on Pointers in Go
+Just like in C you declare a pointer by prefixing the type with an `*`,
+so:
+
+are declared after variable names, and all type modifiers precede the
+\draft{}%
+types. So *X is a pointer to an X; [3]X is an array of three X's. The
+types are therefore really easy to read just read out the names of the
+type modifiers: [] declares something called an array slice; "*"
+declares a pointer; [size] declares an array. So []*[3]*int is an array
+slice of pointers to arrays of three pointers to ints
+
+\noindent\lstinline{var pint *int // declare pint to be pointer to int}
+
+\section{Allocation}
+Go has garbage collection, meaning that you don't have to worry about
+memory allocation and deallocation. Of course almost every language
+since 1980 has this, but it is nice to see garbage collection in a
+C-like language. The following sections show how to handle allocation
+in Go. There is somewhat an artifical distinction between
+\first{\func{new()}} and \first{\func{make()}}. Details follow.
+
+\section{Allocation with \func{new()}}
+Go has two allocation primitives, \func{new()} and \func{make()}. They do different
+things and apply to different types, which can be confusing, but the
+rules are simple. Let's talk about \func{new()} first. It's a built-in function
+essentially the same as its namesakes in other languages: \func{new(T)}
+allocates zeroed storage for a new item of type \type{T} and returns its
+address, a value of type \type{*T}. In Go terminology, it returns a pointer to
+a newly allocated zero value of type \type{T}.
+
+Since the memory returned by \func{new()} is zeroed, it's helpful to arrange
+that the zeroed object can be used without further initialization. This
+means a user of the data structure can create one with \func{new()} and get
+right to work. For example, the documentation for \type{bytes.Buffer} states
+that "the zero value for Buffer is an empty buffer ready to use."
+Similarly, \func{sync.Mutex} does not have an explicit constructor or Init
+method. Instead, the zero value for a \func{sync.Mutex} is defined to be an
+unlocked mutex.
+
+The zero-value-is-useful property works transitively. Consider this type
+declaration.
+
+\begin{lstlisting}
+type SyncedBuffer struct {
+ lock sync.Mutex
+ buffer bytes.Buffer
+}
+\end{lstlisting}
+Values of type \type{SyncedBuffer} are also ready to use immediately upon
+allocation or just declaration. In this snippet, both \var{p} and
+\var{v} will work
+correctly without further arrangement.
+\begin{lstlisting}
+p := new(SyncedBuffer) // type *SyncedBuffer
+var v SyncedBuffer // type SyncedBuffer
+\end{lstlisting}
+
+\section{Constructors and composite literals}
+Sometimes the zero value isn't good enough and an initializing
+constructor is necessary, as in this example derived from package
+\package{os}.
+\begin{lstlisting}
+func NewFile(fd int, name string) *File {
+ if fd < 0 {
+ return nil
+ }
+ f := new(File)
+ f.fd = fd
+ f.name = name
+ f.dirinfo = nil
+ f.nepipe = 0
+ return f
+}
+\end{lstlisting}
+There's a lot of boiler plate in there. We can simplify it using a
+composite literal, which is an expression that creates a new instance
+each time it is evaluated.
+
+\begin{lstlisting}
+func NewFile(fd int, name string) *File {
+ if fd < 0 {
+ return nil
+ }
+ f := File{fd, name, nil, 0}
+ return &f
+}
+\end{lstlisting}
+Note that it's perfectly OK to return the address of a local variable;
+the storage associated with the variable survives after the function
+returns. In fact, taking the address of a composite literal allocates a
+fresh instance each time it is evaluated, so we can combine these last
+two lines.
+
+\begin{lstlisting}
+return &File{fd, name, nil, 0}
+\end{lstlisting}
+The fields of a composite literal are laid out in order and must all be
+present. However, by labeling the elements explicitly as field:value
+pbairs, the initializers can appear in any order, with the missing ones
+left as their respective zero values. Thus we could say
+
+\begin{lstlisting}
+return &File{fd: fd, name: name}
+\end{lstlisting}
+As a limiting case, if a composite literal contains no fields at all, it
+creates a zero value for the type. The expressions
+\lstinline{new(File)} and
+\lstinline|&File{]| are equivalent.
+
+Composite literals can also be created for arrays, slices, and maps,
+with the field labels being indices or map keys as appropriate. In these
+examples, the initializations work regardless of the values of Enone,
+Eio, and Einval, as long as they are distinct.
+\begin{lstlisting}
+a := [...]string {Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
+s := []string {Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
+m := map[int]string{Enone: "no error", Eio: "Eio", Einval: "invalid argument"}
+\end{lstlisting}
+
+\section{Allocation with \func{make()}}
+Back to allocation. The built-in function \func{make(T, args)} serves a purpose
+different from \func{new(T)}. It creates slices, maps, and channels only, and