# Latest

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

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

**Page:** 525

---

## [Why is functional style so much slower here?](https://discourse.julialang.org/t/why-is-functional-style-so-much-slower-here/107657)

<div class="topic-metadata">

**Author:** [@glebm](https://discourse.julialang.org/u/glebm)\
**Replies:** 8\
**Last updated:** [December 22, 2023, 6:19pm UTC](https://discourse.julialang.org/t/why-is-functional-style-so-much-slower-here/107657 "2023-12-22T18:19:45Z")

</div>

I wrote my first program in Julia today, which is a solution to Advent of Code day 15. I wrote it in a functional style at first and was very surprised with how slow it ran. I narrowed it down to the score functions. H…

---

## [How to use \`@kwdef\` with parametric types and inner constructors](https://discourse.julialang.org/t/how-to-use-kwdef-with-parametric-types-and-inner-constructors/107948)

<div class="topic-metadata">

**Author:** [@Maurizio\_Tomasi](https://discourse.julialang.org/u/Maurizio_Tomasi)\
**Replies:** 2\
**Last updated:** [December 22, 2023, 5:30pm UTC](https://discourse.julialang.org/t/how-to-use-kwdef-with-parametric-types-and-inner-constructors/107948 "2023-12-22T17:30:38Z")

</div>

I am having problems declaring a parametric structure with @kwdef and an inner constructor to perform some checks. My struct has many parameters and complicated checks, but this simple example is enough to explain my pr…

---

## [Smoothing probability distribution output of network](https://discourse.julialang.org/t/smoothing-probability-distribution-output-of-network/107934)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 3\
**Last updated:** [December 22, 2023, 4:17pm UTC](https://discourse.julialang.org/t/smoothing-probability-distribution-output-of-network/107934 "2023-12-22T16:17:57Z")

</div>

I’m training a neural network with flux and outputting a probability distribution (ie. probability bins for the value of a continuous variable). The output layer is outputting the values for the bins which I then normali…

---

## [Extracting raw data from qplot](https://discourse.julialang.org/t/extracting-raw-data-from-qplot/107671)

<div class="topic-metadata">

**Author:** [@alex123](https://discourse.julialang.org/u/alex123)\
**Replies:** 2\
**Last updated:** [December 22, 2023, 2:55pm UTC](https://discourse.julialang.org/t/extracting-raw-data-from-qplot/107671 "2023-12-22T14:55:16Z")

</div>

Hi, I am using Quantica for finding the band structure of twisted bilayer graphene. Here is the part of my code that finds the hamiltonian and plots the band structure: b = hamiltonian(tbg, model) |\> bands(subdiv((0, 2…

---

## [Why is relpath("x","y") == "../x"?](https://discourse.julialang.org/t/why-is-relpath-x-y-x/107932)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 5\
**Last updated:** [December 22, 2023, 2:26pm UTC](https://discourse.julialang.org/t/why-is-relpath-x-y-x/107932 "2023-12-22T14:26:21Z")

</div>

julia\> relpath("tatooine", "naboo") "../tatooine" The docs say relpath(path::AbstractString, startpath::AbstractString = ".") -\> AbstractString Return a relative filepath to path either from the current directory or …

---

## [Some functionalities for vscode extension](https://discourse.julialang.org/t/some-functionalities-for-vscode-extension/107895)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 6\
**Last updated:** [December 22, 2023, 2:18pm UTC](https://discourse.julialang.org/t/some-functionalities-for-vscode-extension/107895 "2023-12-22T14:18:08Z")

</div>

Hi all, We now use a lot Julia and VScode for teaching. I’d like to ask about 2 things: while we mostly use notebooks, students often need to open the REPL (e.g. to install packages) or other tasks. They always ask …

---

## [A package for arbitrary array indices?](https://discourse.julialang.org/t/a-package-for-arbitrary-array-indices/107848)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [December 22, 2023, 1:22am UTC](https://discourse.julialang.org/t/a-package-for-arbitrary-array-indices/107848 "2023-12-22T01:22:25Z")

</div>

Hello, I am a looking for a package that allows me to dynamically change the indexing of an array. I’m aware of OffsetArrays but this is not what I need. Say I have an 8 by 8 symmetric matrix A. I have an algorithm tha…

---

## [Latex parens sizing](https://discourse.julialang.org/t/latex-parens-sizing/107940)

<div class="topic-metadata">

**Author:** [@Dan](https://discourse.julialang.org/u/Dan)\
**Replies:** 2\
**Last updated:** [December 19, 2023, 8:22am UTC](https://discourse.julialang.org/t/latex-parens-sizing/107940 "2023-12-19T08:22:25Z")

</div>

Satellite stability aside! I’m concerned that the open curly brace and the close curly brace in the typeset equation are not the same size. Is this right, LaTeX people?

---

## [Broken link in Help file](https://discourse.julialang.org/t/broken-link-in-help-file/107938)

<div class="topic-metadata">

**Author:** [@vsoler](https://discourse.julialang.org/u/vsoler)\
**Replies:** 1\
**Last updated:** [December 22, 2023, 9:15am UTC](https://discourse.julialang.org/t/broken-link-in-help-file/107938 "2023-12-22T09:15:11Z")

</div>

I just asked for help on the sort! command. I’m using Jupyter notebooks. On the help provided, there is a link to “Sorting Algorithms” that points to nowhere. Where can I report this problem?

---

## [Not sure where function is going wrong](https://discourse.julialang.org/t/not-sure-where-function-is-going-wrong/107881)

<div class="topic-metadata">

**Author:** [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Replies:** 8\
**Last updated:** [December 22, 2023, 7:23am UTC](https://discourse.julialang.org/t/not-sure-where-function-is-going-wrong/107881 "2023-12-22T07:23:16Z")

</div>

Here is my code: using CUDA, Optimization, OptimizationNLopt function calc(x0,p) a = x0\[1:293\] # Convert tau to a CUDA array b = x0\[293+1:2\*293\] # Convert q0 to a CUDA array c = CUDA.zeros(293) # Create…

---

## [Strange type instability](https://discourse.julialang.org/t/strange-type-instability/107912)

<div class="topic-metadata">

**Author:** [@abraunst](https://discourse.julialang.org/u/abraunst)\
**Replies:** 2\
**Last updated:** [December 22, 2023, 7:11am UTC](https://discourse.julialang.org/t/strange-type-instability/107912 "2023-12-22T07:11:09Z")

</div>

I’m encountering a strange type instability that I could distill to the following minimal code: function unstable(rv,x0) x1=copy(x0) for t in 1:10 p::Int = prod(x0\[j\] for j in rv; init=1) x1\[1\] =…

---

## [Windows is slower than WSL2 in loading GR, Preferences, Julia 1.9.0-beta2](https://discourse.julialang.org/t/windows-is-slower-than-wsl2-in-loading-gr-preferences-julia-1-9-0-beta2/92623)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 8\
**Last updated:** [December 22, 2023, 4:29am UTC](https://discourse.julialang.org/t/windows-is-slower-than-wsl2-in-loading-gr-preferences-julia-1-9-0-beta2/92623 "2023-12-22T04:29:32Z")

</div>

I recently installed WSL 2. I noticed that @time\_imports reports faster import times for Preferences and GR under WSL2 than under Windows. The loading time for Preferences.jl is appears to be 10x worse. # WSL 2 julia\> @…

---

## [Caching Bytecode/Binary for Dynamic Modules in Embedded Context](https://discourse.julialang.org/t/caching-bytecode-binary-for-dynamic-modules-in-embedded-context/107927)

<div class="topic-metadata">

**Author:** [@chayden](https://discourse.julialang.org/u/chayden)\
**Replies:** 2\
**Last updated:** [December 22, 2023, 3:09am UTC](https://discourse.julialang.org/t/caching-bytecode-binary-for-dynamic-modules-in-embedded-context/107927 "2023-12-22T03:09:09Z")

</div>

Suppose I have embedded Julia in a C++ application so I can write plugins/extensions in Julia. The form of each plugin is (more or less) the following. module \<dynamically-generated\> import Main.bindings # Julia bindin…

---

## [Typed Units instead of parameterized (Unitful) or exponent-tracking (DynamicQuantities)?](https://discourse.julialang.org/t/typed-units-instead-of-parameterized-unitful-or-exponent-tracking-dynamicquantities/105735)

<div class="topic-metadata">

**Author:** [@bcon](https://discourse.julialang.org/u/bcon)\
**Replies:** 8\
**Last updated:** [December 22, 2023, 1:56am UTC](https://discourse.julialang.org/t/typed-units-instead-of-parameterized-unitful-or-exponent-tracking-dynamicquantities/105735 "2023-12-22T01:56:53Z")

</div>

Adding units to a package greatly obfuscates error messages, slowing development. If you share this annoyance I’d appreciate your thoughts on a package, ‘UnitTypes’, that simply treats units as types. The package would …

---

## [How to completely reinstall Julia on Mac](https://discourse.julialang.org/t/how-to-completely-reinstall-julia-on-mac/107924)

<div class="topic-metadata">

**Author:** [@Midez](https://discourse.julialang.org/u/Midez)\
**Replies:** 3\
**Last updated:** [December 22, 2023, 1:52am UTC](https://discourse.julialang.org/t/how-to-completely-reinstall-julia-on-mac/107924 "2023-12-22T01:52:30Z")

</div>

Hello everyone, somehow I managed to render Julia completely useless on My Mac (it happened when I tried to update Julia to a newer version via this thread) Now every time I try to work with Julia I get the error messa…

---

## [Extensions and Plots.jl Finding Broken pre-compiles](https://discourse.julialang.org/t/extensions-and-plots-jl-finding-broken-pre-compiles/107920)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 1\
**Last updated:** [December 22, 2023, 1:18am UTC](https://discourse.julialang.org/t/extensions-and-plots-jl-finding-broken-pre-compiles/107920 "2023-12-22T01:18:09Z")

</div>

Trying to update my code to make it super cool. Trying to add in Package extensions for some of the plot scripts so I can divorce calculation code from the plotting packages. I have a mix of Plots and Makie. Any ideas…

---

## [Is there a way to repeatedly call a function](https://discourse.julialang.org/t/is-there-a-way-to-repeatedly-call-a-function/107762)

<div class="topic-metadata">

**Author:** [@Zentrik](https://discourse.julialang.org/u/Zentrik)\
**Replies:** 12\
**Last updated:** [December 21, 2023, 10:41pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-repeatedly-call-a-function/107762 "2023-12-21T22:41:31Z")

</div>

Say I have a function f, I want to call it repeatedly n times. I.e. for n = 3, I want f ∘ f ∘ f. Is there a nice notation to do this for n not known at compile time, ideally something like f^n.

---

## [UndefVarError: \`savefig\` not defined](https://discourse.julialang.org/t/undefvarerror-savefig-not-defined/107928)

<div class="topic-metadata">

**Author:** [@Midez](https://discourse.julialang.org/u/Midez)\
**Replies:** 5\
**Last updated:** [December 21, 2023, 10:30pm UTC](https://discourse.julialang.org/t/undefvarerror-savefig-not-defined/107928 "2023-12-21T22:30:58Z")

</div>

Hello everyone, After a long run and installing the newest version of Julia (1.9) I still get a frustrating error (that I have written in the title) when trying to save a figure Here is my plain code (minimal example) …

---

## [Why do I get this error when ever I add a new package?](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921)

<div class="topic-metadata">

**Author:** [@Sabe](https://discourse.julialang.org/u/Sabe)\
**Replies:** 8\
**Last updated:** [December 21, 2023, 9:40pm UTC](https://discourse.julialang.org/t/why-do-i-get-this-error-when-ever-i-add-a-new-package/107921 "2023-12-21T21:40:14Z")

</div>

ok so whenever I add a new package to a project no matter what it is when I try to run it I get this ERROR: LoadError: ArgumentError: Package X not found in current path. even though I did \] add X right now I am using sd…

---

## [Good package to smooth outliers?](https://discourse.julialang.org/t/good-package-to-smooth-outliers/107919)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 2\
**Last updated:** [December 21, 2023, 8:40pm UTC](https://discourse.julialang.org/t/good-package-to-smooth-outliers/107919 "2023-12-21T20:40:12Z")

</div>

Hi all, I’m looking for a package (or a good method) that can smooth out outliers like these: Any suggestions?

---

## [CRC32 checksums](https://discourse.julialang.org/t/crc32-checksums/107922)

<div class="topic-metadata">

**Author:** [@LeePhillips](https://discourse.julialang.org/u/LeePhillips)\
**Replies:** 2\
**Last updated:** [December 21, 2023, 7:57pm UTC](https://discourse.julialang.org/t/crc32-checksums/107922 "2023-12-21T19:57:08Z")

</div>

Why are the checksums from CRCR32c.crc32c in the Standard Library different from the ones I get from the linux crc32 command? Documentation suggests that they are both using the same algorithm.

---

## [IJulia hide code cells in notebook](https://discourse.julialang.org/t/ijulia-hide-code-cells-in-notebook/20622)

<div class="topic-metadata">

**Author:** [@lucabrugnolini](https://discourse.julialang.org/u/lucabrugnolini)\
**Replies:** 5\
**Last updated:** [December 21, 2023, 7:38pm UTC](https://discourse.julialang.org/t/ijulia-hide-code-cells-in-notebook/20622 "2023-12-21T19:38:46Z")

</div>

Hi, I am trying to hide the code cells in an IJulia notebook to show only the markdown text, fig, and tables in the output. Here is an example with the IPython: http://chris-said.io/2016/02/13/how-to-make-polished-jup…

---

## [CUDA could not find an appropiate CUDA runtime to use](https://discourse.julialang.org/t/cuda-could-not-find-an-appropiate-cuda-runtime-to-use/97201)

<div class="topic-metadata">

**Author:** [@lepton01](https://discourse.julialang.org/u/lepton01)\
**Replies:** 7\
**Last updated:** [December 21, 2023, 7:33pm UTC](https://discourse.julialang.org/t/cuda-could-not-find-an-appropiate-cuda-runtime-to-use/97201 "2023-12-21T19:33:31Z")

</div>

Hello there. Haven’t used CUDA.jl before. I am working with some NN and wanted to see how it would perform on my GPU, if that makes any sense. After adding CUDA through the Julia Package Manager, using CUDA gives the t…

---

## [Optimization.jl Iterations](https://discourse.julialang.org/t/optimization-jl-iterations/107845)

<div class="topic-metadata">

**Author:** [@bdas123](https://discourse.julialang.org/u/bdas123)\
**Replies:** 3\
**Last updated:** [December 21, 2023, 6:16pm UTC](https://discourse.julialang.org/t/optimization-jl-iterations/107845 "2023-12-21T18:16:12Z")

</div>

Hello, how do I extract the number of iterations from Optimization.jl (specifically the NLopt package)? Here is a sample code using Optimization, OptimizationNLopt, ModelingToolkit function calc\_sse(x0,p) return s…

---

## [How to analyze sensitivity w.r.t. the initial values?](https://discourse.julialang.org/t/how-to-analyze-sensitivity-w-r-t-the-initial-values/107580)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 9\
**Last updated:** [December 21, 2023, 5:40pm UTC](https://discourse.julialang.org/t/how-to-analyze-sensitivity-w-r-t-the-initial-values/107580 "2023-12-21T17:40:21Z")

</div>

I want to run sensitivity analysis w.r.t. the initial conditions: using DifferentialEquations, Optimization, OptimizationPolyalgorithms, SciMLSensitivity, Zygote function harm\_osc\_matrix(t::Real, p::Vector) …

---

## [Fully-funded PhD studentship in Biomedical/Neural Engineering at Trinity College Dublin](https://discourse.julialang.org/t/fully-funded-phd-studentship-in-biomedical-neural-engineering-at-trinity-college-dublin/107917)

<div class="topic-metadata">

**Author:** [@lmcmanus](https://discourse.julialang.org/u/lmcmanus)\
**Replies:** 0\
**Last updated:** [December 21, 2023, 5:29pm UTC](https://discourse.julialang.org/t/fully-funded-phd-studentship-in-biomedical-neural-engineering-at-trinity-college-dublin/107917 "2023-12-21T17:29:18Z")

</div>

Applications are invited for a highly motivated PhD student to join an exciting new project that will use high density electromyography (EMG) and electroencephalography (EEG) to examine changes in neuroelectric signallin…

---

## [Alternatives to LsqFit for nonlinear curve fitting?](https://discourse.julialang.org/t/alternatives-to-lsqfit-for-nonlinear-curve-fitting/107685)

<div class="topic-metadata">

**Author:** [@PeX](https://discourse.julialang.org/u/PeX)\
**Replies:** 12\
**Last updated:** [December 21, 2023, 4:48pm UTC](https://discourse.julialang.org/t/alternatives-to-lsqfit-for-nonlinear-curve-fitting/107685 "2023-12-21T16:48:52Z")

</div>

Hi! I’m trying to use Julia to make a curve fit with the functional form: model = ( p\[1\] / x ) \* exp( -p\[2\] / x ) to a data-set I have. I tried LsqFit, however, if I’m not making really good initial guesses for the p…

---

## [Pivoting results](https://discourse.julialang.org/t/pivoting-results/107914)

<div class="topic-metadata">

**Author:** [@brianhfield](https://discourse.julialang.org/u/brianhfield)\
**Replies:** 3\
**Last updated:** [December 21, 2023, 3:55pm UTC](https://discourse.julialang.org/t/pivoting-results/107914 "2023-12-21T15:55:57Z")

</div>

df = DataFrame(); df\[!,:Vintage\] = \["2021-01-31","2021-01-31","2021-01-31","2021-02-28","2021-02-28", "2021-03-31","2021-04-30","2021-04-30"\]; df\[!,:Grade\] = \["A","B","C","C","A","B","C","D"\]; df\[!,:Amt\] = \[2000000,9…

---

## [Rendering Reactive{string} in StippleUI page](https://discourse.julialang.org/t/rendering-reactive-string-in-stippleui-page/107257)

<div class="topic-metadata">

**Author:** [@Ben\_Sivan](https://discourse.julialang.org/u/Ben_Sivan)\
**Replies:** 2\
**Last updated:** [December 21, 2023, 1:57pm UTC](https://discourse.julialang.org/t/rendering-reactive-string-in-stippleui-page/107257 "2023-12-21T13:57:13Z")

</div>

Hi! I followed through the basic example of reactive UI in the GenieFramework. The very simple webapp below is a lineage tracking app of biological samples based on lineage graph. The user writes a sample name and gets…

---

## [Spatial Kernel in Julia](https://discourse.julialang.org/t/spatial-kernel-in-julia/107707)

<div class="topic-metadata">

**Author:** [@anjelinejeline](https://discourse.julialang.org/u/anjelinejeline)\
**Replies:** 28\
**Last updated:** [December 21, 2023, 1:07pm UTC](https://discourse.julialang.org/t/spatial-kernel-in-julia/107707 "2023-12-21T13:07:17Z")

</div>

Hi, I am really new to Julia, I would like to compute a spatial kernel with a resolution of 1000x1000 metres and then save the results as a raster file (“+proj=moll +lon\_0=0 +x\_0=0 +y\_0=0”). I gave it a try with the …

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

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