# Latest

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

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

**Page:** 945

---

## [Set up Julia for a novice](https://discourse.julialang.org/t/set-up-julia-for-a-novice/86214)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 8\
**Last updated:** [August 23, 2022, 8:13pm UTC](https://discourse.julialang.org/t/set-up-julia-for-a-novice/86214 "2022-08-23T20:13:50Z")

</div>

I’d like to write a script that installs a few packages, does using to trigger compilation, and replies yes to all questions. Is there a way to do this? What I’d like to do is something like for pack in \[FFTW, SparseSui…

---

## [Change line length in legend with Plots](https://discourse.julialang.org/t/change-line-length-in-legend-with-plots/86219)

<div class="topic-metadata">

**Author:** [@thompsonmj](https://discourse.julialang.org/u/thompsonmj)\
**Replies:** 1\
**Last updated:** [August 23, 2022, 7:43pm UTC](https://discourse.julialang.org/t/change-line-length-in-legend-with-plots/86219 "2022-08-23T19:43:49Z")

</div>

Can the length of the example line in the legend be changed? I’m particularly interested in pyplot().

---

## [Avoiding allocation when accessing fields of a StructArray inside a Struct](https://discourse.julialang.org/t/avoiding-allocation-when-accessing-fields-of-a-structarray-inside-a-struct/86168)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 7:42pm UTC](https://discourse.julialang.org/t/avoiding-allocation-when-accessing-fields-of-a-structarray-inside-a-struct/86168 "2022-08-23T19:42:17Z")

</div>

Let me start with the MWE using StructArrays using BenchmarkTools # the struct to be converted to StructArray struct Foo1 a::Float64 b::Float64 end a = \[1.0, 2.0\] b = \[3.0, 4.0\] foo1 = StructArray{Foo1}(a=a, …

---

## [Installing from a subdirectory of Github](https://discourse.julialang.org/t/installing-from-a-subdirectory-of-github/25548)

<div class="topic-metadata">

**Author:** [@pistacliffcho](https://discourse.julialang.org/u/pistacliffcho)\
**Replies:** 6\
**Last updated:** [August 23, 2022, 7:39pm UTC](https://discourse.julialang.org/t/installing-from-a-subdirectory-of-github/25548 "2022-08-23T19:39:57Z")

</div>

I have a Julia package on GitHub for which I’d like to include installation instructions. However, the Julia code is in a subdirectory of the repo as this repo includes both a Julia and R version of the code. I can’t fi…

---

## [Sparse syrk() routine using Transducers.jl](https://discourse.julialang.org/t/sparse-syrk-routine-using-transducers-jl/86218)

<div class="topic-metadata">

**Author:** [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Replies:** 0\
**Last updated:** [August 23, 2022, 7:09pm UTC](https://discourse.julialang.org/t/sparse-syrk-routine-using-transducers-jl/86218 "2022-08-23T19:09:07Z")

</div>

Hi, I implemented a sparse syrk routine to see if I could get something faster than the naive implementation: using SparseArrays using LinearAlgebra using Transducers using Combinatorics naive\_spsyrk(s) = Symmetric(s …

---

## [Initializing Array of Arrays with undef gives UndefRefError?](https://discourse.julialang.org/t/initializing-array-of-arrays-with-undef-gives-undefreferror/53266)

<div class="topic-metadata">

**Author:** [@cosmia](https://discourse.julialang.org/u/cosmia)\
**Replies:** 15\
**Last updated:** [August 23, 2022, 5:55pm UTC](https://discourse.julialang.org/t/initializing-array-of-arrays-with-undef-gives-undefreferror/53266 "2022-08-23T17:55:02Z")

</div>

Hi all, I am initializing an Array of Arrays with undef. Why does it give me an UndefRefError when accessing it, whereas an Array with undef does not? Also, did some behavior change? I seem to remember initializing Arra…

---

## [Generating two vector of same sum](https://discourse.julialang.org/t/generating-two-vector-of-same-sum/86147)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 14\
**Last updated:** [August 23, 2022, 5:38pm UTC](https://discourse.julialang.org/t/generating-two-vector-of-same-sum/86147 "2022-08-23T17:38:08Z")

</div>

Dear all, I need to generate two vectors (not the same length) whose sum is the same. I have the first one: a = rand(1000:2000,5) 5-element Array{Int64,1}: 1404 1438 1529 1039 1071 Supose that I want a another ve…

---

## [Quarto from RStudio](https://discourse.julialang.org/t/quarto-from-rstudio/69532)

<div class="topic-metadata">

**Author:** [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 4:29pm UTC](https://discourse.julialang.org/t/quarto-from-rstudio/69532 "2022-08-23T16:29:18Z")

</div>

Check this out from the RStudio people. A language agnostic Markdown based published system using Pandoc: https://quarto.org/ I haven’t tried it yet so I’m not sure how different it is from Weave.jl

---

## [Inline julia.magic kills Jupyter notebook (only on Linux) \[pyjulia\]](https://discourse.julialang.org/t/inline-julia-magic-kills-jupyter-notebook-only-on-linux-pyjulia/86208)

<div class="topic-metadata">

**Author:** [@apigott](https://discourse.julialang.org/u/apigott)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 4:25pm UTC](https://discourse.julialang.org/t/inline-julia-magic-kills-jupyter-notebook-only-on-linux-pyjulia/86208 "2022-08-23T16:25:01Z")

</div>

I’ve noticed that Julia’s performance seems much better on my Linux partition than my Windows one (same GPU, Windows runs on my SSD while Linux is on and HDD). I was hoping to work on a project I have that’s partially wr…

---

## [Where can I download Juliaup? I have no Windows Store access](https://discourse.julialang.org/t/where-can-i-download-juliaup-i-have-no-windows-store-access/86207)

<div class="topic-metadata">

**Author:** [@RichS](https://discourse.julialang.org/u/RichS)\
**Replies:** 4\
**Last updated:** [August 23, 2022, 4:23pm UTC](https://discourse.julialang.org/t/where-can-i-download-juliaup-i-have-no-windows-store-access/86207 "2022-08-23T16:23:33Z")

</div>

Is there a download location for Juliaup for the Windows platform other than the Windows store? My workplace restricts Windows Store access, so I can’t get it there. Thanks!

---

## [Ttr lyapunovspectrum DynamicalSystems.jl](https://discourse.julialang.org/t/ttr-lyapunovspectrum-dynamicalsystems-jl/86206)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 4:21pm UTC](https://discourse.julialang.org/t/ttr-lyapunovspectrum-dynamicalsystems-jl/86206 "2022-08-23T16:21:45Z")

</div>

I have code: lyapunovspectrum(ds, 300000.0; Ttr = 200000.0, diffeq = (alg = Vern9(), abstol = 1e-11, reltol = 1e-11, dense = false, maxiters = 10000…

---

## [Data Scientist in Logistics](https://discourse.julialang.org/t/data-scientist-in-logistics/86210)

<div class="topic-metadata">

**Author:** [@Clark](https://discourse.julialang.org/u/Clark)\
**Replies:** 0\
**Last updated:** [August 23, 2022, 4:18pm UTC](https://discourse.julialang.org/t/data-scientist-in-logistics/86210 "2022-08-23T16:18:49Z")

</div>

We are looking for a julialang data scientist to join us at CDL1000, a 3PL (third party logistics) company in Chicago. Work will be mostly onsite near downtown Chicago. Preferences: Experience in Logistics Some exper…

---

## [Unexpected result for \`diff\` over DateTime range](https://discourse.julialang.org/t/unexpected-result-for-diff-over-datetime-range/86203)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 1\
**Last updated:** [August 23, 2022, 3:07pm UTC](https://discourse.julialang.org/t/unexpected-result-for-diff-over-datetime-range/86203 "2022-08-23T15:07:08Z")

</div>

Consider the following: julia\> range = Dates.DateTime(2019):Dates.Year(1):Dates.DateTime(2020) Dates.DateTime("2019-01-01T00:00:00"):Dates.Year(1):Dates.DateTime("2020-01-01T00:00:00") julia\> diff(range) 1-element Vect…

---

## [\`show\` and \`displaysize\`](https://discourse.julialang.org/t/show-and-displaysize/86126)

<div class="topic-metadata">

**Author:** [@etienne\_dg](https://discourse.julialang.org/u/etienne_dg)\
**Replies:** 8\
**Last updated:** [August 23, 2022, 2:57pm UTC](https://discourse.julialang.org/t/show-and-displaysize/86126 "2022-08-23T14:57:17Z")

</div>

Why do show(stdout, "text/plain", x) respect the displaysize in one case but not the other ? Is there a way to gather the representation respecting displaysize as a string, using sprint for example? julia\> displaysize(s…

---

## [Automatic differentiation of spline functions](https://discourse.julialang.org/t/automatic-differentiation-of-spline-functions/86182)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 4\
**Last updated:** [August 23, 2022, 2:39pm UTC](https://discourse.julialang.org/t/automatic-differentiation-of-spline-functions/86182 "2022-08-23T14:39:56Z")

</div>

Splines are a common fitting tool and there are a number of versions in Julia, but I can’t seem to find any versions which are auto-differentiable (i.e., for use in JuMP, NLopt, ODE’s, Integration, etc.). \[I’m guessing …

---

## [Why I can't set what parameters are mutable explicitly?](https://discourse.julialang.org/t/why-i-cant-set-what-parameters-are-mutable-explicitly/86091)

<div class="topic-metadata">

**Author:** [@Dan\_Micsa](https://discourse.julialang.org/u/Dan_Micsa)\
**Replies:** 169\
**Last updated:** [August 23, 2022, 1:28pm UTC](https://discourse.julialang.org/t/why-i-cant-set-what-parameters-are-mutable-explicitly/86091 "2022-08-23T13:28:36Z")

</div>

I still don’t understand why parameters can be silently changed in function calls and why there is not a const or mutable like keyword to warn us if this is happening? Running this example will silently change the conte…

---

## [\[Shout-out\]: A shout-out for more shout-outs](https://discourse.julialang.org/t/shout-out-a-shout-out-for-more-shout-outs/81178)

<div class="topic-metadata">

**Author:** [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Replies:** 7\
**Last updated:** [August 23, 2022, 1:02pm UTC](https://discourse.julialang.org/t/shout-out-a-shout-out-for-more-shout-outs/81178 "2022-08-23T13:02:34Z")

</div>

Tired of reading about Julia not living up expectations? Then let’s create some more posts here about those times a person or package community exceeded your expectations! :rocket: I noticed that the tag appreciation ha…

---

## [Replicate @tturbo performance](https://discourse.julialang.org/t/replicate-tturbo-performance/86146)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 23\
**Last updated:** [August 23, 2022, 12:53pm UTC](https://discourse.julialang.org/t/replicate-tturbo-performance/86146 "2022-08-23T12:53:40Z")

</div>

Hi, Is there an easy way to replicate the performance of @tturbo but using just base Julia? The following Julia code might be used if needed for this discussion: function myminmax(x) a = b = x\[1\] @tturbo for i in…

---

## [Flux GPU Error with Zygote](https://discourse.julialang.org/t/flux-gpu-error-with-zygote/86192)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 2\
**Last updated:** [August 23, 2022, 12:43pm UTC](https://discourse.julialang.org/t/flux-gpu-error-with-zygote/86192 "2022-08-23T12:43:38Z")

</div>

Hello, I want to build an encoder for text classification model. But some how I get errors when I call Flux.train! method. For the MWE: # Since this is a text based model, an embedding matrix Is needed - this can be p…

---

## [Latest recommendations for global optimization](https://discourse.julialang.org/t/latest-recommendations-for-global-optimization/17718)

<div class="topic-metadata">

**Author:** [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Replies:** 92\
**Last updated:** [August 23, 2022, 12:29pm UTC](https://discourse.julialang.org/t/latest-recommendations-for-global-optimization/17718 "2022-08-23T12:29:08Z")

</div>

What are people’s recommendations for a global optimizer? I’m trying to do simulated method of moments (choosing a set of parameters for an economic model to minimise the distance between model predictions and data) and …

---

## [Inconsistent size of the ODE solution object for Turing inference](https://discourse.julialang.org/t/inconsistent-size-of-the-ode-solution-object-for-turing-inference/86080)

<div class="topic-metadata">

**Author:** [@vembha](https://discourse.julialang.org/u/vembha)\
**Replies:** 5\
**Last updated:** [August 23, 2022, 11:29am UTC](https://discourse.julialang.org/t/inconsistent-size-of-the-ode-solution-object-for-turing-inference/86080 "2022-08-23T11:29:03Z")

</div>

Hello people, I’ve been using Turing to infer parameters of an ODE model for close to a year. But since recently, I am facing the following non-reproducible error from the code, which I haven’t encountered previously: S…

---

## [Why 'else + condition' does not work but is not returning an error](https://discourse.julialang.org/t/why-else-condition-does-not-work-but-is-not-returning-an-error/86185)

<div class="topic-metadata">

**Author:** [@aTrotier](https://discourse.julialang.org/u/aTrotier)\
**Replies:** 4\
**Last updated:** [August 23, 2022, 11:28am UTC](https://discourse.julialang.org/t/why-else-condition-does-not-work-but-is-not-returning-an-error/86185 "2022-08-23T11:28:15Z")

</div>

Hi, Is there a reason I didn’t get en error when I put a condition after an else ? (which is not taken into account) a = true b = false if a @info "1" else b @info "2" end Thanks

---

## [New MIT course: Introduction to computational thinking for real-world problems](https://discourse.julialang.org/t/new-mit-course-introduction-to-computational-thinking-for-real-world-problems/45909)

<div class="topic-metadata">

**Author:** [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Replies:** 15\
**Last updated:** [August 23, 2022, 11:23am UTC](https://discourse.julialang.org/t/new-mit-course-introduction-to-computational-thinking-for-real-world-problems/45909 "2022-08-23T11:23:01Z")

</div>

We’re happy to announce a new course on Computational Thinking with Julia, co-taught by Alan Edelman, Grant Sanderson (of 3Blue1Brown), James Schloss and myself: The first video lectures are are now up on YouTube at …

---

## [\`map\` vs \`broadcast\`: should one prefer \`map\` if these are equivalent?](https://discourse.julialang.org/t/map-vs-broadcast-should-one-prefer-map-if-these-are-equivalent/86118)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 10:09am UTC](https://discourse.julialang.org/t/map-vs-broadcast-should-one-prefer-map-if-these-are-equivalent/86118 "2022-08-23T10:09:26Z")

</div>

I’m referring to the simplest case where map and broadcast are equivalent, that is – given a vector/tuple, I want to map a function over it to obtain another container. broadcast seems a natural choice here, and map seem…

---

## [Issue with comparing two vectors with different sizes](https://discourse.julialang.org/t/issue-with-comparing-two-vectors-with-different-sizes/86177)

<div class="topic-metadata">

**Author:** [@ashefa](https://discourse.julialang.org/u/ashefa)\
**Replies:** 7\
**Last updated:** [August 23, 2022, 10:01am UTC](https://discourse.julialang.org/t/issue-with-comparing-two-vectors-with-different-sizes/86177 "2022-08-23T10:01:23Z")

</div>

I am wondering how I can get results for R = \[2, 2\] D = \[1, 3\] J = \[1, 1\] P\[2\] = \[1 3; 2 3; 6 3; 1 4; 2 4; 6 4; 1 5; 2 5; 6 5; 1 6; 2 6\] P\[2\]\[:,2\] .== collect(R\[2\]+1:R\[2\]+D\[2\]) similar to R = \[2, 2\] D = \[1, 3\] J = \[1,…

---

## [Agents.jl : how to smartly implement Triangular and Hexagonal Grids](https://discourse.julialang.org/t/agents-jl-how-to-smartly-implement-triangular-and-hexagonal-grids/86106)

<div class="topic-metadata">

**Author:** [@Rouzaire](https://discourse.julialang.org/u/Rouzaire)\
**Replies:** 3\
**Last updated:** [August 23, 2022, 9:19am UTC](https://discourse.julialang.org/t/agents-jl-how-to-smartly-implement-triangular-and-hexagonal-grids/86106 "2022-08-23T09:19:30Z")

</div>

Hello everyone, First of all, I would like to thank the devs for the great piece of work that is Agents.jl . In the world of two dimensional lattice, the square one is ubiquitous in numerical simulations. In this packa…

---

## [ForwardDiff.jl : ERROR: LoadError: MethodError: convert(...) is ambiguous](https://discourse.julialang.org/t/forwarddiff-jl-error-loaderror-methoderror-convert-is-ambiguous/86132)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 4\
**Last updated:** [August 23, 2022, 7:10am UTC](https://discourse.julialang.org/t/forwarddiff-jl-error-loaderror-methoderror-convert-is-ambiguous/86132 "2022-08-23T07:10:50Z")

</div>

My original intention was to use Zygote to achieve the gradient of gradients, but there were a lot of problems with twice automatic differentiation in reverse mode. So I used Zygote.hessian to achieve the mixing forward…

---

## [ReverseDiff.jl interference with Distributed.jl (GitHub action mysteriously starts breaking on Windows)](https://discourse.julialang.org/t/reversediff-jl-interference-with-distributed-jl-github-action-mysteriously-starts-breaking-on-windows/86048)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 21\
**Last updated:** [August 22, 2022, 7:29pm UTC](https://discourse.julialang.org/t/reversediff-jl-interference-with-distributed-jl-github-action-mysteriously-starts-breaking-on-windows/86048 "2022-08-22T19:29:48Z")

</div>

Something strange is happening to the Windows GitHub actions for SymbolicRegression.jl - which is either caused by or manifesting in a Distributed.jl error The action was working 9 days ago, for all operating systems: …

---

## [Juliaup gets stuck at v1.6.12 for MacOS](https://discourse.julialang.org/t/juliaup-gets-stuck-at-v1-6-12-for-macos/85991)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 9\
**Last updated:** [August 23, 2022, 5:06am UTC](https://discourse.julialang.org/t/juliaup-gets-stuck-at-v1-6-12-for-macos/85991 "2022-08-23T05:06:29Z")

</div>

When I use brew to upgrade juliaup version, it shows $ brew upgrade juliaup Warning: juliaup 1.6.12 already installed For 1.6.12, I only get 1.8-rc3, neither 1.8-rc4 nor the 1.8 release. Do I have to upgrade juliaup to…

---

## [TOML: using to\_toml option may produce incorrect TOML](https://discourse.julialang.org/t/toml-using-to-toml-option-may-produce-incorrect-toml/86157)

<div class="topic-metadata">

**Author:** [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Replies:** 1\
**Last updated:** [August 23, 2022, 3:52am UTC](https://discourse.julialang.org/t/toml-using-to-toml-option-may-produce-incorrect-toml/86157 "2022-08-23T03:52:01Z")

</div>

This is a simplified example to illustrate the issue I’m seeing with using the TOML writer with the to\_toml option for writing a custom type. It seems that when using the to\_toml option, TOML print doesn’t print the co…

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

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