Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
U
uva
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
uva
Commits
01dfe8cf
Commit
01dfe8cf
authored
Mar 10, 2011
by
Taddeüs Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Telematica ass2: finished report.
parent
e583dcd7
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
122 additions
and
1 deletion
+122
-1
telematica/ass2/.gitignore
telematica/ass2/.gitignore
+1
-0
telematica/ass2/Makefile
telematica/ass2/Makefile
+21
-0
telematica/ass2/colors.tex
telematica/ass2/colors.tex
+92
-0
telematica/ass2/report.tex
telematica/ass2/report.tex
+8
-1
No files found.
telematica/ass2/.gitignore
0 → 100644
View file @
01dfe8cf
translate.tex
telematica/ass2/Makefile
0 → 100644
View file @
01dfe8cf
# Sander van Veen - 6167969 - University of Amsterdam - <sandervv@gmail.com>
#
# Basic Makefile used to simplify the compilation. Running "make" (without any
# arguments) from the command line will build the report for this assignment.
#
all
:
highlight compile
clean
:
rm
-vf
*
.out
*
.aux
*
.toc translate.tex report.pdf
compile
:
pdflatex report
pdflatex report
rm
-vf
*
.log
highlight
:
translate.tex
translate.tex
:
translate
pygmentize
-O
style
=
colorful
-l
php
-o
$@
$^
telematica/ass2/colors.tex
0 → 100644
View file @
01dfe8cf
% Template coming from Pygments (pygmentize with "-O full,preamble")
\usepackage
{
fancyvrb
}
\usepackage
{
color
}
\makeatletter
\def\PY
@reset
{
\let\PY
@it=
\relax
\let\PY
@bf=
\relax
%
\let\PY
@ul=
\relax
\let\PY
@tc=
\relax
%
\let\PY
@bc=
\relax
\let\PY
@ff=
\relax
}
\def\PY
@tok#1
{
\csname
PY@tok@#1
\endcsname
}
\def\PY
@toks#1+
{
\ifx\relax
#1
\empty\else
%
\PY
@tok
{
#1
}
\expandafter\PY
@toks
\fi
}
\def\PY
@do#1
{
\PY
@bc
{
\PY
@tc
{
\PY
@ul
{
%
\PY
@it
{
\PY
@bf
{
\PY
@ff
{
#1
}}}}}}}
\def\PY
#1#2
{
\PY
@reset
\PY
@toks#1+
\relax
+
\PY
@do
{
#2
}}
\def\PY
@tok@gd
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.63,0.00,0.00
}{
##1
}}}
\def\PY
@tok@gu
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.50,0.00,0.50
}{
##1
}}}
\def\PY
@tok@gt
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.25,0.82
}{
##1
}}}
\def\PY
@tok@gs
{
\let\PY
@bf=
\textbf
}
\def\PY
@tok@gr
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
1.00,0.00,0.00
}{
##1
}}}
\def\PY
@tok@cm
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.50,0.50,0.50
}{
##1
}}}
\def\PY
@tok@vg
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.82,0.44,0.00
}{
##1
}}}
\def\PY
@tok@m
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.38,0.00,0.88
}{
##1
}}}
\def\PY
@tok@mh
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.31,0.50
}{
##1
}}}
\def\PY
@tok@cs
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.80,0.00,0.00
}{
##1
}}}
\def\PY
@tok@ge
{
\let\PY
@it=
\textit
}
\def\PY
@tok@vc
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.19,0.38,0.56
}{
##1
}}}
\def\PY
@tok@il
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.00,0.82
}{
##1
}}}
\def\PY
@tok@go
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.50,0.50,0.50
}{
##1
}}}
\def\PY
@tok@cp
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.31,0.44,0.56
}{
##1
}}}
\def\PY
@tok@gi
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.63,0.00
}{
##1
}}}
\def\PY
@tok@gh
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.00,0.50
}{
##1
}}}
\def\PY
@tok@ni
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.50,0.00,0.00
}{
##1
}}}
\def\PY
@tok@nl
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.56,0.44,0.00
}{
##1
}}}
\def\PY
@tok@nn
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.05,0.52,0.71
}{
##1
}}}
\def\PY
@tok@no
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.19,0.38
}{
##1
}}}
\def\PY
@tok@na
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.00,0.75
}{
##1
}}}
\def\PY
@tok@nb
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.44,0.13
}{
##1
}}}
\def\PY
@tok@nc
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.69,0.00,0.38
}{
##1
}}}
\def\PY
@tok@nd
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.31,0.31,0.31
}{
##1
}}}
\def\PY
@tok@ne
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.94,0.00,0.00
}{
##1
}}}
\def\PY
@tok@nf
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.38,0.69
}{
##1
}}}
\def\PY
@tok@si
{
\def\PY
@bc##1
{
\colorbox
[rgb]
{
0.88,0.88,0.88
}{
##1
}}}
\def\PY
@tok@s2
{
\def\PY
@bc##1
{
\colorbox
[rgb]
{
1.00,0.94,0.94
}{
##1
}}}
\def\PY
@tok@vi
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.19,0.19,0.69
}{
##1
}}}
\def\PY
@tok@nt
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.44,0.00
}{
##1
}}}
\def\PY
@tok@nv
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.56,0.38,0.19
}{
##1
}}}
\def\PY
@tok@s1
{
\def\PY
@bc##1
{
\colorbox
[rgb]
{
1.00,0.94,0.94
}{
##1
}}}
\def\PY
@tok@gp
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.78,0.36,0.04
}{
##1
}}}
\def\PY
@tok@sh
{
\def\PY
@bc##1
{
\colorbox
[rgb]
{
1.00,0.94,0.94
}{
##1
}}}
\def\PY
@tok@ow
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.00,0.00
}{
##1
}}}
\def\PY
@tok@sx
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.82,0.13,0.00
}{
##1
}}
\def\PY
@bc##1
{
\colorbox
[rgb]
{
1.00,0.94,0.94
}{
##1
}}}
\def\PY
@tok@bp
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.44,0.13
}{
##1
}}}
\def\PY
@tok@c1
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.50,0.50,0.50
}{
##1
}}}
\def\PY
@tok@kc
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.50,0.00
}{
##1
}}}
\def\PY
@tok@c
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.50,0.50,0.50
}{
##1
}}}
\def\PY
@tok@mf
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.38,0.00,0.88
}{
##1
}}}
\def\PY
@tok@err
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.94,0.00,0.00
}{
##1
}}
\def\PY
@bc##1
{
\colorbox
[rgb]
{
0.94,0.63,0.63
}{
##1
}}}
\def\PY
@tok@kd
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.50,0.00
}{
##1
}}}
\def\PY
@tok@ss
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.63,0.38,0.00
}{
##1
}}}
\def\PY
@tok@sr
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.00,0.00
}{
##1
}}
\def\PY
@bc##1
{
\colorbox
[rgb]
{
1.00,0.94,1.00
}{
##1
}}}
\def\PY
@tok@mo
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.25,0.00,0.88
}{
##1
}}}
\def\PY
@tok@mi
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.00,0.82
}{
##1
}}}
\def\PY
@tok@kn
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.50,0.00
}{
##1
}}}
\def\PY
@tok@o
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.19,0.19,0.19
}{
##1
}}}
\def\PY
@tok@kr
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.50,0.00
}{
##1
}}}
\def\PY
@tok@s
{
\def\PY
@bc##1
{
\colorbox
[rgb]
{
1.00,0.94,0.94
}{
##1
}}}
\def\PY
@tok@kp
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.19,0.50
}{
##1
}}}
\def\PY
@tok@w
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.73,0.73,0.73
}{
##1
}}}
\def\PY
@tok@kt
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.19,0.19,0.56
}{
##1
}}}
\def\PY
@tok@sc
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.25,0.82
}{
##1
}}}
\def\PY
@tok@sb
{
\def\PY
@bc##1
{
\colorbox
[rgb]
{
1.00,0.94,0.94
}{
##1
}}}
\def\PY
@tok@k
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.00,0.50,0.00
}{
##1
}}}
\def\PY
@tok@se
{
\let\PY
@bf=
\textbf\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.38,0.38,0.38
}{
##1
}}
}
% \def\PY@bc##1{\colorbox[rgb]{1.00,0.94,0.94}{##1}}}
\def\PY
@tok@sd
{
\def\PY
@tc##1
{
\textcolor
[rgb]
{
0.82,0.25,0.13
}{
##1
}}}
\def\PYZbs
{
\char
`
\\
}
\def\PYZus
{
\char
`
\_
}
\def\PYZob
{
\char
`
\{
}
\def\PYZcb
{
\char
`
\}
}
\def\PYZca
{
\char
`
\^
}
% for compatibility with earlier versions
\def\PYZat
{
@
}
\def\PYZlb
{
[
}
\def\PYZrb
{
]
}
\makeatother
telematica/ass2/report.tex
View file @
01dfe8cf
...
...
@@ -80,7 +80,14 @@ front of the function call. We can safely do this because we handle any
failures manually. The two most probable reasons for a ``bad request'' to occur,
are the lack of an internet connection and the invalidness of a specified
source/target language. Since both are critical for the program's ability to
function correctly, we have chosen to end the program after a bad request.
function correctly, we have chosen to end the program after a bad request. If
the request is succesful, we use the built in PHP function
\texttt
{
json
\_
decode
}
to parse the response. The converts the JSON object into an associative array,
form which we can easily extract the translation:
\begin{verbatim}
return
$
response
[
"data"
][
"translations"
][
0
][
"translatedText"
]
;
\end
{
verbatim
}
% }}}
\end
{
document
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment