# Latest

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

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

**Page:** 1091

---

## [Plot fitted curves](https://discourse.julialang.org/t/plot-fitted-curves/78181)

<div class="topic-metadata">

**Author:** [@Mahmoud](https://discourse.julialang.org/u/Mahmoud)\
**Replies:** 6\
**Last updated:** [March 21, 2022, 7:20pm UTC](https://discourse.julialang.org/t/plot-fitted-curves/78181 "2022-03-21T19:20:38Z")

</div>

Is there anyway in Julia to fit these data represented in the attached figure? I want to make them smooth curves (may be exponential fit). p1=plot!(dayss,numberofhealthyy,legend=false,color = :blue) p2=plot!(dayss,nu…

---

## [Doing crazy stuff with generics](https://discourse.julialang.org/t/doing-crazy-stuff-with-generics/78225)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 2\
**Last updated:** [March 21, 2022, 4:32pm UTC](https://discourse.julialang.org/t/doing-crazy-stuff-with-generics/78225 "2022-03-21T16:32:46Z")

</div>

Hi all :slight\_smile: Why can’t I do the following: julia\> function crazy(T) if T == Int String elseif T == String Int else error("use Int o…

---

## [RNN Sentiment analysis example with Flux: how to use batch ? which value for the inner state?](https://discourse.julialang.org/t/rnn-sentiment-analysis-example-with-flux-how-to-use-batch-which-value-for-the-inner-state/78224)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 0\
**Last updated:** [March 21, 2022, 4:05pm UTC](https://discourse.julialang.org/t/rnn-sentiment-analysis-example-with-flux-how-to-use-batch-which-value-for-the-inner-state/78224 "2022-03-21T16:05:42Z")

</div>

Hello, the code belows model a RNN for sentiment analysis over Amazon reviews. My main problem is that I don’t know how to batch a recursive cell when the sequence (i.e. the review text) has variable length. In the \[do…

---

## [Nested for loop in generator](https://discourse.julialang.org/t/nested-for-loop-in-generator/78222)

<div class="topic-metadata">

**Author:** [@joh](https://discourse.julialang.org/u/joh)\
**Replies:** 2\
**Last updated:** [March 21, 2022, 3:47pm UTC](https://discourse.julialang.org/t/nested-for-loop-in-generator/78222 "2022-03-21T15:47:00Z")

</div>

I’ve just stumbled across something odd when using a nested for statement in a generator expression. I would have expected collect((n,k) for n in 1:5, k in 1:n) to be equivalent to collect((n,k) for n in 1:5 for k in 1:n…

---

## [Structs: Able to change members of type Vector{Float64}, but not of type Float64](https://discourse.julialang.org/t/structs-able-to-change-members-of-type-vector-float64-but-not-of-type-float64/78221)

<div class="topic-metadata">

**Author:** [@Christian\_Brunbjerg](https://discourse.julialang.org/u/Christian_Brunbjerg)\
**Replies:** 2\
**Last updated:** [March 21, 2022, 3:21pm UTC](https://discourse.julialang.org/t/structs-able-to-change-members-of-type-vector-float64-but-not-of-type-float64/78221 "2022-03-21T15:21:10Z")

</div>

Hello! :slight\_smile: When using an struct I am able to change the values inside members that are of type Vector, but I cannot not do it for members of type Float64. Do I need to change my struct to an immutable struct …

---

## [Problem Generating executable](https://discourse.julialang.org/t/problem-generating-executable/77716)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 5\
**Last updated:** [March 18, 2022, 1:07pm UTC](https://discourse.julialang.org/t/problem-generating-executable/77716 "2022-03-18T13:07:02Z")

</div>

When I run the below code, it gives the below error. How can I solve the problem? using PackageCompiler: PackageCompiler, create\_sysimage, create\_app, create\_library using Pkg ENV\["JULIA\_DEBUG"\] = "PackageCompiler" mkpa…

---

## [How to slice with start stop step](https://discourse.julialang.org/t/how-to-slice-with-start-stop-step/78217)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 2\
**Last updated:** [March 21, 2022, 2:48pm UTC](https://discourse.julialang.org/t/how-to-slice-with-start-stop-step/78217 "2022-03-21T14:48:12Z")

</div>

In Python I can do \>\>\> a = \[1, 2, 3, 4, 5, 6, 7, 8\] \>\>\> a\[3:7:2\] \[4,6\] Here I am selecting the indices between 3 and 7 with a step size of two. However in Julia I get julia\> a = \[1, 2, 3, 4, 5, 6, 7, 8\] julia\> a\[3:7:2…

---

## [Best Nonlinear Optimizer for a Continuous Convex Problem](https://discourse.julialang.org/t/best-nonlinear-optimizer-for-a-continuous-convex-problem/77771)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 44\
**Last updated:** [March 21, 2022, 2:38pm UTC](https://discourse.julialang.org/t/best-nonlinear-optimizer-for-a-continuous-convex-problem/77771 "2022-03-21T14:38:51Z")

</div>

Hi, I have a simple problem in which I want to \\max\_{x \\in \\mathbb{R}^{N}} f(x) \\text{s.t}\\hspace{5pt}x \\geq 0 where f(x) is continuous and globally concave. Which is the best solver for nonlinear, globally conca…

---

## [Variance in @elapsed while trying to measure function](https://discourse.julialang.org/t/variance-in-elapsed-while-trying-to-measure-function/78049)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 6\
**Last updated:** [March 21, 2022, 2:37pm UTC](https://discourse.julialang.org/t/variance-in-elapsed-while-trying-to-measure-function/78049 "2022-03-21T14:37:25Z")

</div>

Hello, good afternoon. Im using @elapsed to mesure time function and got some flutuation in sequence data. Is this peaks in plot gargabe collection noise?

---

## [Julia Flux, how to build a simple multilayer perception to solve xor problem](https://discourse.julialang.org/t/julia-flux-how-to-build-a-simple-multilayer-perception-to-solve-xor-problem/48901)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 6\
**Last updated:** [March 21, 2022, 1:42pm UTC](https://discourse.julialang.org/t/julia-flux-how-to-build-a-simple-multilayer-perception-to-solve-xor-problem/48901 "2022-03-21T13:42:03Z")

</div>

Hello. Someone knows how to build a simple multilayer perceptron with flux to solve a xor problem? The examples are very complex to start with flux. May someone help?

---

## [Call for Plots examples](https://discourse.julialang.org/t/call-for-plots-examples/78206)

<div class="topic-metadata">

**Author:** [@JohnnyChen94](https://discourse.julialang.org/u/JohnnyChen94)\
**Replies:** 0\
**Last updated:** [March 21, 2022, 11:48am UTC](https://discourse.julialang.org/t/call-for-plots-examples/78206 "2022-03-21T11:48:15Z")

</div>

I’m not an experienced Plots user; every time when I use Plots I try to find an example that looks useful and try to modify it. With the help of @BeastyBlacksmith we’ve finally set up the demo gallery using DemoCards.jl,…

---

## [Is the compiler smart enough to remove this duplicate computation?](https://discourse.julialang.org/t/is-the-compiler-smart-enough-to-remove-this-duplicate-computation/78198)

<div class="topic-metadata">

**Author:** [@fredrikpaues](https://discourse.julialang.org/u/fredrikpaues)\
**Replies:** 7\
**Last updated:** [March 21, 2022, 12:31pm UTC](https://discourse.julialang.org/t/is-the-compiler-smart-enough-to-remove-this-duplicate-computation/78198 "2022-03-21T12:31:19Z")

</div>

Is the compiler smart enough that it doesn’t compute diff(w; dims=3) in the following snippet twice? w = rand(2, 3, 4) @assert( all((diff(w; dims=3) .\> 0) .| isnan.(diff(w; dims=3))), "Something's amiss." ) If …

---

## [Problem with PackageCompiler](https://discourse.julialang.org/t/problem-with-packagecompiler/78130)

<div class="topic-metadata">

**Author:** [@goerch](https://discourse.julialang.org/u/goerch)\
**Replies:** 3\
**Last updated:** [March 21, 2022, 9:47am UTC](https://discourse.julialang.org/t/problem-with-packagecompiler/78130 "2022-03-21T09:47:08Z")

</div>

We have the following MWE. Project structure: package1.jl module package1 Base.@ccallable function julia\_main()::Cint try testApp() catch Base.invokelatest(Base.display\_error, Base.catch\_stac…

---

## [\[Makie, AlgebraOfGraphics\] Multiline title pushed content out of frame](https://discourse.julialang.org/t/makie-algebraofgraphics-multiline-title-pushed-content-out-of-frame/77865)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 1\
**Last updated:** [March 21, 2022, 9:11am UTC](https://discourse.julialang.org/t/makie-algebraofgraphics-multiline-title-pushed-content-out-of-frame/77865 "2022-03-21T09:11:00Z")

</div>

I want a plot with a multiline title. I am plotting via AlgebraOfGraphics.jl. The problem is that the title (set by current\_axis().title = ) pushes content out of frame when it becomes multiline. I also tried adding Labe…

---

## [Looping over each index in varargs](https://discourse.julialang.org/t/looping-over-each-index-in-varargs/78200)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 1\
**Last updated:** [March 21, 2022, 8:43am UTC](https://discourse.julialang.org/t/looping-over-each-index-in-varargs/78200 "2022-03-21T08:43:57Z")

</div>

I have a function that takes in any number of vectors, not necessarily of equal length: function exfnc(x::Vector{Float64}...) sizes = length.(x) ## compute some function over all combinations (x1\[i\], x2\[j\], ...,…

---

## [2 processes of julia.exe in the background when using vscode](https://discourse.julialang.org/t/2-processes-of-julia-exe-in-the-background-when-using-vscode/78194)

<div class="topic-metadata">

**Author:** [@lyulyu](https://discourse.julialang.org/u/lyulyu)\
**Replies:** 3\
**Last updated:** [March 21, 2022, 7:17am UTC](https://discourse.julialang.org/t/2-processes-of-julia-exe-in-the-background-when-using-vscode/78194 "2022-03-21T07:17:05Z")

</div>

2 processes of julia.exe in the background when using vscode, this problem disappears while using atom. environment: win10-x64, julia-1.7.0. julia-client, v0.12.6 (for Atom); vscode-julia-extension, v1.6.5.

---

## [Using mutable struct constructor](https://discourse.julialang.org/t/using-mutable-struct-constructor/78179)

<div class="topic-metadata">

**Author:** [@tgautam03](https://discourse.julialang.org/u/tgautam03)\
**Replies:** 2\
**Last updated:** [March 21, 2022, 5:41am UTC](https://discourse.julialang.org/t/using-mutable-struct-constructor/78179 "2022-03-21T05:41:34Z")

</div>

Hi I’ve defined a mutable struct with constructor that initialises the first field as follows mutable struct Dummy val1::Array val2::Array function Dummy(val1::Array) new(val) end end Is there a way I can defin…

---

## [How to programmatically generate different functions?](https://discourse.julialang.org/t/how-to-programmatically-generate-different-functions/78152)

<div class="topic-metadata">

**Author:** [@DenisTitov](https://discourse.julialang.org/u/DenisTitov)\
**Replies:** 9\
**Last updated:** [March 21, 2022, 3:17am UTC](https://discourse.julialang.org/t/how-to-programmatically-generate-different-functions/78152 "2022-03-21T03:17:59Z")

</div>

Hi all, I want to figure out how to generate different version of a function programmatically. I beleive metaprogramming is what I need but wanted to ask for advice before implementing it. Apologies if below is a bit …

---

## [Order of minimum and average when configuring \`samples\` and \`evals\` in BenchmarkTools](https://discourse.julialang.org/t/order-of-minimum-and-average-when-configuring-samples-and-evals-in-benchmarktools/78184)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 0\
**Last updated:** [March 21, 2022, 1:44am UTC](https://discourse.julialang.org/t/order-of-minimum-and-average-when-configuring-samples-and-evals-in-benchmarktools/78184 "2022-03-21T01:44:33Z")

</div>

Apparently I am not the first one to be confused about the difference between the samples and evals parameters in BenchmarkTools.jl: BenchmarkTools (I know that setup is called newly for each of the samples but not for …

---

## [Cvodes error](https://discourse.julialang.org/t/cvodes-error/78175)

<div class="topic-metadata">

**Author:** [@Yinmin\_Liu](https://discourse.julialang.org/u/Yinmin_Liu)\
**Replies:** 1\
**Last updated:** [March 21, 2022, 12:28am UTC](https://discourse.julialang.org/t/cvodes-error/78175 "2022-03-21T00:28:31Z")

</div>

Hi, I am trying to solve a very large stiff system with the CVODE\_BDF() solver. When I apply the Jacobian-free solver by setting linear\_solver =: GMRES, it magically solved my problem with about 20 sec, which I believe …

---

## [Right way to define a constraint](https://discourse.julialang.org/t/right-way-to-define-a-constraint/78116)

<div class="topic-metadata">

**Author:** [@Popeye](https://discourse.julialang.org/u/Popeye)\
**Replies:** 2\
**Last updated:** [March 20, 2022, 11:54pm UTC](https://discourse.julialang.org/t/right-way-to-define-a-constraint/78116 "2022-03-20T23:54:36Z")

</div>

I am having difficulty in defining a constraint efficiently that is based on a matrix of decision variables. A MWE is given below but as you will see it creates a number of intermediate expressions, so it is not the best…

---

## [Issue adding a row record of a DataFrame with \`String\` name to itself](https://discourse.julialang.org/t/issue-adding-a-row-record-of-a-dataframe-with-string-name-to-itself/78177)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 5\
**Last updated:** [March 20, 2022, 9:54pm UTC](https://discourse.julialang.org/t/issue-adding-a-row-record-of-a-dataframe-with-string-name-to-itself/78177 "2022-03-20T21:54:52Z")

</div>

I have a kind of complicated dataframe df, and I want to append one of its rows to the end, i.e., append!(df, df\[1,:\]). When I try this, I get an error julia\> append!(df, DataFrame(df\[1,:\])) ┌ Error: Error adding value …

---

## [Ploting data](https://discourse.julialang.org/t/ploting-data/78167)

<div class="topic-metadata">

**Author:** [@Mahmoud](https://discourse.julialang.org/u/Mahmoud)\
**Replies:** 3\
**Last updated:** [March 20, 2022, 9:38pm UTC](https://discourse.julialang.org/t/ploting-data/78167 "2022-03-20T21:38:09Z")

</div>

I have the scattered data image is there anyway to represent it in lines like second image? this is the code that I used to generate the image: for i in 1:100 # code to update days,numberofhealthy ,numbero…

---

## [Can't mul! to a slice](https://discourse.julialang.org/t/cant-mul-to-a-slice/78178)

<div class="topic-metadata">

**Author:** [@fredrikpaues](https://discourse.julialang.org/u/fredrikpaues)\
**Replies:** 2\
**Last updated:** [March 20, 2022, 9:10pm UTC](https://discourse.julialang.org/t/cant-mul-to-a-slice/78178 "2022-03-20T21:10:39Z")

</div>

After watching Brian Jackson’s talk on JuliaCon 2020 Adventures in Avoiding Allocations, I wanted to try LinearAlgebra.mul! out. But I’m guessing that I don’t get it as test1 and test2 don’t yield the same result. The pr…

---

## ["unable to find the specified executable file" when trying to use mpirun on julia](https://discourse.julialang.org/t/unable-to-find-the-specified-executable-file-when-trying-to-use-mpirun-on-julia/78172)

<div class="topic-metadata">

**Author:** [@knkn1711](https://discourse.julialang.org/u/knkn1711)\
**Replies:** 0\
**Last updated:** [March 20, 2022, 7:27pm UTC](https://discourse.julialang.org/t/unable-to-find-the-specified-executable-file-when-trying-to-use-mpirun-on-julia/78172 "2022-03-20T19:27:50Z")

</div>

I am trying to run my julia code on multiple nodes of a cluster, which uses Moab and Torque for the scheduler and resource manager. In an interactive session where I requested 3 nodes, I load julia and openmpi modules a…

---

## [Current best practises on dealing with optional dependencies](https://discourse.julialang.org/t/current-best-practises-on-dealing-with-optional-dependencies/78015)

<div class="topic-metadata">

**Author:** [@Luapulu](https://discourse.julialang.org/u/Luapulu)\
**Replies:** 3\
**Last updated:** [March 20, 2022, 7:38pm UTC](https://discourse.julialang.org/t/current-best-practises-on-dealing-with-optional-dependencies/78015 "2022-03-20T19:38:13Z")

</div>

Say I’ve written up a package to compute Foo and now I’d like to add support to write and read Foo to HDF5 or to plot Foo. May be I’d like to plug a DifferentialEquations.jl solution into Foo. What is the current recomme…

---

## [Common legend for subplots](https://discourse.julialang.org/t/common-legend-for-subplots/78079)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [March 20, 2022, 7:30pm UTC](https://discourse.julialang.org/t/common-legend-for-subplots/78079 "2022-03-20T19:30:30Z")

</div>

Hi all, I have a follow up question to this ongoing issue about using a common legend across subplots. In my use case, a vector of plots with an unknown length are combined into a grid of subplots. Subplots do not nece…

---

## [Methods not loaded from package in Pluto, works in REPL](https://discourse.julialang.org/t/methods-not-loaded-from-package-in-pluto-works-in-repl/78072)

<div class="topic-metadata">

**Author:** [@Jon\_Norberg](https://discourse.julialang.org/u/Jon_Norberg)\
**Replies:** 6\
**Last updated:** [March 20, 2022, 9:05am UTC](https://discourse.julialang.org/t/methods-not-loaded-from-package-in-pluto-works-in-repl/78072 "2022-03-20T09:05:36Z")

</div>

In the REPL I can type: using DataDrivenDiffEq sampler = DataSampler( Split(ratio = 0.8), Batcher(n = 10) ) but in Pluto the same give error: “UndefVarError: Split not defined” DataDrivenDiffEq is e…

---

## [Equivalent to plt.add\_axis in Plots.jl?](https://discourse.julialang.org/t/equivalent-to-plt-add-axis-in-plots-jl/78166)

<div class="topic-metadata">

**Author:** [@SamuelJosephs](https://discourse.julialang.org/u/SamuelJosephs)\
**Replies:** 0\
**Last updated:** [March 20, 2022, 3:37pm UTC](https://discourse.julialang.org/t/equivalent-to-plt-add-axis-in-plots-jl/78166 "2022-03-20T15:37:25Z")

</div>

I would like to have some plots with a subplot directly underneath, such as here: How would I go about positioning subplots to get two plots stacked on top of each other?

---

## [Suppression of Info messages on package load](https://discourse.julialang.org/t/suppression-of-info-messages-on-package-load/78169)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 0\
**Last updated:** [March 20, 2022, 5:03pm UTC](https://discourse.julialang.org/t/suppression-of-info-messages-on-package-load/78169 "2022-03-20T17:03:45Z")

</div>

I’m having trouble suppressing Info messages from an imported module—in this case, the MatrixDepot module, which spits out a few lines when imported. At the REPL, the following does what I want: module foo using Loggi…

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

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