Packages

List of official / currated packages: http://pkg.julialang.org


In [2]:
Pkg.status()


1 required packages:
 - Requests                      0.5.1
11 additional packages:
 - BinDeps                       0.6.0
 - BufferedStreams               0.3.3
 - Codecs                        0.3.0
 - Compat                        0.31.0
 - HttpCommon                    0.2.7
 - HttpParser                    0.3.0
 - JSON                          0.13.0
 - Libz                          0.2.4
 - MbedTLS                       0.5.0
 - SHA                           0.5.1
 - URIParser                     0.2.0

In [13]:
Pkg.update()


INFO: Updating METADATA...
INFO: Computing changes...
INFO: No packages to install, update or remove

Package Installation


In [1]:
Pkg.add("SpecialFunctions")


INFO: Package SpecialFunctions is already installed
INFO: METADATA is out-of-date — you may not have the latest version of SpecialFunctions
INFO: Use `Pkg.update()` to get the latest versions of your packages

In [2]:
using SpecialFunctions

In [20]:
airyai(8)


Out[20]:
4.692207616099232e-8

Installation of non-"official" packages


In [11]:
Pkg.clone("https://github.com/scheinerman/LatexPrint.jl")


INFO: Cloning LatexPrint from https://github.com/scheinerman/LatexPrint.jl
INFO: Computing changes...
INFO: No packages to install, update or remove

In [5]:
using LatexPrint


INFO: Precompiling module DataFrames.

In [6]:
lap(5//3)


WARNING: num is deprecated, use numerator instead.
Stacktrace:
 [1] depwarn(::String, ::Symbol) at ./deprecated.jl:70
 [2] num(::Rational{Int64}, ::Vararg{Rational{Int64},N} where N) at ./deprecated.jl:31
 [3] latex_form(::Rational{Int64}) at /home/juser/.julia/v0.6/LatexPrint/src/LatexPrint.jl:141
 [4] laprintln at /home/juser/.julia/v0.6/LatexPrint/src/LatexPrint.jl:258 [inlined]
 [5] lap(::Rational{Int64}) at /home/juser/.julia/v0.6/LatexPrint/src/LatexPrint.jl:265
 [6] include_string(::String, ::String) at ./loading.jl:515
 [7] execute_request(::ZMQ.Socket, ::IJulia.Msg) at /opt/julia_packages/.julia/v0.6/IJulia/src/execute_request.jl:160
 [8] eventloop(::ZMQ.Socket) at /opt/julia_packages/.julia/v0.6/IJulia/src/eventloop.jl:8
 [9] (::IJulia.##11#14)() at ./task.jl:335
while loading In[6], in expression starting on line 1
\frac{5}{3}

Further Capabilities

  • use specific branch of a package
  • pin package to prevent updates
  • create scaffold for your own package
  • publish your own package

Exercises

Task 1

Install the package "SpecialFunction" and evaluate the zeta function at -1.

Task 2

Install the package "LatexPrint" and use it to convert the Matrix $$ A = \begin{pmatrix} \frac{2}{5} & \frac{1}{3} & \frac{2}{7} \\ \frac{3}{5} & \frac{1}{2} & \frac{3}{7} \\ \frac{4}{5} & \frac{2}{3} & \frac{4}{7} \\ \end{pmatrix} $$ into latex code.