# General Usage

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

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

**Page:** 276

---

## [Performance & Profiling Tips for Beginner Code](https://discourse.julialang.org/t/performance-profiling-tips-for-beginner-code/100585)

<div class="topic-metadata">

**Author:** [@physh](https://discourse.julialang.org/u/physh)\
**Replies:** 14\
**Last updated:** [June 26, 2023, 9:18am UTC](https://discourse.julialang.org/t/performance-profiling-tips-for-beginner-code/100585 "2023-06-26T09:18:04Z")

</div>

Dear all, I have been using Julia for a few months now, writing code mostly without worrying too much about performance (profiling very briefly with @time/@btime to make sure nothing too horribly is happening though). I…

---

## [Conda.jl error in GitHub actions](https://discourse.julialang.org/t/conda-jl-error-in-github-actions/74741)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 3\
**Last updated:** [June 26, 2023, 5:39am UTC](https://discourse.julialang.org/t/conda-jl-error-in-github-actions/74741 "2023-06-26T05:39:46Z")

</div>

I have trouble with Conda.jl in GitHub actions. Since yesterday, I get the error ERROR: LoadError: ArgumentError: Path to conda environment is not valid: /home/runner/.julia/conda/3 see https://github.com/ranocha/BSeri…

---

## [DifferentialEquations.jl not precompiling](https://discourse.julialang.org/t/differentialequations-jl-not-precompiling/100766)

<div class="topic-metadata">

**Author:** [@shaurya](https://discourse.julialang.org/u/shaurya)\
**Replies:** 7\
**Last updated:** [June 26, 2023, 3:49am UTC](https://discourse.julialang.org/t/differentialequations-jl-not-precompiling/100766 "2023-06-26T03:49:15Z")

</div>

I’ve been using Differentialequations.jl with VSCode for some time now, but got a precompiling error today, tried remove and reinstalling the package, and still getting the precompiling error. I’ve added the whole stackt…

---

## [Floop threading and Juliacall produce segmentation fault](https://discourse.julialang.org/t/floop-threading-and-juliacall-produce-segmentation-fault/100717)

<div class="topic-metadata">

**Author:** [@CarlosContrerasQ12](https://discourse.julialang.org/u/CarlosContrerasQ12)\
**Replies:** 12\
**Last updated:** [June 26, 2023, 3:16am UTC](https://discourse.julialang.org/t/floop-threading-and-juliacall-produce-segmentation-fault/100717 "2023-06-26T03:16:40Z")

</div>

Hi! I’m trying to speed up some calculations using julia to call from python. I’m trying to use juliacall as follows: I have a julia threaded function to produce samples #"file.jl" using FLoops function my\_func(N) …

---

## [PlutoPlotly : Image trace is not shown](https://discourse.julialang.org/t/plutoplotly-image-trace-is-not-shown/100699)

<div class="topic-metadata">

**Author:** [@kemu](https://discourse.julialang.org/u/kemu)\
**Replies:** 4\
**Last updated:** [June 26, 2023, 2:41am UTC](https://discourse.julialang.org/t/plutoplotly-image-trace-is-not-shown/100699 "2023-06-26T02:41:37Z")

</div>

Hi, I would like to use Pluto.jl(v0.19.26) and PlutoPlotly.jl(v0.3.7) to overlay images and graphics, but the image trace does not display well. Other traces such as scatter and heatmap display fine. using PlutoPlotly …

---

## [BinaryBuilder or running \`build.jl\` as root?](https://discourse.julialang.org/t/binarybuilder-or-running-build-jl-as-root/100479)

<div class="topic-metadata">

**Author:** [@Clemapfel](https://discourse.julialang.org/u/Clemapfel)\
**Replies:** 17\
**Last updated:** [June 26, 2023, 12:24am UTC](https://discourse.julialang.org/t/binarybuilder-or-running-build-jl-as-root/100479 "2023-06-26T00:24:25Z")

</div>

I have a large Julia project with tens of thousands of lines of code. It requires two custom C++ libraries (I wrote), along with a combined 13 foreign dependencies, these are libraries not maintained by me. As far as I …

---

## [How to use \`TOML.print\` to print a \`Dict\` with keys as different \`MyStruct\` objects?](https://discourse.julialang.org/t/how-to-use-toml-print-to-print-a-dict-with-keys-as-different-mystruct-objects/100804)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 3\
**Last updated:** [June 25, 2023, 10:41pm UTC](https://discourse.julialang.org/t/how-to-use-toml-print-to-print-a-dict-with-keys-as-different-mystruct-objects/100804 "2023-06-25T22:41:49Z")

</div>

I’m currently working with a dictionary whose keys are instances of a custom struct named MyStruct. Here is the definition: struct MyStruct a::Int b::String end I need to use the TOML.print function to print th…

---

## [Breaking only an inner for loop due to an error](https://discourse.julialang.org/t/breaking-only-an-inner-for-loop-due-to-an-error/99698)

<div class="topic-metadata">

**Author:** [@Haro](https://discourse.julialang.org/u/Haro)\
**Replies:** 2\
**Last updated:** [June 25, 2023, 9:47pm UTC](https://discourse.julialang.org/t/breaking-only-an-inner-for-loop-due-to-an-error/99698 "2023-06-25T21:47:01Z")

</div>

Hi all. I’m trying to run a some code where I am intentionally pushing a differential equations solver that’s called inside a dynamic systems modeling package to fail to converge. I’m trying to explore the boundaries of …

---

## [Link to source code in versions.json?](https://discourse.julialang.org/t/link-to-source-code-in-versions-json/100816)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 1\
**Last updated:** [June 25, 2023, 6:21pm UTC](https://discourse.julialang.org/t/link-to-source-code-in-versions-json/100816 "2023-06-25T18:21:49Z")

</div>

Having parsable info in https://julialang-s3.julialang.org/bin/versions.json is awesome. As far as I can see it only includes the binary distributions. I think it would be nice if it also included the source code tarball…

---

## [More comfortable enum?](https://discourse.julialang.org/t/more-comfortable-enum/100779)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 8\
**Last updated:** [June 25, 2023, 6:15pm UTC](https://discourse.julialang.org/t/more-comfortable-enum/100779 "2023-06-25T18:15:56Z")

</div>

What I would expect is, if I have an enum like: @enum Color begin red green blue end That if I type Color. \<TAB\>\<TAB\> that I get a list of colors to choose from. But this is not the case. Is there a way t…

---

## [How to get the container type of a container?](https://discourse.julialang.org/t/how-to-get-the-container-type-of-a-container/20253)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 16\
**Last updated:** [June 25, 2023, 3:17pm UTC](https://discourse.julialang.org/t/how-to-get-the-container-type-of-a-container/20253 "2023-06-25T15:17:36Z")

</div>

For example, I have an x = Vector{Int}, then do what operations on x can I get the Vector ?

---

## [Unexpected performance mismatch in gradients for "compiled-tape-in-tape" experiment](https://discourse.julialang.org/t/unexpected-performance-mismatch-in-gradients-for-compiled-tape-in-tape-experiment/100810)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 0\
**Last updated:** [June 25, 2023, 12:49pm UTC](https://discourse.julialang.org/t/unexpected-performance-mismatch-in-gradients-for-compiled-tape-in-tape-experiment/100810 "2023-06-25T12:49:34Z")

</div>

Hi all, I’m working on a way to make selectively compiling parts of a ReverseDiff tape easier and more accessible. The goal is to enable fearless compilation of functions with branches. One problem I’ve run into is rel…

---

## [How to remove the zticks of a 3D plot?](https://discourse.julialang.org/t/how-to-remove-the-zticks-of-a-3d-plot/100806)

<div class="topic-metadata">

**Author:** [@Lee123](https://discourse.julialang.org/u/Lee123)\
**Replies:** 2\
**Last updated:** [June 25, 2023, 11:11am UTC](https://discourse.julialang.org/t/how-to-remove-the-zticks-of-a-3d-plot/100806 "2023-06-25T11:11:51Z")

</div>

I want to remove the zticks of a 3D plot, and I found an option zticksvisible of Axis3 in the manual \[here\] but it doesn’t work. It only removes the tick marks but the numbers still there. Codes and results are as follow …

---

## [How to achieve multi-threaded vectorized FMA operations in the for-loop for SAXPY?](https://discourse.julialang.org/t/how-to-achieve-multi-threaded-vectorized-fma-operations-in-the-for-loop-for-saxpy/100805)

<div class="topic-metadata">

**Author:** [@xinwu](https://discourse.julialang.org/u/xinwu)\
**Replies:** 2\
**Last updated:** [June 25, 2023, 10:42am UTC](https://discourse.julialang.org/t/how-to-achieve-multi-threaded-vectorized-fma-operations-in-the-for-loop-for-saxpy/100805 "2023-06-25T10:42:03Z")

</div>

Hi everyone, For serial vectorized FMA operations in the for-loop for SAXPY, one can use @fastmath @inbounds @simd for i in 1:n See also this discussion (How to enable vectorized fma instruction for multiply-add vecto…

---

## [Fixing my plots after installing something I don't remember](https://discourse.julialang.org/t/fixing-my-plots-after-installing-something-i-dont-remember/100800)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 0\
**Last updated:** [June 25, 2023, 4:23am UTC](https://discourse.julialang.org/t/fixing-my-plots-after-installing-something-i-dont-remember/100800 "2023-06-25T04:23:20Z")

</div>

Hi, a few days ago all of a sudden my plots were reporting an error. In an attempt to fix this, I ended up finding a possible installation in a forum that would solve my problem. It actually fixed it, but now I have anot…

---

## [Why using a mutable struct type argument to create instances creates a 50x slowdown?](https://discourse.julialang.org/t/why-using-a-mutable-struct-type-argument-to-create-instances-creates-a-50x-slowdown/100764)

<div class="topic-metadata">

**Author:** [@Tortar](https://discourse.julialang.org/u/Tortar)\
**Replies:** 7\
**Last updated:** [June 25, 2023, 12:54am UTC](https://discourse.julialang.org/t/why-using-a-mutable-struct-type-argument-to-create-instances-creates-a-50x-slowdown/100764 "2023-06-25T00:54:20Z")

</div>

I created this MWE based on some package code, and I’m not getting why the two different functions have not similar performance: using BenchmarkTools mutable struct A q\_0::Int q\_1::Int q\_2::Int end @noinli…

---

## [How to use @ntuple with N derived from parameters](https://discourse.julialang.org/t/how-to-use-ntuple-with-n-derived-from-parameters/100792)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 4\
**Last updated:** [June 24, 2023, 9:20pm UTC](https://discourse.julialang.org/t/how-to-use-ntuple-with-n-derived-from-parameters/100792 "2023-06-24T21:20:56Z")

</div>

Below is a MWE of an error I get using @ntuple: using StaticArrays import Base.Cartesian: @ntuple function times2(v::SVector{N, T}) where {N, T} return SVector{N, T}(@ntuple N i-\>v\[i\]\*2) end a = randn(SVector{3, F…

---

## [How to export a mesh made in Meshes.jl?](https://discourse.julialang.org/t/how-to-export-a-mesh-made-in-meshes-jl/100794)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 0\
**Last updated:** [June 24, 2023, 9:20pm UTC](https://discourse.julialang.org/t/how-to-export-a-mesh-made-in-meshes-jl/100794 "2023-06-24T21:20:12Z")

</div>

Hello! Suppose I make a basic cylinder like this: Is there any way to export it to vtk, perhaps using WriteVTK.jl? Kind regards

---

## [How to define a Matrix{UInt8} exhibiting chess board patterns](https://discourse.julialang.org/t/how-to-define-a-matrix-uint8-exhibiting-chess-board-patterns/100760)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 13\
**Last updated:** [June 24, 2023, 8:21pm UTC](https://discourse.julialang.org/t/how-to-define-a-matrix-uint8-exhibiting-chess-board-patterns/100760 "2023-06-24T20:21:21Z")

</div>

I need a Matrix{UInt8}, P, of 0 and 1 which exhibits chess board patterns of submatrices A of size(A)=(5,5). I defined it as follows: P=zeros(UInt8, 100,100) A= fill(UInt8(1), (5,5)) for k in 0:2:18 for j in 0:2:…

---

## [NewtonRaphson from NonlinearSolve.jl is not throwing an error when convergence is not achieved](https://discourse.julialang.org/t/newtonraphson-from-nonlinearsolve-jl-is-not-throwing-an-error-when-convergence-is-not-achieved/100780)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 8\
**Last updated:** [June 24, 2023, 4:48pm UTC](https://discourse.julialang.org/t/newtonraphson-from-nonlinearsolve-jl-is-not-throwing-an-error-when-convergence-is-not-achieved/100780 "2023-06-24T16:48:50Z")

</div>

I think I found a bug in the NonlinearSolve.jl package. Consider the problem using NonlinearSolve, GLMakie f(x, p) = tanh(x / 1e-3) + x - 0.5 x0 = 1.0 prob = NonlinearProblem(f, x0) sol = solve(prob, NewtonRaphson(), a…

---

## [\[YouTube/GitHub\] What is the FASTEST Computer Language? 45 Languages Tested](https://discourse.julialang.org/t/youtube-github-what-is-the-fastest-computer-language-45-languages-tested/64506)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 18\
**Last updated:** [June 24, 2023, 5:35am UTC](https://discourse.julialang.org/t/youtube-github-what-is-the-fastest-computer-language-45-languages-tested/64506 "2023-06-24T05:35:58Z")

</div>

A pretty cool project which includes Julia:

---

## [Had to install OpenSpecFun by direct command after upgrade to Julia 1.9](https://discourse.julialang.org/t/had-to-install-openspecfun-by-direct-command-after-upgrade-to-julia-1-9/100765)

<div class="topic-metadata">

**Author:** [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Replies:** 2\
**Last updated:** [June 24, 2023, 1:52am UTC](https://discourse.julialang.org/t/had-to-install-openspecfun-by-direct-command-after-upgrade-to-julia-1-9/100765 "2023-06-24T01:52:40Z")

</div>

It took me a while to figure out that the error message meant OpenSpecFun isn’t current, and can’t be automatically installed; giving the commands to install it directly fixed the problem. A Google search returns multip…

---

## [LLM AI just for Julia? A proposal: Julia \*plus\* science LLM?](https://discourse.julialang.org/t/llm-ai-just-for-julia-a-proposal-julia-plus-science-llm/99468)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 4\
**Last updated:** [June 24, 2023, 1:32am UTC](https://discourse.julialang.org/t/llm-ai-just-for-julia-a-proposal-julia-plus-science-llm/99468 "2023-06-24T01:32:33Z")

</div>

LLMs can now be trained (read this though as fine-tuned) in 30 min. by regular users (“Dolly, a large language model (LLM) trained for less than $30 to exhibit ChatGPT-like human interactivity (aka instruction-following)…

---

## [Why is my code very slow](https://discourse.julialang.org/t/why-is-my-code-very-slow/100577)

<div class="topic-metadata">

**Author:** [@dazhwu](https://discourse.julialang.org/u/dazhwu)\
**Replies:** 16\
**Last updated:** [June 23, 2023, 11:08pm UTC](https://discourse.julialang.org/t/why-is-my-code-very-slow/100577 "2023-06-23T23:08:12Z")

</div>

My code attached is long because I couldn’t figure out which part should be improved. I guess the bottleneck is function rls\_multi which implements a recursive OLS. Note that this function was translated from C++ (armadi…

---

## [Failure to build on AMD64](https://discourse.julialang.org/t/failure-to-build-on-amd64/100748)

<div class="topic-metadata">

**Author:** [@VictorEijkhout](https://discourse.julialang.org/u/VictorEijkhout)\
**Replies:** 11\
**Last updated:** [June 24, 2023, 12:04am UTC](https://discourse.julialang.org/t/failure-to-build-on-amd64/100748 "2023-06-24T00:04:55Z")

</div>

Trying to make on an amd64 platform gives, with both gcc & Intel compilers: error during bootstrap: LoadError(at "sysimg.jl" line 3: LoadError(at "Base.jl" line 297: LoadError(at "show.jl" line 56: LoadError(at "show.jl…

---

## [Optimise calculation with NxNxMxM matrix](https://discourse.julialang.org/t/optimise-calculation-with-nxnxmxm-matrix/100565)

<div class="topic-metadata">

**Author:** [@Stalz](https://discourse.julialang.org/u/Stalz)\
**Replies:** 17\
**Last updated:** [June 22, 2023, 2:33pm UTC](https://discourse.julialang.org/t/optimise-calculation-with-nxnxmxm-matrix/100565 "2023-06-22T14:33:13Z")

</div>

I have been working on a simulation in python where I try to solve the following integral: f(x,y) = \\iint A(x-\\xi', y-\\eta') g(\\xi',\\eta') h(x,\\xi',y,\\eta') \\,d\\xi' \\,d\\eta' With multiprocessing on a server I could g…

---

## [How to define a function whose type is variable?](https://discourse.julialang.org/t/how-to-define-a-function-whose-type-is-variable/100744)

<div class="topic-metadata">

**Author:** [@nvenkov1](https://discourse.julialang.org/u/nvenkov1)\
**Replies:** 2\
**Last updated:** [June 23, 2023, 3:40pm UTC](https://discourse.julialang.org/t/how-to-define-a-function-whose-type-is-variable/100744 "2023-06-23T15:40:58Z")

</div>

I am currently working to implement new sparse matrix formats for faster matrix-vector products. I want to preserve some features of the current CSR implementation in Julia. In particular, I would like to define function…

---

## [Hosting Docs with Documenter.jl with Dependencies / GitHub Actions with Unregistered Packages](https://discourse.julialang.org/t/hosting-docs-with-documenter-jl-with-dependencies-github-actions-with-unregistered-packages/83364)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 9\
**Last updated:** [June 23, 2023, 3:31pm UTC](https://discourse.julialang.org/t/hosting-docs-with-documenter-jl-with-dependencies-github-actions-with-unregistered-packages/83364 "2023-06-23T15:31:24Z")

</div>

I’m struggling to get the documentation for my package hosted due to external dependencies, specifically ones that are also hosted on GitHub but not the general registry. I’ve added these extra deps to both the main pack…

---

## [Is there a way to plot dendrogram?](https://discourse.julialang.org/t/is-there-a-way-to-plot-dendrogram/2197)

<div class="topic-metadata">

**Author:** [@leejm516](https://discourse.julialang.org/u/leejm516)\
**Replies:** 8\
**Last updated:** [June 23, 2023, 3:27pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-plot-dendrogram/2197 "2023-06-23T15:27:42Z")

</div>

Hierarchical clustering is quite simple in Julia by using hclust() in the Clustering package, but plotting the result in Julia does not seem to be straightforward for me as in Python. (see SciPy Hierarchical Clustering…

---

## [Extra allocations performing dot product in ODE callback](https://discourse.julialang.org/t/extra-allocations-performing-dot-product-in-ode-callback/100683)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 3\
**Last updated:** [June 23, 2023, 3:10pm UTC](https://discourse.julialang.org/t/extra-allocations-performing-dot-product-in-ode-callback/100683 "2023-06-23T15:10:35Z")

</div>

Hello, I’m experiencing some extra memory allocations when calculating the dot product inside a ODE callback. Here I write a minimal example A = sprand(ComplexF64, 100, 100, 0.05) u0 = rand(ComplexF64, 100) y = rand(Co…

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

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