# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=290

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

**Page:** 291

---

## [Is there a way to find out the compilation details of binary artifacts shipped with a package?](https://discourse.julialang.org/t/is-there-a-way-to-find-out-the-compilation-details-of-binary-artifacts-shipped-with-a-package/98987)

<div class="topic-metadata">

**Author:** [@vvbond](https://discourse.julialang.org/u/vvbond)\
**Replies:** 2\
**Last updated:** [May 17, 2023, 9:24am UTC](https://discourse.julialang.org/t/is-there-a-way-to-find-out-the-compilation-details-of-binary-artifacts-shipped-with-a-package/98987 "2023-05-17T09:24:42Z")

</div>

My particular use case concerns the FFTW library shipped with the FFTW.jl package, but my interest is general. Investigating performance of a FFT-based signal processing pipeline implemented in c++, I’ve noticed a perfo…

---

## [Seeking help with Pkg extensions: encountering MethodError: no method matching stat\_rep(::Nothing)](https://discourse.julialang.org/t/seeking-help-with-pkg-extensions-encountering-methoderror-no-method-matching-stat-rep-nothing/98906)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [May 17, 2023, 6:23am UTC](https://discourse.julialang.org/t/seeking-help-with-pkg-extensions-encountering-methoderror-no-method-matching-stat-rep-nothing/98906 "2023-05-17T06:23:07Z")

</div>

I’m trying to use Pkg extensions in OffsetArrays in Move \`Adapt\` to a weak dependency by jishnub · Pull Request #331 · JuliaArrays/OffsetArrays.jl · GitHub, where the Project.toml reads While trying to add packages to…

---

## [Is there a shorthand to make all fields of a struct the same type?](https://discourse.julialang.org/t/is-there-a-shorthand-to-make-all-fields-of-a-struct-the-same-type/98961)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 1\
**Last updated:** [May 16, 2023, 11:20pm UTC](https://discourse.julialang.org/t/is-there-a-shorthand-to-make-all-fields-of-a-struct-the-same-type/98961 "2023-05-16T23:20:52Z")

</div>

E.g struct myStruct ::Float64 #apply to all a b c end

---

## [Parallel precompilation and out-of-memory errors](https://discourse.julialang.org/t/parallel-precompilation-and-out-of-memory-errors/98952)

<div class="topic-metadata">

**Author:** [@slawrence](https://discourse.julialang.org/u/slawrence)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 7:38pm UTC](https://discourse.julialang.org/t/parallel-precompilation-and-out-of-memory-errors/98952 "2023-05-16T19:38:28Z")

</div>

My computer has 8 logical CPUs and only ~4GB of RAM usable to Julia. The result is that when I go to install a bunch of packages, it’s easy for parallel compilation to use up all my RAM and trigger the OOM killer (if I’m…

---

## [How do I actually use package extensions?](https://discourse.julialang.org/t/how-do-i-actually-use-package-extensions/98930)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 7\
**Last updated:** [May 16, 2023, 5:35pm UTC](https://discourse.julialang.org/t/how-do-i-actually-use-package-extensions/98930 "2023-05-16T17:35:12Z")

</div>

Say I wish to use ForwardDiffs static arrays extension. I can do: using ForwardDiff, StaticArrays How do I actually access methods from the extension? Because ForwardDiff.ForwardDiffStaticArraysExt gives me: ERROR:…

---

## [Costs of registering packages](https://discourse.julialang.org/t/costs-of-registering-packages/98845)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 25\
**Last updated:** [May 16, 2023, 5:19pm UTC](https://discourse.julialang.org/t/costs-of-registering-packages/98845 "2023-05-16T17:19:07Z")

</div>

I wonder what the costs associated with registering packages are. I brought up this subject in the thread on fragmentation, but it probably wasn’t the right place to ask this question. What I mean is: if I have a piece…

---

## [What is causing type instability in this struct?](https://discourse.julialang.org/t/what-is-causing-type-instability-in-this-struct/98886)

<div class="topic-metadata">

**Author:** [@ejmeitz](https://discourse.julialang.org/u/ejmeitz)\
**Replies:** 13\
**Last updated:** [May 16, 2023, 2:08pm UTC](https://discourse.julialang.org/t/what-is-causing-type-instability-in-this-struct/98886 "2023-05-16T14:08:54Z")

</div>

I have the following struct and I’m a little confused why using @code\_warntype on it’s construct says there’s unstable types. The output from that command is a little verbose but I’ll copy one of the red parts in case th…

---

## [Read single quoted values inside strings](https://discourse.julialang.org/t/read-single-quoted-values-inside-strings/98877)

<div class="topic-metadata">

**Author:** [@uwbanjoman](https://discourse.julialang.org/u/uwbanjoman)\
**Replies:** 13\
**Last updated:** [May 16, 2023, 1:43pm UTC](https://discourse.julialang.org/t/read-single-quoted-values-inside-strings/98877 "2023-05-16T13:43:27Z")

</div>

Hi all, I have opened a text file using the readlines() function. This text file has various sections containing different information. In some of the lines i am finding strings that contain information inside single qu…

---

## [What goes in a MyModule.jl file? (particularly do you use PrecompileTools.jl neatly?)](https://discourse.julialang.org/t/what-goes-in-a-mymodule-jl-file-particularly-do-you-use-precompiletools-jl-neatly/98880)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 1:09pm UTC](https://discourse.julialang.org/t/what-goes-in-a-mymodule-jl-file-particularly-do-you-use-precompiletools-jl-neatly/98880 "2023-05-16T13:09:08Z")

</div>

Hi everyone, I like it when my code looks neat, I also love how much faster PrecompileTools makes TTFX in my modules. What I’m not sure on, however, is where to put the @compile\_workload part of the package. What I lik…

---

## [ERROR: Unable to find compatible target in system image (julia 1.9.0)](https://discourse.julialang.org/t/error-unable-to-find-compatible-target-in-system-image-julia-1-9-0/98921)

<div class="topic-metadata">

**Author:** [@JesperMartinsson](https://discourse.julialang.org/u/JesperMartinsson)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 12:50pm UTC](https://discourse.julialang.org/t/error-unable-to-find-compatible-target-in-system-image-julia-1-9-0/98921 "2023-05-16T12:50:04Z")

</div>

Hi everyone, With julia 1.8.5 (PackageCompiler v2.1.5) it works but when I recently upgraded to julia 1.9.0 (PackageCompiler v2.1.5) and deploy the same julia package in a container using PackageCompiler it results in t…

---

## [Computationally efficient image filtering](https://discourse.julialang.org/t/computationally-efficient-image-filtering/98889)

<div class="topic-metadata">

**Author:** [@donkeysaddle](https://discourse.julialang.org/u/donkeysaddle)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 12:49pm UTC](https://discourse.julialang.org/t/computationally-efficient-image-filtering/98889 "2023-05-16T12:49:16Z")

</div>

I would like to filter hundreds of thousands of small images (say 35x35), using 5x5 kernels (that do not factor). I only want the “good data,” meaning the 31x31 filtered image that comes from correlating the filter at ea…

---

## [Spawning threads boxes variable - spooky action at a distance?](https://discourse.julialang.org/t/spawning-threads-boxes-variable-spooky-action-at-a-distance/97972)

<div class="topic-metadata">

**Author:** [@anicusan](https://discourse.julialang.org/u/anicusan)\
**Replies:** 2\
**Last updated:** [May 16, 2023, 11:12am UTC](https://discourse.julialang.org/t/spawning-threads-boxes-variable-spooky-action-at-a-distance/97972 "2023-05-16T11:12:54Z")

</div>

Hi, While multi-threading some code, I came across an odd case where spawning tasks leads to Julia boxing a variable in a different code section (leading to type instabilities, Any, bad performance, the whole shebang). …

---

## [How to compute/calculate a Confidence Interval (CI)?](https://discourse.julialang.org/t/how-to-compute-calculate-a-confidence-interval-ci/74794)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 4\
**Last updated:** [May 16, 2023, 10:54am UTC](https://discourse.julialang.org/t/how-to-compute-calculate-a-confidence-interval-ci/74794 "2023-05-16T10:54:59Z")

</div>

How can I calculate a confidence interval for a given distribution?

---

## [Plotting parameters and variables on the same plot for Differential Equation solution](https://discourse.julialang.org/t/plotting-parameters-and-variables-on-the-same-plot-for-differential-equation-solution/98745)

<div class="topic-metadata">

**Author:** [@GertEhlers27](https://discourse.julialang.org/u/GertEhlers27)\
**Replies:** 10\
**Last updated:** [May 16, 2023, 8:10am UTC](https://discourse.julialang.org/t/plotting-parameters-and-variables-on-the-same-plot-for-differential-equation-solution/98745 "2023-05-16T08:10:17Z")

</div>

Hi Everyone, I am using DifferentialEquations.jl to solve an ODE. After solving it, I plot the different variables. The problem is: I want to add a parameter (p) to the same plot. Is it possible? I only see different …

---

## [Function whose parameter type is defined in another module](https://discourse.julialang.org/t/function-whose-parameter-type-is-defined-in-another-module/98600)

<div class="topic-metadata">

**Author:** [@zapiano](https://discourse.julialang.org/u/zapiano)\
**Replies:** 3\
**Last updated:** [May 16, 2023, 2:47am UTC](https://discourse.julialang.org/t/function-whose-parameter-type-is-defined-in-another-module/98600 "2023-05-16T02:47:16Z")

</div>

I have a custom module called Utilities, where I define the struct Utility # utilities.jl module Utilities export Utility mutable struct Utility # etc... end # ..etc end and another module called SimplexTools whe…

---

## [Cannot run Julia after trying to install packages](https://discourse.julialang.org/t/cannot-run-julia-after-trying-to-install-packages/62840)

<div class="topic-metadata">

**Author:** [@cesquivea](https://discourse.julialang.org/u/cesquivea)\
**Replies:** 11\
**Last updated:** [May 16, 2023, 12:34am UTC](https://discourse.julialang.org/t/cannot-run-julia-after-trying-to-install-packages/62840 "2023-05-16T00:34:15Z")

</div>

I am working on a university desktop computer which runs on Windows 10 Enterprise. I am set as administrator. I can download, install and run Julia after installation. When I attempt to install any package, the process…

---

## [How to calculate confidence interval?](https://discourse.julialang.org/t/how-to-calculate-confidence-interval/98876)

<div class="topic-metadata">

**Author:** [@Ashu](https://discourse.julialang.org/u/Ashu)\
**Replies:** 5\
**Last updated:** [May 16, 2023, 12:16am UTC](https://discourse.julialang.org/t/how-to-calculate-confidence-interval/98876 "2023-05-16T00:16:11Z")

</div>

Dear All, I have a random sample, let’s say, smpl = {1, 4, 2, 6, 10, 18, 3, 5, 20}. I wish to calculate a 99% confidence interval on \[minimum(smpl), maximum(smpl)\]=\[1, 20\]. I am able to calculate a 99% confidence interv…

---

## [How to use Wasserstein distance in OptimalTransport.jl](https://discourse.julialang.org/t/how-to-use-wasserstein-distance-in-optimaltransport-jl/98898)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 11:23pm UTC](https://discourse.julialang.org/t/how-to-use-wasserstein-distance-in-optimaltransport-jl/98898 "2023-05-15T23:23:44Z")

</div>

Hi all, I was hoping to compare probability distributions using Wasserstein distance. As a starting point, I was hoping to compare two discrete probability distributions, say \[.25.,25.,25.,25\] and \[0,.5,.2,.3\]. I found …

---

## [SciML demos](https://discourse.julialang.org/t/sciml-demos/98893)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [May 15, 2023, 10:47pm UTC](https://discourse.julialang.org/t/sciml-demos/98893 "2023-05-15T22:47:12Z")

</div>

I am going over some demos in SciML. Consider the code fragment found at https://docs.sciml.ai/Overview/stable/showcase/missing\_physics/#autocomplete function predict(θ, X = Xₙ\[:, 1\], T = t) \_prob = remake(prob\_nn,…

---

## [Gradient for Cholesky decomposition with CuArrays with Zygote.jl](https://discourse.julialang.org/t/gradient-for-cholesky-decomposition-with-cuarrays-with-zygote-jl/98900)

<div class="topic-metadata">

**Author:** [@guixien](https://discourse.julialang.org/u/guixien)\
**Replies:** 0\
**Last updated:** [May 15, 2023, 9:47pm UTC](https://discourse.julialang.org/t/gradient-for-cholesky-decomposition-with-cuarrays-with-zygote-jl/98900 "2023-05-15T21:47:48Z")

</div>

Here’s a minimal example: using Zygote, CUDA, LinearAlgebra CUDA.allowscalar(false) C = cu(rand(5,5)) f(x) = sum(cholesky(x’ \* x).L) Zygote.gradient(f, C) While the CPU version works fine, this will throw the sca…

---

## [Possible bug with dispatch on parametric abstract type](https://discourse.julialang.org/t/possible-bug-with-dispatch-on-parametric-abstract-type/98852)

<div class="topic-metadata">

**Author:** [@bgroenks](https://discourse.julialang.org/u/bgroenks)\
**Replies:** 9\
**Last updated:** [May 15, 2023, 8:31pm UTC](https://discourse.julialang.org/t/possible-bug-with-dispatch-on-parametric-abstract-type/98852 "2023-05-15T20:31:08Z")

</div>

Hi all, I think I may have encountered a possible bug in Julia’s method dispatch. But I would like to post this here first in case anyone can spot something that I have missed. I was able to reproduce the problem in a s…

---

## [PGFPlotsX invalid pgf key error](https://discourse.julialang.org/t/pgfplotsx-invalid-pgf-key-error/98839)

<div class="topic-metadata">

**Author:** [@keynescoefen](https://discourse.julialang.org/u/keynescoefen)\
**Replies:** 3\
**Last updated:** [May 15, 2023, 5:20pm UTC](https://discourse.julialang.org/t/pgfplotsx-invalid-pgf-key-error/98839 "2023-05-15T17:20:53Z")

</div>

Hello! When running Version 1.9.0 (2023-05-07) with the latest PGFPlotsX the following snippet gives me this error message. When using the generic plotting functions like so, I get the error message further below. usi…

---

## [Package precompile fail with Distributed](https://discourse.julialang.org/t/package-precompile-fail-with-distributed/98887)

<div class="topic-metadata">

**Author:** [@Gabriel\_Kreindler](https://discourse.julialang.org/u/Gabriel_Kreindler)\
**Replies:** 0\
**Last updated:** [May 15, 2023, 5:06pm UTC](https://discourse.julialang.org/t/package-precompile-fail-with-distributed/98887 "2023-05-15T17:06:49Z")

</div>

I get a persistent error with the following code: git\_julia\_proj\_path = "SOME\_PATH" using Distributed n\_procs = 2 rmprocs(workers()) addprocs(2) # local first using Pkg Pkg.activate(git\_julia\_proj\_path) Pkg.precomp…

---

## [Is it possible to make precompilation portable (for docker images built with a different CPU)?](https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 1\
**Last updated:** [May 15, 2023, 3:11pm UTC](https://discourse.julialang.org/t/is-it-possible-to-make-precompilation-portable-for-docker-images-built-with-a-different-cpu/95913 "2023-05-15T15:11:21Z")

</div>

I recently realized why my docker images were taking ages to restart on production servers, but were much faster on dev servers (which happen to have the same CPU as the build servers). Precompilation is being done and …

---

## [Trying to understand how lazy computation works](https://discourse.julialang.org/t/trying-to-understand-how-lazy-computation-works/98871)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 6\
**Last updated:** [May 15, 2023, 2:34pm UTC](https://discourse.julialang.org/t/trying-to-understand-how-lazy-computation-works/98871 "2023-05-15T14:34:57Z")

</div>

Trying to understand the following argument A zero-argument anonymous function is written as ()-\>3. The idea of a function with no arguments may seem strange, but is useful for “delaying” a computation. In this usage, …

---

## [Parameter estimation DefaultOptimizationCache not defined (DiffEqFlux)](https://discourse.julialang.org/t/parameter-estimation-defaultoptimizationcache-not-defined-diffeqflux/98635)

<div class="topic-metadata">

**Author:** [@ANasc](https://discourse.julialang.org/u/ANasc)\
**Replies:** 5\
**Last updated:** [May 15, 2023, 2:25pm UTC](https://discourse.julialang.org/t/parameter-estimation-defaultoptimizationcache-not-defined-diffeqflux/98635 "2023-05-15T14:25:58Z")

</div>

Hi, I’m trying to learn the basics of parameter estimation with DiffEqFlux by adapting the first example from here https://docs.juliahub.com/DiffEqFlux/BdO4p/1.9.0/ to my own problem. However, I keep getting the followi…

---

## [UndefVarError: \`execute\_msg\` not defined](https://discourse.julialang.org/t/undefvarerror-execute-msg-not-defined/98643)

<div class="topic-metadata">

**Author:** [@StranoArtista](https://discourse.julialang.org/u/StranoArtista)\
**Replies:** 3\
**Last updated:** [May 15, 2023, 1:28pm UTC](https://discourse.julialang.org/t/undefvarerror-execute-msg-not-defined/98643 "2023-05-15T13:28:23Z")

</div>

Hello there, I have a question. I am new at Julia. I am using JupyterNotebook with VSCode. I try execute readline() command in Jupyter but its not working. I got an error: UndefVarError: execute\_msg not defined But…

---

## [Function types](https://discourse.julialang.org/t/function-types/98445)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [May 8, 2023, 9:51am UTC](https://discourse.julialang.org/t/function-types/98445 "2023-05-08T09:51:49Z")

</div>

Why don’t the two functions: a = t -\> cos b = t -\> 0. have the same type? As a result, one cannot do the following: fct = \[a, a\] fct\[1\] = b since the list is of the same type of a. On the other hand, fct = Any\[a,a\] …

---

## [Any way to speed up loading large precompiled packages?](https://discourse.julialang.org/t/any-way-to-speed-up-loading-large-precompiled-packages/98762)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 35\
**Last updated:** [May 15, 2023, 12:54pm UTC](https://discourse.julialang.org/t/any-way-to-speed-up-loading-large-precompiled-packages/98762 "2023-05-15T12:54:05Z")

</div>

I have a package that my collaborators want to use like a script. Specifically, they want it to load quickly. Once it’s compiled, my part of the code is fast — around 0.01s, compared to the several seconds taken by my …

---

## [Creating a struct with symbolic (Symbolics package) functions and variables](https://discourse.julialang.org/t/creating-a-struct-with-symbolic-symbolics-package-functions-and-variables/98851)

<div class="topic-metadata">

**Author:** [@brombo](https://discourse.julialang.org/u/brombo)\
**Replies:** 4\
**Last updated:** [May 15, 2023, 12:49pm UTC](https://discourse.julialang.org/t/creating-a-struct-with-symbolic-symbolics-package-functions-and-variables/98851 "2023-05-15T12:49:56Z")

</div>

I am trying to write a struct with members to manipulate symbolic variables. I am a newbie to Julia. I have programmed in python using sympy for symbolic algebra. Here is the code I have so far - using Symbolics, Sym…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=289)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=291)
