# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1417

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 1418

---

## [Performance optimisation: Julia vs C++](https://discourse.julialang.org/t/performance-optimisation-julia-vs-c/59689)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 31\
**Last updated:** [April 21, 2021, 2:55pm UTC](https://discourse.julialang.org/t/performance-optimisation-julia-vs-c/59689 "2021-04-21T14:55:24Z")

</div>

Hi all! This is for the performance tweaking addicts out there :smiley: I had a conversation with a “C++ friend” today in which upon request I tried to showcase to him that Julia can be as performant as C++ (say, withi…

---

## [DataFrames unique - keep last occurence](https://discourse.julialang.org/t/dataframes-unique-keep-last-occurence/59723)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 6\
**Last updated:** [April 21, 2021, 2:33pm UTC](https://discourse.julialang.org/t/dataframes-unique-keep-last-occurence/59723 "2021-04-21T14:33:40Z")

</div>

I have the following dataframe, where :a and :b are some conditions and :c is an output: df = DataFrame(a=\[1,1,2,2,1\], b=\[1,2,1,2,1\],c=randn(5)) As you can see, the last row has the same conditions as first row (a=1, …

---

## [OrdinaryDiffEq: unexpected results in DEDataArray](https://discourse.julialang.org/t/ordinarydiffeq-unexpected-results-in-dedataarray/59282)

<div class="topic-metadata">

**Author:** [@AlexS12](https://discourse.julialang.org/u/AlexS12)\
**Replies:** 10\
**Last updated:** [April 21, 2021, 2:29pm UTC](https://discourse.julialang.org/t/ordinarydiffeq-unexpected-results-in-dedataarray/59282 "2021-04-21T14:29:26Z")

</div>

I am trying to solve a ODE using a DEDataVector to pass and store parameters that come from evaluating functions taking the state vector as argument. After reading the documentation I expected to obtain the value of the …

---

## [Type stability with tuples is hard](https://discourse.julialang.org/t/type-stability-with-tuples-is-hard/59094)

<div class="topic-metadata">

**Author:** [@mroavi](https://discourse.julialang.org/u/mroavi)\
**Replies:** 23\
**Last updated:** [April 21, 2021, 1:39pm UTC](https://discourse.julialang.org/t/type-stability-with-tuples-is-hard/59094 "2021-04-21T13:39:51Z")

</div>

I came across this article that talks about loop fusion. I saw this as a great opportunity to optimize my code since a lot of intermediate allocations are happening in my program. After having adapted my code, the perfor…

---

## [Bars in plot do not fully extend to x axis](https://discourse.julialang.org/t/bars-in-plot-do-not-fully-extend-to-x-axis/59735)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 1\
**Last updated:** [April 21, 2021, 1:32pm UTC](https://discourse.julialang.org/t/bars-in-plot-do-not-fully-extend-to-x-axis/59735 "2021-04-21T13:32:53Z")

</div>

I recently received the following warning in Plots: ┌ Warning: Indices Base.OneTo(3) of attribute \`seriescolor\` does not match data indices 1:17. └ @ Plots /home/dfish/.julia/packages/Plots/SVksJ/src/utils.jl:102 ┌ Info…

---

## [\[ANN\] Announcing TerminalPager.jl](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 51\
**Last updated:** [April 21, 2021, 1:31pm UTC](https://discourse.julialang.org/t/ann-announcing-terminalpager-jl/59561 "2021-04-21T13:31:45Z")

</div>

Hi! After developing PrettyTables.jl, I understood how hard is to design cropping mechanism to show large data into the terminal. We did have a “nice” algorithm, but with some caveats. For example, it is not that easy t…

---

## [Unable to animate translating a mesh in Makie](https://discourse.julialang.org/t/unable-to-animate-translating-a-mesh-in-makie/59731)

<div class="topic-metadata">

**Author:** [@mlainz](https://discourse.julialang.org/u/mlainz)\
**Replies:** 4\
**Last updated:** [April 21, 2021, 1:31pm UTC](https://discourse.julialang.org/t/unable-to-animate-translating-a-mesh-in-makie/59731 "2021-04-21T13:31:06Z")

</div>

I want to animate a moving object in Makie For this, I do the following using GLMakie, FileIO x = Node{Float32}(0.0) y = Node{Float32}(0.0) z = Node{Float32}(0.0) data = load("mesh.stl") fig, ax, plt = mesh(data) tra…

---

## [Is it possible to work with eval(:(x=10)) without touching a global/modules scope](https://discourse.julialang.org/t/is-it-possible-to-work-with-eval-x-10-without-touching-a-global-modules-scope/59729)

<div class="topic-metadata">

**Author:** [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Replies:** 3\
**Last updated:** [April 21, 2021, 1:04pm UTC](https://discourse.julialang.org/t/is-it-possible-to-work-with-eval-x-10-without-touching-a-global-modules-scope/59729 "2021-04-21T13:04:28Z")

</div>

Hi, is there a way to make this code work without messing up the global namespace? x = 10 function f() eval(:(local x = 20)) return eval(:x) end f() @assert f() == 20 @assert x == 10 This is a minimal example for…

---

## [Unable to add packages: ERROR malformed URL ''](https://discourse.julialang.org/t/unable-to-add-packages-error-malformed-url/59732)

<div class="topic-metadata">

**Author:** [@kobusherbst](https://discourse.julialang.org/u/kobusherbst)\
**Replies:** 0\
**Last updated:** [April 21, 2021, 12:58pm UTC](https://discourse.julialang.org/t/unable-to-add-packages-error-malformed-url/59732 "2021-04-21T12:58:07Z")

</div>

I am unable to add packages on a Windows 10 virtual machine with domain authentication. I get the following error for any package I try to add. \> (@v1.6) pkg\> add https://github.com/JuliaData/DataFrames.jl \> Clonin…

---

## [White noise for 'SDEs with diagonal noise'](https://discourse.julialang.org/t/white-noise-for-sdes-with-diagonal-noise/59695)

<div class="topic-metadata">

**Author:** [@Frederic\_Gilt](https://discourse.julialang.org/u/Frederic_Gilt)\
**Replies:** 10\
**Last updated:** [April 21, 2021, 12:55pm UTC](https://discourse.julialang.org/t/white-noise-for-sdes-with-diagonal-noise/59695 "2021-04-21T12:55:02Z")

</div>

dear all, I have a SDEs with a stochastic part as a white noise k\*N(0,1). Time step is ‘dt’ Following explanations here I don’t get why the white noise is N(0,dt) and not N(0,1/dt), which seems consitent with my resul…

---

## [Flux: implementing efficient RBF layer](https://discourse.julialang.org/t/flux-implementing-efficient-rbf-layer/59402)

<div class="topic-metadata">

**Author:** [@Rasmus\_Hoier](https://discourse.julialang.org/u/Rasmus_Hoier)\
**Replies:** 5\
**Last updated:** [April 21, 2021, 12:15pm UTC](https://discourse.julialang.org/t/flux-implementing-efficient-rbf-layer/59402 "2021-04-21T12:15:48Z")

</div>

Hi, I am new to Flux and could use some feedback on how to optimize some code. Using the source code for the Dense layer as a reference I made a radial basis function (RBF) layer. I am able to train networks using the …

---

## [addall(::AbstractDict, ::AbstractDict)](https://discourse.julialang.org/t/addall-abstractdict-abstractdict/59722)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 1\
**Last updated:** [April 21, 2021, 10:38am UTC](https://discourse.julialang.org/t/addall-abstractdict-abstractdict/59722 "2021-04-21T10:38:16Z")

</div>

Hey All :slight\_smile: First of all. Is there a addall(::AbstractDict, ::AbstractDict) function? I didn’t find one. My work around was: push!(copy\_to\_dict, copy\_from\_dict...) But now the problem is that if length(cop…

---

## [PresetTimeCallback does not reach u\[1\] if save\_positions = false & using interpolations](https://discourse.julialang.org/t/presettimecallback-does-not-reach-u-1-if-save-positions-false-using-interpolations/59719)

<div class="topic-metadata">

**Author:** [@Janssena](https://discourse.julialang.org/u/Janssena)\
**Replies:** 4\
**Last updated:** [April 21, 2021, 10:22am UTC](https://discourse.julialang.org/t/presettimecallback-does-not-reach-u-1-if-save-positions-false-using-interpolations/59719 "2021-04-21T10:22:18Z")

</div>

Hey All, I’m trying to calculate the error of a differential equations sol object with respect to specific timepoints. The system is made up as follows: function dAdt(dA, A, p, t) CL, V1, Q, V2 = p k₁₀ = CL / …

---

## [When to use pipes?](https://discourse.julialang.org/t/when-to-use-pipes/59714)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 4\
**Last updated:** [April 21, 2021, 9:32am UTC](https://discourse.julialang.org/t/when-to-use-pipes/59714 "2021-04-21T09:32:45Z")

</div>

I’ve been thinking about pipes lately as @epogrebnyak and I decided to port the Causal Inference Mixtape (https://mixtape.scunning.com/) to Julia and the original R code is very pipe heavy. My first language was R but I …

---

## [\[ANN\] Biblography.jl (+BibParser.jl&BibInternal.jl): a package to import/export bibliographies from/to various formats](https://discourse.julialang.org/t/ann-biblography-jl-bibparser-jl-bibinternal-jl-a-package-to-import-export-bibliographies-from-to-various-formats/42847)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 6\
**Last updated:** [April 21, 2021, 9:04am UTC](https://discourse.julialang.org/t/ann-biblography-jl-bibparser-jl-bibinternal-jl-a-package-to-import-export-bibliographies-from-to-various-formats/42847 "2021-04-21T09:04:12Z")

</div>

Dear all, I am very pleased to announce my first v1.x package after years of inactivity … Bibliography.jl is package to manage the import/export of bibliographic entries from and to various formats. It is currently in …

---

## [\`foo = () -\> 3\` vs. \`foo() = 3\`](https://discourse.julialang.org/t/foo-3-vs-foo-3/59710)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 10\
**Last updated:** [April 21, 2021, 9:02am UTC](https://discourse.julialang.org/t/foo-3-vs-foo-3/59710 "2021-04-21T09:02:34Z")

</div>

I saw the following line in one of the Flux.jl examples evalcb = () -\> @show loss(tx, ty) In my mind, this is identical to evalcb() = @show loss(tx, ty) which I find more legible. An even more minimal example: juli…

---

## [Adding a SOS2 constraint for a variable which is defined over a DenseAxisArray?](https://discourse.julialang.org/t/adding-a-sos2-constraint-for-a-variable-which-is-defined-over-a-denseaxisarray/59637)

<div class="topic-metadata">

**Author:** [@Mastomaki](https://discourse.julialang.org/u/Mastomaki)\
**Replies:** 2\
**Last updated:** [April 21, 2021, 8:21am UTC](https://discourse.julialang.org/t/adding-a-sos2-constraint-for-a-variable-which-is-defined-over-a-denseaxisarray/59637 "2021-04-21T08:21:48Z")

</div>

Hello! I wonder how to add a SOS2 constraint with JuMP for a variable which is defined over a DenseAxisArray or SparseAxisArray? For example: using JuMP mymod = Model(); #sets node = \["n1", "n2", "n3"\] #declare var…

---

## [Compact way to store Diagonal static matrices?](https://discourse.julialang.org/t/compact-way-to-store-diagonal-static-matrices/59715)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [April 21, 2021, 8:00am UTC](https://discourse.julialang.org/t/compact-way-to-store-diagonal-static-matrices/59715 "2021-04-21T08:00:34Z")

</div>

I want to store a large number of Diagonal 3x3 matrices. I am considering using a HybridArray whose individual elements are these 3x3 matrices. In my case I know that the matrices are Diagonal. I’m not sure which of thes…

---

## [Creating new dataframe column!](https://discourse.julialang.org/t/creating-new-dataframe-column/59711)

<div class="topic-metadata">

**Author:** [@mdsa3d](https://discourse.julialang.org/u/mdsa3d)\
**Replies:** 3\
**Last updated:** [April 21, 2021, 6:13am UTC](https://discourse.julialang.org/t/creating-new-dataframe-column/59711 "2021-04-21T06:13:36Z")

</div>

I am trying to create a new column for a dataframe, such that it appends values only when the columns from the other dataframe have similar values. For example: using DataFrames, Statistics a = \["1.0"; "2.0"; "2.0"; "4…

---

## [Adding variables with the Clp solver in MathOptInterface](https://discourse.julialang.org/t/adding-variables-with-the-clp-solver-in-mathoptinterface/59540)

<div class="topic-metadata">

**Author:** [@leejm516](https://discourse.julialang.org/u/leejm516)\
**Replies:** 4\
**Last updated:** [April 21, 2021, 5:55am UTC](https://discourse.julialang.org/t/adding-variables-with-the-clp-solver-in-mathoptinterface/59540 "2021-04-21T05:55:11Z")

</div>

Hi, I am trying to be familiar with MathOptInterface, in order to revise a package that has been written with MathProgBase. When I tried to add a variable into the Clp model, I got the following error. julia\> using M…

---

## [Function definition hook?](https://discourse.julialang.org/t/function-definition-hook/59709)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 2\
**Last updated:** [April 21, 2021, 5:54am UTC](https://discourse.julialang.org/t/function-definition-hook/59709 "2021-04-21T05:54:22Z")

</div>

Is it possible to hook into function definition? Whenever a new function or method is defined I want to do something with the new function.

---

## [Solve a routine economics PDE from an HJB w/ ModelingToolkit](https://discourse.julialang.org/t/solve-a-routine-economics-pde-from-an-hjb-w-modelingtoolkit/49718)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 33\
**Last updated:** [April 21, 2021, 5:29am UTC](https://discourse.julialang.org/t/solve-a-routine-economics-pde-from-an-hjb-w-modelingtoolkit/49718 "2021-04-21T05:29:10Z")

</div>

Consider a routine continuous time optimization problem from economics: V(t,a\_{t}) := \\max \\int\_{\\tau=t}^{\\tau = T} e^{-\\rho (\\tau -t)} u(c\_{\\tau})d\\tau \\text{ s.t. } \\dot{a}\_{t} = y + ra\_{t} - c\_{t}, a\_{0} \\text…

---

## [The problem of calling “MKL pardiso” in Julia](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830)

<div class="topic-metadata">

**Author:** [@FujiwaraTakumiEH](https://discourse.julialang.org/u/FujiwaraTakumiEH)\
**Replies:** 6\
**Last updated:** [April 21, 2021, 4:19am UTC](https://discourse.julialang.org/t/the-problem-of-calling-mkl-pardiso-in-julia/25830 "2021-04-21T04:19:01Z")

</div>

Background： I have a large sparse matrix written by Julia that requires solutions, and I want to use MKL pardiso to improve speed. I’ve found the pardiso.jl page and read README. What I’ve done： Install Pardiso in Jul…

---

## [Turing.jl: prior on quantiles](https://discourse.julialang.org/t/turing-jl-prior-on-quantiles/59510)

<div class="topic-metadata">

**Author:** [@jdossgollin](https://discourse.julialang.org/u/jdossgollin)\
**Replies:** 4\
**Last updated:** [April 21, 2021, 2:27am UTC](https://discourse.julialang.org/t/turing-jl-prior-on-quantiles/59510 "2021-04-21T02:27:58Z")

</div>

I’d like to develop a model with prior on quantiles of the outcome, rather than on the parameters themselves. This is pretty commonly used in expert elicitation contexts. However, when I try to implement this model, I’m …

---

## [DataFrameRow Row Number](https://discourse.julialang.org/t/dataframerow-row-number/18692)

<div class="topic-metadata">

**Author:** [@Paul\_McVay](https://discourse.julialang.org/u/Paul_McVay)\
**Replies:** 5\
**Last updated:** [April 21, 2021, 2:07am UTC](https://discourse.julialang.org/t/dataframerow-row-number/18692 "2021-04-21T02:07:33Z")

</div>

If you have a data frame, and want to iterate over each row? How do you access the row number? data = DataFrame(a = \[1, 2, 3\], b = \['a', 'b', 'c'\]) r = collect(eachrow(data))\[1\] The row number is obviously stored but …

---

## [Makie arrow through transparent mesh](https://discourse.julialang.org/t/makie-arrow-through-transparent-mesh/59666)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 1\
**Last updated:** [April 20, 2021, 10:59pm UTC](https://discourse.julialang.org/t/makie-arrow-through-transparent-mesh/59666 "2021-04-20T22:59:37Z")

</div>

How can I draw arrows through semi-transparent objects with Makie? I can’t get the line to show properly through the transparent surface. Here’s a minimal example: using GLMakie scene = Scene(resolution = (800, 600), …

---

## [Generated Tuples of Functions](https://discourse.julialang.org/t/generated-tuples-of-functions/59499)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 3\
**Last updated:** [April 20, 2021, 10:20pm UTC](https://discourse.julialang.org/t/generated-tuples-of-functions/59499 "2021-04-20T22:20:11Z")

</div>

Continuing the discussion from Performance and allocation issue with arrays of functions (v1.5): I want to modify the question I originally posed above, to the case that the collection of functions on which I wish to ev…

---

## [Clarification on usage for non-type type parameters](https://discourse.julialang.org/t/clarification-on-usage-for-non-type-type-parameters/59669)

<div class="topic-metadata">

**Author:** [@Samuele-Colombo](https://discourse.julialang.org/u/Samuele-Colombo)\
**Replies:** 6\
**Last updated:** [April 20, 2021, 9:40pm UTC](https://discourse.julialang.org/t/clarification-on-usage-for-non-type-type-parameters/59669 "2021-04-20T21:40:45Z")

</div>

Hi, I was trying to define an abstract type which I would like to be subtype of FieldVector{N,T}, from the package StaticArrays, where N must be Unsigned. If it were simply a case like the following abstract type MyType…

---

## [Convert/parse a VersionNumber into a struct or similar](https://discourse.julialang.org/t/convert-parse-a-versionnumber-into-a-struct-or-similar/59692)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 2\
**Last updated:** [April 20, 2021, 9:35pm UTC](https://discourse.julialang.org/t/convert-parse-a-versionnumber-into-a-struct-or-similar/59692 "2021-04-20T21:35:01Z")

</div>

Is there a function for that purpose? Sure it is not difficult to write for v"1.6.0", and not that difficult for "v"1.7.0-dev.100", but probably already done (many times).

---

## [How to (properly) use the solution of a simulation in ModelingToolkit](https://discourse.julialang.org/t/how-to-properly-use-the-solution-of-a-simulation-in-modelingtoolkit/59686)

<div class="topic-metadata">

**Author:** [@CodeLenz](https://discourse.julialang.org/u/CodeLenz)\
**Replies:** 4\
**Last updated:** [April 20, 2021, 8:16pm UTC](https://discourse.julialang.org/t/how-to-properly-use-the-solution-of-a-simulation-in-modelingtoolkit/59686 "2021-04-20T20:16:02Z")

</div>

Hi there. I am starting to use the amazing ModellingToolkit, but I am afraid I am missing something important. So I apologize if my questions is silly. Suppose I have a model consisting of two differential equations, t…

[Previous page](https://discourse.julialang.org/latest.md?page=1416)

[Next page](https://discourse.julialang.org/latest.md?page=1418)
