# Latest

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

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

**Page:** 1464

---

## [Sorting by two values (basic sorting)](https://discourse.julialang.org/t/sorting-by-two-values-basic-sorting/56961)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 7\
**Last updated:** [March 11, 2021, 9:21pm UTC](https://discourse.julialang.org/t/sorting-by-two-values-basic-sorting/56961 "2021-03-11T21:21:59Z")

</div>

This is probably fairly simple. I want to sort a set of tuples first by the second value, and then by the first value, like this: julia\> a = \[ rand(1:3,2) for i in 1: 5 \] 5-element Array{Array{Int64,1},1}: \[2, 1\] \[3, …

---

## [How can I interpolate inside single quotes inside a command?](https://discourse.julialang.org/t/how-can-i-interpolate-inside-single-quotes-inside-a-command/56515)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 9:00pm UTC](https://discourse.julialang.org/t/how-can-i-interpolate-inside-single-quotes-inside-a-command/56515 "2021-03-11T21:00:49Z")

</div>

How can I interpolate inside single quotes inside a command? h = "hey" \`echo $h\` # this works \`echo '$h'\` # this does not Note that the original poster on Slack cannot see your response here on Discourse. Consider tran…

---

## [Copying subvector makes pointer?](https://discourse.julialang.org/t/copying-subvector-makes-pointer/56935)

<div class="topic-metadata">

**Author:** [@Ribeiro](https://discourse.julialang.org/u/Ribeiro)\
**Replies:** 5\
**Last updated:** [March 11, 2021, 8:58pm UTC](https://discourse.julialang.org/t/copying-subvector-makes-pointer/56935 "2021-03-11T20:58:02Z")

</div>

Hi! I’m getting some surprising behavior from a Vector of Vectors. julia\> b=\[\[1,2,3\]\] 1-element Array{Array{Int64,1},1}: \[1, 2, 3\] julia\> pushfirst!(b,b\[1\]) 2-element Array{Array{Int64,1},1}: \[1, 2, 3\] \[1, 2, 3\] j…

---

## [Speeding up the exit(); restart REPL loop in VSCode](https://discourse.julialang.org/t/speeding-up-the-exit-restart-repl-loop-in-vscode/56834)

<div class="topic-metadata">

**Author:** [@marty0801](https://discourse.julialang.org/u/marty0801)\
**Replies:** 8\
**Last updated:** [March 11, 2021, 6:43pm UTC](https://discourse.julialang.org/t/speeding-up-the-exit-restart-repl-loop-in-vscode/56834 "2021-03-11T18:43:32Z")

</div>

I use Revise, but I frequently change struct definitions, which requires to exit Julia and start another REPL, wait for my package to compile. You know the drill; there must be a better way! How do you handle this? The …

---

## [Testing one loop with two operations or a two loops](https://discourse.julialang.org/t/testing-one-loop-with-two-operations-or-a-two-loops/56959)

<div class="topic-metadata">

**Author:** [@swishmas](https://discourse.julialang.org/u/swishmas)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 6:23pm UTC](https://discourse.julialang.org/t/testing-one-loop-with-two-operations-or-a-two-loops/56959 "2021-03-11T18:23:40Z")

</div>

I was poking around a few discussion forums about what the best coding practice is. I have a few operations that I put into one loop, similar to using BenchmarkTools function single(A::Array{Int64,1}) @simd for i = 1…

---

## [Abstract repeated code in a method without overhead](https://discourse.julialang.org/t/abstract-repeated-code-in-a-method-without-overhead/56953)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 2\
**Last updated:** [March 11, 2021, 6:17pm UTC](https://discourse.julialang.org/t/abstract-repeated-code-in-a-method-without-overhead/56953 "2021-03-11T18:17:06Z")

</div>

When writing a method I used some child (internal?) functions to avoid copy/pasting code that was used repeatedly. The methods are not that complicated so I figured the compiler would just inline them and there would be…

---

## [Question on HTTP.jl](https://discourse.julialang.org/t/question-on-http-jl/56924)

<div class="topic-metadata">

**Author:** [@sampope](https://discourse.julialang.org/u/sampope)\
**Replies:** 2\
**Last updated:** [March 11, 2021, 6:11pm UTC](https://discourse.julialang.org/t/question-on-http-jl/56924 "2021-03-11T18:11:57Z")

</div>

Hi, I’m trying to do a lookup on IP addresses using HTTP.jl \[cd3eb016\] HTTP v0.9.5, I purposely put in invalid addresses to see how it responds, and not sure how to access this error: The request is: ipaddr = "10.10.10…

---

## [Difference between toml files for 1.5 and 1.6](https://discourse.julialang.org/t/difference-between-toml-files-for-1-5-and-1-6/56920)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 8\
**Last updated:** [March 11, 2021, 5:02pm UTC](https://discourse.julialang.org/t/difference-between-toml-files-for-1-5-and-1-6/56920 "2021-03-11T17:02:21Z")

</div>

has been driving me nuts for a while now. For instance, on mybinder. Is the end of the divergence nigh?

---

## [Figures as Jupyter widgets](https://discourse.julialang.org/t/figures-as-jupyter-widgets/56872)

<div class="topic-metadata">

**Author:** [@sswatson](https://discourse.julialang.org/u/sswatson)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 4:52pm UTC](https://discourse.julialang.org/t/figures-as-jupyter-widgets/56872 "2021-03-11T16:52:05Z")

</div>

I’d like to create a Jupyter notebook which I can deploy on Binder which allows users to click on a two-dimensional plot and have a curve drawn through the clicked point. For example, the curve might be an ODE solution w…

---

## [Slow julia-mode on Windows 10](https://discourse.julialang.org/t/slow-julia-mode-on-windows-10/44182)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 12\
**Last updated:** [March 11, 2021, 4:51pm UTC](https://discourse.julialang.org/t/slow-julia-mode-on-windows-10/44182 "2021-03-11T16:51:00Z")

</div>

I observe intermittent sluggish behavior when using Emacs’ julia-mode in two different Windows 10 computers and Emacs 26.3: an arrow key move takes sometimes between 1 and 5 seconds. Non julia-modes are instead working f…

---

## [ERROR: TypeError: in new, expected Float64, got a value of type ForwardDiff.Dual{Nothing,Float64,10}](https://discourse.julialang.org/t/error-typeerror-in-new-expected-float64-got-a-value-of-type-forwarddiff-dual-nothing-float64-10/56909)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 6\
**Last updated:** [March 11, 2021, 4:32pm UTC](https://discourse.julialang.org/t/error-typeerror-in-new-expected-float64-got-a-value-of-type-forwarddiff-dual-nothing-float64-10/56909 "2021-03-11T16:32:58Z")

</div>

I’m trying to solve a problem similar to the Trebuche problem using the sciml\_train diffeqflux, etc. I have a neural network married to a diffeq simulation and the neural network would ultimately condition the parameter…

---

## [Problems with the scale 3d on animations](https://discourse.julialang.org/t/problems-with-the-scale-3d-on-animations/56949)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 2\
**Last updated:** [March 11, 2021, 4:24pm UTC](https://discourse.julialang.org/t/problems-with-the-scale-3d-on-animations/56949 "2021-03-11T16:24:58Z")

</div>

Dear all, I have the following code to perform an animation in 3d: using Plots plotlyjs() anim = Animation() for n in range(0,2π,length=10) t=0:0.1:n x=cos.(t) y=sin.(t) z=t scatter(x,y,z,lw=1,mar…

---

## [External product of StaticArrays vectors](https://discourse.julialang.org/t/external-product-of-staticarrays-vectors/56955)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 2\
**Last updated:** [March 11, 2021, 3:38pm UTC](https://discourse.julialang.org/t/external-product-of-staticarrays-vectors/56955 "2021-03-11T15:38:39Z")

</div>

Hi, I have two SVector’s, and I wish to compute their external product. I have three requirements the output should be a SMatrix, the operation should be FAST (slow, I can do myself…) preferably, the output is non-mu…

---

## [Recent developments in StaticArrays.jl land](https://discourse.julialang.org/t/recent-developments-in-staticarrays-jl-land/47778)

<div class="topic-metadata">

**Author:** [@mateuszbaran](https://discourse.julialang.org/u/mateuszbaran)\
**Replies:** 12\
**Last updated:** [March 11, 2021, 3:13pm UTC](https://discourse.julialang.org/t/recent-developments-in-staticarrays-jl-land/47778 "2021-03-11T15:13:27Z")

</div>

StaticArrays.jl has received a few cool new features since its 0.12.4 release that are now fast thanks to the memory layout changes in Julia 1.5. These changes are commonly known as non-allocating views but as I show her…

---

## [How to make mutually referencial structs?](https://discourse.julialang.org/t/how-to-make-mutually-referencial-structs/56952)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 4\
**Last updated:** [March 11, 2021, 3:06pm UTC](https://discourse.julialang.org/t/how-to-make-mutually-referencial-structs/56952 "2021-03-11T15:06:31Z")

</div>

Hello, here is a MWE: mutable struct Bar{T} y::T foo end Bar(y) = Bar(y, nothing) mutable struct Foo{T, B \<: Bar} x::T bar::B end function Foo(x, bar) foo = Foo(x, bar) bar.foo = foo retur…

---

## [Is there a "native" way for me to splat all the values of the parameters of a stru](https://discourse.julialang.org/t/is-there-a-native-way-for-me-to-splat-all-the-values-of-the-parameters-of-a-stru/56951)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 11, 2021, 2:33pm UTC](https://discourse.julialang.org/t/is-there-a-native-way-for-me-to-splat-all-the-values-of-the-parameters-of-a-stru/56951 "2021-03-11T14:33:03Z")

</div>

is there a “native” way for me to splat all the values of the parameters of a struct? So: struct A x y z end a = A(1,2,3) a... (1,2,3) or a vector \[1,2,3\] Note that the original poster on Slack cannot see …

---

## [Not sure if I am using \`Revise\` correctly](https://discourse.julialang.org/t/not-sure-if-i-am-using-revise-correctly/56774)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 10\
**Last updated:** [March 11, 2021, 1:23pm UTC](https://discourse.julialang.org/t/not-sure-if-i-am-using-revise-correctly/56774 "2021-03-11T13:23:24Z")

</div>

I am trying to use Revise for a module mymodule defined in the file model.jl. julia\> using Revise julia\> include("model.jl"); using .mymodule if I change the file model.jl , the changes are not reflected. I imagine tha…

---

## [Excessive namespace using @reexport](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 1:07pm UTC](https://discourse.julialang.org/t/excessive-namespace-using-reexport/56823 "2021-03-11T13:07:18Z")

</div>

Hi, I’m writing a module that makes use of the Distributions package. Its API has arguments that are Distribution types. So in order to be used in another environment, it is practically mandatory that the Distributions …

---

## [Randomness and reproducible results / unit tests](https://discourse.julialang.org/t/randomness-and-reproducible-results-unit-tests/56941)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 5\
**Last updated:** [March 11, 2021, 12:40pm UTC](https://discourse.julialang.org/t/randomness-and-reproducible-results-unit-tests/56941 "2021-03-11T12:40:07Z")

</div>

I wonder if this is the suggested approach if one want reproducible results / set unit tests that don’t fail because of the random component, or other approaches are favoured… using StableRNGs, Random function myAlgori…

---

## [When and How to use Types](https://discourse.julialang.org/t/when-and-how-to-use-types/56659)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 7\
**Last updated:** [March 11, 2021, 11:36am UTC](https://discourse.julialang.org/t/when-and-how-to-use-types/56659 "2021-03-11T11:36:44Z")

</div>

I have a function that depends on two integer parameters. It currently returns a function, but extensions would likely return objects whose dimensions depended on the input parameters. Naive implementation: using Spec…

---

## [Hi, quick question on using latex strings for labeling plots in PyPlot.jl: what](https://discourse.julialang.org/t/hi-quick-question-on-using-latex-strings-for-labeling-plots-in-pyplot-jl-what/56757)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 8:46am UTC](https://discourse.julialang.org/t/hi-quick-question-on-using-latex-strings-for-labeling-plots-in-pyplot-jl-what/56757 "2021-03-11T08:46:56Z")

</div>

Hi, quick question on using latex strings for labeling plots in PyPlot.jl: what would be a correct way to do in-place variable substitution? Here’s a piece of code that does not work …. ax.set\_title(L"$ $(a) $") Not…

---

## [Alternate color for each point in scatter plot and add legend](https://discourse.julialang.org/t/alternate-color-for-each-point-in-scatter-plot-and-add-legend/56856)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 12\
**Last updated:** [March 11, 2021, 8:07am UTC](https://discourse.julialang.org/t/alternate-color-for-each-point-in-scatter-plot-and-add-legend/56856 "2021-03-11T08:07:28Z")

</div>

I’m plotting a series where I’d like to alternate colors for each point. This works fine via the mc keyword, but I can’t get the legend to indicate the color coding scheme correctly: using Plots a = rand(10); b = rand(1…

---

## [Problems with Animation](https://discourse.julialang.org/t/problems-with-animation/56921)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 2\
**Last updated:** [March 11, 2021, 7:50am UTC](https://discourse.julialang.org/t/problems-with-animation/56921 "2021-03-11T07:50:16Z")

</div>

Dear all, I want to do a simple animation: using Plots plotly() x=-1:0.01:1 y=-1:0.01:1 h(x,y)=x^2-y^2; anim = Animation() for θ in range(0,2π,length=10) surface(x,y,h,leg=false,camera=(θ,30)) frame(anim) end …

---

## [Can documenter insert (embed) examples from a file to a page code block?](https://discourse.julialang.org/t/can-documenter-insert-embed-examples-from-a-file-to-a-page-code-block/56898)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [March 11, 2021, 5:28am UTC](https://discourse.julialang.org/t/can-documenter-insert-embed-examples-from-a-file-to-a-page-code-block/56898 "2021-03-11T05:28:07Z")

</div>

I would like to add some full-feature examples on my package documentation, but rather than copy/pasting in the example block I would like to keep each example on its own file. In general markdown this is not possible, …

---

## [Defining a rank-N tensor](https://discourse.julialang.org/t/defining-a-rank-n-tensor/56791)

<div class="topic-metadata">

**Author:** [@DocDave](https://discourse.julialang.org/u/DocDave)\
**Replies:** 4\
**Last updated:** [March 11, 2021, 3:50am UTC](https://discourse.julialang.org/t/defining-a-rank-n-tensor/56791 "2021-03-11T03:50:34Z")

</div>

TL;DR: I have three main questions: How do I define a struct type such that it is limited to one of a few select options? How do I define a struct type such that it can only take integer values? How do I programmatical…

---

## [Warning invalid warm start GLPK](https://discourse.julialang.org/t/warning-invalid-warm-start-glpk/46441)

<div class="topic-metadata">

**Author:** [@ErwanPiR](https://discourse.julialang.org/u/ErwanPiR)\
**Replies:** 3\
**Last updated:** [March 11, 2021, 2:20am UTC](https://discourse.julialang.org/t/warning-invalid-warm-start-glpk/46441 "2021-03-11T02:20:50Z")

</div>

Hi, I see some topics dated from 2019 talking about the warm start in JuMP with GLPK. I still have the warning : Warning: MathOptInterface.VariablePrimalStart() is not supported by MathOptInterface.Bridges.LazyBridgeOp…

---

## [HDF5 build failure on HPC](https://discourse.julialang.org/t/hdf5-build-failure-on-hpc/56859)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 4\
**Last updated:** [March 11, 2021, 12:41am UTC](https://discourse.julialang.org/t/hdf5-build-failure-on-hpc/56859 "2021-03-11T00:41:48Z")

</div>

Hello everyone, could you please spend a minute to look at these error message ? I am trying to install MLDatasets on an HPC cluster but I got the following error while building and using HDF5. I know that a library is …

---

## [PKG.JL error](https://discourse.julialang.org/t/pkg-jl-error/56866)

<div class="topic-metadata">

**Author:** [@baddate](https://discourse.julialang.org/u/baddate)\
**Replies:** 2\
**Last updated:** [March 10, 2021, 11:20pm UTC](https://discourse.julialang.org/t/pkg-jl-error/56866 "2021-03-10T23:20:24Z")

</div>

I want to add ‘Genie’ package, but there was an error: (@v1.5) pkg\> add Genie ERROR: The following package names could not be resolved: \* Genie (not found in project, manifest or registry) And, when i tried to update …

---

## [In JuMP, how to access a named constraint created inside a function](https://discourse.julialang.org/t/in-jump-how-to-access-a-named-constraint-created-inside-a-function/56912)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 2\
**Last updated:** [March 10, 2021, 10:54pm UTC](https://discourse.julialang.org/t/in-jump-how-to-access-a-named-constraint-created-inside-a-function/56912 "2021-03-10T22:54:02Z")

</div>

I would like to delete a constraint created inside a function. For example, function mymodel(a) m = Model() @variable(model, w\[1:n\] \>= 0) @constraint(model, budget, sum(w) == a) ... return m end …

---

## [Multidimensional integration and differentiation](https://discourse.julialang.org/t/multidimensional-integration-and-differentiation/56163)

<div class="topic-metadata">

**Author:** [@simonf](https://discourse.julialang.org/u/simonf)\
**Replies:** 3\
**Last updated:** [March 10, 2021, 10:42pm UTC](https://discourse.julialang.org/t/multidimensional-integration-and-differentiation/56163 "2021-03-10T22:42:11Z")

</div>

Hi, I have a series of parameterized functions containing double integrals and function limits and want to find stationary points of those functions. I have a solution using SymPy.jl, but this is only working well for k…

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

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