# Latest

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

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

**Page:** 863

---

## [Avoiding allocations of small but non-trivial arrays (work array alternative?)](https://discourse.julialang.org/t/avoiding-allocations-of-small-but-non-trivial-arrays-work-array-alternative/90084)

<div class="topic-metadata">

**Author:** [@martin.d.maas](https://discourse.julialang.org/u/martin.d.maas)\
**Replies:** 38\
**Last updated:** [November 17, 2022, 12:52am UTC](https://discourse.julialang.org/t/avoiding-allocations-of-small-but-non-trivial-arrays-work-array-alternative/90084 "2022-11-17T00:52:01Z")

</div>

Hi everyone, I’m in the process of optimizing a portion of my code that has a general problem of too much memory allocation, and consequently poor threading efficiency and overall performance. This is a series of pretty…

---

## [Enum or struct?](https://discourse.julialang.org/t/enum-or-struct/90326)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 3\
**Last updated:** [November 17, 2022, 12:20am UTC](https://discourse.julialang.org/t/enum-or-struct/90326 "2022-11-17T00:20:43Z")

</div>

I would have chosen 1 but finance packages I’ve seen do something like 2. Is this better Julia ? more functional ? Option 1 - using enum @enum DayCount Actual360 Actual365 Year\_Fraction(d1::Date,d2::Date,dc::…

---

## [Is there a log scale range function?](https://discourse.julialang.org/t/is-there-a-log-scale-range-function/90354)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 4\
**Last updated:** [November 17, 2022, 12:09am UTC](https://discourse.julialang.org/t/is-there-a-log-scale-range-function/90354 "2022-11-17T00:09:31Z")

</div>

Is there a function like range() but the steps are multiplicative? Something like logrange(start,stepmul,length) = cumprod(\[start,(ones(length)\*stepmul)...\])

---

## [Gradient of 2D splines on irregular grid](https://discourse.julialang.org/t/gradient-of-2d-splines-on-irregular-grid/87575)

<div class="topic-metadata">

**Author:** [@Thomas\_Mikaelsen](https://discourse.julialang.org/u/Thomas_Mikaelsen)\
**Replies:** 2\
**Last updated:** [September 21, 2022, 2:29pm UTC](https://discourse.julialang.org/t/gradient-of-2d-splines-on-irregular-grid/87575 "2022-09-21T14:29:33Z")

</div>

Hello. I’m looking to (1) interpolate data where the x-axis is a log-spaced grid, the y-axis is a regular spaced grid and there is an array A(x,y) recording the function values in each point; and (2) take the gradient o…

---

## [Get WCSS (Within-Cluster Sum of Square) for optimal number of clusters in kmeans](https://discourse.julialang.org/t/get-wcss-within-cluster-sum-of-square-for-optimal-number-of-clusters-in-kmeans/90374)

<div class="topic-metadata">

**Author:** [@indymnv](https://discourse.julialang.org/u/indymnv)\
**Replies:** 0\
**Last updated:** [November 16, 2022, 11:34pm UTC](https://discourse.julialang.org/t/get-wcss-within-cluster-sum-of-square-for-optimal-number-of-clusters-in-kmeans/90374 "2022-11-16T23:34:40Z")

</div>

I want to use kmeans for a clustering project, and I need to get the optimal number of clusters with the elbow method, is there a way to get the WCSS in the implementation of Clustering.jl to build something like this …

---

## [Creating random \`MMatrix\` with large size is too slow](https://discourse.julialang.org/t/creating-random-mmatrix-with-large-size-is-too-slow/90323)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 5\
**Last updated:** [November 16, 2022, 3:57pm UTC](https://discourse.julialang.org/t/creating-random-mmatrix-with-large-size-is-too-slow/90323 "2022-11-16T15:57:52Z")

</div>

I want to create a StaticArrays.MMatrix with a somewhat medium or large size using rand, but it seems much slower than the plain Matrix and it took a long time for it to display: using StaticArray: MMatrix N = 10 m = r…

---

## [Calculating a pade approximant?](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 10\
**Last updated:** [November 16, 2022, 10:27pm UTC](https://discourse.julialang.org/t/calculating-a-pade-approximant/74060 "2022-11-16T22:27:03Z")

</div>

I’m assuming this must be hiding in a library somewhere… I found a pade appoximant evaluation in the Polynomials package, but it doesn’t look like there is any functionality for generating an approximant for an arbitrar…

---

## [Koka language: "FBIP: Functional but In-Place" and "Perceus memory management"](https://discourse.julialang.org/t/koka-language-fbip-functional-but-in-place-and-perceus-memory-management/90370)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 0\
**Last updated:** [November 16, 2022, 9:54pm UTC](https://discourse.julialang.org/t/koka-language-fbip-functional-but-in-place-and-perceus-memory-management/90370 "2022-11-16T21:54:21Z")

</div>

Seems like an interesting language, and maybe Julia can learn from it. First background (and seemingly interesting in of itself): Perceus Reference Counting Perceus is an advanced compilation method for reference cou…

---

## [CairoMakie - SVG export options](https://discourse.julialang.org/t/cairomakie-svg-export-options/90348)

<div class="topic-metadata">

**Author:** [@cripcate](https://discourse.julialang.org/u/cripcate)\
**Replies:** 7\
**Last updated:** [November 16, 2022, 9:02pm UTC](https://discourse.julialang.org/t/cairomakie-svg-export-options/90348 "2022-11-16T21:02:14Z")

</div>

Hi all, when saving Makie plots as svg, all text is converted to curves (i am using Arial font in case that matters). I would like to have the text as actual text instead so that it is easier to edit later on using oth…

---

## [Unexpected Behavior in LogisticClassifier MLJLinearModels](https://discourse.julialang.org/t/unexpected-behavior-in-logisticclassifier-mljlinearmodels/90013)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 7\
**Last updated:** [November 16, 2022, 8:37pm UTC](https://discourse.julialang.org/t/unexpected-behavior-in-logisticclassifier-mljlinearmodels/90013 "2022-11-16T20:37:52Z")

</div>

I am experiencing some odd behavior from the Logistic Classifier in MLJLinearModels.jl that maybe somebody can help me to understand. This MWE is not the research problem I am working on (because that is hard to boil dow…

---

## [Resources on Modelling SDE with Parameter Switches](https://discourse.julialang.org/t/resources-on-modelling-sde-with-parameter-switches/90137)

<div class="topic-metadata">

**Author:** [@dleather](https://discourse.julialang.org/u/dleather)\
**Replies:** 5\
**Last updated:** [November 16, 2022, 6:09pm UTC](https://discourse.julialang.org/t/resources-on-modelling-sde-with-parameter-switches/90137 "2022-11-16T18:09:26Z")

</div>

I’m exploring the SciMl ecosystem for the possibility of modelling something like an OU process where the drift, autoregressive, and volatility parameters are subject to discrete switches governed by a continuous-time Ma…

---

## [Print errors untruncated and full precision](https://discourse.julialang.org/t/print-errors-untruncated-and-full-precision/90358)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 4:24pm UTC](https://discourse.julialang.org/t/print-errors-untruncated-and-full-precision/90358 "2022-11-16T16:24:18Z")

</div>

For a error thrown in some source location outside my control, is it possible to print the error object with full precision, untruncated, so that I can save the values from the REPL? MWE: julia\> throw(DomainError(rand(…

---

## [\[DynamicPPL\] attempt to link a linked vi](https://discourse.julialang.org/t/dynamicppl-attempt-to-link-a-linked-vi/87572)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 4\
**Last updated:** [November 16, 2022, 4:23pm UTC](https://discourse.julialang.org/t/dynamicppl-attempt-to-link-a-linked-vi/87572 "2022-11-16T16:23:44Z")

</div>

I am getting this warning multiple times and the NUTS sampler doesn’t terminate. Can you please explain what is happening for an end user of Turing.jl? The warning message is not very helpful. How can I further debug th…

---

## [How could I draw a force field (arrows) using AlgebraOfGraphics?](https://discourse.julialang.org/t/how-could-i-draw-a-force-field-arrows-using-algebraofgraphics/90301)

<div class="topic-metadata">

**Author:** [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Replies:** 2\
**Last updated:** [November 16, 2022, 4:17pm UTC](https://discourse.julialang.org/t/how-could-i-draw-a-force-field-arrows-using-algebraofgraphics/90301 "2022-11-16T16:17:43Z")

</div>

Hello, I have a dataframe where two columns give the position and two columns give the arrow, I would like to use AoG to plot it. Thanks

---

## [Improving performance with @sync @async macros](https://discourse.julialang.org/t/improving-performance-with-sync-async-macros/82822)

<div class="topic-metadata">

**Author:** [@mauri5566](https://discourse.julialang.org/u/mauri5566)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 3:17pm UTC](https://discourse.julialang.org/t/improving-performance-with-sync-async-macros/82822 "2022-11-16T15:17:45Z")

</div>

I’m trying to parallelize this function by using @async @sync function INSR\_opt(f) function INSR0\_opt(seq) len = length(seq) res = seq\[end\] @inbounds @sync for i in range(len-2,step=-1,stop=0) @async res = f(\[…

---

## [Speed up very elemental functions](https://discourse.julialang.org/t/speed-up-very-elemental-functions/90342)

<div class="topic-metadata">

**Author:** [@Djoser42](https://discourse.julialang.org/u/Djoser42)\
**Replies:** 6\
**Last updated:** [November 16, 2022, 3:00pm UTC](https://discourse.julialang.org/t/speed-up-very-elemental-functions/90342 "2022-11-16T15:00:02Z")

</div>

Hey, I am still kind of new to Julia and I have a question about the performance and potential speed up of functions which are very elementar and/or “atomic” in my code, since they are used often and I figured that this …

---

## [Performance issues when working with dict](https://discourse.julialang.org/t/performance-issues-when-working-with-dict/74565)

<div class="topic-metadata">

**Author:** [@Deoch](https://discourse.julialang.org/u/Deoch)\
**Replies:** 11\
**Last updated:** [November 16, 2022, 2:05pm UTC](https://discourse.julialang.org/t/performance-issues-when-working-with-dict/74565 "2022-11-16T14:05:02Z")

</div>

Hello, I have some performance issues with dictionnaries, and I’m unsure about how to approach this problem. I profiled my code the other day, and I found that it spent a fair amount of time (that I wasn’t expecting) on…

---

## [Using Atomics in the vs code debugger](https://discourse.julialang.org/t/using-atomics-in-the-vs-code-debugger/90349)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 0\
**Last updated:** [November 16, 2022, 1:46pm UTC](https://discourse.julialang.org/t/using-atomics-in-the-vs-code-debugger/90349 "2022-11-16T13:46:23Z")

</div>

Hi all :slight\_smile: I tried to use a = Threads.Atomic{Int}(1) a\[\] = 2 # more stuff... in the vs code debugger. It stopped and didn’t want to continue at a\[\] = 2. Any idea why? Thanks Cheers

---

## [GLMakie: how to refresh Menu object when item is selected via code?](https://discourse.julialang.org/t/glmakie-how-to-refresh-menu-object-when-item-is-selected-via-code/90341)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 2\
**Last updated:** [November 16, 2022, 12:49pm UTC](https://discourse.julialang.org/t/glmakie-how-to-refresh-menu-object-when-item-is-selected-via-code/90341 "2022-11-16T12:49:27Z")

</div>

Consider the following code using GLMakie fig = Figure() b = Button(fig, label="Select ABC", textsize=20) m = Menu(fig, options=zip(\["A", "AB", "ABC"\], 1:3), default="A", textsize=20) panel = GridLayout() panel\[:v\] = \[…

---

## [Solver for differential algebraic equations with arbitrary implicit Runge Kutta method](https://discourse.julialang.org/t/solver-for-differential-algebraic-equations-with-arbitrary-implicit-runge-kutta-method/90310)

<div class="topic-metadata">

**Author:** [@Tri](https://discourse.julialang.org/u/Tri)\
**Replies:** 6\
**Last updated:** [November 16, 2022, 12:33pm UTC](https://discourse.julialang.org/t/solver-for-differential-algebraic-equations-with-arbitrary-implicit-runge-kutta-method/90310 "2022-11-16T12:33:21Z")

</div>

Hello As the title suggest, is there any package in Julia that enables solving differential algebraic equations DAEs with arbitrary implicit Runge Kutta (beyond the available ones) methods? Alternatively, is there any p…

---

## [Array of multiple differently sized vectors](https://discourse.julialang.org/t/array-of-multiple-differently-sized-vectors/90292)

<div class="topic-metadata">

**Author:** [@lukas\_r](https://discourse.julialang.org/u/lukas_r)\
**Replies:** 4\
**Last updated:** [November 16, 2022, 12:25pm UTC](https://discourse.julialang.org/t/array-of-multiple-differently-sized-vectors/90292 "2022-11-16T12:25:47Z")

</div>

I have an array of multiple vectors with different lengths. For further use I need them in one \[n, m\] Array. Is there a function to fill up the shorter vectors with missing/NaN?

---

## [Conda install julia](https://discourse.julialang.org/t/conda-install-julia/90335)

<div class="topic-metadata">

**Author:** [@Ludovic\_Dumoulin](https://discourse.julialang.org/u/Ludovic_Dumoulin)\
**Replies:** 3\
**Last updated:** [November 16, 2022, 12:08pm UTC](https://discourse.julialang.org/t/conda-install-julia/90335 "2022-11-16T12:08:52Z")

</div>

Hey, I would like to install julia using conda on ubuntu 22.04 64bits but I get something that I don’t understand. I typed sudo conda install -c conda-forge julia end get Collecting package metadata (current\_repo…

---

## [Interface: MethodError: no method matching](https://discourse.julialang.org/t/interface-methoderror-no-method-matching/90325)

<div class="topic-metadata">

**Author:** [@xuanquansheng](https://discourse.julialang.org/u/xuanquansheng)\
**Replies:** 9\
**Last updated:** [November 16, 2022, 10:53am UTC](https://discourse.julialang.org/t/interface-methoderror-no-method-matching/90325 "2022-11-16T10:53:39Z")

</div>

I’m reading the book Hands-on-Design-Patterns-and-Best-Practices-with-Julia in Vehicle.jl module Vehicle # ------------------------------------------------------------------ # 1. Export/Imports # ---------------------…

---

## [Structures and TypeVar](https://discourse.julialang.org/t/structures-and-typevar/71518)

<div class="topic-metadata">

**Author:** [@m4ltee](https://discourse.julialang.org/u/m4ltee)\
**Replies:** 5\
**Last updated:** [November 16, 2022, 10:04am UTC](https://discourse.julialang.org/t/structures-and-typevar/71518 "2022-11-16T10:04:17Z")

</div>

Hi, I want to create a structure like: struct Lattice{D, L, D1} # number of sites per dimension L::NTuple{D, Int} ... sites::Array{Site{L}, D1} end where D is just the dimension of the lattice and D1 is…

---

## [Unintuitive behavior for iterator of views of a vector](https://discourse.julialang.org/t/unintuitive-behavior-for-iterator-of-views-of-a-vector/90334)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 10:00am UTC](https://discourse.julialang.org/t/unintuitive-behavior-for-iterator-of-views-of-a-vector/90334 "2022-11-16T10:00:57Z")

</div>

We are creating a simple iterator whose goal is to generate views of a given vector (something like a sliding window). However, the Julia behavior on this object is rather unituitive to me, with weird type instabilities …

---

## [How to pick random values from an \`Enum\` type?](https://discourse.julialang.org/t/how-to-pick-random-values-from-an-enum-type/90330)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 8:11am UTC](https://discourse.julialang.org/t/how-to-pick-random-values-from-an-enum-type/90330 "2022-11-16T08:11:44Z")

</div>

For example, define type Ball: @enum Ball b=1 r=-1 julia\> rand(Ball, 10) ERROR: ArgumentError: Sampler for this object is not defined Stacktrace: \[1\] Random.Sampler(#unused#::Type{Random.TaskLocalRNG}, sp::Random.Samp…

---

## [What is the default font on Julia Plot (and how do I see what font is being used?)](https://discourse.julialang.org/t/what-is-the-default-font-on-julia-plot-and-how-do-i-see-what-font-is-being-used/88280)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 4\
**Last updated:** [November 16, 2022, 6:47am UTC](https://discourse.julialang.org/t/what-is-the-default-font-on-julia-plot-and-how-do-i-see-what-font-is-being-used/88280 "2022-11-16T06:47:52Z")

</div>

What is the default font on Julia Plot (and how do I see what font is being used?)

---

## [Type constraint in struct definition](https://discourse.julialang.org/t/type-constraint-in-struct-definition/90328)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 0\
**Last updated:** [November 16, 2022, 6:29am UTC](https://discourse.julialang.org/t/type-constraint-in-struct-definition/90328 "2022-11-16T06:29:00Z")

</div>

I want to do something like the following: abstract type Foo{V, S} end # Does not work but the idea is that I want to constrain T and # use whatever U that makes the constraint in the # parameterization of the super …

---

## [Fix Manifest-file warnings for Pluto notebooks](https://discourse.julialang.org/t/fix-manifest-file-warnings-for-pluto-notebooks/89050)

<div class="topic-metadata">

**Author:** [@DOT](https://discourse.julialang.org/u/DOT)\
**Replies:** 1\
**Last updated:** [November 16, 2022, 6:18am UTC](https://discourse.julialang.org/t/fix-manifest-file-warnings-for-pluto-notebooks/89050 "2022-11-16T06:18:46Z")

</div>

Hi, When loading a certain Pluto notebook (written beginning 2022), I get the following two warning messages. julia\> Pluto.run() \[...\] Warning: The active manifest file at \[...\] has an old format that is being maintain…

---

## [How to debug-break in unit test](https://discourse.julialang.org/t/how-to-debug-break-in-unit-test/58717)

<div class="topic-metadata">

**Author:** [@asyrov](https://discourse.julialang.org/u/asyrov)\
**Replies:** 10\
**Last updated:** [November 16, 2022, 6:02am UTC](https://discourse.julialang.org/t/how-to-debug-break-in-unit-test/58717 "2022-11-16T06:02:24Z")

</div>

Can anyone suggest how to debug break in unit test. My unit tests use standard Test.jl with @testset, @test macro and I start them from VS Code as ‘\] test MyPackage’. Thank you very much,

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

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