Commit 4ee2051c authored by François Févotte's avatar François Févotte

Ex 03-3: résumé + correction taux d'accroissement

- passage à Plotly pour les figures
- correction du style
parent 7893ffdc
*~
\ No newline at end of file
Exercice.so
exercice.jl
\ No newline at end of file
......@@ -112,9 +112,9 @@ version = "2.0.0"
[[DataStructures]]
deps = ["InteractiveUtils", "OrderedCollections"]
git-tree-sha1 = "73eb18320fe3ba58790c8b8f6f89420f0a622773"
git-tree-sha1 = "4dead20a1606a60292529023d6eac18a1ef6432e"
uuid = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
version = "0.17.11"
version = "0.17.12"
[[DataValueInterfaces]]
git-tree-sha1 = "bfc1187b79289637fa0ef6d4436ebdfe6905cbd6"
......@@ -170,9 +170,9 @@ uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
version = "0.24.7"
[[ElasticArrays]]
git-tree-sha1 = "5b5b7cb8cba44bcf337b8af0a1f3e57c89468660"
git-tree-sha1 = "6643de157ea3332d73e35a6a6ed2bdffe7792b12"
uuid = "fdbdab4c-e67f-52f5-8c3f-e7b388dad3d4"
version = "1.0.0"
version = "1.1.0"
[[ElasticPDMats]]
deps = ["LinearAlgebra", "MacroTools", "PDMats", "Test"]
......
#!/bin/bash
#=
exec julia --color=yes --startup-file=no "${BASH_SOURCE[0]}" "$@"
=#
using Pkg
Pkg.activate(@__DIR__)
Pkg.instantiate()
using PackageCompiler
@time create_sysimage(Symbol.(keys(Pkg.project().dependencies));
sysimage_path=Pkg.project().name * ".so",
precompile_execution_file=joinpath(@__DIR__, "make.jl"))
# Local Variables:
# mode: julia
# End:
This diff is collapsed.
This diff is collapsed.
<!DOCTYPE html>
<HTML lang = "en">
<HEAD>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">
{{#:title}}<title>{{:title}}</title>{{/:title}}
{{{ :header_script }}}
<script src="plotly-latest.min.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]},
TeX: { equationNumbers: { autoNumber: "AMS" } }
});
</script>
<script type="text/javascript" async src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
{{{ :highlightcss }}}
<style type="text/css">
{{{ :themecss }}}
</style>
</HEAD>
<BODY>
<div class ="container">
<div class = "row">
<div class = "col-md-12 twelve columns">
<div class="title">
{{#:title}}<h1 class="title">{{:title}}</h1>{{/:title}}
{{#:author}}<h5>{{{:author}}}</h5>{{/:author}}
{{#:date}}<h5>{{{:date}}}</h5>{{/:date}}
</div>
{{{ :body }}}
<HR/>
<div class="footer"><p>
Published from <a href="{{{:source}}}">{{{:source}}}</a> using
<a href="http://github.com/mpastell/Weave.jl">Weave.jl</a>
{{:wversion}} on {{:wtime}}.
<p></div>
</div>
</div>
</div>
</BODY>
</HTML>
using Pkg
Pkg.activate(@__DIR__)
#!/bin/bash
#=
OPTS="--color=yes --startup-file=no"
[ -f Exercice.so ] && OPTS="$OPTS -J Exercice.so"
import Weave
Weave.tangle(joinpath(@__DIR__, "exercice.jmd"))
exec julia ${OPTS} "${BASH_SOURCE[0]}" "$@"
=#
using PackageCompiler
create_sysimage(Symbol.(keys(Pkg.project().dependencies));
sysimage_path=Pkg.project().name * ".so",
precompile_execution_file=joinpath(@__DIR__, "exercice.jl"))
using Weave
let srcfile = joinpath(@__DIR__, "exercice.jmd")
tangle(srcfile)
Weave.weave() = @time weave(srcfile)
weave()
end
# Local Variables:
# mode: julia
# End:
This diff is collapsed.
# Permet de construire des durées avec une syntaxe comme :
# 7Days
const Years = Year(1)
const Days = Day(1)
# Affichage des DataFrames dans la sortie HTML
function info(df::DataFrame)
try
WEAVE_ARGS
catch
display(df)
return
end
pretty(x) = x
pretty(x::Float64) = @sprintf "%.6f" x
pretty(::Type{Union{T,Missing}}) where {T} = "$T?"
function printrow(i)
......@@ -55,7 +68,25 @@ function info(df::DataFrame)
end
# Permet de construire des durées avec une syntaxe comme :
# 7Days
const Years = Year(1)
const Days = Day(1)
# Meilleure intégration entre Plotly et Weave
function disp()
try
WEAVE_ARGS
catch
display(plot!())
return
end
buf = IOBuffer()
show(buf, MIME("text/html"), plot!())
seekstart(buf)
str = String(read(buf))
m = match(r"<body>(.*)</body>"s, str)
return if m === nothing
str
else
m.captures[1]
end |> print
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment