# General Usage

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

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

**Page:** 125

---

## [Recommended recipe for deploying a Julia app in Docker with efficient precompilation?](https://discourse.julialang.org/t/recommended-recipe-for-deploying-a-julia-app-in-docker-with-efficient-precompilation/95591)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 3\
**Last updated:** [October 10, 2024, 8:38pm UTC](https://discourse.julialang.org/t/recommended-recipe-for-deploying-a-julia-app-in-docker-with-efficient-precompilation/95591 "2024-10-10T20:38:22Z")

</div>

Now that Julia 1.9/10 precompilation is doing more the first time a package is used, I’m seeing rather slow (7-8 minutes) restarts on a production docker image of my Julia app. When I run it locally with packages that h…

---

## [String macro with trailing argument](https://discourse.julialang.org/t/string-macro-with-trailing-argument/121162)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [October 10, 2024, 5:39pm UTC](https://discourse.julialang.org/t/string-macro-with-trailing-argument/121162 "2024-10-10T17:39:25Z")

</div>

I am trying to get the string literal macro example with a trailing argument from the manual to work (end of section linked), with the MWE struct Foo str::String flag::Bool end macro foo\_str(str, flag) \_fla…

---

## [Type-instability of mapreduce vs. map + reduce](https://discourse.julialang.org/t/type-instability-of-mapreduce-vs-map-reduce/121136)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 18\
**Last updated:** [October 10, 2024, 4:43pm UTC](https://discourse.julialang.org/t/type-instability-of-mapreduce-vs-map-reduce/121136 "2024-10-10T16:43:03Z")

</div>

I’m a bit surprised that in this simple example, f is type-stable but g is not. Is this a JET.jl issue (@aviatesk) or a Julia issue? using JET function f(m, n) blocks = map(1:n) do i ones(m) end ret…

---

## [Is it idiomatic to use \`Bool\` as \`Number\`?](https://discourse.julialang.org/t/is-it-idiomatic-to-use-bool-as-number/121154)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 4\
**Last updated:** [October 10, 2024, 3:47pm UTC](https://discourse.julialang.org/t/is-it-idiomatic-to-use-bool-as-number/121154 "2024-10-10T15:47:21Z")

</div>

Both f and g below do the same thing f(x) = x ? 0 : 1 g(x) = x \* 0 + (!x) \* 1 They lower to the same llvm code too: julia\> @code\_llvm debuginfo=:none f(true) define i64 @julia\_f\_7188(i8 zeroext %0) #0 { top: %1 = an…

---

## [Julia Tab Completion is Slow in directories with many items](https://discourse.julialang.org/t/julia-tab-completion-is-slow-in-directories-with-many-items/121156)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 0\
**Last updated:** [October 10, 2024, 3:09pm UTC](https://discourse.julialang.org/t/julia-tab-completion-is-slow-in-directories-with-many-items/121156 "2024-10-10T15:09:58Z")

</div>

In the REPL, when I try to use strings, REPL keeps hanging in directories with many items. I have a directory with around 400+ items, all of which are dates from 2020-01-01 to 2020-12-31, and Julia keeps hanging (and is…

---

## [Iterate over a range in a non standard way](https://discourse.julialang.org/t/iterate-over-a-range-in-a-non-standard-way/121137)

<div class="topic-metadata">

**Author:** [@JM\_Beckers](https://discourse.julialang.org/u/JM_Beckers)\
**Replies:** 4\
**Last updated:** [October 10, 2024, 12:45pm UTC](https://discourse.julialang.org/t/iterate-over-a-range-in-a-non-standard-way/121137 "2024-10-10T12:45:01Z")

</div>

I’m doing some exhaustive search loops and would like to cover say a range 10:100 but suspect (with quite some confidence) that the solution I look for is around 90. So I would like to loop over the range by starting at …

---

## [Understanding how ForwardDiff.Duals are propagated](https://discourse.julialang.org/t/understanding-how-forwarddiff-duals-are-propagated/121114)

<div class="topic-metadata">

**Author:** [@AndreaRH](https://discourse.julialang.org/u/AndreaRH)\
**Replies:** 6\
**Last updated:** [October 10, 2024, 12:18pm UTC](https://discourse.julialang.org/t/understanding-how-forwarddiff-duals-are-propagated/121114 "2024-10-10T12:18:55Z")

</div>

Hello, I’m trying to understand how ForwardDiff propagates Duals through an ode solver, so how the function defining an ODE system can be overloaded (specialized is another word that could be used?) to handle Duals. Ta…

---

## [Agents.jl Interactive Plot](https://discourse.julialang.org/t/agents-jl-interactive-plot/121111)

<div class="topic-metadata">

**Author:** [@Damiano](https://discourse.julialang.org/u/Damiano)\
**Replies:** 7\
**Last updated:** [October 10, 2024, 11:21am UTC](https://discourse.julialang.org/t/agents-jl-interactive-plot/121111 "2024-10-10T11:21:34Z")

</div>

Hi, I am trying to learn how to use the package Agents.jl. Even if I just started, I already like it a lot. I am following this explanation from the documentation for doing interactive plots. Everything seems to work …

---

## [Resolving method ambiguity with Union](https://discourse.julialang.org/t/resolving-method-ambiguity-with-union/121106)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 8\
**Last updated:** [October 10, 2024, 9:09am UTC](https://discourse.julialang.org/t/resolving-method-ambiguity-with-union/121106 "2024-10-10T09:09:13Z")

</div>

Suppose I am trying to define a hvcat for a user type, and after I deal with the first argument (which can be an Int, or a Tuple{Vararg{Int}), the methods share a lot of code. So it would be ideal for me to just branch o…

---

## [How to gracefully retire a package](https://discourse.julialang.org/t/how-to-gracefully-retire-a-package/121101)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 12\
**Last updated:** [October 10, 2024, 6:35am UTC](https://discourse.julialang.org/t/how-to-gracefully-retire-a-package/121101 "2024-10-10T06:35:55Z")

</div>

Julia 1.11 has made PushVectors.jl obsolete. I wonder what the best workflow is to retire it. I have read the previous threads on this, with various recommendations (eg 1, 2). I am still not sure how to proceed. Specif…

---

## [@nloops and @generated function](https://discourse.julialang.org/t/nloops-and-generated-function/121051)

<div class="topic-metadata">

**Author:** [@JM\_Beckers](https://discourse.julialang.org/u/JM_Beckers)\
**Replies:** 6\
**Last updated:** [October 10, 2024, 4:33am UTC](https://discourse.julialang.org/t/nloops-and-generated-function/121051 "2024-10-10T04:33:15Z")

</div>

I know macros should only be used in very specific cases and I’m not an expert at all on the topic. Nevertheless I managed to make work a skeleton of my planned code (where actually the loop limits at each level are diff…

---

## [Can I put non-primitive geometries into a GeometrySet?](https://discourse.julialang.org/t/can-i-put-non-primitive-geometries-into-a-geometryset/121102)

<div class="topic-metadata">

**Author:** [@Jfschue](https://discourse.julialang.org/u/Jfschue)\
**Replies:** 8\
**Last updated:** [October 10, 2024, 12:46am UTC](https://discourse.julialang.org/t/can-i-put-non-primitive-geometries-into-a-geometryset/121102 "2024-10-10T00:46:25Z")

</div>

If I put a SimpleMesh geometry into a GeometrySet, I get a StackOverflowError: using Meshes # test using primitive geometries s1 = Meshes.Sphere((0, 0, 0), 1) s2 = Meshes.Sphere((1, 1, 1), 1) gs1 = GeometrySet(\[s1, s2\]…

---

## [Remove units from sparse matrix](https://discourse.julialang.org/t/remove-units-from-sparse-matrix/121112)

<div class="topic-metadata">

**Author:** [@Fourier](https://discourse.julialang.org/u/Fourier)\
**Replies:** 2\
**Last updated:** [October 9, 2024, 8:36pm UTC](https://discourse.julialang.org/t/remove-units-from-sparse-matrix/121112 "2024-10-09T20:36:34Z")

</div>

I have a sparse array of Quantities with Units from Unitful.jl . I would like to use the conjugate gradient method (cg) from IterativeSolvers.jl on it. However that is only defined for reals. And AbstractQuantity is not…

---

## [Regressions in Julia not getting caught by PkgEval](https://discourse.julialang.org/t/regressions-in-julia-not-getting-caught-by-pkgeval/121069)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 8\
**Last updated:** [October 9, 2024, 1:38pm UTC](https://discourse.julialang.org/t/regressions-in-julia-not-getting-caught-by-pkgeval/121069 "2024-10-09T13:38:41Z")

</div>

As happened before as well, the 1.11 Julia release has some regressions that break existing code – and not just any code, but registered packages. Some examples of what I personally encountered today when testing my pac…

---

## [SVD 2x slower than in Matlab and how to get best performance on Windows10](https://discourse.julialang.org/t/svd-2x-slower-than-in-matlab-and-how-to-get-best-performance-on-windows10/21645)

<div class="topic-metadata">

**Author:** [@Baicai\_Xiao](https://discourse.julialang.org/u/Baicai_Xiao)\
**Replies:** 20\
**Last updated:** [October 9, 2024, 12:22pm UTC](https://discourse.julialang.org/t/svd-2x-slower-than-in-matlab-and-how-to-get-best-performance-on-windows10/21645 "2024-10-09T12:22:04Z")

</div>

Hello , Recently, I found that julia svd is slower than the one in matlab. It has been discussed once here in https://github.com/JuliaLang/julia/issues/3521, but after reading this, I am still not quite sure what is exa…

---

## [Interactively finding files for types and functions directly, in Core and Base](https://discourse.julialang.org/t/interactively-finding-files-for-types-and-functions-directly-in-core-and-base/121099)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 0\
**Last updated:** [October 9, 2024, 9:44am UTC](https://discourse.julialang.org/t/interactively-finding-files-for-types-and-functions-directly-in-core-and-base/121099 "2024-10-09T09:44:53Z")

</div>

Interactively finding a method’s file with which generally works well, except for Core. Finding where a type or a function is defined however is more indirect by going through the module, and the module definition’s file…

---

## [Issue at REPL with 1.11---am I doing something silly here?](https://discourse.julialang.org/t/issue-at-repl-with-1-11-am-i-doing-something-silly-here/121070)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 16\
**Last updated:** [October 9, 2024, 9:33am UTC](https://discourse.julialang.org/t/issue-at-repl-with-1-11-am-i-doing-something-silly-here/121070 "2024-10-09T09:33:58Z")

</div>

Hi all— I see that 1.11 is out and I’m super excited to use it and play with the new Memory type and stuff. I am sure this is just me doing something silly, but I am getting a lot of errors in the REPL before doing anyt…

---

## [How to use Malt.jl and IOCapture.jl for evaluating expressions](https://discourse.julialang.org/t/how-to-use-malt-jl-and-iocapture-jl-for-evaluating-expressions/121045)

<div class="topic-metadata">

**Author:** [@Rene\_David\_Hernandez](https://discourse.julialang.org/u/Rene_David_Hernandez)\
**Replies:** 2\
**Last updated:** [October 9, 2024, 6:42am UTC](https://discourse.julialang.org/t/how-to-use-malt-jl-and-iocapture-jl-for-evaluating-expressions/121045 "2024-10-09T06:42:40Z")

</div>

I would like to use Malt.jl to evaluate expressions in a workspace separate from the main thread running Julia. So far I have not been able to find a way to use Malt.jl and capture with IOCapture the different outputs of…

---

## [Performance Tips for functions](https://discourse.julialang.org/t/performance-tips-for-functions/121030)

<div class="topic-metadata">

**Author:** [@luke98](https://discourse.julialang.org/u/luke98)\
**Replies:** 9\
**Last updated:** [October 9, 2024, 3:38am UTC](https://discourse.julialang.org/t/performance-tips-for-functions/121030 "2024-10-09T03:38:37Z")

</div>

Hi Everyone, I’m working on optimizing two functions, mplFun and marketEq, and I’m looking for advice on how to make them as efficient as possible. Below, I’ve included a simplified version of the code that allows these…

---

## [ChebyshevApprox.jl type error](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022)

<div class="topic-metadata">

**Author:** [@RuanCoelho](https://discourse.julialang.org/u/RuanCoelho)\
**Replies:** 7\
**Last updated:** [October 8, 2024, 9:30pm UTC](https://discourse.julialang.org/t/chebyshevapprox-jl-type-error/121022 "2024-10-08T21:30:57Z")

</div>

Hi there! First time here, so I’ll try to be clear and go straight to the point. I’m trying to use the ChebyshevApprox.jl package, specifically the chebyshev\_weights\_extrema() function. However, even when using the exam…

---

## [Large Numbers Make Lines Disappear in Makie](https://discourse.julialang.org/t/large-numbers-make-lines-disappear-in-makie/121026)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 2\
**Last updated:** [October 8, 2024, 6:45pm UTC](https://discourse.julialang.org/t/large-numbers-make-lines-disappear-in-makie/121026 "2024-10-08T18:45:30Z")

</div>

The following code: using CairoMakie xs = \[1,2,3,4\] ys = \[1,1,1e15,1\] fig = Figure() ax1 = Axis(fig\[1,1\], limits=(nothing, nothing)) ax2 = Axis(fig\[1,2\], limits=(nothing, (0,2))) lines!(ax1, xs, ys) lines!(ax2, xs, ys) …

---

## [Heap-size-hint in MPIClusterManager.jl for out of memory problems](https://discourse.julialang.org/t/heap-size-hint-in-mpiclustermanager-jl-for-out-of-memory-problems/121050)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 3\
**Last updated:** [October 8, 2024, 2:23pm UTC](https://discourse.julialang.org/t/heap-size-hint-in-mpiclustermanager-jl-for-out-of-memory-problems/121050 "2024-10-08T14:23:15Z")

</div>

Hi, for the MPI transport option, where only MPI can be used for communication on the cluster, I’ve gotten the example from MPIClusterManagers.jl working well for my use case. However, I would like to add a heap size hin…

---

## [Juliaup not updating to 1.11.0](https://discourse.julialang.org/t/juliaup-not-updating-to-1-11-0/121062)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 5\
**Last updated:** [October 8, 2024, 2:19pm UTC](https://discourse.julialang.org/t/juliaup-not-updating-to-1-11-0/121062 "2024-10-08T14:19:55Z")

</div>

Does juliaup get updated at the same time that the latest release is released? My computer (PI on raspberry PI OS) does not recognize 1.11.0 as the release candidate, nor can I juliaup add 1.11.0. When should I expect …

---

## [Simple sum types](https://discourse.julialang.org/t/simple-sum-types/121048)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 7\
**Last updated:** [October 8, 2024, 1:47pm UTC](https://discourse.julialang.org/t/simple-sum-types/121048 "2024-10-08T13:47:35Z")

</div>

There are quite a few julia packages for sum types: SumTypes.jl Unityper.jl LightSumTypes.jl Moshi.jl Probably more. For my usecase, I am looking for a sum types package with the following tradeoffs: I don’t need pa…

---

## [Constraints in SymbolicRegression.jl](https://discourse.julialang.org/t/constraints-in-symbolicregression-jl/121063)

<div class="topic-metadata">

**Author:** [@PrimulaBunce](https://discourse.julialang.org/u/PrimulaBunce)\
**Replies:** 0\
**Last updated:** [October 8, 2024, 1:26pm UTC](https://discourse.julialang.org/t/constraints-in-symbolicregression-jl/121063 "2024-10-08T13:26:50Z")

</div>

Hi, I was experimenting with the constraints parameter in SymbolicRegression.jl. So, my original equation is y = \\mathrm{sin}(2x\_4) + x\_1^2 \\,. I believe the size/complexity of sin here is 3. Since \\mathrm{sin…

---

## [How to find package preventing others from updating](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 19\
**Last updated:** [October 8, 2024, 12:02pm UTC](https://discourse.julialang.org/t/how-to-find-package-preventing-others-from-updating/8235 "2024-10-08T12:02:46Z")

</div>

While trying to upgrade a package I found that some other package held it back with an upper version bound. To track down the offending package, I found the following function useful function find\_holdback(held\_back\_pac…

---

## [Reaction-advection-diffusion in VoronoiFVM](https://discourse.julialang.org/t/reaction-advection-diffusion-in-voronoifvm/119252)

<div class="topic-metadata">

**Author:** [@Alicanter](https://discourse.julialang.org/u/Alicanter)\
**Replies:** 2\
**Last updated:** [October 8, 2024, 11:28am UTC](https://discourse.julialang.org/t/reaction-advection-diffusion-in-voronoifvm/119252 "2024-10-08T11:28:17Z")

</div>

I was trying to use VoronoiFVM.jl and I am not sure I understand how to build a Physics object correctly. This is probably because of my lack of knowledge about FVM in general. I have a PDE in 2D with two species and t…

---

## [Install packages behind the proxy](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298)

<div class="topic-metadata">

**Author:** [@ni\_ck](https://discourse.julialang.org/u/ni_ck)\
**Replies:** 18\
**Last updated:** [October 8, 2024, 11:30am UTC](https://discourse.julialang.org/t/install-packages-behind-the-proxy/23298 "2024-10-08T11:30:46Z")

</div>

Hi everyone! I try to use Julia in my current job. But have trouble with installing packages behind the proxy. I use 1.1.0 binaries. error massage: julia\> Pkg.add(“IJulia”) Cloning default registries into ~/.julia …

---

## [How can I create a fancier REPL prompt with styled strings? (was: Make \`Base.textwidth\` ignore ANSI sequences)](https://discourse.julialang.org/t/how-can-i-create-a-fancier-repl-prompt-with-styled-strings-was-make-base-textwidth-ignore-ansi-sequences/120782)

<div class="topic-metadata">

**Author:** [@HanD](https://discourse.julialang.org/u/HanD)\
**Replies:** 12\
**Last updated:** [October 8, 2024, 11:18am UTC](https://discourse.julialang.org/t/how-can-i-create-a-fancier-repl-prompt-with-styled-strings-was-make-base-textwidth-ignore-ansi-sequences/120782 "2024-10-08T11:18:51Z")

</div>

I’m trying to spice up my Julia REPL prompt with ANSI color codes (not just one single color, but multiple colors in the same line). However, it messes up the cursor alignment, because the code in REPL.jl also counts the…

---

## [Using GLM programmatically](https://discourse.julialang.org/t/using-glm-programmatically/30828)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 8\
**Last updated:** [October 8, 2024, 8:13am UTC](https://discourse.julialang.org/t/using-glm-programmatically/30828 "2024-10-08T08:13:07Z")

</div>

I would like to perform linear regression in a loop with variables. For example, using DataFrames, GLM data = DataFrame(X=\[1,2,3\], Y=\[2,4,7\]) var1 = :Y var2 = :X ols = lm(@formula($var1 ~ $var2), data) I tried vari…

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

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